/*
  URBGEN homepage — redesign prototype.

  Same palette, same copy, same constraints: no build step, no framework, no
  third-party request. What changes is the structure. The band-and-stripe
  rhythm is gone; sections are sheets on a drawing-office grid, with the sheet
  number sitting in the margin and staying with you as you read.

  Motion is scroll-driven CSS (animation-timeline), so there is no library and
  no script behind it. It is wrapped in @supports and switched off entirely
  under prefers-reduced-motion, which means the page is complete and static
  without any of it.
*/

:root {
  --paper: #f0eeea;
  --panel: #fbfaf8;
  --sunk: #f4f2ee;
  --ink: #1a1f26;
  --ink-deep: #0f1318;
  --ink-soft: #565c65;
  --rule: #dbd6ce;
  --rule-soft: #e8e4dd;
  --blueprint: #2c5d8f;
  --blueprint-soft: #e4ecf4;

  --pad: clamp(20px, 5vw, 64px);
  --rail: clamp(0px, 7vw, 104px);
  --measure: 62ch;

  color-scheme: light;
}

/*
  Inter, self-hosted. project.md §1 used to say system font stack; the reason
  behind that rule was "no third-party font requests", and self-hosting keeps
  that true — the file comes from this origin and Google never sees a visitor.
  The spec row was changed rather than quietly broken.

  Latin subset only, 48 KB, which is the range this page actually uses: the
  em-dash, the thin space, the middle dot in the hero caption and the U+2212
  minus the FAQ toggle draws when open. Licence sits beside the file.

  Named "Inter var" so a locally installed static Inter cannot shadow it.
*/
@font-face {
  font-family: "Inter var";
  src: url("/assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter var", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.58;
  font-synthesis-weight: none;
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--blueprint); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--blueprint); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { margin: 0 0 0.5em; letter-spacing: -0.022em; text-wrap: balance;
             overflow-wrap: normal; hyphens: none; }
h1 {
  max-width: 15ch;
  font-size: clamp(38px, 6.4vw, 76px);
  line-height: 1.02;
  font-weight: 620;
  color: var(--ink-deep);
  letter-spacing: -0.035em;
  margin-bottom: 0.42em;
}
h2 {
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.1;
  font-weight: 600;
  color: var(--ink-deep);
  margin-bottom: 0.9em;
}
h3 { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.25; font-weight: 600; }
p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.num { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--panel);
        border: 1px solid var(--rule); padding: 10px 14px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.bar-in {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 0 var(--pad);
}
.brand { display: flex; align-items: center; gap: 9px; flex: 1; font-size: 15px; }
.mark { flex: none; color: var(--blueprint); }
.brand-name { font-weight: 650; letter-spacing: 0.06em; }
.bar-cta {
  flex: none;
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 7px 15px;
  border-radius: 999px;
}
.bar-cta:hover { border-color: var(--blueprint); color: var(--blueprint); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding: clamp(40px, 7vw, 104px) var(--pad) clamp(40px, 6vw, 88px);
  border-bottom: 1px solid var(--rule);
}
.hero-copy { min-width: 0; }
.hero-copy .lead, .hero-copy p { max-width: 46ch; }
.lead { font-size: clamp(17px, 1.35vw, 20px); color: var(--ink-soft); }
.cta { margin: 28px 0 12px; }
.note { font-size: 15px; color: var(--ink-soft); }

.btn {
  display: inline-block;
  background: var(--ink-deep);
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 550;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid var(--ink-deep);
}
.btn:hover { background: var(--blueprint); border-color: var(--blueprint); color: #fff; }

@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); }
}

/* ---------- the interactive block ---------- */

.toy {
  display: grid;
  gap: 18px;
  background: linear-gradient(var(--panel), var(--sunk));
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  padding: clamp(16px, 2.4vw, 28px);
}
.toy-stage { display: grid; place-items: center; min-height: 0; }
#toy { display: none; width: 100%; max-height: 56vh; overflow: visible; }
.js #toy { display: block; }
.js .toy-fallback { display: none; }
.toy-fallback img { border-radius: 8px; border: 1px solid var(--rule); }

.toy-meta {
  display: none;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule-soft);
  padding-top: 12px;
  margin: 0;
  max-width: none;
}
.js .toy-meta { display: flex; }
.toy-h { color: var(--ink); }

/* The block fades between schemes rather than snapping. Under reduced motion
   it does not change at all — see the rotation guard in block.js. */
