/* Orchestration & Command: base tokens, type, header, footer, shared parts.
   Corners: surfaces 0px (20 letters mod 5 = 0), buttons 3px (13 letters mod 3 = 1). */

@font-face { font-family: 'Brygada 1918'; src: url('../fonts/brygada-1918.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Brygada 1918'; src: url('../fonts/brygada-1918-italic.woff2') format('woff2'); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('../fonts/cinzel.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('../fonts/hanken-grotesk.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
/* metric-matched fallbacks so nothing jumps when the web fonts arrive */
@font-face { font-family: 'Brygada Fallback'; src: local('Georgia'); size-adjust: 104.8%; ascent-override: 92%; descent-override: 24%; }
@font-face { font-family: 'Cinzel Fallback'; src: local('Times New Roman'); size-adjust: 142%; ascent-override: 68%; descent-override: 21%; }
@font-face { font-family: 'Hanken Fallback'; src: local('Arial'); size-adjust: 101.6%; ascent-override: 100%; descent-override: 28%; }

:root {
  --night: #060B18;
  --navy: #0D1830;
  --navy-2: #12213F;
  --cobalt: #3B7FE0;
  --cobalt-soft: rgba(59, 127, 224, .35);
  --gold: #E2B062;
  --gold-deep: #B8873A;
  --gold-line: rgba(226, 176, 98, .45);
  --ivory: #F3ECDD;
  --ivory-2: #EAE1CE;
  --ink: #18202F;
  --ink-soft: #3A4357;
  --mist: #B4BFD2;
  --white: #F7F3EA;

  --f-display: 'Brygada 1918', 'Brygada Fallback', Georgia, serif;
  --f-title: 'Cinzel', 'Cinzel Fallback', 'Times New Roman', serif;
  --f-body: 'Hanken Grotesk', 'Hanken Fallback', Arial, sans-serif;

  --r-surface: 0px;
  --r-btn: 3px;

  --wrap: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
  --pad-y: clamp(84px, 9vw, 140px);
  --head-h: 96px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --media-cap: min(76vh, 760px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--night);
  color: var(--mist);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--gold); color: var(--night); padding: 10px 16px; border-radius: var(--r-btn);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* section worlds: night = the AI world, paper = the book's human thinking */
.sec { position: relative; padding: var(--pad-y) 0; }
.sec--night { background: var(--night); color: var(--mist); }
.sec--navy { background: var(--navy); color: var(--mist); }
.sec--paper { background: var(--ivory); color: var(--ink-soft); }
.sec--paper::before {
  /* paper grain */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url('../img/grain.svg');
}

/* type */
.h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2rem, 3.5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -.01em;
  color: var(--white);
  display: flow-root;
}
.sec--paper .h2 { color: var(--ink); }
.h2 em { font-style: italic; color: var(--gold); font-weight: 500; }
.sec--paper .h2 em { color: var(--gold-deep); }
.h3 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.3rem, 1.6vw, 1.7rem); line-height: 1.2; color: var(--white); }
.sec--paper .h3 { color: var(--ink); }
.lede { font-size: clamp(1.08rem, 1.2vw, 1.2rem); line-height: 1.6; color: var(--white); opacity: .9; }
.sec--paper .lede { color: var(--ink); }
.body { max-width: 72ch; }
.gold { color: var(--gold); }
.sec--paper .gold { color: var(--gold-deep); }

/* masked line reveals (SplitText mask: lines). Padding pulled back by the same negative margin,
   all of it on the bottom so lines never collapse into each other. */
.split-line-mask { padding: .25em .15em .5em; margin: 0 -.15em -.75em; }
.split-line-mask:first-child { margin-top: -.25em; }
.split-line-mask:last-child { margin-bottom: -.5em; }

/* buttons */
.btn {
  --bg: transparent; --fg: var(--white); --bd: rgba(247, 243, 234, .4);
  position: relative; display: inline-flex; align-items: center; gap: .6em;
  min-height: 52px; padding: 0 26px; border-radius: var(--r-btn);
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font-family: var(--f-body); font-weight: 600; font-size: 1rem; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: color .4s var(--ease-out), border-color .4s var(--ease-out);
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--white);
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-out);
}
.btn:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.btn:focus-visible { color: var(--night); border-color: var(--white); }
@media (any-hover: hover) {
  .btn:hover::before { transform: scaleX(1); transform-origin: left; }
  .btn:hover { color: var(--night); border-color: var(--white); }
}
.btn--gold { --bg: var(--gold); --fg: var(--night); --bd: var(--gold); }
.btn--ink { --bg: var(--ink); --fg: var(--ivory); --bd: var(--ink); }
.btn--ink::before { background: var(--gold); }
.btn--line-ink { --fg: var(--ink); --bd: rgba(24, 32, 47, .45); }
.btn--line-ink::before { background: var(--ink); }
.btn--line-ink:focus-visible { color: var(--ivory); border-color: var(--ink); }
@media (any-hover: hover) { .btn--line-ink:hover { color: var(--ivory); border-color: var(--ink); } }
.btn__arrow { width: 18px; height: 18px; flex: none; transition: transform .4s var(--ease-out); }
@media (any-hover: hover) { .btn:hover .btn__arrow { transform: translateX(4px); } }

/* header */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--head-h);
  transition: background-color .5s, height .5s var(--ease-out), box-shadow .5s;
}
.site-head::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent); opacity: 0; transition: opacity .5s;
}
.site-head.is-stuck { background: rgba(6, 11, 24, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); height: 76px; }
.site-head.is-stuck::after { opacity: 1; }
.site-head__inner {
  height: 100%; max-width: 1560px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 14px; min-height: 48px; text-decoration: none; color: var(--white); flex: none; }
