/* Base: tokens, type, the floating nav and its dot menu, buttons, footer.
   Identity (docs/design/identity.md): pure black, white type, one grey. Dots are the only ornament.
   Spacing on 4/8/16/24/32/48. Type scale: 12 label, 17 body, 20 lede/h3, 40-72 h2, 56-144 h1. */

/* Display face for headlines: Hedvig Letters Serif (OFL), self-hosted so the site still calls no one. */
@font-face { font-family: "Hedvig Letters Serif"; src: url("../assets/fonts/hedvig-letters-serif-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;

  --bg: #000;
  --ink: #fff;
  --grey: #8d93a5;          /* 6.6:1 on black */
  --dim: #636366;           /* hairline-level text only (placeholders) */
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.28);
  --surface: #0d0f14;       /* the rare raised surface (feature panels) */

  /* Black and white with a subtle blue cast (the philippedebekker.com mist / periwinkle / steel-blue family;
     never its lilac). --light fills the liquid and the glows, --light-low is its shadowed base, --light-hi the hot
     core; --light-ink is the text tint for "on" states (15:1 on black). */
  --light: #dfe6f4;
  --light-low: #8f9ab8;
  --light-hi: #fff;
  --light-ink: #e3e9f7;
  --graphite: #262a35;
  --graphite-hi: #424859;
  --graphite-lo: #181b23;

  --font-display: "Hedvig Letters Serif", Georgia, serif;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1rem, 5vw, 3rem);
  --section: clamp(6rem, 14vw, 12rem);
  --nav-h: 4.5rem;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
html.menu-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.75rem, 7.2vw, 6.25rem); font-weight: 300; line-height: 1.02; letter-spacing: -0.05em; }
h2 { margin-bottom: 3rem; font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 300; line-height: 1.02; letter-spacing: -0.035em; }
/* Headlines in the display face; it wants far less negative tracking than the system sans did. */
html h1, html h2, html .contrast__title, html .feat__title, html .lit__title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
}
h3 { margin-bottom: 0.5rem; font-size: 1.25rem; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--border-strong);
}
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-color: currentColor; }
}

::selection { background: #fff; color: #000; }

:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 4px; }

.skip-link {
  position: fixed;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); border-top: 1px solid var(--border); }

/* The one label style: a dot, uppercase, tracked. Mirrors the app's caption2 labels. */
.label {
  margin: 0 0 1.5rem;
  color: var(--grey);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.label::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0.75em 0.15em 0;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}
.label--plain::before { display: none; }

.lede { max-width: 32rem; color: var(--grey); font-size: 1.25rem; line-height: 1.45; }

/* The wordmark, set in the headline serif and fitted by hand (Hedvig Letters Serif: x-height 0.52em, ascent 1.02em).
   The colon is an empty ring (devices, off) over a solid dot (you, on): exactly one x-height tall, the ring's top on
   the x-height and the dot on the baseline, the ring's line as fine as the serif's hairlines. The "i" carries the
   same solid dot instead of the font's own, and stands a little apart from the "t". */
.wordmark { white-space: nowrap; font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; }
.wordmark__colon { display: inline-block; position: relative; width: 0.2em; height: 0.52em; margin: 0 0.1em; }
.wordmark__colon i { position: absolute; left: 0; width: 0.2em; height: 0.2em; border-radius: 50%; }
.wordmark__colon i:first-child { top: 0; border: max(1px, 0.045em) solid currentColor; }
.wordmark__colon i:last-child { bottom: 0; background: currentColor; }
.wordmark__i { position: relative; margin-left: 0.035em; }
/* Absolute children of an inline box measure from the top of its content area (the font's ascent above the baseline). */
.wordmark__i::after { content: ""; position: absolute; left: 50%; top: 0.276em; width: 0.124em; height: 0.124em; border-radius: 50%; background: currentColor; transform: translateX(-50%); }

/* Nav: a floating wordmark top-left and one ring button top-right. The ring fills as you scroll;
   pressed, it opens a full-screen dot-grid menu. No bar. */

/* A real, solid black bar fixed to the top edge (iOS Safari 26 colours the status bar from it, and only from a plain
   element with a plain background colour), then a short separate fade below it so content slides under softly. */
