/* Evinlo — coming soon page.
   Concept: the page is one day. The hero is the night sky, cut flat on a horizon
   where the half sun of the mark rests. Below it is daylight (the dashboards),
   and the page ends in the evening (privacy, open source, footer).
   No web fonts, no scripts, no external requests. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  /* Brand palette (brand/README.md) */
  --night: #262B73;
  --daybreak: #F08A5B;
  --ink: #1B1F3F;
  --moonlight: #E6E4F4;
  --glow: #F59B6C;
  --paper: #F3F0EA;
  --sky-top: #232A6E;
  --sky-bottom: #11143A;

  /* Type */
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-score: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout. The gutter never lets text run under a notch or the Dynamic Island
     when an iPhone is held in landscape (the page uses viewport-fit=cover). */
  --gutter: clamp(1rem, 5vw, 3rem);
  --gutter-safe: max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --max: 72rem;
  --radius-widget: 1.5rem;
  --radius-control: 0.75rem;

  /* The site header's height, which the hero of the home page and the 404 page
     leave to it in the first view: its padding and one row of links (2.35rem),
     which stand taller than the logo. The header itself sizes to its content. */
  --site-header-pad-top: clamp(1rem, 3vw, 1.75rem);
  --site-header-pad-bottom: clamp(0.75rem, 3vw, 1.75rem);
  --site-header-h: calc(var(--site-header-pad-top) + var(--site-header-pad-bottom) + 2.35rem);

  /* Night surfaces: the hero sky and the evening. The evening fades into the
     night of the zenith, so the page ends where it began. */
  --sky-zenith: #11143A;
  --sky-horizon: #262B73;
  --evening: #262B73;
  --evening-end: var(--sky-zenith);
  --on-night: var(--paper);
  --on-night-muted: #C9C7E0;          /* 7.6:1 on Night, 10.7:1 on Sky bottom */
  --night-rule: rgb(230 228 244 / 0.16);
  --horizon-ring: rgb(230 228 244 / 0.1);

  /* Day surface (light scheme) */
  --day: var(--paper);
  --on-day: var(--ink);               /* 14.1:1 */
  --on-day-strong: var(--night);      /* 11.0:1 */
  --on-day-muted: #4B4F6B;            /* 7.0:1 */
  --day-rule: rgb(27 31 63 / 0.14);
  --panel: #FFFFFF;
  --panel-rule: rgb(27 31 63 / 0.08);
  --on-panel-muted: #555872;          /* 6.9:1 on white */

  /* Data (warmth is the signal). The stress ramp gets steadily darker and
     warmer from 'At your usual level' to 'Well above', so time above the
     usual level draws the eye. */
  --data: var(--daybreak);
  --track: rgb(38 43 115 / 0.06);
  --band: rgb(38 43 115 / 0.32);
  --stress-at-usual: #CDCFE8;
  --stress-slightly-above: #F6B994;
  --stress-above: #F39E72;
  --stress-well-above: var(--daybreak);
  --active: rgb(38 43 115 / 0.08);
  --active-edge: rgb(38 43 115 / 0.28);

  --focus-day: var(--night);
  --focus-night: var(--glow);
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky-zenith: #0D1033;
    --evening: #191D4C;

    --day: var(--sky-bottom);
    --on-day: var(--paper);           /* 15.6:1 */
    --on-day-strong: #C4C3F2;         /* 10.5:1, a lavender tint so leads stay distinct from Paper headings */
    --on-day-muted: #B9B7D3;          /* 9.1:1 */
    --day-rule: rgb(230 228 244 / 0.13);
    --panel: #191D4C;
    --panel-rule: rgb(230 228 244 / 0.08);
    --on-panel-muted: #B4B2D0;        /* 7.6:1 on the panel */

    --data: var(--glow);
    --track: rgb(230 228 244 / 0.1);
    --band: rgb(230 228 244 / 0.24);
    --stress-at-usual: #6E72AE;
    --stress-slightly-above: #C98C73;
    --stress-above: #E0906D;
    --stress-well-above: var(--glow);
    --active: rgb(230 228 244 / 0.07);
    --active-edge: rgb(230 228 244 / 0.3);

    --focus-day: var(--glow);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Overscroll at the top shows the hero's zenith, and at the bottom the footer's night. */
  background: var(--sky-zenith);
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-text);
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  line-height: 1.55;
  color: var(--on-day);
  background: var(--day);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
