/* Hallmark · genre: modern-minimal · macrostructure: Workbench · theme: Cobalt
 * nav: N9 Edge-aligned minimal · footer: Ft2 Inline single line
 * enrichment: E5 custom illustration · craft: tier-B hand-built SVG (window + marquee/checkmark/transfer motif, 3 pieces + hero reuse)
 * pre-emit critique: P5 H4 E5 S5 R5 V5
 */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 68px; /* clears the fixed .cta-sticky bar */
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); color: var(--color-ink); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
.wrap { max-width: 72rem; margin: 0 auto; padding-inline: var(--page-gutter); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- focus ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ---------- buttons / links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm);
  padding: 0.65em 1.1em; border-radius: var(--radius-button);
  transition: background var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
  min-height: 44px;
}
.btn--solid {
  background: var(--color-accent); color: var(--color-accent-ink); border: 1px solid var(--color-accent);
}
.btn--solid:hover { background: oklch(52% 0.20 256); border-color: oklch(52% 0.20 256); }
.btn--solid:active { background: oklch(46% 0.19 256); }
.btn--outline {
  background: transparent; color: var(--color-ink); border: 1px solid var(--color-rule-2);
}
.btn--outline:hover { border-color: var(--color-accent); color: var(--color-accent); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-weight: 600; font-size: var(--text-md); color: var(--color-ink);
  border-bottom: 1px solid var(--color-rule-2);
  padding-bottom: 0.1em;
  transition: border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.link-arrow:hover { color: var(--color-accent); border-color: var(--color-accent); }
.link-arrow svg { transition: transform var(--dur-short) var(--ease-out); }
.link-arrow:hover svg { transform: translateX(3px); }

.mono-label {
  font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-muted);
}

/* ---------- nav (N9 edge-aligned) ---------- */
.nav-edge {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--page-gutter);
  background: color-mix(in oklch, var(--color-paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-rule);
}
.wordmark {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-md);
  letter-spacing: -0.01em; color: var(--color-ink);
}

/* ---------- hero ---------- */
.hero { padding: var(--space-2xl) 0 var(--space-xl); }
.hero-grid {
  display: grid; grid-template-columns: 5fr 7fr; gap: var(--space-xl);
  align-items: center;
}
.hero h1 { font-size: clamp(1.875rem, 1.6vw + 1.15rem, 3rem); max-width: 20ch; }
.hero-lede { font-size: var(--text-md); color: var(--color-ink-2); max-width: 42ch; margin-top: var(--space-md); }
.hero-actions { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-lg); flex-wrap: wrap; }

.frame {
  border: 1px solid var(--color-rule-2); border-radius: var(--radius-card);
  overflow: hidden; box-shadow: 0 1px 2px oklch(24% 0.02 258 / 0.06);
  background: var(--color-paper-2);
}
.frame img, .frame svg.illo { width: 100%; height: auto; display: block; }

/* ---------- hand-built illustrations (Tier B SVG, refined) ---------- */
.illo { color: var(--color-ink); }

/* gradient / pattern / shadow-filter stops — CSS-driven so they follow the theme tokens */
.illo-stop-a { stop-color: var(--color-paper); }
.illo-stop-b { stop-color: var(--color-paper-2); }
.illo-stop-accent { stop-color: var(--color-accent); }
.illo-stop-accent-light { stop-color: color-mix(in oklch, var(--color-accent) 70%, white); }
.illo-dot { fill: var(--color-rule); }
.illo-shadow-soft { flood-color: var(--color-ink); flood-opacity: 0.16; }
.illo-shadow-tight { flood-color: var(--color-ink); flood-opacity: 0.22; }

.illo-window { stroke: var(--color-ink); stroke-width: 1.5; }
.illo-window--source { opacity: 0.7; }
.illo-window--target { stroke: var(--color-ink); }
.illo-header-rule { stroke: var(--color-rule-2); stroke-width: 1.25; }
.illo-line { stroke: var(--color-ink-2); stroke-width: 3; stroke-linecap: round; }
.illo-line--muted { stroke: var(--color-rule-2); }
.illo-line--accent { stroke: var(--color-accent); }
.illo-caret-target { stroke: var(--color-ink-2); }

