/* iMix Labs — studio home. Mission-control dossier: navy ground, cream hairlines, one amber accent.
   Flat by design: no shadows, no radius beyond dots and nodes. Reference: DESIGN.md. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/fonts/archivo-wdth.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Roboto Slab";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/roboto-slab-wght.woff2") format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-wght.woff2") format("woff2-variations");
}

:root {
  color-scheme: dark;
  --navy: #0b1026;
  --cream: #dcd4bc;
  --cream-60: rgba(220, 212, 188, 0.6);
  --hair: rgba(220, 212, 188, 0.18);
  --hair-soft: rgba(220, 212, 188, 0.09);
  --amber: #f2b840;
  --amber-hover: #ffd05a;
  --teal: #3a8a9a;
  --pearl: #e6e9f2;
  --on-amber: #0b1026;
  --max: 1440px;
  --gutter: clamp(16px, 4vw, 48px);
  --display: "Archivo", "Arial Narrow", Impact, sans-serif;
  --serif: "Roboto Slab", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-contrast: more) {
  :root { --cream-60: rgba(220, 212, 188, 0.85); --hair: rgba(220, 212, 188, 0.4); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--navy);
  color: var(--cream);
  font: 500 0.9375rem/1.6 var(--mono);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  padding-inline: var(--gutter);
  overflow-x: hidden;
}

a { color: var(--amber); text-decoration: none; }
a:hover, a:focus-visible { color: var(--amber-hover); text-decoration: underline; text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: var(--on-amber); padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 10; }

.serif { font-family: var(--serif); font-weight: 400; color: var(--pearl); }
.muted { color: var(--cream-60); }
.dot { color: var(--amber); }
.k { font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cream-60); }
.v { color: var(--cream); }

/* ---------- header ---------- */
.top {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 18px; border-bottom: 1px solid var(--hair);
  position: sticky; top: env(safe-area-inset-top, 0px); background: var(--navy); z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); font-weight: 700; letter-spacing: 0.18em; font-size: 0.8125rem; }
.brand:hover { text-decoration: none; color: var(--amber-hover); }
.brand-mark { width: 26px; height: 29px; color: var(--amber); }
.nav { display: flex; gap: clamp(12px, 2.5vw, 28px); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.nav a { color: var(--cream-60); }
.nav a:hover { color: var(--amber-hover); }
.nav-cta { color: var(--amber) !important; }
@media (max-width: 640px) { .nav a:not(.nav-cta) { display: none; } }

/* ---------- hero ---------- */
.hero { max-width: var(--max); margin: 0 auto; padding-block: 28px 0; position: relative; }
/* Background plate: the Imix sign etched on the right (build/art/gen/bg-01.png). The image's own
   navy is a shade lighter than --navy, so it fades into the page at the left and bottom edges. */
.hero::before {
  content: ""; position: absolute; inset: 0 calc(-1 * var(--gutter)) 0 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to right, var(--navy) 0%, rgba(11,16,38,0.85) 30%, rgba(11,16,38,0) 60%),
    linear-gradient(to bottom, rgba(11,16,38,0) 38%, rgba(11,16,38,0.7) 70%, var(--navy) 100%),
    url("/img/hero-bg.webp") right top / auto 100% no-repeat, var(--navy);
}
@media (max-width: 1080px) { .hero::before { background-image:
    linear-gradient(to right, var(--navy) 0%, rgba(11,16,38,0.85) 30%, rgba(11,16,38,0) 60%),
    linear-gradient(to bottom, rgba(11,16,38,0) 38%, rgba(11,16,38,0.7) 70%, var(--navy) 100%),
    url("/img/hero-bg-1080.webp"); } }
@media (max-width: 640px) { .hero::before { opacity: 0.4; background-position: right 20%; } }

.meta-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--hair); border-bottom: 0;
}
.meta-strip > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-right: 1px solid var(--hair); min-width: 0; }
.meta-strip > div:last-child { border-right: 0; }
.meta-strip .v { font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .meta-strip { grid-template-columns: 1fr 1fr; }
  .meta-strip > div:nth-child(2) { border-right: 0; }
  .meta-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--hair); }
}

.display {
  margin: 0; padding: 20px 0 8px; border-top: 1px solid var(--hair);
  font-family: var(--display); font-stretch: 62%; font-weight: 900; text-transform: uppercase;
  font-size: clamp(72px, 17vw, 232px); line-height: 0.86; letter-spacing: -0.01em; color: var(--cream);
}
.display .line { display: block; overflow: hidden; }
.display .rise { display: block; }
.js .display .rise { transform: translateY(110%); animation: rise 0.9s var(--ease) forwards; }
.display .line:nth-child(2) .rise { animation-delay: 0.12s; }
@keyframes rise { to { transform: translateY(0); } }

