/* ============================================================
   Ape Mod — one-page site
   Clinical and cold, after dark: near-black, pale ink, one red signal.
   ============================================================ */

:root {
  --paper: #0A0A0A;
  --ink: #E6E6E3;
  --ink-2: #9A9A96;
  --ink-3: #72726E;
  --line: #222221;
  --signal: #E01E26;
  --ink-rgb: 222,222,218;   /* mesh lines, read by evolution.js */
  --display: "Outfit", system-ui, sans-serif;
  --sans: "Outfit", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(16px, 3.4vw, 48px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-weight: 300;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
/* film grain over everything */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  opacity: .07; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* the whole site is one screen */
.page {
  height: 100svh;
  min-height: 560px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 var(--pad);
  background: radial-gradient(60% 60% at 50% 38%, #111111, var(--paper) 72%);
  overflow: hidden;
}

/* ---------- top / foot ---------- */
.top, .foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top { height: 64px; border-bottom: 1px solid var(--line); }
.foot { height: 44px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.founders { color: var(--ink-2); }
.founders i { font-style: normal; color: var(--signal); margin: 0 .35em; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark { width: 22px; height: auto; }
.brand__name { font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: .5em; }
.top__meta { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.rec { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: rec 2.4s steps(1) infinite; }
@keyframes rec { 50% { opacity: .15; } }

/* ---------- main ---------- */
.copy { max-width: 540px; }

/* products */
.prods { list-style: none; margin-top: clamp(24px, 4.5vh, 44px); border-top: 1px solid var(--line); }
.prod {
  display: grid;
  grid-template-columns: 11.5em 1fr auto;
  align-items: center; gap: 12px;
  padding: clamp(9px, 1.6vh, 13px) 0;
  border-bottom: 1px solid var(--line);
}
.prod__name { font-family: var(--display); font-size: 15px; font-weight: 400; }
.prod__line { font-size: 13.5px; color: var(--ink-2); }
.prod__act {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2);
  background: none; border: 0; border-bottom: 1px solid transparent;
  padding: 3px 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.prod__act:hover { color: var(--ink); border-bottom-color: var(--ink); }
.prod__act[aria-pressed="true"] { color: var(--ink); }
.prod__act[aria-pressed="true"]::before { content: "■"; font-size: 8px; }
.prod__act--live { color: var(--ink); }
.prod__act--live i { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: rec 2.4s steps(1) infinite; }

/* signup */
.form { display: flex; gap: 0; margin-top: clamp(20px, 3.5vh, 32px); border: 1px solid var(--ink); }
.form input {
  flex: 1; min-width: 0;
  padding: 13px 14px;
  background: transparent; border: 0;
  font-size: 15px;
}
.form input::placeholder { color: var(--ink-3); }
.form input:focus { outline: none; background: rgba(255,255,255,.04); }
.btn {
  padding: 13px 20px;
  background: var(--ink); color: var(--paper);
  border: 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
  transition: background .2s;
}
.btn:hover { background: var(--signal); }
.btn[disabled] { opacity: .6; cursor: progress; }
.note { min-height: 1.5em; margin-top: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-2); }
.note.is-ok { color: var(--ink); }
.note.is-err { color: var(--signal); }

/* ---------- the specimen ---------- */
.visual { position: relative; height: 100%; min-height: 0; }
.visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* detonation flash for the Judgment stage */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: #FFF6E8; opacity: 0;
}
body.flash::before { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { opacity: 0; } 6% { opacity: .85; } 100% { opacity: 0; } }

/* ---------- long-form pages (privacy): scroll instead of one screen ---------- */
.foot a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.foot a:hover { color: var(--ink); }
.page--doc { height: auto; min-height: 100svh; overflow: visible; }
.doc { width: 100%; max-width: 680px; margin: 0 auto; padding: clamp(32px, 6vh, 64px) 0 clamp(40px, 8vh, 80px); }
.doc h1 { font-family: var(--display); font-weight: 300; font-size: clamp(26px, 3.2vw, 34px); letter-spacing: .01em; }
.doc__date { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.doc h2 {
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
}
.doc p, .doc li { margin-top: 12px; font-size: 15px; line-height: 1.7; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-top: 8px; }
.doc li::marker { color: var(--signal); }
.doc strong { font-weight: 400; }
.doc a { text-underline-offset: 3px; transition: color .2s; }
.doc a:hover { color: var(--signal); }

/* ---------- company pages: nav, lede, contact line, details ---------- */
.nav { display: flex; gap: 22px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.nav a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.lede { margin-top: 10px; max-width: 520px; font-size: 14px; color: var(--ink-2); }
.prod__act--soon { cursor: default; color: var(--ink-3); }
.prod__act--soon:hover { color: var(--ink-3); border-bottom-color: transparent; }
.reach { margin-top: clamp(14px, 2.4vh, 24px); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-2); }
.reach a { color: var(--ink); text-underline-offset: 3px; }
.reach a:hover { color: var(--signal); }
.facts { margin-top: 16px; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 11em 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.facts dd { font-size: 15px; line-height: 1.6; }
.facts a { text-underline-offset: 3px; }
.facts a:hover { color: var(--signal); }
.foot { flex-wrap: wrap; height: auto; min-height: 44px; padding: 8px 0; }
@media (max-width: 560px) {
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .nav { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .rec, .prod__act--live i { animation: none; }
}

/* ---------- centered single column ---------- */
.main {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; min-height: 0; text-align: center;
}
.visual { order: -1; flex: 1 1 auto; width: min(100%, 760px); min-height: 180px; height: auto; }
.copy { flex: none; width: 100%; max-width: 860px; padding: 8px 0 clamp(10px, 2vh, 20px); display: flex; flex-direction: column; align-items: center; }
.sub { margin-top: 4px; font-weight: 300; font-size: clamp(15px, 1.3vw, 18px); letter-spacing: .01em; color: var(--ink); }
.prods {
  display: grid; grid-template-columns: repeat(4, 1fr);
  width: 100%; margin-top: clamp(16px, 2.6vh, 28px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.prod {
  grid-template-columns: 1fr; justify-items: center; gap: 2px;
  padding: clamp(10px, 1.6vh, 14px) 8px; border-bottom: 0;
}
.prod + .prod { border-left: 1px solid var(--line); }
.prod__act { margin-top: 4px; }
.form { width: min(100%, 460px); margin-top: clamp(14px, 2.4vh, 24px); }
.note { margin-top: 6px; text-align: center; }

/* ---------- small screens: still one screen ---------- */
@media (max-width: 860px) {
  .page { min-height: 0; }
  .top { height: 52px; }
  .top__meta span:last-child { display: none; }
  .foot { height: 36px; }
  .foot { font-size: 9px; letter-spacing: .06em; }
  .visual { min-height: 150px; }
  .sub { margin-top: 2px; font-size: 14px; }
  .prods { grid-template-columns: 1fr 1fr; margin-top: 12px; }
  .prod { padding: 8px 6px; }
  .prod + .prod { border-left: 0; }
  .prod:nth-child(even) { border-left: 1px solid var(--line); }
  .prod:nth-child(n+3) { border-top: 1px solid var(--line); }
  .prod__name { font-size: 14px; }
  .prod__line { font-size: 12px; }
  .form { margin-top: 12px; }
  .form input, .btn { padding: 11px 12px; }
}
