/* obrys.ai — "The Drawing Sheet".
   The marketing page rendered as an architect's drafting document: one
   continuous sheet, ruled section bands, plate numbers in the margin rail,
   registration crop-marks, a real title block. Tokens lifted from the
   product (src/index.css): blueprint paper + navy ink + one redline accent,
   so the site and the app are one continuous drawing. */

:root {
  /* "Drafting Positive": the architect's drawing sheet as ink on paper — cool
     blueprint paper, navy linework, brick-red redline for drift / proposals /
     correction. The palette is the photographic positive of the old cyanotype
     and is matched to the product's own tokens (src/index.css), so the
     marketing surface and the app read as one continuous drawing. */
  --paper: #f1f5fa;          /* cool blueprint paper (not warm cream) */
  --paper-deep: #e2ebf4;     /* recessed panel */
  --fill: #ffffff;           /* raised plate — a drawing pinned to the sheet */
  --ink: #16314e;            /* primary linework + text (navy) */
  --ink-soft: #54708d;       /* body */
  --ink-mute: #566f88;       /* technical labels (AA on paper) */
  --accent: #bd3a24;         /* redline red — drift / proposed / correction (AA on paper) */
  --accent-soft: #d4604a;
  --accent-deep: #bd3a24;    /* small accent text on paper */
  --rule: #8fa8c5;           /* blueprint line (ghost numerals, dashed borders) */
  --hair: rgba(22, 49, 78, 0.12);   /* ink hairline */
  --frame: rgba(22, 49, 78, 0.26);  /* sheet trim line */
  --grid: rgba(80, 112, 150, 0.11);  /* fine graph paper */
  --grid-major: rgba(80, 112, 150, 0.20); /* major grid every 5 cells */

  /* region tints — saturated, AA-on-paper, used ONLY on the §04 shape plates */
  --amber-line: rgba(168, 100, 17, 0.55);  --amber-ink: #a86411;
  --blue-line:  rgba(31, 99, 166, 0.55);   --blue-ink:  #1f63a6;
  --green-line: rgba(28, 122, 74, 0.55);   --green-ink: #1c7a4a;
  --purple-line: rgba(106, 69, 173, 0.55); --purple-ink: #6a45ad;
  --amber-fill: rgba(189, 58, 36, 0.05);  /* redline wash on frontier plates */

  --serif: "Newsreader", Georgia, serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(22px, 5vw, 60px);
  --sheet-w: min(1180px, calc(100% - 2 * var(--gutter)));
  --rail: clamp(56px, 9vw, 128px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  background-color: var(--paper);
  /* engineering graph paper — fine grid + major lines every 5 cells */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 135px 135px, 135px 135px, 27px 27px, 27px 27px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* sheet trim line + corner registration crop-marks, drawn over everything */
body::after {
  content: "";
  position: fixed;
  inset: clamp(9px, 1.3vw, 20px);
  pointer-events: none;
  z-index: 80;
  border: 1px solid var(--frame);
  background:
    linear-gradient(var(--accent), var(--accent)) left  top    / 15px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left  top    / 1.5px 15px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top    / 15px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top    / 1.5px 15px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left  bottom / 15px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left  bottom / 1.5px 15px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 15px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 1.5px 15px no-repeat;
}

.mono { font-family: var(--mono); }
em { font-style: italic; }

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── the sheet: each section is a ruled band, numbered in the margin ─── */

main { counter-reset: fig; }

.zone {
  position: relative;
  width: var(--sheet-w);
  margin: 0 auto;
  padding: clamp(48px, 7.5vh, 96px) 0 clamp(40px, 6vh, 78px) var(--rail);
  border-top: 1px solid var(--hair);
}

main .zone { counter-increment: fig; }
main .zone::before {
  content: counter(fig, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: clamp(44px, 7vh, 90px);
  width: calc(var(--rail) - clamp(18px, 2.4vw, 34px));
  text-align: right;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 58px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--rule);
}

.zone-tag {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85em;
  margin: 0 0 1.7em;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.zone-tag::before { content: ""; width: 28px; height: 1.5px; background: var(--accent); flex: none; }

/* tint classes are now inert on zones — colour lives only on §04 plates */
.tint-amber, .tint-blue, .tint-green, .tint-purple { background: none; }

/* ── hero: the masthead ────────────────────────────────────────────── */

.zone-hero {
  border-top: none;
  padding: clamp(56px, 12vh, 150px) 0 clamp(40px, 6vw, 72px) var(--rail);
}
.zone-hero .zone-tag { margin-bottom: 2.4em; }

h1 {
  margin: 0 0 0.5em;
  max-width: min(16ch, 100%);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(46px, 8.4vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
}
h1 em { font-style: italic; font-weight: 500; color: var(--accent); }

.lede {
  max-width: 54ch;
  margin: 0 0 1.1em;
  font-size: clamp(17px, 1.55vw, 20px);
  color: var(--ink-soft);
}
.lede.strong { color: var(--ink); }

.hero-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin: 2.4em 0 0; }

/* ── buttons: stamped mono labels, no offset shadow ───────────────── */

.btn {
  display: inline-block;
  padding: 14px 28px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.zone-cta {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  margin-top: clamp(26px, 3.2vw, 44px);
  padding-top: clamp(20px, 2.6vw, 30px);
  border-top: 1px solid var(--hair);
}
.cta-note { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); }

/* ── self-map board (kept slim for future focused animations) ─────── */

.board { width: 100%; margin: 0 0 clamp(20px, 4vh, 40px); }
.board-chrome {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-mute);
  background: var(--paper-deep);
  border: 1px solid var(--ink); border-bottom: none;
}
.board-chrome .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); border: 1px solid var(--ink-mute); }
.board img, .board video {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--ink); background: var(--paper-deep);
}
.board .board-still { display: none; }
.board figcaption { margin-top: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute); }

