/* Snapr website. Plain CSS, no build step. */

:root {
  --paper: #f3efe6;
  --panel: #ebe6da;
  --ink: #1b1a17;
  --muted: #625d52;
  --rule: #d4cdbd;
  --accent: #b8321b;
  --accent-ink: #ffffff;

  --term-bg: #1b1a17;
  --term-fg: #e9e4d6;
  --term-dim: #8f8979;
  --term-ok: #a9c795;
  --term-add: #a9c795;
  --term-mod: #e3c27a;
  --term-cmd: #ffffff;
  --term-rule: #1b1a17;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151411;
    --panel: #1c1a16;
    --ink: #ece7da;
    --muted: #a59f90;
    --rule: #35322b;
    --accent: #ee7a5f;
    --accent-ink: #151411;

    --term-bg: #0d0c0a;
    --term-rule: #35322b;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

code, pre { font-family: var(--mono); }
p code, li code, td code, th code {
  font-size: 0.88em;
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 0.08em 0.35em;
  white-space: nowrap;
}
pre code { font-size: inherit; background: none; border: 0; padding: 0; white-space: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px;
  background: var(--ink); color: var(--paper);
  padding: 10px 14px; z-index: 20;
}
.skip:focus { top: 12px; }

/* ── Header ───────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 16px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.mark { width: 22px; height: 22px; }
.mark-front { fill: var(--accent); }

.site-header nav ul { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.site-header nav a { font-size: 0.92rem; text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--ink); }
.site-header nav li:last-child a,
.site-header nav li:nth-last-child(2) a { color: var(--ink); }

@media (max-width: 760px) { .nav-extra { display: none; } }

/* ── Type ─────────────────────────────── */

h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); line-height: 1.06; }
.h1-soft { color: var(--muted); display: block; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); line-height: 1.1; max-width: 22ch; }
h3 { font-size: 1.06rem; line-height: 1.35; font-weight: 650; }

.eyebrow, .kicker {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.kicker { color: var(--accent); margin-bottom: 18px; }

.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; max-width: 60ch; }
.section-lede { max-width: 66ch; color: var(--muted); margin-top: 18px; }
.small { font-size: 0.92rem; color: var(--muted); }

/* ── Buttons ──────────────────────────── */

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px;
  border: 1.5px solid var(--ink);
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-quiet { border-color: transparent; text-decoration: underline; text-decoration-color: var(--accent); padding: 0 8px; }
.btn-quiet:hover { background: none; color: var(--accent); }

/* ── Hero ─────────────────────────────── */

.hero { padding: clamp(40px, 7vw, 80px) 0 clamp(56px, 8vw, 96px); }
.hero .eyebrow { margin-bottom: 26px; }
.hero .lede { margin-top: 28px; }
.hero .actions { margin-top: 32px; }
.hero-note { margin-top: 18px; font-size: 0.92rem; color: var(--muted); max-width: 60ch; }