dl,
dd,
figure,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
}

p,
dd,
li {
  text-wrap: pretty;
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--glow);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

.wrap {
  width: min(var(--max), 100% - 2 * var(--gutter-safe));
  margin-inline: auto;
}

/* ---------- Hero: night sky and horizon ---------- */

.hero {
  color: var(--on-night);
  background: linear-gradient(to bottom, var(--sky-zenith) 0%, #1A1E58 55%, var(--sky-horizon) 100%);
  overflow: hidden;
}

.hero :focus-visible {
  outline-color: var(--focus-night);
}

/* The site header sits above the hero on the same night sky, so the hero
   takes the rest of the first view and the sun still rests on its bottom edge. */
.hero-grid {
  display: grid;
  /* One column exactly as wide as the wrap: the horizon's aspect ratio must
     never widen it past the screen. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  justify-items: center;
  min-height: calc(min(100svh, 64rem) - var(--site-header-h));
  text-align: center;
}

.hero-copy {
  max-width: 64rem;
  padding-block: clamp(3rem, 9vw, 4.5rem) clamp(2.5rem, 6vw, 3.5rem);
  /* Tighter on short screens, so the horizon stays in the first view. */
  padding-block: max(min(clamp(3rem, 9vw, 4.5rem), 8svh), 2rem) max(min(clamp(2.5rem, 6vw, 3.5rem), 6svh), 1.75rem);
}

.hero h1 {
  font-size: clamp(2.375rem, 1.35rem + 4.3vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero-sub {
  max-width: 37em;
  margin: clamp(1.25rem, 3vw, 1.75rem) auto 0;
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
  color: var(--on-night-muted);
  text-wrap: balance;
}

/* A status, not a button: a soft tint without a border. The half sun rests on
   the text baseline, like the sun on the horizon. */
.status {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55em;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  padding: 0.45em 1em 0.5em;
  border-radius: 999px;
  background: rgb(230 228 244 / 0.08);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--on-night);
}

.status-sun {
  flex: none;
  width: 1.1em;
  height: 0.55em;
  fill: var(--glow);
}

/* The horizon: the upper half of the mark at landscape scale. It fills the
   space left under the copy (at most 44rem wide) and is drawn bottom-aligned,
   so the sun always rests on the bottom edge of the hero: the page's horizon. */
.horizon {
  position: relative;
  width: min(100%, 44rem);
  min-height: min(50vw, 12rem);
}

/* On phones the scene runs edge to edge, so the sun is as large as the screen allows. */
@media (max-width: 39.99rem) {
  .hero-grid {
    grid-template-rows: 1fr auto;
  }

  .hero-copy {
    align-self: center;
  }

  .horizon {
    justify-self: stretch;
    width: auto;
    min-height: 0;
    aspect-ratio: 2 / 1;
    margin-inline: calc(-1 * var(--gutter-safe));
  }
}

.horizon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

.horizon-ring {
  fill: var(--horizon-ring);
}

.horizon-sun {
  fill: var(--glow);
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .horizon-sun {
    animation: daybreak 1.5s cubic-bezier(0.22, 0.75, 0.25, 1) 0.1s both;
  }
}

@keyframes daybreak {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ---------- Day: three areas of the app ---------- */

.day {
  padding-block: clamp(4.5rem, 11vw, 8rem) clamp(4rem, 9vw, 6.5rem);
}

h2 {
  font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.section-intro {
  max-width: 42rem;
  margin-bottom: clamp(2.5rem, 7vw, 4.5rem);
}

.section-intro p {
  margin-top: clamp(1rem, 2.5vw, 1.5rem);
  max-width: 36em;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--on-day-muted);
}

.section-intro .intro-note {
  margin-top: 1rem;
  font-size: 0.9375rem;
}

.pillar {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--day-rule);
}

@media (min-width: 56rem) {
  .pillar {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(3rem, 7vw, 7rem);
    align-items: center;
  }
}

.pillar h3 {
  font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.pillar-lead {
  margin-top: 0.5rem;
  font-size: clamp(1.1875rem, 1.08rem + 0.45vw, 1.4375rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--on-day-strong);
}

.pillar-text p + p {
  margin-top: 1rem;
  max-width: 34em;
  color: var(--on-day-muted);
}

/* Illustrations of the planned app screens */

/* In one column the illustration is as wide as the text measure above it. */
.viz {
  width: 100%;
  max-width: 38rem;
}

@media (min-width: 56rem) {
  .viz {
    max-width: 31rem;
    justify-self: end;
  }
}

.widget {
  padding: clamp(1.25rem, 3.5vw, 1.75rem);
  border: 1px solid var(--panel-rule);
  border-radius: var(--radius-widget);
  background: var(--panel);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.viz figcaption {
  margin-top: 0.75rem;
  padding-inline: 0.25rem;
  font-size: 0.8125rem;
  color: var(--on-day-muted);
}

.widget-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.15rem 1rem;
  font-weight: 600;
}

.widget-meta {
  font-weight: 400;
  white-space: nowrap;
  color: var(--on-panel-muted);
}

/* Sleep */

.score {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.score-num {
  font-family: var(--font-score);
  font-size: clamp(3.25rem, 2.6rem + 2.5vw, 4.25rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.score-word {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--on-panel-muted);
}

/* Readiness: the same score, a step smaller, so the contributors lead. */
.score-compact .score-num {
  font-size: clamp(2.5rem, 2.15rem + 1.4vw, 3rem);
}

.score-compact .score-word {
  font-size: 1.0625rem;
}

.scale {
  margin-top: 1.25rem;
}

.scale-track,
.contrib-track {
  position: relative;
  display: block;
  height: 0.625rem;
  border-radius: 999px;
  background: var(--track);
}

.scale-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--data);
}

.fill-37 { width: 37%; }
.fill-54 { width: 54%; }

.scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--on-panel-muted);
}

.widget-note,
.widget-sub {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--panel-rule);
}