/* ── embedded canvas plates: focused animated SVGs, one per narrative beat ─ */
.demo-slot { width: var(--sheet-w); margin: clamp(30px, 4.5vw, 60px) auto clamp(12px, 2vw, 26px); padding-left: var(--rail); }
.plate { margin: 0; border: 1px solid var(--hair); border-radius: 3px; overflow: hidden; background: var(--paper); }
.demo-slot .plate { max-width: 760px; }
.zone .plate { max-width: 600px; margin-top: clamp(22px, 3vw, 38px); }
.plate img { display: block; width: 100%; height: auto; }
.plate figcaption {
  padding: 9px 14px; border-top: 1px solid var(--hair); background: var(--paper-deep);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink-mute);
}
@media (max-width: 860px) { .demo-slot { padding-left: 0; } }

/* ── §01 loop: node plates + edges (the product's own language) ───── */

.cards {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 1.6em 0;
}

.card {
  position: relative;
  background: var(--fill);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 22px 20px 32px;
  transition: transform 160ms ease, border-color 160ms ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h3 { margin: 0 0 0.45em; font-family: var(--serif); font-weight: 600; font-size: 23px; line-height: 1.1; }
.card-body { margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.card-tech {
  margin: 0.9em 0 0; font-family: var(--mono); font-size: 11px; color: var(--ink-mute);
  opacity: 0; transform: translateY(2px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.card:hover .card-tech { opacity: 1; transform: none; }
.card-kind {
  position: absolute; bottom: 10px; left: 20px; margin: 0;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute);
}
.card.ghost { border-style: dashed; background: var(--paper-deep); }
.card.ghost h3 { color: var(--ink-soft); }
.card.drift { border-color: var(--accent); }
.card.drift .card-kind { color: var(--accent-deep); font-weight: 500; }
.card.drift::after {
  content: ""; position: absolute; inset: -1px;
  border: 1px dashed var(--accent-soft); border-radius: 2px;
  pointer-events: none; animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 0; } 50% { opacity: 0.9; } }

.edge { width: 110px; height: 56px; flex: none; }
.edge path { fill: none; stroke: var(--ink-mute); stroke-width: 1.5; stroke-dasharray: 6 5; animation: dashdraw 1.2s linear infinite; }
@keyframes dashdraw { to { stroke-dashoffset: -11; } }
.edge .edge-label { font-family: var(--mono); font-size: 9px; fill: var(--ink-mute); text-anchor: middle; }

.loop-intro { max-width: 58ch; margin: 0 0 1.6em; font-size: 15.5px; color: var(--ink-soft); }
.loop-return { margin: 0.5em 0 0; }
.loop-back { display: block; width: 100%; height: clamp(40px, 6vw, 56px); overflow: visible; }
.loop-back path { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 5; animation: dashdraw 1.2s linear infinite; }
.loop-label { margin: 0.1em 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--accent-deep); }
.loop-proof { max-width: 66ch; margin: 1.2em 0 0; font-size: 14.5px; color: var(--ink-soft); }

/* ── §05 centerpiece pull-quote ───────────────────────────────────── */

.pull {
  margin: 0 0 0.7em;
  max-width: min(18ch, 100%);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(38px, 6.4vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}
.pull em { font-style: italic; color: var(--accent); }
.centerpiece .split { margin-top: clamp(18px, 3vw, 34px); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 4vw, 60px); }
.split p { margin: 0; color: var(--ink-soft); }
.split .big { font-size: clamp(18px, 2vw, 24px); font-family: var(--serif); color: var(--ink); line-height: 1.32; }

/* ── status legend (top-right title-block chip) ───────────────────── */

.legend {
  position: fixed; top: clamp(16px, 2vw, 28px); right: clamp(16px, 2vw, 28px); z-index: 90;
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--hair);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-soft);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.legend-title { font-size: 8.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 1px; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.sw { width: 8px; height: 8px; display: inline-block; }
.sw-done { background: #1c7a4a; }
.sw-progress { background: var(--accent); }
.sw-planned { background: transparent; border: 1px dashed var(--ink-mute); }

/* ── motion: staggered load + scroll reveal ───────────────────────── */

.rise { opacity: 0; transform: translateY(16px); animation: rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards; animation-delay: calc(var(--d, 0) * 115ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
/* entrance orchestration: each block in a section rises as it scrolls in —
   heading → copy → cards → the animation plate: a cascade driven by scroll. */
@keyframes reveal { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  main .zone > * { animation: reveal both; animation-timeline: view(); animation-range: entry 4% entry 48%; }
}

/* ── §02 the division-of-labour ledger (You ‖ Obrys) ──────────────── */

.ledger {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: clamp(20px, 3.6vw, 48px); align-items: start;
  margin: 0.4em 0 1.4em;
}
.ledger-head {
  display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap;
  margin: 0 0 1em; padding-bottom: 0.6em;
  border-bottom: 1px solid var(--hair);
  font-family: var(--serif); font-weight: 600; font-size: clamp(23px, 2.6vw, 32px);
}
.ledger-head .who { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); }
.ledger-you .ledger-head { color: var(--ink); }
.ledger-obrys .ledger-head { color: var(--accent); }
.ledger-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75em; }
.ledger-list li { position: relative; padding-left: 1.7em; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.ledger-list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; }
.ledger-you .ledger-list li::before { background: var(--ink); }
.ledger-obrys .ledger-list li::before { background: var(--accent); }
.ledger-rule { position: relative; width: 0; border-left: 1px dashed var(--rule); }
.ledger-rule::after {
  content: "‖"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  padding: 7px 3px; background: var(--paper); font-family: var(--mono); font-size: 14px; color: var(--ink-mute);
}
.ledger-note { margin: 1.4em 0 0; font-family: var(--serif); font-style: italic; font-size: clamp(17px, 1.9vw, 22px); color: var(--ink); max-width: 40ch; }

/* ── §03/§04 plates ───────────────────────────────────────────────── */

.shapes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 1.5em 0 0; }
.shape {
  background: var(--fill); border: 1px solid var(--ink); border-radius: 2px;
  padding: 20px 20px 18px;
  transition: transform 160ms ease, border-color 160ms ease;
}
.shape:hover { transform: translateY(-2px); }
.shape h3 { margin: 0 0 0.15em; font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.12; }
.shape-q { margin: 0 0 0.7em; font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }
.shape p:not(.shape-q) { margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.shape .reproj { display: inline-block; margin-top: 0.9em; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-mute); }
.shape-structural     { border-color: var(--amber-line); }  .shape-structural h3     { color: var(--amber-ink); }
.shape-operational    { border-color: var(--blue-line); }   .shape-operational h3    { color: var(--blue-ink); }
.shape-interaction    { border-color: var(--green-line); }  .shape-interaction h3    { color: var(--green-ink); }
.shape-sociotechnical { border-color: var(--purple-line); } .shape-sociotechnical h3 { color: var(--purple-ink); }

/* the frontier plate (delegation §04 / agent-fleet lead §03) breaks out */
.shape-frontier {
  margin-top: 14px; border-color: var(--accent);
  background: linear-gradient(var(--amber-fill), var(--amber-fill)), var(--fill);
  padding: 24px 24px 22px;
}
.shape-frontier h3 { color: var(--accent); font-size: 25px; }
.frontier-eyebrow { display: block; margin: 0 0 0.3em; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-deep); }
.frontier-handoff { display: inline-block; margin-top: 0.9em; font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em; color: var(--ink-mute); text-decoration: none; }
.frontier-handoff:hover { color: var(--accent); }