#toy { transition: opacity .34s ease; }
@media (prefers-reduced-motion: reduce) { #toy { transition: none; } }

/* ---------- sheets ---------- */

.sheet {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  padding: clamp(48px, 7vw, 104px) var(--pad);
  border-bottom: 1px solid var(--rule);
}
.sheet.tint { background: var(--panel); }
.sheet > .n {
  position: sticky;
  top: 84px;
  align-self: start;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--blueprint);
  font-variant-numeric: tabular-nums;
}
.col { min-width: 0; }
.col.narrow { max-width: 68ch; }
.prose { max-width: var(--measure); }

@media (max-width: 700px) {
  .sheet { grid-template-columns: 1fr; gap: 6px; }
  .sheet > .n { position: static; }
}

/* ---------- rows ---------- */

.row {
  display: grid;
  gap: clamp(16px, 2.6vw, 44px);
  align-items: center;
  padding: clamp(22px, 3vw, 40px) 0;
  border-top: 1px solid var(--rule-soft);
}
.row:first-of-type { border-top: 0; padding-top: 0; }

@media (min-width: 860px) {
  .row { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
  .row.flip .fig { order: 2; }
}

/* Figures carry no frame. The drawings already sit on paper; boxing them made
   them read as clip-art rather than as the page's own content. */
.fig { margin: 0; }
/* The drawings are ink on paper and sit better multiplied onto the page.
   Screenshots are not — they carry their own white, so they get an edge
   instead of a blend. */
.fig img { width: 100%; mix-blend-mode: multiply; }
.fig--shot img {
  mix-blend-mode: normal;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
}
.fig figcaption {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  max-width: 52ch;
}
/* Pulled back across the rail, so the drawing runs wider than the text. */
.fig.bleed { margin-left: calc(var(--rail) * -1); margin-bottom: clamp(20px, 3vw, 40px); }
@media (max-width: 700px) { .fig.bleed { margin-left: 0; } }

/* ---------- claims ---------- */

.claims { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.claims li { padding: clamp(18px, 2.2vw, 30px) 0; border-top: 1px solid var(--rule); }
.claims p { color: var(--ink-soft); }
@media (min-width: 800px) {
  .claims { grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 4vw, 64px); }
}

/* ---------- limits ---------- */

.nots { list-style: none; margin: 0; padding: 0; }
.nots li {
  position: relative;
  padding: 15px 0 15px 26px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  max-width: var(--measure);
}
.nots li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(15px + 0.79em);
  width: 13px;
  border-top: 1px solid var(--blueprint);
}
.nots strong { color: var(--ink); font-weight: 600; }

/* ---------- steps ---------- */

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0;
         display: grid; gap: clamp(22px, 3vw, 40px); }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--blueprint);
  border-top: 1px solid var(--blueprint);
  padding-top: 10px;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.steps p { color: var(--ink-soft); }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* ---------- questions ---------- */

details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary {
  cursor: pointer; padding: 16px 0; font-weight: 550; list-style: none;
  display: flex; gap: 14px; align-items: baseline;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; color: var(--blueprint); font-weight: 600; width: 12px; flex: none; }
details[open] summary::before { content: "\2212"; }
details p { margin: 0 0 18px 26px; color: var(--ink-soft); }

/* ---------- close + footer ---------- */

.close {
  text-align: center;
  padding: clamp(56px, 8vw, 120px) var(--pad);
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}
.close p { margin-left: auto; margin-right: auto; }
.close .cta { margin-bottom: 0; }

.foot {
  display: grid;
  gap: 12px;
  padding: 36px var(--pad);
  background: var(--sunk);
  font-size: 15px;
  color: var(--ink-soft);
}
.foot p { max-width: none; }
.foot-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 22px; }
.foot-fine { margin: 0; }
@media (min-width: 760px) {
  .foot { grid-template-columns: 1fr auto; align-items: center; row-gap: 14px; }
  .foot-links { justify-content: flex-end; }
  .foot-fine { grid-column: 1 / -1; }
}

/* ---------- scroll-driven motion ----------
   Progressive enhancement, twice over: the browser must support scroll
   timelines, and the reader must not have asked for less motion. Neither
   condition holding leaves a page that was already complete. */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 8% cover 32%;
    }
    @keyframes rise {
      from { opacity: 0; transform: translateY(20px); }
      to   { opacity: 1; transform: none; }
    }
  }
}