.illo-marquee, .illo-marquee-photo {
  fill: color-mix(in oklch, var(--color-accent) 8%, transparent);
  stroke: var(--color-accent); stroke-width: 1.5;
  stroke-dasharray: 5 4;
}
.illo-handle { fill: var(--color-paper); stroke: var(--color-accent); stroke-width: 2; }

/* hero — a photo with text baked into it, not just a plain text window */
.illo-photo-frame { fill: var(--color-paper); stroke: var(--color-rule-2); stroke-width: 1.25; }
.illo-photo-sun { fill: var(--color-ink); opacity: 0.14; }
.illo-photo-hills { fill: var(--color-ink); opacity: 0.1; }
.illo-sign-text { stroke: var(--color-ink); stroke-width: 4; stroke-linecap: round; }
.illo-sign-text--lg { stroke-width: 5; }
.illo-cursor-fill { fill: var(--color-paper); }
.illo-cursor-stroke { fill: none; stroke: var(--color-ink); stroke-width: 1.5; stroke-linejoin: round; }

/* drag-select loop: the marquee grows diagonally from the top-left corner,
   as if a real drag drew it — holds for ~2s, then cuts back and redraws */
.illo-marquee { width: 264px; }
.illo-handle-tr { cx: 328px; }
.illo-handle-bl { cy: 128px; }
.illo-handle-br { cx: 328px; cy: 128px; }
.illo-cursor-grp { transform: translate(6px, 10px); }

.reveal.is-in .illo-marquee {
  animation: illo-drag-width 3.4s 150ms ease-in-out infinite both,
             illo-drag-height 3.4s 150ms ease-in-out infinite both;
}
.reveal.is-in .illo-handle-tr { animation: illo-drag-handle-x 3.4s 150ms ease-in-out infinite both; }
.reveal.is-in .illo-handle-bl { animation: illo-drag-handle-y 3.4s 150ms ease-in-out infinite both; }
.reveal.is-in .illo-handle-br {
  animation: illo-drag-handle-x 3.4s 150ms ease-in-out infinite both,
             illo-drag-handle-y 3.4s 150ms ease-in-out infinite both;
}
.reveal.is-in .illo-cursor-grp { animation: illo-drag-cursor 3.4s 150ms ease-in-out infinite both; }

@keyframes illo-drag-width    { 0% { width: 0px; }  41% { width: 264px; }  100% { width: 264px; } }
@keyframes illo-drag-height   { 0% { height: 0px; } 41% { height: 24px; } 100% { height: 24px; } }
@keyframes illo-drag-handle-x { 0% { cx: 64px; }    41% { cx: 328px; }    100% { cx: 328px; } }
@keyframes illo-drag-handle-y { 0% { cy: 104px; }   41% { cy: 128px; }    100% { cy: 128px; } }
@keyframes illo-drag-cursor   { 0% { transform: translate(-258px, -14px); } 41% { transform: translate(6px, 10px); } 100% { transform: translate(6px, 10px); } }

/* hero variant — same drag-loop language, targeting text that's part of the photo's background */
.illo-marquee-photo { width: 158px; }
.illo-handle-photo-tr { cx: 238px; }
.illo-handle-photo-bl { cy: 118px; }
.illo-handle-photo-br { cx: 238px; cy: 118px; }
.illo-cursor-grp-photo { transform: translate(-84px, 0px); }

.reveal.is-in .illo-marquee-photo {
  animation: illo-drag-photo-width 3.4s 150ms ease-in-out infinite both,
             illo-drag-photo-height 3.4s 150ms ease-in-out infinite both;
}
.reveal.is-in .illo-handle-photo-tr { animation: illo-drag-photo-handle-x 3.4s 150ms ease-in-out infinite both; }
.reveal.is-in .illo-handle-photo-bl { animation: illo-drag-photo-handle-y 3.4s 150ms ease-in-out infinite both; }
.reveal.is-in .illo-handle-photo-br {
  animation: illo-drag-photo-handle-x 3.4s 150ms ease-in-out infinite both,
             illo-drag-photo-handle-y 3.4s 150ms ease-in-out infinite both;
}
.reveal.is-in .illo-cursor-grp-photo { animation: illo-drag-photo-cursor 3.4s 150ms ease-in-out infinite both; }