.brand__mark { width: 40px; height: 40px; transition: width .5s var(--ease-out), height .5s var(--ease-out); }
.brand__mark-outer { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.brand__mark-inner { fill: var(--gold); }
.brand__text { display: flex; flex-direction: column; font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; font-size: 1.05rem; line-height: 1.22; }
.brand__line--b { color: var(--gold); }
.site-head.is-stuck .brand__mark { width: 32px; height: 32px; }
.site-nav { position: relative; margin-left: auto; }
.site-nav__list { display: flex; gap: clamp(14px, 1.8vw, 30px); }
.site-nav a {
  display: block; padding: 10px 2px; text-decoration: none; color: var(--white);
  font-weight: 500; font-size: .98rem; opacity: .82; transition: opacity .3s, color .3s;
}
.site-nav a:hover, .site-nav a.is-active { opacity: 1; color: var(--gold); }
.site-nav__baton {
  position: absolute; left: 0; bottom: 2px; height: 2px; width: 0; background: var(--gold);
  box-shadow: 0 0 10px rgba(226, 176, 98, .8); pointer-events: none; opacity: 0;
}
.site-head__cta { min-height: 46px; padding: 0 20px; flex: none; }
.nav-toggle {
  display: none; margin-left: auto; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px;
  background: transparent; border: 1px solid rgba(247, 243, 234, .35); border-radius: var(--r-btn); color: var(--white); cursor: pointer;
}
.nav-toggle__bars { position: relative; width: 20px; height: 10px; }
.nav-toggle__bars span { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .4s var(--ease-out), top .4s var(--ease-out); }
.nav-toggle__bars span:first-child { top: 0; }
.nav-toggle__bars span:last-child { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:first-child { top: 4px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:last-child { top: 4px; transform: rotate(-45deg); }
.nav-toggle__label { font-weight: 600; font-size: .95rem; }

.mobile-nav {
  position: fixed; inset: 0; z-index: -1; background: var(--night);
  padding: calc(var(--head-h) + 24px) var(--gutter) 40px; display: flex; flex-direction: column; justify-content: space-between;
  clip-path: circle(0% at calc(100% - 60px) 48px);
}
.mobile-nav[hidden] { display: none; }
.mobile-nav.is-open { clip-path: circle(150% at calc(100% - 60px) 48px); }
.mobile-nav__list a {
  display: block; padding: 10px 0; font-family: var(--f-display); font-size: clamp(1.8rem, 7vw, 2.4rem); font-weight: 600;
  color: var(--white); text-decoration: none; border-bottom: 1px solid rgba(226, 176, 98, .18);
}
.mobile-nav__list a:hover { color: var(--gold); }
.mobile-nav__line { color: var(--gold); font-family: var(--f-display); font-style: italic; font-size: 1.15rem; }

@media (max-width: 1180px) {
  .site-nav, .site-head__cta { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 600px) {
  :root { --head-h: 80px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__text { font-size: .9rem; }
}
@media (max-width: 380px) {
  .site-head__inner { gap: 12px; }
  .brand { gap: 10px; }
  .brand__mark, .site-head.is-stuck .brand__mark { width: 28px; height: 28px; }
  .brand__text { font-size: .78rem; letter-spacing: .1em; }
  .nav-toggle { gap: 8px; padding: 0 10px; }
}

/* footer */
.site-foot { position: relative; background: var(--night); color: var(--mist); overflow: hidden; border-top: 1px solid rgba(226, 176, 98, .2); }
.site-foot__marquee { padding: 34px 0; border-bottom: 1px solid rgba(226, 176, 98, .14); overflow: hidden; }
.site-foot__track { display: flex; align-items: center; gap: 36px; width: max-content; will-change: transform; }
.site-foot__track span { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.6rem); color: var(--white); white-space: nowrap; }
.site-foot__track i { font-style: normal; color: var(--gold); font-size: 1rem; }
.site-foot__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 64px var(--gutter) 40px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px;
}
.site-foot__line { margin-top: 22px; font-family: var(--f-display); font-size: 1.25rem; color: var(--white); line-height: 1.45; }
.site-foot__head { font-family: var(--f-body); font-size: .9rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.site-foot__links li + li { margin-top: 0; }
.site-foot__links a { text-decoration: none; color: var(--mist); display: inline-flex; align-items: center; min-height: 44px; padding: 4px 0; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease-out), color .3s; }
.site-foot__links a:hover { color: var(--white); background-size: 100% 1px; }
.site-foot__base {
  max-width: var(--wrap); margin: 0 auto; padding: 22px var(--gutter) 30px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .95rem;
  border-top: 1px solid rgba(180, 191, 210, .14);
}
.site-foot__base a { color: var(--gold); display: inline-flex; align-items: center; min-height: 44px; }
.site-foot__base p { display: flex; align-items: center; gap: .3em; }
@media (max-width: 860px) { .site-foot__inner { grid-template-columns: 1fr; gap: 36px; } }

/* hidden start states (JS only). If scripts never start, oc-fallback shows everything after 6 s. */
.js [data-hide] { opacity: 0; }
.js [data-split] { visibility: hidden; }
.oc-fallback [data-split], .reduced [data-split] { visibility: visible !important; }
/* no-JS and reduced motion: everything visible, nothing waiting on a reveal */
.no-js [data-hide], .reduced [data-hide], .oc-fallback [data-hide] { opacity: 1 !important; transform: none !important; clip-path: none !important; visibility: visible !important; }
@media (prefers-reduced-motion: reduce) { .btn::before { transition: none; } }