.hero-row {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 0;
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.hero-row > * { padding: 22px 18px 22px 0; border-right: 1px solid var(--hair); margin: 0; }
.hero-row > * + * { padding-left: 18px; }
.hero-row > *:last-child { border-right: 0; }
.lead { max-width: 56ch; font-size: 0.9375rem; }
.lead .serif { display: block; font-size: 1.375rem; line-height: 1.25; margin-bottom: 10px; }
.counter, .status { display: flex; flex-direction: column; gap: 8px; justify-content: space-between; }
.counter .num { font-family: var(--display); font-stretch: 62%; font-weight: 900; font-size: clamp(56px, 7vw, 96px); line-height: 0.9; color: var(--amber); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber); border: 1px solid var(--amber); padding: 5px 10px; white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.pill.flight { color: var(--cream-60); border-color: var(--hair); }
.pill.flight i { background: var(--cream-60); }
@media (prefers-reduced-motion: no-preference) {
  .status .pill i { animation: blink 1.6s steps(1) infinite; }
}
@keyframes blink { 50% { opacity: 0.25; } }
@media (max-width: 860px) {
  .hero-row { grid-template-columns: 1fr 1fr; }
  .lead { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--hair); }
  .counter { padding-left: 0; }
}
@media (max-width: 480px) {
  .hero-row { grid-template-columns: 1fr; }
  .hero-row > * { border-right: 0; padding-left: 0; }
  .counter { border-bottom: 1px solid var(--hair); }
}

.terminal { margin-top: 28px; border: 1px solid var(--hair); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-bottom: 1px solid var(--hair); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-60); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; }
.term-bar .r { background: #ff5f56; } .term-bar .y { background: #ffbd2e; } .term-bar .g { background: #27c93f; }
.term-bar span { margin-left: 8px; }
.terminal pre { margin: 0; padding: 16px; font: 500 0.8125rem/1.7 var(--mono); color: var(--cream); white-space: pre-wrap; min-height: 10.5em; }
.terminal .prompt { color: var(--teal); }
.terminal .hi { color: var(--amber); }
.terminal .cursor { display: inline-block; width: 0.6em; height: 1.1em; background: var(--amber); vertical-align: -0.2em; }
@media (prefers-reduced-motion: no-preference) { .terminal .cursor { animation: blink 1s steps(1) infinite; } }

.ruler { height: 18px; margin-top: 28px;
  background-image: linear-gradient(var(--hair) 0 0), linear-gradient(var(--hair) 0 0);
  background-size: 1px 18px, 1px 8px; background-position: 0 0, 0 0; background-repeat: repeat-x;
  background-image: repeating-linear-gradient(to right, var(--hair) 0 1px, transparent 1px 10px),
                    repeating-linear-gradient(to right, var(--cream-60) 0 1px, transparent 1px 100px);
  background-size: 100% 8px, 100% 18px; background-position: bottom, bottom;
}

/* ---------- sections ---------- */
.sec { max-width: var(--max); margin: 0 auto; padding-block: 56px 40px; border-bottom: 1px solid var(--hair); }
.sec-head { display: grid; grid-template-columns: 7fr 5fr; gap: 24px; align-items: end; margin-bottom: 28px; }
.sec-head h2 { margin: 0; font-family: var(--display); font-stretch: 70%; font-weight: 800; text-transform: uppercase; font-size: clamp(36px, 6vw, 72px); line-height: 0.95; letter-spacing: 0; }
.sec-head h2 .num { font-family: var(--mono); font-stretch: normal; font-weight: 500; font-size: 0.75rem; letter-spacing: 0.16em; color: var(--amber); display: block; margin-bottom: 10px; }
.sec-head .data { margin: 0; color: var(--cream-60); max-width: 48ch; border-left: 1px solid var(--hair); padding-left: 16px; }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; } .sec-head .data { border-left: 0; padding-left: 0; } }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--hair); }
table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
th { text-align: left; font-weight: 500; font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream-60); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hair); white-space: nowrap; }
td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--hair-soft); vertical-align: top; }
td.serif { font-size: 1.0625rem; white-space: nowrap; }
td .sub { display: block; font-size: 0.6875rem; letter-spacing: 0.08em; color: var(--cream-60); margin-top: 6px; }
td.serif .sub { display: inline; margin: 0 0 0 6px; font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase; }
.manifest { min-width: 860px; }
.gates { min-width: 720px; }
.legal { min-width: 600px; }
tbody tr:hover td { background: var(--hair-soft); }