.nav__bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  background-color: #000;
  pointer-events: none;
}
.nav::before {
  content: "";
  position: fixed;
  top: calc(var(--nav-h) + env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 40;
  height: 1.5rem;
  background: linear-gradient(#000, rgba(0, 0, 0, 0));
  pointer-events: none;
}

.nav__mark,
.nav__toggle {
  position: fixed;
  top: calc(0.75rem + env(safe-area-inset-top));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
}

.nav__mark {
  left: var(--gutter);
  color: var(--ink);
  font-size: 1.25rem;
  text-decoration: none;
}

.nav__toggle {
  right: calc(var(--gutter) - 0.25rem);
  gap: 0.75rem;
  padding: 0 0.25rem 0 0.75rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav__toggle:focus-visible { border-radius: 999px; }
.nav__label {
  color: var(--grey);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.nav__ring { width: 2.5rem; height: 2.5rem; overflow: visible; transform: rotate(-90deg); }
.nav__track { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.nav__progress {
  fill: none;
  stroke: #fff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--p, 0));
}
.nav__dot { fill: #fff; transform-origin: 24px 24px; transition: transform 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .nav__toggle:hover .nav__label { color: var(--ink); }
  .nav__toggle:hover .nav__dot { transform: scale(1.4); }
}
/* Open: the ring closes and the dot grows to fill it, the mark in its "on" state. */
.nav__toggle[aria-expanded="true"] .nav__progress { stroke-dashoffset: 0; }
.nav__toggle[aria-expanded="true"] .nav__dot { transform: scale(2.6); }
.nav__toggle[aria-expanded="true"] .nav__label { color: var(--ink); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 1rem + env(safe-area-inset-top)) var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.16) 1px, transparent 1.5px) 0 0 / 24px 24px,
    #000;
  opacity: 0;
  transition: opacity 280ms var(--ease-out);
}
.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; }

.menu__list {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.menu__list a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 8vw, 4.5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-decoration: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms var(--ease-out), transform 500ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 40ms + 60ms);
}
.menu.is-open .menu__list a { opacity: 1; transform: none; }
/* Each item is a ring (off). Hover or focus turns it into a dot (on). */
.menu__list a::before {
  content: "";
  flex: none;
  width: 0.22em;
  height: 0.22em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.05em currentColor;
  transition: box-shadow 250ms var(--ease-out);
}
.menu__list a:hover::before,
.menu__list a:focus-visible::before { box-shadow: inset 0 0 0 0.11em currentColor; }
.menu__list a:focus-visible { outline-offset: 2px; }
.menu__n {
  order: 2;
  margin-left: auto;
  color: var(--grey);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}
.menu__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  width: 100%;
  max-width: var(--wrap);
  margin: clamp(2rem, 6vh, 4rem) auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--grey);
  font-size: 0.9375rem;
}

/* Buttons: one kind. A white pill. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #d9d9d9; }
}
.btn:focus-visible { border-radius: 999px; }

/* Text link with an arrow, for secondary actions. */
.link { color: var(--grey); text-decoration: none; }
.link:hover, .link:focus-visible { color: var(--ink); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 4rem calc(3rem + env(safe-area-inset-bottom));
  color: var(--grey);
  font-size: 0.9375rem;
}
.site-footer__inner { display: grid; gap: 2rem; }
@media (min-width: 768px) {
  .site-footer__inner { grid-template-columns: 1fr auto; align-items: end; }
  .site-footer__fine { grid-column: 1 / -1; }
}
.site-footer__mark { display: inline-block; color: var(--ink); font-size: 1.5rem; text-decoration: none; }
.site-footer__tag { margin-top: 0.5rem; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer__nav a { color: var(--grey); text-decoration: none; overflow-wrap: anywhere; }
.site-footer__nav a:hover, .site-footer__nav a[aria-current="page"] { color: var(--ink); }
.site-footer__fine { padding-top: 2rem; border-top: 1px solid var(--border); font-size: 0.8125rem; }

/* Calm reveal on scroll. Only hidden once JS has marked the page. */
.js-reveal .reveal { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation: none !important; }
  .js-reveal .reveal { opacity: 1; transform: none; }
}

@media print { .nav, .site-footer { display: none; } }