.widget-sub {
  font-weight: 600;
}

/* Readiness */

.contrib {
  display: grid;
  gap: 1.15rem;
  margin-top: 0.9rem;
  padding: 0;
  list-style: none;
}

.contrib-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1rem;
}

.contrib-name {
  font-weight: 500;
}

.contrib-value {
  color: var(--on-panel-muted);
}

/* What a part measured, under its name. */
.contrib-detail {
  grid-column: 1 / -1;
  margin-top: -0.25rem;
  font-size: 0.875rem;
  color: var(--on-panel-muted);
}

.contrib-track {
  grid-column: 1 / -1;
}

/* On the narrowest phones the value goes under the name. */
@media (max-width: 21.99rem) {
  .contrib-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }

  .contrib-track {
    margin-top: 0.5rem;
  }
}

.contrib-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--band);
}

.contrib-dot {
  position: absolute;
  top: 50%;
  width: 0.9375rem;
  height: 0.9375rem;
  margin: -0.46875rem 0 0 -0.46875rem;
  border-radius: 50%;
  background: var(--data);
  box-shadow: 0 0 0 3px var(--panel);
}

.contrib-heart .contrib-band { left: 44%; width: 24%; }
.contrib-heart .contrib-dot { left: 27%; }

.widget-legend,
.strip-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-top: 1.25rem;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--panel-rule);
  font-size: 0.8125rem;
  color: var(--on-panel-muted);
}

.widget-legend > span,
.strip-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.ramp {
  margin-right: 0.35rem;
}

