/* Feet & Fraction: graphite workshop, one safety-amber tape. Same palette as the app. */
:root {
  --bg: #0b0c0e;
  --surface: #14171b;
  --line: #262a31;
  --line-strong: #3a3f48;
  --text: #f2f0eb;
  --muted: #a9afb9;
  --faint: #7d8490;
  --amber: #ffb020;
  --amber-ink: #1a1408;
  --sans:
    'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Display', 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --gutter: clamp(16px, 5vw, 64px);
  --measure: 1180px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
a:hover {
  color: var(--amber);
}

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

h1,
h2,
p {
  margin: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--amber);
  color: var(--amber-ink);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

/* ── Header ─────────────────────────────────────────────── */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px max(var(--gutter), calc((100% - var(--measure)) / 2 + var(--gutter)));
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.bar.scrolled {
  border-bottom-color: var(--line);
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.mark img {
  border-radius: 7px;
}
.bar nav {
  display: flex;
  gap: clamp(4px, 2.4vw, 24px);
  margin-right: -6px;
  font-size: 15px;
  color: var(--muted);
}
.bar nav a {
  text-decoration: none;
  padding: 12px 6px;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: clamp(32px, 6vh, 72px) 0 clamp(48px, 8vh, 96px);
}
.hero-copy {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.status {
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(20px, 3vw, 32px);
}
h1 {
  font-size: clamp(44px, 8.4vw, 118px);
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: -0.045em;
  max-width: 12ch;
  text-wrap: balance;
}
h1 em {
  font-style: normal;
  color: var(--amber);
}
.lede {
  margin-top: clamp(20px, 3vw, 30px);
  max-width: 34ch;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
  color: var(--muted);
}
.lede strong {
  color: var(--text);
  font-weight: 650;
}

@media (min-width: 980px) {
  .hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    column-gap: 56px;
    align-items: end;
  }
  .hero-copy h1 {
    font-size: clamp(56px, 6.6vw, 100px);
    max-width: 13ch;
  }
  .status {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .lede {
    margin-top: 0;
    padding-bottom: 10px;
  }
}

/* The tape runs edge to edge; the readout sits on the hook line. */
.tape-wrap {
  margin: clamp(36px, 5vw, 64px) 0 0;
}
.readout {
  max-width: var(--measure);
  margin: 0 auto 14px;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.read-main {
  font: 780 clamp(44px, 6.4vw, 76px) / 1 var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  min-width: 7ch;
}
.read-alt {
  font: 500 15px/1.2 var(--mono);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.tape {
  position: relative;
  height: 112px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.tape:active {
  cursor: grabbing;
}
.tape:focus-visible {
  outline-offset: -2px;
  border-radius: 0;
}
.tape canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.hook {
  position: absolute;
  left: 50%;
  top: -10px;
  bottom: -10px;
  width: 2px;
  margin-left: -1px;
  background: var(--text);
  pointer-events: none;
}
.hook::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -6px;
  border: 7px solid transparent;
  border-top-color: var(--text);
}
figcaption {
  max-width: 60ch;
  margin: 18px auto 0;
  padding: 0 var(--gutter);
  text-align: center;
  font-size: 14px;
  color: var(--faint);
  text-wrap: balance;
}
@media (hover: none) {
  .kbd-hint {
    display: none;
  }
}

/* ── Sections ───────────────────────────────────────────── */
main > section:not(.hero) {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 128px) var(--gutter) 0;
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 8px clamp(24px, 5vw, 72px);
  align-items: end;
  border-top: 1px solid var(--line-strong);
  padding-top: 20px;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.label {
  grid-column: 1 / -1;
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
}
h2 {
  font-size: clamp(32px, 4.6vw, 56px);
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.section-head > p:not(.label) {
  color: var(--muted);
  max-width: 52ch;
}

/* Calculator demo: the real key sequence from the app. */
.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 24px;
  align-items: center;
}
.keyseq {
  grid-column: 1 / -1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 8px;
}
.keyseq li {
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #22262d;
  border: 1px solid rgb(255 255 255 / 0.06);
  font: 700 20px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  transition:
    transform 0.12s,
    background-color 0.12s,
    color 0.12s;
}
.keyseq li.u,
.keyseq li.op {
  color: #ffc24d;
  background: #1b1f25;
}
.keyseq li.op {
  background: #2c2414;
}
.keyseq li.eq {
  background: var(--amber);
  color: var(--amber-ink);
}
.keyseq.playing li {
  opacity: 0.45;
}
.keyseq.playing li.done {
  opacity: 1;
}
.keyseq li.hit {
  transform: scale(0.92);
  background: var(--amber);
  color: var(--amber-ink);
  opacity: 1;
}
.demo-screen {
  min-height: 118px;
  padding: 20px 24px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.demo-expr {
  font: 500 17px/1.3 var(--mono);
  color: var(--muted);
  min-height: 1.3em;
}
.demo-result {
  margin-top: 8px;
  font: 780 clamp(36px, 5vw, 56px) / 1 var(--sans);
  letter-spacing: -0.03em;
  min-height: 1em;
}
.replay {
  align-self: stretch;
  padding: 0 22px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: 600 15px/1 var(--sans);
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.replay:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* Tools: a tally sheet, not cards. */
.tally {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.tally th,
.tally td {
  text-align: left;
  vertical-align: top;
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--line);
}
.tally thead th {
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 0;
}
.tally tbody th {
  font-weight: 700;
  width: 22%;
}
.tally td {
  color: var(--muted);
  width: 36%;
}
.tally td:last-child {
  color: var(--text);
  font-weight: 650;
  width: auto;
  text-wrap: pretty;
}
.tally tbody tr {
  transition: background-color 0.15s;
}
.tally tbody tr:hover td:last-child {
  color: var(--amber);
}
.more {
  margin-top: 24px;
  max-width: 64ch;
  color: var(--muted);
}

/* Price */
.ticket {
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  overflow: hidden;
}
.ticket-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.ticket-row > div {
  padding: clamp(22px, 3vw, 36px);
}
.ticket-row .pro {
  background: var(--amber);
  color: var(--amber-ink);
}
.tier {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  align-content: flex-end;
  min-height: clamp(36px, 4.6vw, 52px);
  font-weight: 780;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.amount {
  font: 800 clamp(36px, 4.6vw, 52px) / 1 var(--sans);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.ticket ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ticket li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.pro li {
  border-top-color: rgb(26 20 8 / 0.18);
}
.fine {
  padding: 16px clamp(22px, 3vw, 36px);
  border-top: 1px dashed var(--line-strong);
  font-size: 14px;
  color: var(--faint);
}
.privacy-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 32px;
  align-items: baseline;
  margin-top: clamp(40px, 6vw, 72px);
}
.privacy-note .big {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.privacy-note p:not(.big) {
  color: var(--muted);
  max-width: 48ch;
}

/* Support */
.faq {
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  font-weight: 650;
  font-size: 18px;
  cursor: pointer;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  font: 500 22px/1 var(--mono);
  color: var(--amber);
  transition: transform 0.2s;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  padding: 0 0 20px;
  max-width: 64ch;
  color: var(--muted);
}

/* Footer: a drawing-sheet title block. */
.titleblock {
  max-width: var(--measure);
  margin: clamp(80px, 12vw, 140px) auto 0;
  padding: 0 var(--gutter) 40px;
}
.titleblock dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
}
.titleblock dl > div {
  padding: 12px 14px;
  border-left: 1px solid var(--line-strong);
}
.titleblock dl > div:first-child {
  border-left: 0;
}
.titleblock dt {
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}
.titleblock dd {
  margin: 0;
  font-weight: 650;
}
.titleblock dd a {
  display: inline-block;
  padding: 11px 0;
  margin: -11px 0;
}
.titleblock > p {
  margin-top: 16px;
  font-size: 13px;
  color: var(--faint);
}

/* Reading pages (privacy, 404) */
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) var(--gutter) 0;
}
.doc h1 {
  font-size: clamp(40px, 7vw, 72px);
  max-width: none;
}
.doc .meta {
  margin-top: 14px;
  font: 500 13px/1.4 var(--mono);
  color: var(--faint);
}
.doc .meta:first-child {
  margin: 0 0 14px;
}
.doc h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 40px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.doc p {
  color: var(--muted);
  margin-bottom: 12px;
}
.doc .first {
  margin-top: 32px;
  font-size: 21px;
  color: var(--text);
}
.doc .back {
  display: inline-block;
  margin-top: 20px;
  padding: 11px 0;
  font-weight: 650;
  color: var(--text);
}

/* ── Responsive ─────────────────────────────────────────── */
/* Too narrow for one row of keys: two rows of seven, one per measurement. */
@media (max-width: 979px) {
  .keyseq {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .section-head {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }
  .demo {
    grid-template-columns: 1fr;
  }
  .replay {
    justify-self: start;
    height: 44px;
  }
  .keyseq {
    gap: 6px;
  }
  .keyseq li {
    height: 46px;
    font-size: 17px;
    border-radius: 12px;
  }
  .tally thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .tally,
  .tally tbody,
  .tally tr,
  .tally th,
  .tally td {
    display: block;
    width: auto !important;
  }
  .tally tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .tally th,
  .tally td {
    border: 0;
    padding: 0;
  }
  .tally td {
    margin-top: 4px;
  }
  .ticket-row {
    grid-template-columns: 1fr;
  }
  .privacy-note {
    grid-template-columns: 1fr;
  }
  .titleblock dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .titleblock dl > div:nth-child(3) {
    border-left: 0;
  }
  .titleblock dl > div:nth-child(n + 3) {
    border-top: 1px solid var(--line-strong);
  }
  .tape {
    height: 96px;
  }
}

@media (max-width: 420px) {
  .mark span {
    font-size: 16px;
  }
}
@media (max-width: 359px) {
  .bar nav a:first-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
