/* ============================================
   JESUSAXIOM.NET — Primary Stylesheet
   Author: DG7 / OCP
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --color-bg-deep: #0a0a0f;
  --color-bg-primary: #0d0d14;
  --color-bg-card: #12121c;
  --color-bg-card-hover: #1a1a28;
  --color-bg-accent: #16162a;
  --color-border: #2a2a40;
  --color-border-glow: #3a3a5c;
  --color-text-primary: #e8e6f0;
  --color-text-secondary: #a0a0b8;
  --color-text-muted: #707088;
  --color-gold: #c9a84c;
  --color-gold-dim: #9a7a30;
  --color-gold-bright: #e8c84c;
  --color-blue: #4a7cc9;
  --color-blue-dim: #2a4c8c;
  --color-red: #c94a4a;
  --color-green: #4ac97a;
  --color-purple: #7a4ac9;
  --color-white: #f0eeff;
  --font-display: 'Cinzel', serif;
  --font-body: 'Lora', serif;
  --font-ui: 'Inter', sans-serif;
  --font-mono: 'Courier New', monospace;
  --fs-xs: 0.7rem;
  --fs-sm: 0.85rem;
  --fs-base: 1rem;
  --fs-body: 1.1rem;
  --fs-md: 1.2rem;
  --fs-lg: 1.3rem;
  --fs-xl: 1.5rem;
  --max-width: 1200px;
  --section-padding: 80px 0;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 17.6px;
  background: var(--color-bg-deep);
}

html::-webkit-scrollbar {
  display: none;
}

html {
  scrollbar-width: none;
}

.scroll-hex {
  position: fixed;
  right: 14px;
  width: 18px;
  height: 20px;
  z-index: 9999;
  pointer-events: auto;
  cursor: grab;
  transition: top 0s;
  touch-action: none;
}
.scroll-hex:active { cursor: grabbing; }

.scroll-hex::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--hex-bg, rgb(255,255,255));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  filter: drop-shadow(0 0 6px var(--hex-glow, rgba(255,255,255,0.7))) drop-shadow(0 0 15px var(--hex-glow-soft, rgba(255,255,255,0.3)));
  animation: hexPulse 2s ease-in-out infinite;
}

.scroll-track {
  position: fixed;
  right: 21.5px;
  top: 20px;
  bottom: 20px;
  width: 3px;
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 4px rgba(255,255,255,0.15), 0 0 12px rgba(255,255,255,0.06);
  z-index: 9998;
  pointer-events: auto;
  cursor: pointer;
}

@keyframes hexPulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

body {
  font-family: var(--font-body);
  background: transparent;
  color: var(--color-text-primary);
  line-height: 1.75;
  overflow-x: hidden;
}

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-gold-bright);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.8) 55%, rgba(0,0,0,0) 100%);
  transition: all 0.3s ease;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-inner.centered {
  justify-content: center;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--color-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: none;
  cursor: pointer;
}

.nav-logo:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 20px rgba(255,255,255,0.4), 0 0 40px rgba(255,255,255,0.2);
}

.nav-logo.visible {
  display: block;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--color-gold);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-primary);
  font-size: var(--fs-xl);
  cursor: pointer;
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: calc(50% - 30px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-cross {
  position: relative;
  width: 330px;
  height: 330px;
  margin: 28px auto 40px;
  transform-style: preserve-3d;
}

.hero-cross::after {
  content: '';
  position: absolute;
  top: calc(50% - 30px);
  left: 50%;
  width: 100px;
  height: 100px;
  transform-style: preserve-3d;
  animation: cubeRotate3D 12s linear infinite;
}

.hero-cross::after::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
  border: 2px solid rgba(255,255,250,0.9);
  box-shadow:
    0 0 10px rgba(255,255,250,0.8),
    0 0 20px rgba(255,250,220,0.6),
    0 0 40px rgba(255,250,220,0.3),
    inset 0 0 10px rgba(255,255,250,0.3);
  transform: translateZ(50px);
}

.hero-cross::after::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
  border: 2px solid rgba(255,255,250,0.9);
  box-shadow:
    0 0 10px rgba(255,255,250,0.8),
    0 0 20px rgba(255,250,220,0.6),
    0 0 40px rgba(255,250,220,0.3),
    inset 0 0 10px rgba(255,255,250,0.3);
  transform: translateZ(-50px);
}

.hero-cross-rays {
  position: absolute;
  top: calc(50% - 30px);
  left: 50%;
  width: 100px;
  height: 100px;
  transform-style: preserve-3d;
  animation: cubeRotate3D 12s linear infinite;
}

.hero-cross-rays::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
  border: 2px solid rgba(255,255,250,0.9);
  box-shadow:
    0 0 10px rgba(255,255,250,0.8),
    0 0 20px rgba(255,250,220,0.6),
    0 0 40px rgba(255,250,220,0.3),
    inset 0 0 10px rgba(255,255,250,0.3);
  transform: rotateY(90deg) translateZ(50px);
}

.hero-cross-rays::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
  border: 2px solid rgba(255,255,250,0.9);
  box-shadow:
    0 0 10px rgba(255,255,250,0.8),
    0 0 20px rgba(255,250,220,0.6),
    0 0 40px rgba(255,250,220,0.3),
    inset 0 0 10px rgba(255,255,250,0.3);
  transform: rotateX(90deg) translateZ(50px);
}

@keyframes cubeRotate3D {
  from { transform: translate(-50%, -50%) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  to { transform: translate(-50%, -50%) rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}

.hero-cross-vert {
  position: absolute;
  top: calc(50% - 10px);
  left: 50%;
  width: 22px;
  height: 218px;
  transform: translate(-50%, -50%);
  background: rgba(255,255,250,1);
  box-shadow: 0 0 15px rgba(255,250,220,1), 0 0 30px rgba(255,250,220,0.8), 0 0 50px rgba(255,250,220,0.5);
}

.hero-cross-horiz {
  position: absolute;
  top: calc(50% - 10px);
  left: 50%;
  width: 170px;
  height: 22px;
  transform: translate(-50%, -50%) translateY(-30px);
  background: rgba(255,255,250,1);
  box-shadow: 0 0 15px rgba(255,250,220,1), 0 0 30px rgba(255,250,220,0.8), 0 0 50px rgba(255,250,220,0.5);
}

.hero-cross-rays {
  position: absolute;
  top: calc(50% - 30px);
  left: 50%;
  width: 400px;
  height: 400px;
  transform: translate(-50%, -50%);
  animation: crossRaysSpin 40s linear infinite;
}

.hero-cross-rays span {
  display: none;
}

@keyframes crossPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.95); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes crossRaysSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero-subtitle {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.8vw, 3.8rem);
  font-weight: 900;
  color: var(--color-white);
  line-height: 1.15;
  margin-top: -75px;
  margin-bottom: 4px;
  max-width: 800px;
}

.hero-axiom {
  font-family: var(--font-mono);
  font-size: clamp(var(--fs-xs), 1.5vw, var(--fs-body));
  color: var(--color-gold-bright);
  background: rgba(232, 200, 76, 0.08);
  border: 1px solid rgba(232, 200, 76, 0.25);
  border-radius: 8px;
  padding: 16px 28px;
  margin: 32px auto;
  max-width: 800px;
  line-height: 1.9;
  word-break: break-word;
  position: relative;
}

.axiom-copy-btn {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 5px;
  color: var(--color-gold-dim);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.axiom-copy-btn:hover {
  background: rgba(201, 168, 76, 0.22);
  border-color: rgba(201, 168, 76, 0.45);
  color: var(--color-gold);
}

.hero-desc {
  font-family: var(--font-mono);
  font-size: clamp(var(--fs-xs), 1.5vw, var(--fs-body));
  color: var(--color-gold-bright);
  max-width: 800px;
  margin: 0 auto 24px;
  line-height: 1.9;
  background: rgba(232, 200, 76, 0.08);
  border: 1px solid rgba(232, 200, 76, 0.25);
  border-radius: 10px;
  padding: 28px 36px;
  text-align: center;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.25), inset 0 0 40px rgba(0, 0, 0, 0.1);
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.hero-cta .btn {
  flex: 1;
  min-width: 200px;
  text-align: center;
}

.btn {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 13px 29px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--color-gold);
  color: var(--color-bg-deep);
}

.btn-primary:hover {
  background: var(--color-gold-bright);
  color: var(--color-bg-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201, 168, 76, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--color-gold);
  border: 1px solid var(--color-gold-dim);
}

.btn-outline:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--color-gold);
  transform: translateY(-2px);
}

.hero-cta .btn:hover {
  color: #fff !important;
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.4) !important;
}
.hero-cta .btn:nth-child(1):hover { background: rgba(30,120,255,0.15); }
.hero-cta .btn:nth-child(2):hover { background: rgba(255,60,60,0.15); }
.hero-cta .btn:nth-child(3):hover { background: rgba(40,200,80,0.15); }

/* --- Section Base --- */
.section {
  padding: var(--section-padding);
  position: relative;
  z-index: 2;
}

