/* Wimpsey public site. Hand-written; colours and sizes come from tokens.css,
   which tools/web/build_assets.py generates from design/tokens.json.
   Dark is the default theme, light follows the system setting. */

@font-face {
  font-family: "Wimpsey Voice";
  src: url("fonts/WimpseyVoice-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg-base);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 1.0625rem;            /* body: 17 */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-xs);
}

::selection { background: var(--accent-subtle); color: var(--text-primary); }

.skip {
  position: absolute;
  left: var(--space-4);
  top: -6rem;
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-raised);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}
.skip:focus { top: var(--space-4); }

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--space-screen-edge);
}
.wrap.narrow { max-width: 43rem; }

/* ---------- Type ---------- */

.voice {
  font-family: var(--font-voice);
  font-weight: 400;
  letter-spacing: -0.01em;
}

h1 {
  font-family: var(--font-voice);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.6rem + 4.6vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
h1 .lamp { color: var(--accent-text); display: block; }

h2 {
  font-family: var(--font-voice);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);   /* voiceL and up */
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;              /* title: 20 */
  line-height: 1.25;
  font-weight: 600;
}

.secondary { color: var(--text-secondary); }
.nowrap { white-space: nowrap; }
.caption {
  font-size: 0.8125rem;            /* caption: 13 */
  line-height: 1.4;
  color: var(--text-tertiary);
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-2);
}
.logo {
  display: inline-block;
  margin-left: -12px;              /* the lock-up file carries its own clear space */
  border-radius: var(--radius-sm);
}
.logo img { height: 64px; width: auto; }
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding-inline: var(--space-2);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}
.site-header nav a:hover { color: var(--text-primary); text-decoration: underline; }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  gap: var(--space-8);
  padding-block: var(--space-6) var(--space-16);
  align-items: center;
}
.hero-mark {
  position: relative;
  width: 132px;
  aspect-ratio: 1;
  margin-top: var(--space-4);
}
.mark { width: 100%; height: 100%; position: relative; }
.mark .lid { fill: var(--mark-lid); }
.mark .light { fill: var(--mark-light); }

/* Only the mark glows. */
.hero-mark::before {
  content: "";
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-fill), transparent);
  opacity: calc(var(--glow-opacity) * 0.75);
  animation: breathe var(--duration-breath) ease-in-out infinite;
  pointer-events: none;
}
@keyframes breathe {
  0%, 100% { opacity: calc(var(--glow-opacity) * 0.45); }
  50%      { opacity: var(--glow-opacity); }
}

.hero-sub {
  margin-top: var(--space-5);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  line-height: 1.35;
  color: var(--text-secondary);
}
.hero-lead {
  margin-top: var(--space-8);
  max-width: 34rem;
}
.hero-lead .voice {
  font-size: 1.375rem;             /* voiceM: 22 */
  line-height: 1.32;
  color: var(--text-primary);
}
.hero-lead p + p { margin-top: var(--space-4); color: var(--text-secondary); }

.availability {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  font-weight: 600;
  color: var(--text-primary);
}
.availability::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-fill);
}

/* ---------- Sections ---------- */

.section { padding-block: var(--space-16); }
.section + .section { border-top: 1px solid var(--border-subtle); }
.section-head { max-width: 36rem; }
.section-head p { margin-top: var(--space-4); color: var(--text-secondary); }

/* How a night goes: the lid comes down the page. */
.night { margin-top: var(--space-10); display: grid; gap: 0; }
.night li {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: var(--space-5);
  padding-bottom: var(--space-10);
}
.night li:last-child { padding-bottom: 0; }
.night li::before {                /* the rail between the marks */
  content: "";
  position: absolute;
  left: 23px;
  top: 56px;
  bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: var(--border-subtle);
}
.night li:last-child::before { display: none; }
.night .mark { width: 48px; height: 48px; }
.night .when {
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  padding-top: 2px;
}
.night .said {
  margin-top: var(--space-1);
  font-family: var(--font-voice);
  font-size: clamp(1.375rem, 1.2rem + 0.9vw, 1.75rem);
  line-height: 1.22;
}
.night .what { margin-top: var(--space-2); color: var(--text-secondary); max-width: 32rem; }

/* Who it is for */
.points {
  margin-top: var(--space-10);
  display: grid;
  gap: var(--space-5) var(--space-12);
}
.points li {
  position: relative;
  padding-left: var(--space-8);
  font-size: 1.125rem;
  line-height: 1.4;
}
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-fill);
}

.cards { display: grid; gap: var(--space-4); }
.below-head { margin-top: var(--space-10); }
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
}
.card h3 + p, .card p + p { margin-top: var(--space-3); }
.card p { color: var(--text-secondary); }
.card .label {
  display: block;
  margin-bottom: var(--space-3);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
}

.prose p { color: var(--text-secondary); max-width: 38rem; }
.prose p + p, .prose h3 + p { margin-top: var(--space-3); }
.prose h3 { color: var(--text-primary); }
.split { display: grid; gap: var(--space-10); }