.ramp-keys {
  display: inline-flex;
  gap: 2px;
}

.ramp-keys .key {
  border-radius: 2px;
}

.key {
  flex: none;
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
}

.key-band {
  width: 1.5rem;
  height: 0.625rem;
  border-radius: 999px;
  background: var(--band);
}

.key-dot {
  border-radius: 50%;
  background: var(--data);
}

/* Stress */

.strip {
  margin-top: 1.25rem;
}

.strip-chart {
  width: 100%;
  height: 4.5rem;
}

.s1, .key-s1 { fill: var(--stress-at-usual); background: var(--stress-at-usual); }
.s2, .key-s2 { fill: var(--stress-slightly-above); background: var(--stress-slightly-above); }
.s3, .key-s3 { fill: var(--stress-above); background: var(--stress-above); }
.s4, .key-s4 { fill: var(--stress-well-above); background: var(--stress-well-above); }

.strip-active {
  fill: var(--active);
  stroke: var(--active-edge);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.key-active {
  background: var(--active);
  border: 1px dashed var(--active-edge);
}

.strip-gap {
  stroke: var(--on-panel-muted);
  stroke-width: 2;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
}

.key-gap {
  width: 1rem;
  height: 0;
  border-top: 2px dotted var(--on-panel-muted);
  border-radius: 0;
}

/* 7:00 and 23:00 sit at the ends; the others are centred on their hours. */
.strip-axis {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--on-panel-muted);
}

.strip-axis .at-25,
.strip-axis .at-50,
.strip-axis .at-75 {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.strip-axis .at-25 { left: 25%; }
.strip-axis .at-50 { left: 50%; }
.strip-axis .at-75 { left: 75%; }

.disclaimer {
  padding-top: clamp(1.75rem, 4vw, 2.5rem);
  border-top: 1px solid var(--day-rule);
  font-size: 0.9375rem;
  color: var(--on-day-muted);
}

/* ---------- Evening: privacy, open source, footer ---------- */

.evening,
.site-footer {
  color: var(--on-night);
  background: var(--evening-end);
}

.evening {
  background: linear-gradient(to bottom, var(--evening), var(--evening-end));
}

.evening :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--focus-night);
}

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(3rem, 7vw, 7rem);
  }
}

.privacy {
  padding-block: clamp(4.5rem, 11vw, 8rem) clamp(3.5rem, 8vw, 5.5rem);
}

.split-lead {
  margin-top: clamp(1rem, 2.5vw, 1.5rem);
  max-width: 24em;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--on-night-muted);
}

.fact {
  display: grid;
  gap: 0.35rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--night-rule);
}

.fact:first-child {
  padding-top: 0;
  border-top: 0;
}

.fact:last-child {
  padding-bottom: 0;
}

/* Label beside the text only where the text keeps a comfortable measure: on
   a single column, and again once the two-column layout is wide enough. */
@media (min-width: 40rem) and (max-width: 55.99rem), (min-width: 72rem) {
  .fact {
    grid-template-columns: 9.5rem minmax(0, 1fr);
    column-gap: 1.75rem;
  }
}

/* The short heading column stays in view next to the facts. */
@media (min-width: 56rem) {
  .privacy .split-head {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

.facts dt {
  font-weight: 600;
}

.facts dd {
  color: var(--on-night-muted);
}

.open .split {
  padding-block: clamp(3.5rem, 8vw, 5.5rem) clamp(4.5rem, 10vw, 7rem);
  border-top: 1px solid var(--night-rule);
}

.open-body {
  max-width: 36em;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--on-night-muted);
}

.open-note {
  margin-top: 1rem;
  color: var(--on-night);
}

.site-footer {
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--night-rule);
}

@media (min-width: 56rem) {
  .footer-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(3rem, 7vw, 7rem);
    /* The wordmark's letters sit on the bottom edge of its box, which lines up
       with the first line of the footer text. */
    align-items: baseline;
  }
}