.section-alt {
  background: transparent;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.25;
  margin-bottom: 16px;
}

.section-desc {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.75;
}

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: rgba(18, 18, 28, 0.92);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 32px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--color-border-glow);
  background: rgba(26, 26, 40, 0.95);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card-label {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 12px;
}

.card-text {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  line-height: 1.75;
}

/* --- Scripture Blocks --- */
.scripture-block {
  background: rgba(22, 22, 42, 0.88);
  border-left: 3px solid var(--color-gold-dim);
  border-radius: 0 6px 6px 0;
  padding: 20px 24px;
  margin: 20px 0;
}

.scripture-ref {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}

.scripture-text {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  line-height: 1.8;
  font-style: italic;
}

/* --- Axiom Display --- */
.axiom-display {
  font-family: var(--font-mono);
  font-size: clamp(var(--fs-xs), 1.5vw, var(--fs-body));
  color: var(--color-gold-bright);
  background: rgba(12, 12, 20, 0.6);
  border: 1px solid rgba(180, 160, 100, 0.12);
  border-radius: 8px;
  padding: 14px 24px;
  margin: 16px auto;
  max-width: 800px;
  line-height: 2;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.scripture-topic-header {
  background: rgba(12, 12, 20, 0.6);
  border: 1px solid rgba(180, 160, 100, 0.12);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 24px;
}

.scripture-topic-num {
  color: var(--color-gold);
  cursor: pointer;
  transition: color 0.2s;
  scroll-margin-top: 70px;
}

.scripture-topic-num:hover {
  color: var(--color-gold-bright);
}

#scripture-toc a:hover {
  color: var(--color-gold-bright) !important;
}

