/* shippeditself — hand-written CSS, no framework */

:root {
  --accent: #d4622a;
  --accent-ink: #ffffff;
  --bg: #faf8f5;
  --bg-raised: #ffffff;
  --ink: #1a1714;
  --ink-soft: #5c554d;
  --ink-faint: #918a80;
  --line: #e7e0d6;
  --line-strong: #d8cfc1;
  --mono: "SFMono-Regular", "IBM Plex Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26,23,20,0.04), 0 8px 24px rgba(26,23,20,0.06);
  --paper: repeating-linear-gradient(
      180deg,
      rgba(0,0,0,0.015) 0px,
      rgba(0,0,0,0.015) 1px,
      transparent 1px,
      transparent 3px
    );
  color-scheme: light dark;
}

:root[data-theme="dark"] {
  --accent: #ef7d42;
  --accent-ink: #1a1210;
  --bg: #171310;
  --bg-raised: #201a15;
  --ink: #f3ede4;
  --ink-soft: #c2b8a8;
  --ink-faint: #8a8074;
  --line: #33291f;
  --line-strong: #453824;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 30px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #ef7d42;
    --accent-ink: #1a1210;
    --bg: #171310;
    --bg-raised: #201a15;
    --ink: #f3ede4;
    --ink-soft: #c2b8a8;
    --ink-faint: #8a8074;
    --line: #33291f;
    --line-strong: #453824;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 30px rgba(0,0,0,0.4);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  max-width: 960px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
}
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.topnav {
  display: flex;
  gap: 22px;
  font-size: 14px;
}
.topnav a { color: var(--ink-soft); text-decoration: none; }
.topnav a:hover { color: var(--accent); }

/* ---------- hero / intro ---------- */
.hero {
  padding: 72px 0 56px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 0 0 14px;
}
.lede strong { color: var(--ink); font-weight: 600; }
.thesis {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
  max-width: 60ch;
  margin: 26px 0 0;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
}

section { padding: 56px 0; border-top: 1px solid var(--line); }
.hero { border-top: none; }

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  letter-spacing: -0.005em;
  margin: 0 0 8px;
}
.section-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 10px;
}
.section-intro {
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 32px;
}

/* ---------- what I did ---------- */
.did-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.did-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.did-list .tick {
  color: var(--accent);
  font-size: 18px;
  line-height: 1.5;
}
.did-list .label {
  font-weight: 600;
  margin-right: 6px;
}
.did-list .detail { color: var(--ink-soft); }
.did-list code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 5px;
}

.hero-shot {
  margin-top: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero-shot img { width: 100%; height: auto; }
.hero-shot figcaption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
}

/* ---------- how it works ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 28px 0 36px;
}
.stat {
  background: var(--bg-raised);
  padding: 18px 14px;
  min-width: 0;
}
.stat .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.stat .lbl {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 4px;
}

.steps {
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 10px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 4px 40px;
  color: var(--ink-soft);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps li strong { color: var(--ink); font-weight: 600; }
.steps code { font-family: var(--mono); font-size: 0.88em; background: var(--bg-raised); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }

.diagram-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 20px;
  margin: 0 0 8px;
  overflow-x: auto;
}
.diagram-wrap svg { display: block; margin: 0 auto; min-width: 560px; }
.diagram-cap { font-size: 13px; color: var(--ink-faint); margin: 10px 0 0; }

/* ---------- receipt ---------- */
#cost .wrap { max-width: 960px; }
.receipt-block {
  background: var(--bg-raised);
  background-image: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.receipt-caption {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin: 0 0 16px;
}
.receipt-scroll { overflow-x: auto; }
table.receipt {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}
table.receipt th, table.receipt td {
  padding: 7px 6px;
  text-align: left;
  border-bottom: 1px dashed var(--line-strong);
  white-space: nowrap;
}
table.receipt th {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
}
/* widths in ch (character units) so every full requestId, merchant name and
   amount fits with no clipping, regardless of which monospace font resolves */
table.receipt col.c-merchant { width: 25ch; }
table.receipt col.c-req { width: 30ch; }
table.receipt col.c-amount { width: 9ch; }
table.receipt col.c-fee { width: 8ch; }
table.receipt col.c-status { width: 12ch; }
table.receipt col.c-tx { width: 20ch; }
table.receipt col.c-protocol { width: 8ch; }
table.receipt col.c-chain { width: 7ch; }
table.receipt td.num { text-align: right; }
table.receipt tr.totals td {
  border-top: 1.5px solid var(--ink);
  border-bottom: none;
  font-weight: 600;
  padding-top: 12px;
  white-space: normal;
}
table.receipt tr.totals td.totals-label { color: var(--ink-soft); font-weight: 500; }
table.receipt tr.group-heading td {
  padding-top: 16px;
  padding-bottom: 4px;
  border-bottom: none;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.status-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}
.receipt-note {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
  font-size: 14.5px;
  color: var(--ink-soft);
  font-family: var(--sans);
}
.receipt-empty { color: var(--ink-faint); font-size: 14px; padding: 10px 0; }

/* ---------- video ---------- */
.video-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.video-box .placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 14px;
}
.video-box .play-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}

/* ---------- reproduce ---------- */
.repro-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  counter-reset: repro;
  display: grid;
  gap: 16px;
}
.repro-list li {
  counter-increment: repro;
  padding: 16px 18px 16px 52px;
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.repro-list li::before {
  content: counter(repro);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.repro-list strong { display: block; margin-bottom: 3px; }
.repro-list .detail { color: var(--ink-soft); font-size: 15px; }
.repro-list code { font-family: var(--mono); font-size: 0.87em; background: var(--bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { text-decoration: none; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--ink-faint);
  font-size: 13.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
footer a { color: var(--ink-faint); }
footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .hero { padding: 44px 0 40px; }
  section { padding: 40px 0; }
  .topnav { display: none; }
  .diagram-wrap svg { min-width: 460px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 16px 12px; }
  .stat .num { font-size: 1.2rem; }
}
