/* FencingAI v2 — ink on paper. One light theme, locked. Sharp corners. */

:root {
  --paper: #f4f3ee;
  --paper-dim: #eceae2;
  --ink: #191919;
  --ink-soft: #504f49;
  --hairline: rgba(25, 25, 25, 0.16);
  --signal: #c22b1d;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Paper grain, fixed and cheap */
body.paper-grain::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 44px);
  border-bottom: 1px solid var(--hairline);
  background: rgba(244, 243, 238, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand svg { display: block; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-word em { font-style: italic; }
.nav-right { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 36px); }
.nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.18s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link.solid {
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 10px 18px;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-link.solid:hover { background: var(--paper); color: var(--ink); }
.nav-link.solid:active { transform: translateY(1px); }
@media (max-width: 760px) {
  .nav-link.ghostable { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 15px 26px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.btn:hover { background: var(--paper); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.line { background: transparent; color: var(--ink); }
.btn.line:hover { background: var(--ink); color: var(--paper); }

.closed-beta {
  position: relative;
  cursor: not-allowed;
  user-select: none;
}
.btn.closed-beta,
.btn.closed-beta:hover,
.nav-link.solid.closed-beta,
.nav-link.solid.closed-beta:hover {
  background: var(--ink);
  color: var(--paper);
}
.closed-beta:active { transform: none; }
.closed-beta::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 90;
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.closed-beta:hover::after,
.closed-beta:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.nav .closed-beta::after {
  top: calc(100% + 10px);
  right: 0;
  bottom: auto;
  left: auto;
  transform: translateY(-4px);
}
.nav .closed-beta:hover::after,
.nav .closed-beta:focus-visible::after {
  transform: translateY(0);
}

/* ---------- hero ---------- */
.hero { position: relative; height: 300vh; }
.hero.static { height: 100dvh; }
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scroll-cue {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.scroll-cue .bar {
  width: 1px; height: 30px;
  background: currentColor;
  transform-origin: top;
  animation: hiCue 1.8s ease-in-out infinite;
}
@keyframes hiCue { 0%, 100% { transform: scaleY(0.35); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue { display: none; } }
.hero-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.hero-word-wrap { position: relative; text-align: center; padding: 0 16px; }
.hero-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.2rem, 11vw, 9.5rem);
  letter-spacing: -0.02em;
  line-height: 1;
  user-select: none;
  white-space: nowrap;
}
.hero-word em { font-style: italic; }
.hero-word.paper { color: var(--paper); }
.hero-word.ink { color: var(--ink); position: absolute; inset: 0; }
.hero-subline {
  margin-top: 34px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- sections ---------- */
.container { max-width: 1400px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 44px); }
.section { border-top: 1px solid var(--hairline); }
.section.no-line { border-top: none; }
.section-pad { padding-top: clamp(80px, 10vw, 130px); padding-bottom: clamp(80px, 10vw, 130px); }

.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.06;
}
h1.display { font-size: clamp(2.6rem, 5.2vw, 4.4rem); max-width: 16ch; }
h2.display { font-size: clamp(2.1rem, 4vw, 3.4rem); max-width: 18ch; }
.display em { font-style: italic; }

.lede {
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.7;
  max-width: 52ch;
  margin-top: 26px;
}

/* statement */
.statement-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
@media (min-width: 900px) {
  .statement-grid { grid-template-columns: 6fr 6fr; gap: 56px; }
  .statement-art { margin-top: -32px; }
}
.statement-cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 40px; }
.art-frame { border: 1px solid var(--hairline); display: block; width: 100%; }

/* world model stage */
.wm-stage {
  position: relative;
  height: min(74vh, 760px);
  min-height: 420px;
  margin-top: 48px;
}
.wm-stage canvas { display: block; }
.wm-caption {
  position: absolute;
  bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  pointer-events: none;
}
.wm-caption.left { left: 16px; }
.wm-caption.right { right: 16px; }
@media (max-width: 760px) { .wm-caption.right { display: none; } }
.wm-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.wm-loadbar { width: 180px; height: 1px; background: var(--hairline); position: relative; overflow: visible; }
.wm-loadbar span { position: absolute; left: 0; top: -0.5px; height: 2px; background: var(--ink); width: 0%; transition: width 0.2s ease; }
.wm-controls {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}
.wm-play {
  width: 34px; height: 34px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
}
.wm-play:hover { background: var(--ink); color: var(--paper); }
.wm-scrub {
  width: min(240px, 34vw);
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.wm-scrub-track { width: 100%; height: 1px; background: var(--hairline); position: relative; }
.wm-scrub-fill { position: absolute; left: 0; top: -0.5px; height: 2px; background: var(--ink); width: 0%; }
.wm-scrub-dot {
  position: absolute;
  top: 50%;
  width: 9px; height: 9px;
  background: var(--ink);
  transform: translate(-50%, -50%) rotate(45deg);
}
.wm-time { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-soft); min-width: 56px; }
.wm-flash {
  position: absolute;
  inset: 0;
  background: var(--signal);
  opacity: 0;
  pointer-events: none;
}
.wm-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  color: var(--ink-soft);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
}

/* actions timeline */
.tl-frame { border: 1px solid var(--hairline); padding: clamp(22px, 3.4vw, 44px); margin-top: 54px; }
.tl-lane { position: relative; margin-bottom: 40px; }
.tl-lane:last-of-type { margin-bottom: 0; }
.tl-name {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 12px;
}
.tl-band { position: relative; height: 56px; }
.tl-band.dim { opacity: 0.6; }
.tl-base { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--hairline); }
.tl-ev { position: absolute; top: 0; height: 100%; }
.tl-tick { position: absolute; top: 50%; transform: translateY(-50%); width: 1px; height: 20px; background: var(--ink); }
.tl-tick.signal { background: var(--signal); }
.tl-label {
  position: absolute; top: 0; left: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  white-space: nowrap; color: var(--ink);
}
.tl-label.signal { color: var(--signal); }
.tl-dot { position: absolute; top: -8px; left: -3.5px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.tl-note { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-soft); margin-top: 34px; }

/* method */
.method-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border-top: 1px solid var(--hairline);
  padding: 38px 0;
}
@media (min-width: 900px) {
  .method-row { grid-template-columns: 4fr 1fr 7fr; gap: 32px; }
}
.method-verb {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
  padding-bottom: 4px;
}
.method-body { color: var(--ink-soft); max-width: 52ch; padding-top: 6px; }

/* closing */
.closing { text-align: center; display: flex; flex-direction: column; align-items: center; }
.closing .lede { margin-left: auto; margin-right: auto; }
.closing .btn { margin-top: 40px; }

/* footer */
.foot {
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 40px clamp(20px, 4vw, 44px);
}
.foot-note { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--ink-soft); }

/* reveal on scroll (CSS-driven, JS adds .in) */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