.footer-wordmark {
  width: 6.125rem;
  height: 1.75rem;
}

.wordmark-letters {
  fill: var(--paper);
}

.wordmark-sun {
  fill: var(--glow);
}

.footer-body {
  display: grid;
  gap: 1.25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.footer-links a {
  display: inline-block;
  padding-block: 0.3rem;
  color: var(--on-night);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-text {
  display: grid;
  gap: 0.5rem;
  max-width: 40rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--on-night-muted);
}

/* After the day of a content page the footer starts on its own, without the
   rule that separates it from the evening on the home page. */
.site-footer-standalone {
  padding-top: clamp(2.5rem, 6vw, 3.5rem);
}

.site-footer-standalone .footer-grid {
  padding-top: 0;
  border-top: 0;
}

/* ---------- 404 ---------- */

/* The same night sky, with a strip of ground under the horizon and the
   evening of the footer below it. */
.lost-page {
  --ground: clamp(2rem, 7vh, 4rem);
}

/* The copy takes the free space and is centred in it; the horizon keeps its
   natural shape (half as tall as wide) and rests on the ground. */
.lost .hero-grid {
  grid-template-rows: 1fr auto;
  min-height: calc(100svh - var(--ground) - var(--site-header-h));
}

.lost .hero-copy {
  align-self: center;
}

.lost .horizon {
  max-width: 36rem;
  min-height: 0;
  aspect-ratio: 2 / 1;
}

.lost-ground {
  height: var(--ground);
}

.lost-action {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
}

.brand-link {
  display: block;
  border-radius: 6px;
}

/* The only bordered pill: a real link. */
.pill-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55em 1.1em 0.6em;
  border: 1px solid rgb(230 228 244 / 0.3);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--on-night);
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pill-link:hover {
  border-color: rgb(230 228 244 / 0.6);
  background: rgb(230 228 244 / 0.08);
}

/* ---------- Privacy policy ---------- */

/* A plain text page: the night sky as the slim site header, then the day. */
.policy {
  max-width: 44rem;
  padding-block: clamp(3rem, 8vw, 5rem) clamp(4rem, 9vw, 6rem);
}

.policy h1 {
  font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.policy h2 {
  margin-top: clamp(2rem, 5vw, 2.75rem);
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.policy p {
  margin-top: 0.9rem;
}

.policy .policy-meta {
  font-size: 0.9375rem;
  color: var(--on-day-muted);
}

.policy .policy-lead {
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--on-day-strong);
}

.policy ul {
  margin-top: 0.9rem;
  padding-left: 1.25rem;
}

.policy li + li {
  margin-top: 0.45rem;
}

.policy address {
  margin-top: 0.9rem;
  font-style: normal;
}

/* A place the publisher still has to fill in. A page that shows one is not
   ready to be deployed. */
.policy mark {
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: var(--glow);
  color: var(--ink);
}

/* ---------- Site header (every content page) ---------- */

/* The night sky as a slim band: the logo, and the three places to go. On the
   home page and the 404 page the band is the top of the hero's sky. */
.site-header {
  color: var(--on-night);
  background: linear-gradient(to bottom, var(--sky-zenith), var(--sky-horizon));
}

.site-header-hero {
  background: var(--sky-zenith);
}

.site-header :focus-visible {
  outline-color: var(--focus-night);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: max(var(--site-header-pad-top), env(safe-area-inset-top)) var(--site-header-pad-bottom);
}

.site-brand img {
  width: auto;
  height: var(--site-logo-h);
}

:root {
  --site-logo-h: clamp(1.625rem, 1.4rem + 0.9vw, 2.25rem);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(1rem, 3vw, 1.75rem);
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.45rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--on-night-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--on-night);
}

/* The current page: a short line of Glow under it, like the sun on the horizon. */
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--glow);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5em;
}