.closing {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--space-5);
  padding-block: var(--space-24);
}
.closing .mark { width: 96px; height: 96px; }
.closing .voice { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); line-height: 1.15; }
.closing p:last-child { color: var(--text-secondary); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-sunken);
  padding-block: var(--space-10) var(--space-12);
  color: var(--text-secondary);
  font-size: 1rem;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-6);
  margin-top: var(--space-4);
}
.site-footer li a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  color: var(--text-primary);
}
.site-footer .caption { margin-top: var(--space-4); }

/* ---------- Document pages (support, legal) ---------- */

.doc { padding-block: var(--space-4) var(--space-16); }
.doc h1 { font-size: clamp(2.125rem, 1.7rem + 2.2vw, 3rem); line-height: 1.1; }
.doc .intro { margin-top: var(--space-4); color: var(--text-secondary); font-size: 1.125rem; }
.doc h2 { margin-top: var(--space-12); }
.doc h3 { margin-top: var(--space-8); }
.doc h2 + p, .doc h3 + p { margin-top: var(--space-3); }
.doc p + p, .doc ol + p, .doc ul + p { margin-top: var(--space-4); }
.doc .answers p { color: var(--text-secondary); }
.doc ol.steps {
  margin-top: var(--space-4);
  counter-reset: step;
  display: grid;
  gap: var(--space-3);
}
.doc ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: var(--space-10);
  min-height: 28px;
}
.doc ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-raised);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.doc ul.bullets { margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.doc ul.bullets li { position: relative; padding-left: var(--space-6); color: var(--text-secondary); }
.doc ul.bullets li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

/* Legal text: the approved wording, set for reading on a phone. */
.legal { line-height: 1.6; }
.legal h1 { margin-bottom: var(--space-6); }
.legal h2 {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}
.legal p { margin-top: var(--space-4); }
.legal .num { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.legal a { overflow-wrap: anywhere; }
.legal :target { scroll-margin-top: var(--space-6); }

/* ---------- Form ---------- */

.form { margin-top: var(--space-8); display: grid; gap: var(--space-5); }
.field { display: grid; gap: var(--space-2); }
.field label { font-weight: 600; font-size: 1rem; }
.field .hint { font-size: 0.8125rem; line-height: 1.4; color: var(--text-tertiary); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: var(--button-height);
  padding: var(--space-4);
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.field textarea { min-height: 11rem; resize: vertical; line-height: 1.5; }
.field select { appearance: none; -webkit-appearance: none; padding-right: var(--space-12);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
                    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 25px) 50%, calc(100% - 19px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-tertiary); opacity: 1; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { border-radius: var(--radius-sm); }
.field [aria-invalid="true"] { border-color: var(--negative-fill); border-width: 2px; }
.field .error { font-size: 0.9375rem; color: var(--negative-text); }

/* A field for robots only. People never see or reach it. */
.extra-field {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-height);
  padding: 0 var(--space-8);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--accent-fill);
  color: var(--text-on-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--duration-quick) var(--ease-standard),
              background-color var(--duration-quick) var(--ease-standard);
}
.button:hover { background: var(--accent-fill-pressed); }
.button:active { transform: scale(var(--press-scale)); background: var(--accent-fill-pressed); }
.button:focus-visible { border-radius: var(--radius-lg); }
.button[disabled] { opacity: 0.4; cursor: default; }
.button.quiet {
  background: var(--bg-raised);
  color: var(--text-primary);
}
.form .button { justify-self: start; }

.notice {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
}
.notice strong { display: block; margin-bottom: var(--space-1); }
.notice.drifted { background: var(--negative-subtle); }
.notice.drifted strong { color: var(--negative-text); }
.notice.settled { background: var(--positive-subtle); }
.notice.settled strong { color: var(--positive-text); }
.notice p + p { margin-top: var(--space-2); }
.notice a { color: var(--text-primary); }
.notice .ref { color: var(--text-primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

.publisher { margin-top: var(--space-12); }

/* ---------- Wider screens ---------- */

@media (min-width: 48rem) {
  .wrap { padding-inline: var(--space-10); }
  .logo img { height: 72px; }
  .logo { margin-left: -14px; }
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: var(--space-12);
    padding-block: var(--space-12) var(--space-24);
  }
  .hero-mark {
    order: 2;
    width: min(100%, 26rem);
    justify-self: end;
    margin-top: 0;
  }
  .section { padding-block: var(--space-24); }
  .with-aside {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: var(--space-16);
    align-items: start;
  }
  .with-aside .night { margin-top: var(--space-2); }
  .points { grid-template-columns: 1fr 1fr; }
  .cards.two { grid-template-columns: 1fr 1fr; }
  .cards.three { grid-template-columns: repeat(3, 1fr); }
  .card { padding: var(--space-8); }
  .split { grid-template-columns: 1fr 1fr; gap: var(--space-16); }
  .doc { padding-block: var(--space-8) var(--space-24); }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero-mark::before { animation: none; opacity: calc(var(--glow-opacity) * 0.75); }
  .button { transition: none; }
  .button:active { transform: none; }
  html { scroll-behavior: auto; }
}

@media print {
  .site-header nav, .site-footer ul, .skip { display: none; }
  body { background: #fff; color: #000; }
}