@keyframes illo-drag-photo-width    { 0% { width: 0px; }  41% { width: 158px; }  100% { width: 158px; } }
@keyframes illo-drag-photo-height   { 0% { height: 0px; } 41% { height: 30px; }  100% { height: 30px; } }
@keyframes illo-drag-photo-handle-x { 0% { cx: 80px; }    41% { cx: 238px; }     100% { cx: 238px; } }
@keyframes illo-drag-photo-handle-y { 0% { cy: 88px; }    41% { cy: 118px; }     100% { cy: 118px; } }
@keyframes illo-drag-photo-cursor   { 0% { transform: translate(-242px, -30px); } 41% { transform: translate(-84px, 0px); } 100% { transform: translate(-84px, 0px); } }

.illo-pill { fill: color-mix(in oklch, var(--color-accent) 12%, var(--color-paper)); stroke: var(--color-accent); stroke-width: 1.25; }
.illo-badge { stroke: none; }
.illo-check {
  fill: none; stroke: var(--color-paper); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22; stroke-dashoffset: 22;
}
.step.is-in .illo-check { animation: illo-draw 500ms 200ms var(--ease-out) forwards; }

.illo-transfer {
  fill: none; stroke: var(--color-accent); stroke-width: 1.5; stroke-linecap: round;
  stroke-dasharray: 5 5;
  marker-end: url(#illo-arrowhead);
}
.illo-transfer path, #illo-arrowhead path { fill: var(--color-accent); }
.step.is-in .illo-transfer { animation: illo-flow 1.4s linear infinite; }
.illo-caret {
  stroke: var(--color-accent); stroke-width: 2; stroke-linecap: round;
  animation: illo-blink 1.1s steps(1) infinite;
}

@keyframes illo-draw { to { stroke-dashoffset: 0; } }
@keyframes illo-flow { to { stroke-dashoffset: -20; } }
@keyframes illo-blink { 0%, 45% { opacity: 1; } 50%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .illo-check { animation: none; stroke-dashoffset: 0; }
  .illo-transfer { animation: none; }
  .illo-caret { animation: none; opacity: 1; }
  .illo-marquee, .illo-handle-tr, .illo-handle-bl, .illo-handle-br, .illo-cursor-grp { animation: none; }
  .illo-marquee-photo, .illo-handle-photo-tr, .illo-handle-photo-bl, .illo-handle-photo-br, .illo-cursor-grp-photo { animation: none; }
}

/* ---------- workbench walkthrough ---------- */
.workbench { padding: var(--space-2xl) 0; border-top: 1px solid var(--color-rule); }
.workbench-head { max-width: 40ch; margin-bottom: var(--space-xl); }
.workbench-head h2 { font-size: var(--text-2xl); }
.workbench-head p { margin-top: var(--space-sm); color: var(--color-ink-2); }

.step-seq { display: flex; flex-direction: column; gap: var(--space-2xl); }
.step {
  display: grid; grid-template-columns: 5fr 7fr; gap: var(--space-xl); align-items: center;
}
.step:nth-child(even) { direction: rtl; }
.step:nth-child(even) > * { direction: ltr; }
.step-label { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); letter-spacing: 0.08em; text-transform: uppercase; }
.step h3 { font-size: var(--text-xl); margin-top: var(--space-2xs); }
.step-caption { margin-top: var(--space-2xs); color: var(--color-muted); font-size: var(--text-sm); max-width: 34ch; }