.lenses { margin: 1.6em 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--ink-mute); }
.lenses em { font-style: normal; font-weight: 500; color: var(--accent-deep); }

/* ── title block (replaces the footer colophon) ───────────────────── */

.titleblock {
  width: var(--sheet-w);
  margin: clamp(40px, 7vh, 90px) auto clamp(34px, 6vh, 64px);
  display: grid;
  grid-template-columns: 2.4fr repeat(4, 1fr);
  border: 1px solid var(--ink);
  font-family: var(--mono);
}
.tb-cell, .tb-brand { padding: 11px 14px; border-left: 1px solid var(--hair); display: flex; flex-direction: column; gap: 3px; }
.tb-brand { border-left: none; }
.tb-k { font-size: 8.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mute); }
.tb-v { font-size: 12px; color: var(--ink); }
.tb-brand .tb-v { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.tb-etym { margin-top: 2px; font-style: italic; font-size: 10.5px; color: var(--ink-mute); }

/* ── responsive ───────────────────────────────────────────────────── */

/* tablet: collapse the margin rail + stack the loop, but keep 2-col grids */
@media (max-width: 860px) {
  :root { --rail: 0px; }
  main .zone::before { display: none; }
  .zone, .zone-hero { padding-left: 0; }
  .zone-tag::before { width: 20px; }
  h1 { font-size: clamp(34px, 8vw, 64px); }
  .pull { font-size: clamp(30px, 7vw, 56px); }
  .cards { grid-template-columns: 1fr; }
  .edge { transform: rotate(90deg); margin: -4px auto; height: 46px; }
  .legend { display: none; }
}
/* phone: single column everywhere */
@media (max-width: 620px) {
  h1 { font-size: clamp(30px, 8.2vw, 52px); max-width: 100%; }
  .hero-br { display: none; }  /* let the hero headline wrap naturally on phones */
  .pull { font-size: clamp(29px, 9vw, 46px); }
  .split { grid-template-columns: 1fr; }
  .shapes { grid-template-columns: 1fr; }
  .ledger { grid-template-columns: 1fr; gap: 26px; }
  .ledger-rule { width: auto; height: 0; border-left: none; border-top: 1px dashed var(--rule); }
  .titleblock { grid-template-columns: 1fr 1fr; }
  .tb-brand { grid-column: 1 / -1; border-bottom: 1px solid var(--hair); }
  .tb-cell:nth-child(2), .tb-cell:nth-child(4) { border-left: none; }
  body { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .rise, main .zone, main .zone > *, .edge path, .loop-back path, .card.drift::after {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
}
