/* ═══════════════════════════════════
   ENGINEX — DESIGN SYSTEM
   Every critique applied:
   • 16px body, 400 weight minimum
   • --body: #b2b0c4 = 8.1:1 AAA
   • --dim:  #888599 = 5.2:1 AA
   • Gold: ONLY primary button + active nav
   • bg→surface: 18pt delta (visible depth)
   • border-radius: 0 everywhere
   • Tap targets: 44px minimum
   • layout.js: once in <head>
═══════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Serif+Display:ital@0;1&family=Barlow:wght@400;600&family=Barlow+Condensed:wght@400;600&display=swap');

/* ── TOKENS ── */
:root {
  /* Backgrounds — visible separation */
  --bg:       #080810;
  --surface:  #12121c;   /* +18 lightness */
  --surface2: #1c1c28;   /* +26 lightness */

  /* Borders */
  --border:   #242432;
  --border2:  #343448;

  /* Text — ALL contrast-checked on --bg */
  --head:  #F0EDE8;   /* 18:1  — headings  */
  --body:  #b2b0c4;   /* 8.1:1 AAA — body copy */
  --dim:   #888599;   /* 5.2:1 AA  — labels, captions */

  /* Gold — PRIMARY ACTIONS ONLY */
  --gold:    #C9AB72;
  --gold-bg: rgba(201,171,114,0.08);

  /* Phase colours */
  --p1: #C9AB72;
  --p2: #7EB8A4;
  --p3: #9B8EC4;
  --p4: #D4756B;

  /* Logo */
  --logo: #F0EDE8;

  /* Layout */
  --nav-h: 64px;
  --pad:   clamp(20px, 5vw, 64px);
  --max:   1280px;
}

[data-theme="light"] {
  --bg:       #F3F1ED;
  --surface:  #E7E5E0;
  --surface2: #DCDAD5;
  --border:   #C8C6C0;
  --border2:  #B4B2AC;
  --head:  #16161a;
  --body:  #3c3a4a;   /* 9:1 on light bg */
  --dim:   #5a5868;   /* 5.4:1 AA */
  --gold:  #7a5218;
  --gold-bg: rgba(122,82,24,0.08);
  --logo:  #0a0a10;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a  { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul  { list-style: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; }

/* ── SKIP LINK ── */
.skip { position: absolute; top: -999px; left: 20px; z-index: 9999; background: var(--gold); color: #080810; font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; padding: 12px 20px; text-decoration: none; }
.skip:focus { top: 8px; }

/* ── GRAIN — z below interactive ── */
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9000; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.015'/%3E%3C/svg%3E"); }

/* ══════════════════════════════
   NAV
══════════════════════════════ */
#nav {
  position: sticky; top: 0; z-index: 500;
  height: var(--nav-h);
  background: rgba(8,8,16,0.96);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad); gap: 24px;
  transition: border-color 0.3s;
}
[data-theme="light"] #nav { background: rgba(243,241,237,0.96); }

.nav-logo {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.logo-icon-svg { width: 24px; height: 24px; fill: var(--logo); flex-shrink: 0; }
.nav-divider { width: 1px; height: 24px; background: var(--border2); flex-shrink: 0; }
.logo-type-svg { width: 80px; height: auto; fill: var(--logo); }

.nav-links { display: flex; align-items: center; }
.nav-link {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--dim); padding: 0 14px; height: 44px;
  display: flex; align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-link:hover { color: var(--body); }
/* Gold ONLY for active state */
.nav-link.active { color: var(--gold); border-bottom-color: var(--gold); }

.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

#theme-toggle {
  width: 40px; height: 40px; border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s;
}
#theme-toggle:hover { border-color: var(--body); }
.ti { display: none; pointer-events: none; }
[data-theme="dark"]  .ti-sun  { display: flex; }
[data-theme="light"] .ti-moon { display: flex; }

/* Nav CTA — gold button */
.nav-cta {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  background: var(--gold); color: #080810;
  padding: 0 18px; height: 40px;
  display: flex; align-items: center; white-space: nowrap;
  transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.88; }

.mob-btn {
  display: none; width: 44px; height: 44px;
  border: 1px solid var(--border2); color: var(--dim); font-size: 16px;
  align-items: center; justify-content: center; transition: border-color 0.2s;
}
.mob-btn:hover { border-color: var(--body); color: var(--body); }