/* On phones the logo stands on its own line and the links sit under it. */
@media (max-width: 29.99rem) {
  :root {
    --site-header-h: calc(var(--site-header-pad-top) + var(--site-logo-h) + 0.35rem + 2.35rem + var(--site-header-pad-bottom));
  }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header-inner {
    gap: 0.35rem 1rem;
  }

  .site-nav ul {
    gap: 0 1.15rem;
  }
}

/* ---------- Utilities ---------- */

/* Hidden means hidden, also for elements whose class sets a display. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Content pages: how it works, contribute ---------- */

.page {
  padding-block: clamp(3rem, 8vw, 5rem) clamp(4rem, 9vw, 6rem);
}

.page-intro {
  max-width: 44rem;
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-day-muted);
}

.page h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.eyebrow + h1 {
  margin-top: 0.75rem;
}

.page-lead {
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.375rem);
  line-height: 1.5;
  color: var(--on-day-strong);
}

.page-intro p + p:not(.page-lead) {
  margin-top: 1rem;
  color: var(--on-day-muted);
}

.page-section {
  max-width: 44rem;
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  padding-top: clamp(2rem, 5vw, 2.75rem);
  border-top: 1px solid var(--day-rule);
}

.page-section h2 {
  font-size: clamp(1.625rem, 1.25rem + 1.5vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.page-section > p,
.page-section > ul,
.page-section > ol {
  margin-top: 1rem;
}

.page-section > p {
  color: var(--on-day-muted);
}

.page-section > p.page-section-lead {
  color: var(--on-day);
}

.page a:hover {
  text-decoration-thickness: 2px;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

/* ---------- How it works: the explainers ---------- */

.explainers {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .explainers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 68rem) {
  .explainers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.explainer {
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3.5vw, 1.75rem);
  border: 1px solid var(--panel-rule);
  border-radius: var(--radius-widget);
  background: var(--panel);
  scroll-margin-top: 1.5rem;
}

/* Where subgrid is supported, the parts of the cards in a row line up: every
   question starts at the same height, whatever the length of the line above it. */
@supports (grid-template-rows: subgrid) {
  .explainer:not(.explainer-featured) {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .explainer:not(.explainer-featured) .explainer-foot {
    align-self: end;
  }

  .way {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
}

.explainer-title {
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

.explainer-line {
  margin-top: 0.6rem;
  font-size: 1rem;
  color: var(--on-panel-muted);
}

.explainer-question {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--panel-rule);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.explainer-kicker {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-panel-muted);
}

/* Version and file sit at the bottom of every card, so the cards of a row line up. */
.explainer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: auto;
  padding-top: 1.25rem;
}

.explainer-version {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--on-panel-muted);
}

.explainer-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.45rem;
  padding: 0.5em 1em 0.55em;
  border-radius: 999px;
  background: var(--button);
  color: var(--on-button);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.explainer-link:hover {
  background: var(--button-hover);
}

.explainer-file {
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.explainer-soon {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--on-panel-muted);
}

/* The overview opens the series: it takes a whole row, with its text in two columns. */
.explainer-featured {
  border-color: transparent;
  background: linear-gradient(to bottom right, var(--sky-horizon), var(--sky-zenith));
  color: var(--on-night);
  --panel-rule: var(--night-rule);
  --on-panel-muted: var(--on-night-muted);
  --button: var(--glow);
  --button-hover: #F8AE85;
  --on-button: var(--ink);
}

.explainer-featured :focus-visible {
  outline-color: var(--focus-night);
}

/* On the dark day the night card keeps a faint edge. */
@media (prefers-color-scheme: dark) {
  .explainer-featured {
    border-color: var(--night-rule);
  }
}

.explainer-featured .explainer-title {
  font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
}

.explainer-featured .explainer-line {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

@media (min-width: 44rem) {
  .explainer-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    column-gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
  }

  .explainer-featured .explainer-title,
  .explainer-featured .explainer-line {
    grid-column: 1;
  }

  .explainer-featured .explainer-question {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    font-size: 1.0625rem;
  }

  .explainer-featured .explainer-foot {
    grid-column: 1 / -1;
    padding-top: 1.5rem;
  }
}

/* ---------- Contribute ---------- */

.ways {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .ways {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 68rem) {
  .ways {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.way {
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3.5vw, 1.75rem);
  border: 1px solid var(--panel-rule);
  border-radius: var(--radius-widget);
  background: var(--panel);
}

.way h2 {
  font-size: 1.375rem;
  line-height: 1.2;
}

.way p {
  margin-top: 0.6rem;
  font-size: 1rem;
  color: var(--on-panel-muted);
}

.way-links {
  display: grid;
  gap: 0.35rem;
  margin-top: auto;
  padding: 1.1rem 0 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.way p + .way-links {
  margin-top: 1rem;
}

.way-links a {
  display: inline-block;
  padding-block: 0.15rem;
}

.steps {
  display: grid;
  gap: 1.25rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 2.75rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: -0.05rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--day-rule);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--on-day-strong);
}

.steps li {
  color: var(--on-day-muted);
}

.steps strong {
  font-weight: 600;
  color: var(--on-day);
}

.link-list {
  display: grid;
  gap: 0.6rem;
  padding: 0;
  list-style: none;
}

.link-list a {
  font-weight: 500;
}

.link-list span {
  color: var(--on-day-muted);
}

/* ---------- Buttons and form controls (feedback pages) ---------- */

:root {
  --button: var(--night);
  --button-hover: #333894;
  --on-button: var(--paper);
  --control: #FFFFFF;
  --control-edge: #7C7F99;           /* 4.0:1 on white, 3.6:1 on Paper */
  --alert: #9A3A12;                  /* 6.9:1 on Paper */
  --alert-tint: rgb(240 138 91 / 0.14);
  --alert-edge: var(--daybreak);
  --success-tint: rgb(38 43 115 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --button: var(--glow);
    --button-hover: #F8AE85;
    --on-button: var(--ink);
    --control: #191D4C;
    --control-edge: #8285B8;         /* 4.6:1 on the control */
    --alert: #F7B48F;
    --alert-tint: rgb(245 155 108 / 0.14);
    --alert-edge: var(--glow);
    --success-tint: rgb(230 228 244 / 0.06);
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.6em 1.4em 0.65em;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: var(--on-button);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button:hover {
  background: var(--button-hover);
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

/* A quiet button: an outline in the colour of the text. */
.button-quiet {
  border: 1px solid var(--control-edge);
  background: transparent;
  color: var(--on-day);
}

.button-quiet:hover {
  background: var(--track);
}

/* ---------- Feedback pages ---------- */

/* Until the page has chosen its language, nothing shows, so a reader never sees
   the English text change under their eyes. Without scripts, or should the
   script not run, the page shows after a moment anyway. */
.i18n-pending body {
  visibility: hidden;
  animation: i18n-reveal 0s linear 1.5s forwards;
}

@keyframes i18n-reveal {
  to {
    visibility: visible;
  }
}

@media (scripting: none) {
  .i18n-pending body {
    visibility: visible;
    animation: none;
  }
}

.needs-script-note {
  display: none;
}

@media (scripting: none) {
  .needs-script-note {
    display: block;
  }

  .feedback-page .form {
    display: none;
  }
}

.feedback-page {
  max-width: 42rem;
}

.feedback-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.lang-switch ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.lang-switch a {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  color: var(--on-day-muted);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--on-day);
  background: var(--track);
}

.lang-switch a[aria-current="true"] {
  color: var(--on-day);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--day-rule);
  font-weight: 600;
}

.feedback-page h1 {
  margin-top: clamp(1.5rem, 4vw, 2.25rem);
}

.feedback-note {
  margin-top: 0.85rem;
  color: var(--on-day-muted);
}

.feedback-page .needs-script-note {
  margin-top: 1.5rem;
}

.form {
  display: grid;
  gap: 1.75rem;
  margin-top: clamp(2rem, 5vw, 2.75rem);
}

.field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label {
  font-weight: 600;
}

.field-optional {
  font-weight: 400;
  color: var(--on-day-muted);
}

.field-hint {
  font-size: 0.9375rem;
  color: var(--on-day-muted);
}

.input,
.textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--control-edge);
  border-radius: var(--radius-control);
  background: var(--control);
  color: var(--on-day);
  font: inherit;
  font-size: max(1rem, 16px);   /* 16 px at least, so iOS does not zoom in */
  line-height: 1.45;
}

.textarea {
  min-height: 11rem;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--on-panel-muted);
  opacity: 1;
}

.input:focus-visible,
.textarea:focus-visible {
  outline: 3px solid var(--focus-day);
  outline-offset: 1px;
  border-radius: var(--radius-control);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--alert-edge);
  box-shadow: inset 0 0 0 1px var(--alert-edge);
}

.field-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  font-size: 0.875rem;
  color: var(--on-day-muted);
}