/* ---------- principles matrix ---------- */
.matrix { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--hair); }
.cell { padding: 24px; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); margin: 0; }
.cell:nth-child(2n) { border-right: 0; }
.cell:nth-last-child(-n+2) { border-bottom: 0; }
.cell h3 { margin: 18px 0 8px; font-family: var(--serif); font-weight: 400; font-size: 1.25rem; color: var(--pearl); }
.cell p { margin: 0; color: var(--cream-60); max-width: 46ch; }
.schem { width: 120px; height: 80px; color: var(--teal); display: block; }
@media (max-width: 640px) {
  .matrix { grid-template-columns: 1fr; }
  .cell { border-right: 0; }
  .cell:nth-last-child(-n+2) { border-bottom: 1px solid var(--hair); }
  .cell:last-child { border-bottom: 0; }
}

/* ---------- the sign ---------- */
.sign-row { display: grid; grid-template-columns: 5fr 7fr; gap: 32px; align-items: start; }
.glyph { margin: 0; border: 1px solid var(--hair); padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.glyph svg { width: min(100%, 300px); height: auto; color: var(--amber); }
.glyph figcaption { font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-60); text-align: center; }
.sign-copy p { margin: 0 0 16px; max-width: 60ch; }
.sign-copy .serif { font-size: 1.375rem; display: block; margin-bottom: 8px; }
.sign-copy em { color: var(--pearl); font-style: italic; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 24px 0 0; border: 1px solid var(--hair); }
.facts > div { padding: 12px 14px; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.facts > div:nth-child(2n) { border-right: 0; }
.facts > div:nth-last-child(-n+2) { border-bottom: 0; }
.facts dt { font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream-60); }
.facts dd { margin: 4px 0 0; color: var(--cream); }
@media (max-width: 760px) { .sign-row { grid-template-columns: 1fr; } }

/* ---------- stroke draw + reveal ---------- */
.js .draw .s { stroke-dasharray: 600; stroke-dashoffset: 600; }
.draw.on .s { animation: draw 1.6s var(--ease) forwards; }
.draw.on .s:nth-child(n+2) { animation-delay: 0.08s; }
.draw.on .s:nth-child(n+5) { animation-delay: 0.25s; }
.draw.on .s:nth-child(n+9) { animation-delay: 0.45s; }
.draw.on .s:nth-child(n+13) { animation-delay: 0.7s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Hidden states apply only once app.js has run, so the page is complete without JavaScript. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.on { opacity: 1; transform: none; }
tr.reveal { display: table-row; }

@media (prefers-reduced-motion: reduce) {
  .display .rise { animation: none; transform: none; }
  .draw .s { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- contact ---------- */
.contact { max-width: var(--max); margin: 0 auto; padding-block: 64px 48px; }
.contact-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 32px; align-items: end; }
.display-sm { margin: 0 0 14px; font-family: var(--display); font-stretch: 66%; font-weight: 900; text-transform: uppercase; font-size: clamp(40px, 8vw, 112px); line-height: 0.9; }
.type-in { margin: 0; color: var(--cream-60); max-width: 48ch; min-height: 3.2em; }
.contact-data { display: flex; flex-direction: column; border: 1px solid var(--hair); }
.contact-data > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; border-bottom: 1px solid var(--hair); font-size: 0.8125rem; }
.contact-data > div:last-child { border-bottom: 0; }
.contact-data .v { text-align: right; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.foot { max-width: var(--max); margin: 0 auto; padding-block: 12px 40px; font-size: 0.75rem; color: var(--cream-60); border-top: 1px solid var(--hair); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 12px; }
.foot nav { display: flex; gap: 18px; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.6875rem; }
.foot nav a { color: var(--cream-60); }
.foot nav a:hover { color: var(--amber-hover); }
.foot .ruler { margin-top: 8px; }
.colophon { margin: 16px 0 0; max-width: 70ch; }

/* ---------- document pages (privacy, terms, 404) ---------- */
.doc { max-width: 760px; margin: 0 auto; padding-block: 48px 72px; }
.doc h1 { font-family: var(--display); font-stretch: 66%; font-weight: 900; text-transform: uppercase; font-size: clamp(44px, 9vw, 96px); line-height: 0.9; margin: 0 0 8px; }
.doc .k { display: block; margin-bottom: 24px; }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; color: var(--pearl); margin: 32px 0 8px; }
.doc p, .doc li { color: var(--cream); max-width: 68ch; }
.doc ul { padding-left: 1.2em; }
.doc .back { display: inline-block; margin-top: 32px; }