/* The strip: three snapshot frames, like a row on a contact sheet. */
.strip { margin-top: clamp(40px, 5vw, 56px); }
.frames {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1.5px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 10px, transparent 10px 22px) top left / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 10px, transparent 10px 22px) bottom left / 100% 5px no-repeat,
    var(--panel);
  padding: 15px 0;
}
.frame {
  padding: 18px clamp(14px, 2.2vw, 26px) 20px;
  border-left: 1.5px solid var(--ink);
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
  animation: develop 500ms ease both;
}
.frame:first-child { border-left: 0; }
.frame:nth-child(2) { animation-delay: 100ms; }
.frame:nth-child(3) { animation-delay: 200ms; }
@keyframes develop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.frame-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-family: var(--mono); }
.frame-no { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.frame-meta { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; text-align: right; }
.is-current .frame-no { color: var(--accent); }
.frame-msg { font-family: var(--serif); font-size: 1.15rem; line-height: 1.25; }
.frame-from { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.chunks { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chunks i, .legend i {
  display: inline-block; width: 18px; height: 18px;
  border: 1.5px solid var(--ink);
}
.chunks i.new, .legend i.new { background: var(--accent); border-color: var(--accent); }
.frame-foot { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

.strip figcaption {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px;
  margin-top: 16px; font-size: 0.9rem; color: var(--muted);
}
.legend { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.78rem; }
.legend i { width: 12px; height: 12px; }
.legend-text { flex-basis: 100%; max-width: 70ch; }

@media (max-width: 700px) {
  .frames { grid-template-columns: minmax(0, 1fr); padding: 15px 0; }
  .frame { border-left: 0; border-top: 1.5px solid var(--ink); }
  .frame:first-child { border-top: 0; }
  .frame-from:empty, .frame:first-child .frame-from { display: none; }
}

/* ── Sections ─────────────────────────── */

.section { padding: clamp(64px, 9vw, 120px) 0; border-top: 1px solid var(--rule); }
.section-tint { background: var(--panel); }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 72px); margin-top: clamp(32px, 4vw, 52px); }
@media (max-width: 820px) { .cols { grid-template-columns: minmax(0, 1fr); } }

.prose > * + * { margin-top: 16px; }
.prose h3 { margin-top: 30px; }
.prose h3:first-child { margin-top: 0; }

.tree {
  font-family: var(--mono); font-size: 0.92rem;
  border-left: 2px solid var(--ink); padding: 4px 0 4px 16px;
}
.tree li { color: var(--muted); }
.tree li:last-child { color: var(--ink); }

.plain-note { border-left: 2px solid var(--accent); padding-left: 16px; }

/* ── Features ─────────────────────────── */

.features {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(32px, 4vw, 52px);
  border-top: 1.5px solid var(--ink);
}
.features li {
  padding: 26px 26px 30px 0;
  border-bottom: 1px solid var(--rule);
  counter-increment: feat;
}
.features li::before {
  content: counter(feat, decimal-leading-zero);
  display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-bottom: 12px;
}
.features { counter-reset: feat; }
.features h3 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; line-height: 1.2; letter-spacing: -0.01em; }
.features p { margin-top: 10px; color: var(--muted); font-size: 0.98rem; }
.features code {
  display: inline-block; margin-top: 14px; font-size: 0.82rem;
  background: var(--panel); border: 1px solid var(--rule); padding: 3px 8px;
}
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .features { grid-template-columns: minmax(0, 1fr); } .features li { padding-right: 0; } }

/* ── Demo ─────────────────────────────── */

.steps { margin-top: clamp(36px, 5vw, 60px); display: grid; gap: clamp(36px, 5vw, 60px); counter-reset: step; }
.step {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: clamp(20px, 4vw, 56px);
  align-items: start; counter-increment: step;
}
.step-text { position: sticky; top: 88px; }
.step-text::before {
  content: "Step " counter(step);
  display: block; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.step-text h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; }
.step-text p { margin-top: 10px; color: var(--muted); }
@media (max-width: 820px) {
  .step { grid-template-columns: minmax(0, 1fr); }
  .step-text { position: static; }
}

.term {
  background: var(--term-bg); color: var(--term-fg);
  border: 1.5px solid var(--term-rule);
  min-width: 0;
}
.term pre {
  margin: 0; padding: 20px 22px;
  font-size: 0.82rem; line-height: 1.55;
  overflow-x: auto; tab-size: 2;
}
.term pre:focus-visible { outline-offset: -4px; }
.term .p { color: var(--term-dim); user-select: none; }
.term .c { color: var(--term-cmd); font-weight: 600; }
.term .ok { color: var(--term-ok); }
.term .add { color: var(--term-add); }
.term .mod { color: var(--term-mod); }
.term .d { color: var(--term-dim); }

.fineprint { margin-top: 36px; font-size: 0.9rem; color: var(--muted); max-width: 78ch; }

/* ── How it works ─────────────────────── */

.pipeline {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px;
  margin-top: clamp(32px, 4vw, 52px);
  padding: 26px clamp(16px, 3vw, 30px);
  border: 1.5px solid var(--ink);
  font-family: var(--mono); font-size: 0.8rem;
}
.pipe-stage { display: flex; flex-direction: column; gap: 8px; }
.pipe-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem; }
.pipe-row { display: flex; gap: 5px; }
.pipe-box {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; min-width: 52px; padding: 0 10px;
  border: 1.5px solid var(--ink); white-space: nowrap;
}
.pipe-box.short { min-width: 26px; padding: 0; }
.pipe-box.hash { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pipe-arrow { height: 38px; display: inline-flex; align-items: center; color: var(--muted); font-size: 1.1rem; }

.how {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 5vw, 72px);
  margin-top: 28px; counter-reset: how;
}
.how li { padding: 26px 0; border-bottom: 1px solid var(--rule); counter-increment: how; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); }
.how li::before { content: counter(how); font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; color: var(--accent); }
.how h3, .how p { grid-column: 2; }
.how p { margin-top: 8px; color: var(--muted); font-size: 0.98rem; }
.how em { font-style: normal; color: var(--ink); border-bottom: 1px dotted var(--muted); }
@media (max-width: 820px) { .how { grid-template-columns: minmax(0, 1fr); } }

