/* Humspan site. Tokens follow DESIGN.md ("The Night Tide Table"). */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/AtkinsonHyperlegibleNext.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("fonts/AtkinsonHyperlegibleMono.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #05090d;
  --raised: #0b1117;
  --ink: #d6ccb2;
  --ink-hover: #e3dbc6;
  --dim: #8c8676;
  --rule: #1a232b;
  --tick: #2a343c;
  --sea: #4f7f95;
  --sea-deep: #1d3a4a;
  --sea-wash: #1d3a4a33;

  --sans: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;

  --gutter: 20px;
  --width: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 900px) {
  :root { --gutter: 32px; }
}

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--tick) var(--ground);
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--sea-deep); color: var(--ink); }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--dim);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { text-decoration-color: var(--ink); }
:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 3px;
  border-radius: 8px;
}

.mono, time, .figure {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.wrap {
  width: 100%;
  max-width: calc(var(--width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 10px 14px;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.mark svg { width: 26px; height: 26px; flex: none; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--dim);
  text-decoration: none;
  font-size: 15px;
  border-radius: 8px;
}
.site-nav a:hover { color: var(--ink); background: var(--sea-wash); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

/* ---------- Store links ---------- */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 168px;
  min-height: 56px;
  padding: 8px 22px;
  border-radius: 28px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.store small {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
/* A live link: the page's one solid shape, like the app's Play circle. */
a.store { background: var(--ink); color: var(--ground); }
a.store small { color: #3a3628; }
a.store:hover { background: var(--ink-hover); }
/* Not yet released: an outline, not a link. */
.store.is-soon {
  border: 1.5px solid var(--dim);
  color: var(--ink);
}
.store.is-soon small { color: var(--dim); }

/* ---------- Home: hero ---------- */

.hero { padding-top: clamp(24px, 6vh, 72px); }
.hero-top {
  display: grid;
  gap: 28px;
  align-items: end;
}
@media (min-width: 900px) {
  .hero-top { grid-template-columns: minmax(0, 1fr) auto; gap: 64px; }
}
.hero h1 {
  margin: 0 0 18px;
  max-width: 13ch;
  font-size: clamp(2.35rem, 1.4rem + 3.6vw, 4.4rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero .lede {
  margin: 0 0 28px;
  max-width: 36rem;
  color: var(--dim);
  font-size: clamp(17px, 0.9rem + 0.3vw, 19px);
}
.hero .lede strong { color: var(--ink); font-weight: 400; }

.readout { text-align: left; }
@media (min-width: 900px) { .readout { text-align: right; } }
.readout .clock {
  display: block;
  font: 200 clamp(3rem, 2rem + 4vw, 5.6rem)/1 var(--mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.readout .note {
  display: block;
  margin-top: 10px;
  color: var(--dim);
  font-size: 15px;
}
.readout .note time { color: var(--ink); }

/* ---------- Home: the night span ---------- */

.night {
  position: relative;
  margin: clamp(28px, 5vh, 56px) 0 0;
  padding: 0;
}
.night-plot {
  position: relative;
  touch-action: pan-y;
}
.night svg { display: block; width: 100%; height: auto; overflow: visible; }
.trace { stroke: var(--sea); stroke-width: 1.4; stroke-linecap: round; fill: none; }
.axis { stroke: var(--rule); stroke-width: 1; }
.tick { stroke: var(--tick); stroke-width: 1; }
.tick.end { stroke: var(--dim); }
.night svg { height: clamp(120px, 18vw, 176px); }
.hours {
  position: relative;
  height: 22px;
  margin-top: 6px;
  color: var(--dim);
  font: 400 13px var(--mono);
  font-variant-numeric: tabular-nums;
}
.hours span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.hours span:last-child { transform: translateX(-80%); }
.hours .minor { display: none; }
@media (min-width: 640px) { .hours .minor { display: inline; } }

.js .trace-g { clip-path: inset(0 100% 0 0); }
.js .night.is-drawn .trace-g {
  clip-path: inset(0 0 0 0);
  transition: clip-path 2.6s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .js .trace-g, .js .night.is-drawn .trace-g { clip-path: none; transition: none; }
}

.cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--dim);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms;
}
.cursor span {
  position: absolute;
  top: -30px;
  left: 8px;
  white-space: nowrap;
  color: var(--ink);
  font: 400 13px var(--mono);
  font-variant-numeric: tabular-nums;
}
.cursor span em { font-style: normal; color: var(--dim); }
.cursor.flip span { left: auto; right: 8px; }
.night-plot.is-hover .cursor { opacity: 1; }

/* Hovering or focusing an entry pins its time on the span. */
.pin {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  opacity: 0;
  transition: opacity 160ms;
}
.pin-start, .pin-end { top: 0; bottom: 0; width: 2px; }
.pin-start { left: 0; }
.pin-end { right: 0; }
.pin-span { left: 0; right: 0; bottom: 0; height: 2px; }
.night:has(.entries li:nth-child(1):is(:hover, :focus-visible)) .pin-start,
.night:has(.entries li:nth-child(2):is(:hover, :focus-visible)) .pin-span,
.night:has(.entries li:nth-child(3):is(:hover, :focus-visible)) .pin-end { opacity: 1; }
.entries li { cursor: default; transition: color 160ms; }
.entries li:hover, .entries li:focus-visible { color: var(--ink); }
.entries li:focus-visible { outline-offset: 6px; }
.lr { width: 16px; height: 16px; vertical-align: -3px; }
.pin span {
  position: absolute;
  top: 4px;
  padding: 2px 6px;
  background: var(--ground);
  color: var(--ink);
  font: 400 13px var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pin-start span { left: 8px; }
.pin-end span { right: 8px; }
.pin-span span { top: auto; bottom: 8px; left: 50%; transform: translateX(-50%); }
.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Entries pinned along the span, like a tide table. */
.entries {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.entries li {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--dim);
}
.entries time, .entries .at { color: var(--ink); font-size: 14px; padding-top: 1px; }
@media (min-width: 760px) {
  .entries {
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: 32px;
  }
  .entries li {
    display: block;
    border-top: 0;
    padding: 0;
  }
  .entries li:nth-child(2) { text-align: center; }
  .entries li:nth-child(3) { text-align: right; }
  .entries time, .entries .at { display: block; margin-bottom: 4px; }
}

/* ---------- Home: sections ---------- */

.section { padding-top: clamp(80px, 12vh, 140px); }
.section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.6rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.section .intro {
  margin: 0 0 40px;
  max-width: 38rem;
  color: var(--dim);
}

/* The layer table */
.layers { border-bottom: 1px solid var(--rule); }
.layer {
  display: grid;
  gap: 6px 32px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
@media (min-width: 900px) {
  .layer { grid-template-columns: 14rem 18rem 1fr; align-items: baseline; }
}
.layer h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.layer .sub { color: var(--dim); font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 400; }
.layer p { margin: 0; color: var(--dim); max-width: 34rem; }
.words {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 4px 0 6px;
  padding: 0;
  list-style: none;
  color: var(--dim);
  font-size: 16px;
}
.words li { padding-bottom: 6px; }
.words .figure { font-size: 15px; }
.words .on {
  color: var(--ink);
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 28px 2px no-repeat;
}
.aside-row {
  display: grid;
  gap: 6px 32px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  color: var(--dim);
}
@media (min-width: 900px) { .aside-row { grid-template-columns: 14rem 1fr; } }
.aside-row b { color: var(--ink); font-weight: 500; }

/* Length */
.length {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .length { grid-template-columns: 340px 1fr; gap: 64px; }
}
.dial { position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 0 auto; }
.dial svg { display: block; width: 100%; height: 100%; }
.dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.dial-clock {
  font: 200 clamp(36px, 10vw, 48px)/1 var(--mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.dial-note { color: var(--dim); font-size: 14px; line-height: 1.4; }
.stops {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  max-width: 340px;
  margin: 18px auto 0;
  padding: 0;
  list-style: none;
  color: var(--dim);
  font: 400 14px var(--mono);
  text-align: center;
}
.stops li { display: flex; justify-content: center; align-items: center; min-height: 44px; }
.stops svg { width: 20px; height: 20px; }
.length-copy p { margin: 0 0 16px; color: var(--dim); max-width: 34rem; }
.length-copy p strong { color: var(--ink); font-weight: 400; }

/* Refusals */
.nevers { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--rule); }
.nevers li {
  display: grid;
  gap: 4px 32px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}
@media (min-width: 900px) { .nevers li { grid-template-columns: 14rem 1fr; } }
.nevers b { font-weight: 500; font-size: 18px; }
.nevers span { color: var(--dim); max-width: 38rem; }

/* Close */
.close {
  padding-top: clamp(96px, 16vh, 180px);
  padding-bottom: clamp(72px, 10vh, 120px);
  text-align: center;
}
.close img { display: block; margin: 0 auto 28px; }
.close h2 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.9rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.close p { margin: 0 auto 32px; color: var(--dim); max-width: 30rem; }
.close .stores { justify-content: center; }

/* ---------- Footer ---------- */

.site-foot {
  border-top: 1px solid var(--rule);
  padding: 22px 0 36px;
  color: var(--dim);
  font-size: 14px;
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.site-foot nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.site-foot a { color: var(--dim); display: inline-flex; min-height: 44px; align-items: center; }
.site-foot a:hover { color: var(--ink); }

/* ---------- Document pages (privacy, support) ---------- */

.doc { padding-top: clamp(32px, 7vh, 80px); padding-bottom: clamp(72px, 10vh, 120px); }
.doc-body { max-width: 42rem; }
.doc h1 {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 1.5rem + 2vw, 3rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.doc .meta { margin: 0 0 40px; color: var(--dim); font-size: 15px; }
.doc h2 {
  margin: 52px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}
.doc h3 { margin: 28px 0 6px; font-size: 17px; font-weight: 600; }
.doc p, .doc li { color: #c8bfa8; }
.doc p { margin: 0 0 14px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc ul { margin: 0 0 16px; padding-left: 1.2em; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--dim); }
.doc code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--ink);
}
.summary {
  margin: 0 0 8px;
  padding: 22px 24px;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.summary p { margin: 0; color: var(--ink); font-size: 18px; }
.summary p + p { margin-top: 10px; color: #c8bfa8; font-size: 16px; }

.kept {
  width: 100%;
  margin: 8px 0 18px;
  border-collapse: collapse;
  font-size: 15px;
}
.kept th, .kept td {
  padding: 10px 12px 10px 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.kept th { color: var(--dim); font-weight: 500; font-size: 13px; letter-spacing: 0.02em; }
.kept td { color: #c8bfa8; }
.kept td:first-child { color: var(--ink); }
.kept td:last-child { width: 40%; }

.qa { margin: 0; }
.qa dt {
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-weight: 600;
  color: var(--ink);
}
.qa dd { margin: 6px 0 22px; color: #c8bfa8; }
.qa dt:first-child { border-top: 0; padding-top: 6px; }

.contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 18px;
}