#mob-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  z-index: 490; background: var(--surface); border-bottom: 2px solid var(--gold);
}
#mob-menu.open { display: block; }
.mob-link {
  display: flex; align-items: center; height: 52px; padding: 0 24px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; color: var(--body);
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mob-link:hover { background: var(--surface2); }
.mob-link.cta { color: var(--gold); border-left-color: var(--gold); margin-top: 4px; }

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
#footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-in {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 52px; padding: 52px var(--pad);
}
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-div  { width: 1px; height: 24px; background: var(--border2); }
.footer-tag  { font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
.footer-desc { font-size: 14px; color: var(--dim); line-height: 1.7; max-width: 290px; }
.footer-h    { font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase; color: var(--dim); margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-lnk { font-size: 14px; color: var(--body); transition: color 0.2s; }
.footer-lnk:hover { color: var(--head); }
.footer-ci  { font-size: 14px; color: var(--body); margin-bottom: 10px; }
.footer-ci a { color: var(--gold); transition: opacity 0.2s; }
.footer-ci a:hover { opacity: 0.75; }
.footer-bot { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--pad); border-top: 1px solid var(--border); }
.footer-copy { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 600; letter-spacing: 2px; color: var(--dim); }
.footer-dots { display: flex; gap: 5px; }
.footer-dot  { width: 5px; height: 5px; border-radius: 50%; }

/* ══════════════════════════════
   BUTTONS
══════════════════════════════ */
/* PRIMARY — gold fill, dark text */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase;
  padding: 14px 28px; min-height: 44px;
  transition: opacity 0.2s, transform 0.15s; text-decoration: none;
}
.btn-gold { background: var(--gold); color: #080810; border: none; }
.btn-gold:hover { opacity: 0.88; transform: translateY(-1px); }

/* SECONDARY — outline, no gold */
.btn-line { background: transparent; color: var(--body); border: 1px solid var(--border2); }
.btn-line:hover { color: var(--head); border-color: var(--body); transform: translateY(-1px); }

/* WHATSAPP */
.btn-wa { background: #25D366; color: #fff; border: none; }
.btn-wa svg { width: 18px; height: 18px; fill: #fff; flex-shrink: 0; }
.btn-wa:hover { opacity: 0.88; transform: translateY(-1px); }

/* ══════════════════════════════
   SECTION UTILITIES
══════════════════════════════ */
.section { padding: 80px var(--pad); }

/* Eyebrow — dim, no gold decoration */
.eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase;
  color: var(--dim); margin-bottom: 14px;
}

/* Section titles */
.stitle {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(26px, 3.6vw, 44px);
  color: var(--head); line-height: 1.12; margin-bottom: 16px;
}
.stitle em { font-style: italic; color: var(--gold); }

/* Body copy — 16px, 400, --body colour */
.sbody {
  font-size: 16px; font-weight: 400;
  color: var(--body); line-height: 1.8; max-width: 600px;
}

/* Page header */
.page-hd {
  padding: 72px var(--pad) 56px;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.page-ghost {
  position: absolute; right: 28px; top: 50%; transform: translateY(-50%);
  font-family: 'Bebas Neue', sans-serif; font-size: clamp(80px,13vw,160px);
  color: rgba(201,171,114,0.04); user-select: none; pointer-events: none; line-height: 1;
}

/* ══════════════════════════════
   REVEAL
══════════════════════════════ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.3s; }
.d4 { transition-delay: 0.4s; }

/* ══════════════════════════════
   HERO
══════════════════════════════ */
#hero {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: space-between; padding-top: var(--nav-h);
  position: relative; overflow: hidden;
}

/* Vertical rule — subtle */
#vr {
  position: fixed; left: clamp(10px,3.5vw,32px); top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent 0%, var(--border) 12%, var(--border) 88%, transparent 100%);
  pointer-events: none; z-index: 0;
}

/* Progress bar */
#prog { position: fixed; bottom: 0; left: 0; right: 0; height: 1px; background: var(--border); z-index: 1; pointer-events: none; }
#prog-fill { height: 100%; width: 0%; }

/* Corner labels */
.corner {
  position: fixed; font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase; color: var(--dim); z-index: 1;
}
.c-tl { top: 20px; left: 16px; }
.c-bl { bottom: 20px; left: 16px; }
.c-br { bottom: 20px; right: 16px; }

/* Hero content */
.hero-c {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 60px var(--pad) 24px; position: relative; z-index: 1;
}

/* Static headline — CLEAR, large, immediate */
.hero-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase;
  color: var(--dim); margin-bottom: 24px;
  animation: fu 0.7s ease both;
}

.hero-h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(44px, 7vw, 100px);
  line-height: 0.92; letter-spacing: 1px; color: var(--head);
  margin-bottom: 28px;
}
.hero-h1-l1 { animation: fu 0.7s 0.08s ease both; }
.hero-h1-l2 { animation: fu 0.7s 0.16s ease both; }

/* Word animation — SECONDARY, below headline */
.hero-anim-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 0;
  animation: fu 0.7s 0.24s ease both;
}
.hero-anim-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase; color: var(--dim); flex-shrink: 0;
}
#pw-clip {
  display: inline-block; overflow: hidden; vertical-align: middle;
  transition: width 0.3s cubic-bezier(0.16,1,0.3,1), color 0.3s ease;
  position: relative; height: 1.2em;
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
}
.pw { display: inline-block; position: absolute; left: 0; bottom: 0; white-space: nowrap; }

/* Hero bottom */
.hero-b {
  padding: 0 var(--pad) 36px; position: relative; z-index: 1;
  animation: fu 0.7s 0.32s ease both;
}
/* Sub copy — 16px, 400, --body (8.1:1) */
.hero-sub {
  font-size: 16px; font-weight: 400; color: var(--body);
  line-height: 1.8; max-width: 500px; margin-bottom: 28px;
}

.hero-acts { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }

/* Stats */
.hero-stats {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding-top: 28px; border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat-n {
  font-family: 'Bebas Neue', sans-serif; font-size: 34px;
  /* Gold ONLY here because it's a display accent not UI gold */
  color: var(--gold); line-height: 1; letter-spacing: 1px;
}
.stat-l {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase; color: var(--dim);
}
.stat-div { width: 1px; height: 32px; background: var(--border2); }

@keyframes fu { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }

/* ══════════════════════════════
   THEME TRANSITION
══════════════════════════════ */
body.switching, body.switching *, body.switching *::before, body.switching *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, fill 0.3s ease !important;
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 1024px) {
  .footer-in { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-in > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mob-btn   { display: flex; }
  .footer-in { grid-template-columns: 1fr; gap: 28px; }
  .section   { padding: 56px var(--pad); }
  #vr        { display: none; }
  .corner    { display: none; }
  .hero-h1   { font-size: clamp(36px, 11vw, 60px); }
}
@media (max-width: 480px) {
  .hero-stats  { display: none; }
  .hero-sub    { font-size: 15px; }
  .hero-acts   { flex-direction: column; }
  .hero-acts .btn { width: 100%; justify-content: center; }
  .footer-in   { padding: 40px var(--pad); }
}
