:root {
  --paper: #f4f1ea;        /* warm paper, the page */
  --paper-deep: #e9e4da;   /* the darker edge of the page */
  --ink: #161513;          /* words, hairlines, the south half of the needle */
  --ink-soft: rgba(22, 21, 19, 0.6);
  --ink-faint: rgba(22, 21, 19, 0.3);
  --accent: #e0482b;       /* the only accent: the north half of the needle and the lit ticks */
  --pill-ink: #f8f6f1;
  --sans: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, monospace;
  --size: clamp(112px, min(44vw, 40vh), 300px);  /* the compass, measured on width and height */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3.2vh, 34px);
  padding: clamp(10px, 3vh, 40px) clamp(14px, 4vw, 40px);
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(110% 90% at 50% 42%, var(--paper) 50%, var(--paper-deep) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .4  0 0 0 0 .37  0 0 0 0 .33  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------------------------------------------------------------- the compass */
.compass {
  width: var(--size);
  height: var(--size);
  flex: none;
  filter: drop-shadow(0 calc(var(--size) * 0.05) calc(var(--size) * 0.07) rgba(60, 48, 30, 0.16));
}

.compass__svg { width: 100%; height: 100%; display: block; overflow: visible; }

.compass__case { fill: #fbfaf6; stroke: var(--ink); stroke-width: 1.4; }
.compass__ring { fill: none; stroke: var(--ink-faint); stroke-width: 0.8; }
.compass__inner { fill: none; stroke: var(--ink-faint); stroke-width: 0.7; }
.compass__inner--soft { stroke-dasharray: 1.5 3.5; }

.tick { stroke: var(--ink); stroke-width: 0.9; stroke-linecap: round; opacity: 0.38; }
.tick--major { stroke-width: 1.4; opacity: 0.7; }

.compass__card {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: central;
  letter-spacing: 0.04em;
}
.compass__card--n { fill: var(--accent); font-weight: 700; }

.needle__north { fill: var(--accent); }
.needle__south { fill: var(--ink); }
.needle__ridge { stroke: rgba(255, 255, 255, 0.45); stroke-width: 0.6; }
.needle__shadow { fill: rgba(40, 30, 20, 0.34); }

.compass__pivot { fill: var(--ink); }
.compass__pivot-hole { fill: #fbfaf6; }
.compass__glass { pointer-events: none; opacity: 0.9; }

/* ---------------------------------------------------------------- the words */
.copy {
  text-align: center;
  max-width: min(92vw, 560px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.code {
  font-family: var(--mono);
  font-size: clamp(9px, min(1.6vw, 1.8vh), 12px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(6px, 1.6vh, 14px);
}
.code__soft { color: var(--ink-faint); margin-left: 0.8em; }

.title {
  font-size: clamp(20px, min(6vw, 6.2vh), 52px);
  font-weight: 640;
  font-stretch: 92%;
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}

.lede {
  margin-top: clamp(6px, 1.4vh, 14px);
  font-size: clamp(11px, min(2vw, 2.2vh), 17px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 34em;
  text-wrap: balance;
}

/* the site's elastic pill: the label widens on the wdth axis, the background swells with a bounce */
.pill {
  position: relative;
  margin-top: clamp(10px, 2.6vh, 26px);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: clamp(9px, 1.6vh, 14px) clamp(16px, 2.6vw, 24px);
  color: var(--pill-ink);
  text-decoration: none;
  font-size: clamp(12px, min(2vw, 2.2vh), 16px);
  font-weight: 600;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.pill__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 6px 16px -8px rgba(22, 21, 19, 0.6);
}
.pill__label { font-stretch: calc(var(--w, 100) * 1%); display: inline-block; }
.pill__arrow { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 999px; }

/* wide and short: compass on the left, words on the right */
@media (min-aspect-ratio: 7/4) and (min-width: 700px) {
  .stage { flex-direction: row; gap: clamp(24px, 6vw, 90px); }
  .copy { text-align: left; align-items: flex-start; max-width: min(46vw, 520px); }
  :root { --size: clamp(140px, min(34vw, 62vh), 360px); }
}