.callout { margin-top: 36px; padding: 22px 24px; background: var(--panel); border-left: 3px solid var(--ink); max-width: 78ch; }
.callout p { margin-top: 8px; color: var(--muted); }

@media (max-width: 700px) {
  .pipeline { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pipe-arrow { height: auto; transform: rotate(90deg); margin-left: 14px; }
}

/* ── Get started ──────────────────────── */

.step-title { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin-bottom: 12px; }
.step-title span {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1.5px solid var(--ink); font-family: var(--mono); font-size: 0.85rem; font-weight: 600;
}
.start-cols p { color: var(--muted); }
.start-cols p + .cmd, .start-cols .cmd + p { margin-top: 14px; }

.cmd {
  display: flex; align-items: stretch; margin-top: 8px;
  background: var(--term-bg); color: var(--term-fg); border: 1.5px solid var(--term-rule);
}
.cmd pre { margin: 0; padding: 12px 16px; flex: 1; min-width: 0; overflow-x: auto; font-size: 0.86rem; line-height: 1.5; }
.cmd pre code::before { content: "$ "; color: var(--term-dim); user-select: none; }
.copy {
  appearance: none; border: 0; border-left: 1px solid #3a3832; background: none; color: var(--term-dim);
  font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0 14px; min-width: 68px; cursor: pointer;
}
.copy:hover, .copy.done { color: var(--term-fg); }
.copy:focus-visible { outline-offset: -3px; }
.copy[hidden] { display: none; }

.warning {
  margin-top: clamp(32px, 4vw, 48px); padding: 22px 24px;
  border: 1.5px solid var(--accent); background: var(--paper); max-width: 86ch;
}
.warning h3 { color: var(--accent); }
.warning p { margin-top: 8px; }

.facts h3 { margin-bottom: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 0; border-top: 1px solid var(--rule); font-weight: 400; }
th { padding-right: 18px; white-space: nowrap; }
td { color: var(--muted); }
@media (max-width: 520px) {
  th, td { display: block; }
  th { padding-bottom: 0; }
  td { border-top: 0; padding-top: 4px; }
}

.plain li { position: relative; padding: 9px 0 9px 20px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.97rem; }
.plain li::before { content: ""; position: absolute; left: 0; top: 1.1em; width: 8px; height: 1.5px; background: var(--ink); }
.plain + .small { margin-top: 14px; }

/* ── Docs ─────────────────────────────── */

.docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: clamp(32px, 4vw, 52px); border-top: 1.5px solid var(--ink); }
.docs li { border-bottom: 1px solid var(--rule); }
.docs li:nth-child(odd) { border-right: 1px solid var(--rule); }
.docs a { display: block; padding: 26px 26px 28px 0; text-decoration: none; height: 100%; }
.docs li:nth-child(even) a { padding-left: 26px; }
.docs a:hover { color: inherit; }
.doc-name { display: block; font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; }
.doc-name::after { content: " →"; color: var(--accent); transition: margin-left 120ms ease; }
.docs a:hover .doc-name::after { margin-left: 6px; }
.doc-desc { display: block; margin-top: 8px; color: var(--muted); font-size: 0.97rem; max-width: 46ch; }
@media (max-width: 700px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs li:nth-child(odd) { border-right: 0; }
  .docs li:nth-child(even) a { padding-left: 0; }
}

/* ── Closing and footer ───────────────── */

.closing { padding: clamp(72px, 10vw, 136px) 0; border-top: 1.5px solid var(--ink); }
.closing h2 { max-width: 18ch; }
.closing p { margin-top: 20px; max-width: 58ch; font-size: 1.1rem; }
.closing .actions { margin-top: 32px; }

.site-footer { border-top: 1px solid var(--rule); padding: 26px 0 36px; font-size: 0.88rem; color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ── Motion ───────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame { animation: none; }
  * { transition: none !important; }
}
