/* Qookin — light-table identity. One family (Archivo, OFL, self-hosted); width does the talking. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --lightbox: #ECEFF4;
  --ink: #16183A;
  --ink-soft: #4A4E72;
  --sodium: #F0923C;
  --selection: #2F6BFF;
  --plate: #C9D1DE;
  --paper: #FFFFFF;
  --line: rgba(22, 24, 58, 0.14);
  --measure: 62ch;
  --step--1: clamp(0.84rem, 0.8rem + 0.15vw, 0.92rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
  --step-2: clamp(1.7rem, 1.3rem + 1.8vw, 2.6rem);
  --step-3: clamp(2.6rem, 1.6rem + 4.6vw, 5.4rem);
  --gutter: clamp(1rem, 4vw, 3.5rem);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--lightbox);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--selection); }
:focus-visible { outline: 3px solid var(--selection); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem; }
.skip:focus { left: 0.5rem; z-index: 10; }

h1, h2, h3 { font-stretch: 125%; line-height: 1.02; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: var(--step-3); font-weight: 850; max-width: 11ch; }
h2 { font-size: var(--step-2); font-weight: 800; max-width: 18ch; }
h3 { font-size: var(--step-1); font-weight: 750; }
p { margin: 0.9em 0 0; max-width: var(--measure); }

/* Header */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem var(--gutter); }
.wordmark { font-stretch: 125%; font-weight: 900; font-size: 1.35rem; text-decoration: none; letter-spacing: -0.02em; }
.wordmark.small { font-size: 1rem; }
nav { display: flex; gap: clamp(0.75rem, 2vw, 1.75rem); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
nav a { text-decoration: none; font-size: var(--step--1); font-weight: 550; }
nav .nav-cta { background: var(--ink); color: var(--paper); padding: 0.5rem 0.9rem; border-radius: 999px; }
nav .nav-cta:hover { background: var(--selection); color: var(--paper); }

/* Buttons */
.button { display: inline-block; font: inherit; font-weight: 650; text-decoration: none; padding: 0.8rem 1.25rem; border-radius: 999px; border: 2px solid var(--ink); cursor: pointer; }
.button.primary { background: var(--ink); color: var(--paper); }
.button.primary:hover { background: var(--selection); border-color: var(--selection); color: var(--paper); }
.button.quiet { background: transparent; color: var(--ink); }
.button.quiet:hover { color: var(--selection); border-color: var(--selection); }

/* Hero */
.hero { overflow-x: clip; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding: clamp(2rem, 6vw, 5rem) var(--gutter) clamp(3rem, 7vw, 6rem); }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); max-width: 38ch; }
.hero-actions { display: flex; gap: 0.75rem; margin-top: 1.75rem; flex-wrap: wrap; }