.counter {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.counter.is-over {
  color: var(--alert);
  font-weight: 600;
}

.field-error {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--alert);
}

.field-error:empty {
  display: none;
}

/* The choice to publish, with the name field under it once it is chosen. */
.choice {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.25rem);
  border: 1px solid var(--panel-rule);
  border-radius: var(--radius-control);
  background: var(--panel);
}

.check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 0.75rem;
  align-items: start;
}

.check input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  accent-color: var(--button);
}

.check label {
  font-weight: 600;
}

.check .field-hint {
  grid-column: 2;
}

.choice .field {
  padding-top: 1rem;
  border-top: 1px solid var(--panel-rule);
}

/* Present for robots that fill in every field; hidden from people and from
   assistive technology. */
.hp-field {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-privacy {
  font-size: 0.9375rem;
  color: var(--on-day-muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

/* Next to the send button: what sending loads. Below it when the line is narrow. */
.form-check-note {
  flex: 1 1 16rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--on-day-muted);
}

.form-status:empty {
  display: none;
}

.callout {
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--alert-edge);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--alert-tint);
  color: var(--on-day);
}

.thanks {
  margin-top: clamp(2rem, 5vw, 2.75rem);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: var(--radius-widget);
  background: var(--panel);
  border: 1px solid var(--panel-rule);
}