/* --- Definitions Table --- */
#system {
  background: rgba(12, 12, 20, 0.6);
  border-top: 1px solid rgba(180, 160, 100, 0.08);
  border-bottom: 1px solid rgba(180, 160, 100, 0.08);
  border-radius: 12px;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 48px 24px;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.3), inset 0 0 60px rgba(0, 0, 0, 0.15);
}

.def-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: rgba(8, 8, 14, 0.5);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(180, 160, 100, 0.1);
}

.def-table th {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.def-table td {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(42, 42, 64, 0.5);
  vertical-align: top;
}

.def-table td:first-child {
  font-family: var(--font-mono);
  color: var(--color-gold-dim);
  white-space: nowrap;
  font-weight: 600;
}

/* --- Testimony Timeline --- */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-gold-dim), var(--color-border));
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

.timeline-dot {
  position: absolute;
  left: -34px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-gold);
  border: 3px solid var(--color-bg-deep);
  box-shadow: 0 0 0 2px var(--color-gold-dim);
}

.timeline-date {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.timeline-content {
  background: rgba(18, 18, 28, 0.92);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px;
}

.timeline-content h3 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--color-white);
  margin-bottom: 12px;
}

.timeline-content p {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  line-height: 1.8;
}

/* --- Pillar Section Visual --- */
.pillar-visual {
  text-align: center;
  padding: 40px 0;
  margin: 40px 0;
  background: linear-gradient(180deg, rgba(12,12,40,0.8) 0%, rgba(12,12,30,0.6) 100%);
  border-radius: 12px;
  border: 1px solid rgba(180,160,100,0.12);
}

.pillar-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* --- Footer --- */
.footer {
  background: rgba(13, 13, 20, 0.92);
  border-top: 1px solid var(--color-border);
  padding: 60px 24px 40px;
  position: relative;
  z-index: 2;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-gold);
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.footer-verse {
  font-size: var(--fs-body);
  color: var(--color-text-muted);
  font-style: italic;
  max-width: 500px;
  margin: 0 auto 24px;
  line-height: 1.75;
}

.footer-copy {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  letter-spacing: 1px;
}

/* --- Section Dividers --- */
.divider {
  width: 60px;
  height: 2px;
  background: var(--color-gold-dim);
  margin: 24px auto;
}

/* --- State Badges --- */
.state-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  margin: 4px;
}

.state-k {
  background: rgba(74, 201, 122, 0.15);
  color: var(--color-green);
  border: 1px solid rgba(74, 201, 122, 0.3);
}

.state-r {
  background: rgba(201, 168, 76, 0.15);
  color: var(--color-gold);
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.state-v {
  background: rgba(201, 74, 74, 0.15);
  color: var(--color-red);
  border: 1px solid rgba(201, 74, 74, 0.3);
}

/* --- Cube Matrix Table --- */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: var(--fs-body);
}