.stage { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 15.5rem; gap: 1.25rem; align-items: center; }
.stack { position: relative; aspect-ratio: 1; perspective: 1600px; transform-style: preserve-3d; container-type: inline-size; }
.layer { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 900ms cubic-bezier(0.2, 0.7, 0.1, 1), opacity 300ms ease; border-radius: 6px; }
.layer-plate img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 30px 60px -30px rgba(22, 24, 58, 0.55); }
.layer-emblem .emblem-dot { position: absolute; left: 6.25%; top: 84.375%; width: 7.03%; aspect-ratio: 1; border-radius: 50%; background: #F2BC79; }
.live-headline { position: absolute; left: 6.25cqw; top: 8.545cqw; color: #fff; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-weight: 400; font-size: 7.03cqw; line-height: 1; letter-spacing: 0; white-space: nowrap; }
.stack[data-mode="layers"] .layer-plate { transform: rotateX(52deg) rotateZ(-32deg) translateZ(-90px) scale(0.78); }
.stack[data-mode="layers"] .layer-emblem { transform: rotateX(52deg) rotateZ(-32deg) translateZ(20px) scale(0.78); }
.stack[data-mode="layers"] .layer-text { transform: rotateX(52deg) rotateZ(-32deg) translateZ(130px) scale(0.78); }
.stack[data-mode="layers"] .layer-emblem, .stack[data-mode="layers"] .layer-text {
  outline: 1.5px dashed rgba(47, 107, 255, 0.85); outline-offset: -1px;
  /* The transparency checkerboard creative apps use, dark enough for white type. */
  background-color: rgba(70, 76, 110, 0.55);
  background-image: conic-gradient(rgba(255, 255, 255, 0.07) 25%, transparent 0 50%, rgba(255, 255, 255, 0.07) 0 75%, transparent 0);
  background-size: 22px 22px;
}
.layer.is-hidden { opacity: 0; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem; font-size: var(--step--1); box-shadow: 0 18px 40px -28px rgba(22, 24, 58, 0.5); }
.panel-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 0.6rem; }
.segmented { display: inline-flex; background: var(--lightbox); border-radius: 999px; padding: 2px; }
.segmented button { font: inherit; font-size: 0.78rem; font-weight: 600; border: 0; background: transparent; color: var(--ink-soft); padding: 0.25rem 0.6rem; border-radius: 999px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(22, 24, 58, 0.18); }
.layer-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.layer-list li { display: grid; grid-template-columns: 1.6rem 1.6rem 1fr; grid-template-rows: auto auto; column-gap: 0.4rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.layer-list li:first-child { background: linear-gradient(90deg, rgba(47, 107, 255, 0.12), transparent); }
.eye { grid-row: span 2; width: 1.4rem; height: 1.4rem; border: 0; border-radius: 6px; cursor: pointer; background: transparent; position: relative; }
.eye::before { content: ""; position: absolute; inset: 0.32rem 0.15rem; border: 1.6px solid var(--ink); border-radius: 50% / 70%; }
.eye::after { content: ""; position: absolute; left: 50%; top: 50%; width: 0.36rem; height: 0.36rem; margin: -0.18rem 0 0 -0.18rem; background: var(--ink); border-radius: 50%; }
.eye[aria-pressed="false"]::before, .eye[aria-pressed="false"]::after { opacity: 0.25; }
.kind { grid-row: span 2; width: 1.4rem; height: 1.4rem; border-radius: 4px; display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; }
.kind-text { background: var(--lightbox); }
.kind-shape { background: radial-gradient(circle, #F2BC79 45%, var(--lightbox) 47%); }
.kind-image { background: url("/media/generated-background.jpg") center / cover; }
.layer-name { font-weight: 650; }
.layer-type { color: var(--ink-soft); font-size: 0.78rem; }
.try { display: grid; gap: 0.3rem; margin-top: 0.8rem; font-weight: 600; }
.try input, .signup input[type="email"], .signup select { font: inherit; color: var(--ink); background: var(--lightbox); border: 1.5px solid transparent; border-radius: 8px; padding: 0.55rem 0.7rem; }
.try input:focus, .signup input:focus, .signup select:focus { border-color: var(--selection); outline: none; background: var(--paper); }
.panel-note { color: var(--ink-soft); font-size: 0.78rem; line-height: 1.45; margin-top: 0.7rem; }

/* Sections */
section { padding: clamp(3rem, 8vw, 6.5rem) var(--gutter); }
.section-lede { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.45; max-width: 46ch; }

.flow { background: var(--paper); }
.steps { list-style: none; counter-reset: step; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); }
.steps li { counter-increment: step; position: relative; padding-top: 3.2rem; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 0; font-stretch: 125%; font-weight: 900; font-size: 2.3rem; line-height: 1; color: var(--sodium); }
.flow-shot { margin-top: 1.25rem; border-radius: 10px; border: 1px solid var(--line); max-height: 26rem; object-fit: cover; object-position: top; width: 100%; }
.flow-shot.app-shot { max-height: none; max-width: 36rem; height: auto; border: 0; border-radius: 0; background: transparent; }
.proof { margin-top: 2.5rem; font-size: var(--step-1); font-weight: 600; max-width: 44ch; }

.app-rows { margin-top: 2.5rem; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.app-row { display: grid; grid-template-columns: 9rem 1fr; gap: clamp(1rem, 3vw, 2.5rem); align-items: center; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.app-row img { border-radius: 8px; width: 9rem; height: 9rem; object-fit: cover; }
.app-row p { max-width: 60ch; }
.app-row-next { grid-template-columns: 1fr; }
.status { font-weight: 700; font-size: var(--step--1); margin-top: 0.6rem; }
.status.ready::before { content: ""; display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #1F8A4C; margin-right: 0.45rem; }
.status.next::before { content: ""; display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 2px solid var(--ink-soft); margin-right: 0.45rem; vertical-align: -0.05rem; }
.caveat { color: var(--ink-soft); font-size: var(--step--1); }

.rebuild { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; background: var(--ink); color: var(--paper); }
.rebuild a, .rebuild sup a { color: var(--plate); }
.rebuild p { color: #D4D8E8; }
.compare { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; container-type: inline-size; }
.compare > img, .compare-after img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split, 50%)); }
.compare-after::before { content: ""; position: absolute; inset: 0; border-left: 2px solid var(--sodium); left: var(--split, 50%); z-index: 2; }
.rebuilt-text { position: absolute; left: 6.25cqw; top: 8.545cqw; color: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 7.03cqw; line-height: 1; outline: 1.5px dashed rgba(240, 146, 60, 0.95); outline-offset: 0.6cqw; white-space: nowrap; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; z-index: 3; }
.compare-range:focus-visible + .compare-label { outline: 3px solid var(--sodium); }
.compare-label { position: absolute; bottom: 0.75rem; font-size: 0.8rem; font-weight: 700; background: rgba(22, 24, 58, 0.78); color: #fff; padding: 0.25rem 0.55rem; border-radius: 999px; z-index: 2; }
.compare-label.left { left: 0.75rem; }
.compare-label.right { right: 0.75rem; }

/* Reference → model: each pair is the photo and what Qookin built from it. */
.recreate { background: var(--paper); }
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); margin-top: 2.5rem; }
.pair { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pair img { width: 100%; height: auto; aspect-ratio: 960 / 736; object-fit: cover; border-radius: 8px; }
.pair figcaption { grid-column: 1 / -1; color: var(--ink-soft); font-size: var(--step--1); }
.teach { background: var(--paper); }
.teach .fact { font-size: var(--step-1); line-height: 1.15; }

.local-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); margin-top: 2.5rem; }
.fact { font-stretch: 125%; font-weight: 850; font-size: var(--step-2); line-height: 1; margin: 0; color: var(--ink); }
.local-fact p:not(.fact) { color: var(--ink-soft); }
.fine { color: var(--ink-soft); font-size: var(--step--1); margin-top: 2.5rem; }

.access { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); background: var(--paper); border-top: 6px solid var(--sodium); }
.signup { display: grid; gap: 0.45rem; align-content: start; max-width: 28rem; }
.signup label { font-weight: 650; font-size: var(--step--1); margin-top: 0.5rem; }
.signup .consent { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 450; color: var(--ink-soft); line-height: 1.4; }
.signup .consent input { margin-top: 0.2rem; accent-color: var(--selection); }
.signup .button { margin-top: 0.9rem; justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { min-height: 1.5em; font-weight: 600; margin-top: 0.4rem; }
.form-status[data-tone="ok"] { color: #1F7A44; }
.form-status[data-tone="error"] { color: #B42318; }

.notes { padding-top: 2rem; padding-bottom: 2rem; font-size: var(--step--1); color: var(--ink-soft); }
.notes ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; max-width: 80ch; }
.site-foot { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: baseline; padding: 2rem var(--gutter) 3rem; font-size: var(--step--1); color: var(--ink-soft); border-top: 1px solid var(--line); }
.site-foot .trademarks { flex-basis: 100%; font-size: 0.78rem; }

/* Legal pages */
.doc { max-width: 70ch; padding: clamp(2rem, 6vw, 4rem) var(--gutter); }
.doc h1 { font-size: var(--step-2); max-width: none; }
.doc h2 { font-size: var(--step-1); margin-top: 2rem; max-width: none; }
.doc .draft { background: #FFF4E6; border-left: 4px solid var(--sodium); padding: 0.75rem 1rem; }

/* One orchestrated moment: the poster separates into layers once, on load. */
@media (prefers-reduced-motion: reduce) { .layer { transition: none; } }

@media (max-width: 980px) {
  .hero, .rebuild, .access { grid-template-columns: 1fr; }
  .stage { grid-template-columns: 1fr; }
  .panel { max-width: 26rem; }
  .steps, .local-grid, .pairs { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  nav a:not(.nav-cta) { display: none; }
  .app-row { grid-template-columns: 5.5rem 1fr; }
  .app-row img { width: 5.5rem; height: 5.5rem; }
  .app-row-next { grid-template-columns: 1fr; } /* no thumbnail: the text takes the full width */
}