.thanks h2 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem);
  line-height: 1.15;
}

.thanks h2:focus {
  outline: none;
}

.thanks-sun {
  flex: none;
  width: 1.4em;
  height: 0.7em;
  fill: var(--data);
}

.thanks p {
  margin-top: 0.85rem;
  color: var(--on-panel-muted);
}

.thanks .form-actions {
  margin-top: 1.5rem;
}

/* ---------- Public feedback ---------- */

.public-head-actions {
  margin-top: 1.5rem;
}

.public-list {
  display: grid;
  gap: 1rem;
  margin-top: clamp(2rem, 5vw, 2.75rem);
  padding: 0;
  list-style: none;
}

.public-item {
  padding: clamp(1.25rem, 3.5vw, 1.75rem);
  border: 1px solid var(--panel-rule);
  border-radius: var(--radius-widget);
  background: var(--panel);
}

.public-item:focus {
  outline: none;
}

.public-item:focus-visible {
  outline: 3px solid var(--focus-day);
  outline-offset: 3px;
}

.public-text {
  overflow-wrap: anywhere;
}

.public-text p + p {
  margin-top: 0.75rem;
}

.public-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--panel-rule);
  font-size: 0.875rem;
  color: var(--on-panel-muted);
}

.public-name {
  font-weight: 600;
  color: var(--on-day);
  overflow-wrap: anywhere;
}

.public-state {
  margin-top: clamp(2rem, 5vw, 2.75rem);
  color: var(--on-day-muted);
}

.public-state .button {
  margin-top: 1rem;
}

.public-more {
  margin-top: 1.5rem;
}

.public-note {
  margin-top: 1rem;
  color: var(--on-day-muted);
}