.matrix-table th,
.matrix-table td {
  padding: 14px 18px;
  border: 1px solid var(--color-border);
  text-align: center;
}

.matrix-table th {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--color-bg-accent);
}

.matrix-table td {
  color: var(--color-text-secondary);
}

.matrix-table td:first-child {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--color-bg-accent);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-inner {
    justify-content: center;
  }
  
  .nav-logo {
    display: block !important;
    text-align: center;
    width: 100%;
  }

  .nav-logo.menu-open {
    background: rgba(10, 10, 15, 0.98);
  }

  .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .nav-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links li {
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    font-weight: 700;
    color: var(--color-text-primary);
    font-size: var(--fs-base);
    text-shadow: 0 0 8px rgba(255,255,255,0.3);
    padding: 16px 24px;
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-links a:hover {
    background: rgba(201, 168, 76, 0.1);
    color: var(--color-gold);
  }

  .nav-toggle {
    display: none;
  }

  .nav-logo {
    cursor: pointer;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-cta .btn {
    min-width: 160px;
    width: 100%;
    padding: 12px 20px;
    font-size: var(--fs-xs);
    -webkit-tap-highlight-color: transparent;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    display: none;
  }

  :root {
    --section-padding: 60px 0;
  }

  /* Reduce container padding on mobile */
  .container {
    padding: 0 16px;
  }

  /* Optimize sections for mobile */
  .section {
    contain: layout style;
  }

  /* Optimize scripture blocks on mobile */
  .scripture-block {
    padding: 14px 16px;
    margin: 14px 0;
  }

  /* Optimize definition table on mobile */
  .def-table td,
  .def-table th {
    padding: 8px 10px;
    font-size: var(--fs-sm);
  }

  /* Optimize timeline on mobile */
  .timeline {
    padding-left: 30px;
  }

  .timeline-content {
    padding: 16px;
  }

  /* Optimize cards on mobile */
  .card {
    padding: 20px;
  }

  /* Optimize hero for mobile */
  .hero {
    padding: 80px 16px 60px;
  }

  .hero-axiom {
    padding: 12px 16px;
    font-size: var(--fs-xs);
    line-height: 1.7;
  }

  /* Optimize pillar visual on mobile */
  .pillar-visual {
    padding: 20px 0;
    margin: 20px 0;
  }

  /* Mobile font size adjustment for readability */
  html {
    font-size: 16px;
  }
}

/* --- Small Mobile (< 375px) --- */
@media (max-width: 375px) {
  .hero {
    padding: 60px 12px 40px;
  }

  .hero-axiom {
    padding: 10px 12px;
    font-size: 0.65rem;
  }

  .card {
    padding: 16px;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .def-table td:first-child {
    white-space: normal;
    font-size: var(--fs-xs);
  }
}

/* --- Large Mobile / Tablet (768px - 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  :root {
    --section-padding: 70px 0;
  }
}

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Selection --- */
::selection {
  background: rgba(201, 168, 76, 0.3);
  color: var(--color-white);
}

/* --- Background Pillars --- */
#bg-pillars {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* --- Canvas GPU Acceleration --- */
canvas {
  image-rendering: auto;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* --- Mobile Touch Optimization --- */
.scroll-hex,
.nav-toggle {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* --- iOS Safe Area Support --- */
@supports (padding: env(safe-area-inset-top)) {
  .nav {
    padding-top: env(safe-area-inset-top);
  }
  .footer {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
  .hero {
    padding-top: calc(120px + env(safe-area-inset-top));
  }
}

/* --- Reduced Motion Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #bg-pillars, #starfield {
    display: none !important;
  }
  .hero-cross::after,
  .hero-cross-rays,
  .hero-cross-rays::before,
  .hero-cross-rays::after {
    animation: none !important;
  }
  .scroll-hex::before {
    animation: none !important;
  }
}

/* --- Mobile GPU Compositing Layers --- */
.hero,
.section,
.footer,
.nav {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: auto;
}

/* --- Mobile Pillar Canvas Optimization --- */
.pillar-visual canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 50vh;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* --- Mobile Scroll Track/Hex — completely hidden, no space --- */
@media (max-width: 768px) {
  .scroll-track,
  .scroll-hex {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: fixed !important;
    pointer-events: none !important;
  }
}

/* --- Mobile Card Grid Optimization --- */
.card-grid {
  contain: layout style;
}

.page-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 40%, rgba(0,0,0,0) 100%);
}