/* ---------- dark graphite band ---------- */
.band-dark {
  background: var(--color-graphite); color: var(--color-graphite-ink);
  padding: var(--space-2xl) 0; margin: var(--space-2xl) 0;
}
.band-dark h2 { color: var(--color-graphite-ink); font-size: var(--text-2xl); max-width: 18ch; }
.band-dark-grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--space-xl); align-items: start; }
.band-dark p { color: var(--color-graphite-muted); margin-top: var(--space-sm); max-width: 46ch; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.checklist li {
  font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-graphite-ink);
  padding: var(--space-sm) 0; border-top: 1px solid var(--color-graphite-rule);
  display: flex; align-items: baseline; gap: var(--space-2xs);
}
.checklist li::before { content: "—"; color: var(--color-accent); }

/* ---------- spec sheet (F3) ---------- */
.spec-wrap { padding: var(--space-2xl) 0; }
.spec-wrap h2 { font-size: var(--text-2xl); max-width: 30ch; margin-bottom: var(--space-xl); }
table.spec-sheet { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.spec-sheet tr { border-top: 1px solid var(--color-rule); }
.spec-sheet tr:last-child { border-bottom: 1px solid var(--color-rule); }
.spec-sheet th, .spec-sheet td { text-align: left; padding: var(--space-md) var(--space-sm); vertical-align: top; }
.spec-sheet th { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); font-weight: 500; width: 30%; }
.spec-sheet td { font-size: var(--text-md); color: var(--color-ink-2); }
.spec-sheet td.muted { font-size: var(--text-sm); color: var(--color-muted); }

/* ---------- feature strip (QR / barcode / markdown — single row, high on the page) ---------- */
.feature-strip { padding: var(--space-lg) 0 var(--space-2xl); }
.feature-strip-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule);
}
.chip {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-md) var(--space-md);
  border-left: 1px solid var(--color-rule);
}
.chip:first-child { border-left: none; }
.chip h3 { font-size: var(--text-sm); font-weight: 600; }
.chip p { font-size: var(--text-xs); color: var(--color-muted); margin-top: 2px; }

.chip-badge { width: 44px; height: 44px; flex-shrink: 0; }
.chip-badge-bg { fill: var(--color-paper-2); stroke: var(--color-rule-2); stroke-width: 1.25; }
.chip-mark { fill: var(--color-ink); }
.chip-mark-stroke { fill: none; stroke: var(--color-ink); }
.chip-accent { fill: var(--color-accent); }
.chip-mark-path { fill: none; stroke: var(--color-ink); stroke-linecap: round; stroke-linejoin: round; }
.chip-accent-path { fill: none; stroke: var(--color-accent); stroke-linecap: round; stroke-linejoin: round; }

/* ---------- sticky CTA bar (C4) ---------- */
.cta-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: var(--space-sm) var(--page-gutter);
  background: color-mix(in oklch, var(--color-paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-rule);
  transform: translateY(100%);
  transition: transform var(--dur-med) var(--ease-out);
}
.cta-sticky.is-visible { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .cta-sticky { transition: none; }
}
.cta-sticky span { font-size: var(--text-sm); color: var(--color-ink-2); }

/* ---------- footer (Ft2) ---------- */
.foot-line {
  border-top: 1px solid var(--color-rule);
  padding: var(--space-lg) var(--page-gutter);
  font-size: var(--text-sm); color: var(--color-muted);
}

/* ---------- responsive ---------- */
@media (max-width: 60rem) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid .frame { order: -1; }
  .step, .step:nth-child(even) { grid-template-columns: 1fr; direction: ltr; }
  .band-dark-grid { grid-template-columns: 1fr; }
  .spec-sheet th, .spec-sheet td { padding: var(--space-sm) var(--space-2xs); }
  .feature-strip-row { grid-template-columns: 1fr; }
  .chip { border-left: none; border-top: 1px solid var(--color-rule); }
  .chip:first-child { border-top: none; }
}
@media (max-width: 40rem) {
  .hero { padding-top: var(--space-xl); }
  .hero h1 { max-width: 100%; }
  .spec-sheet { display: block; }
  .spec-sheet tr { display: grid; padding: var(--space-sm) 0; }
  .spec-sheet th, .spec-sheet td { display: block; width: 100%; padding: var(--space-3xs) 0; }
  .cta-sticky { flex-direction: column; align-items: stretch; text-align: center; }
}
