/* Zodiak for anything set large, Newsreader for reading, Geist Mono for
   labels. */
@font-face {
  font-family: "Zodiak";
  src: url("/assets/fonts/Zodiak-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Zodiak";
  src: url("/assets/fonts/Zodiak-LightItalic.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/NewsreaderText-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/NewsreaderText-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0b0a;
  --ink: #ece7dd;
  --mute: #918b80;
  --faint: #57534b;
  --line: rgb(236 231 221 / 0.12);
  --heat: #ff9a5a;

  --text: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --display: "Zodiak", "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --edge: clamp(16px, 2.6vw, 36px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #efebe4;
    --ink: #191816;
    --mute: #67625a;
    --faint: #a7a196;
    --line: rgb(25 24 22 / 0.14);
    --heat: #b4532a;
  }
}

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

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--text);
  font-size: clamp(1.06rem, 1rem + 0.25vw, 1.2rem);
  line-height: 1.5;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* A little grain, so the black reads as a material rather than a void. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
p,
ol,
ul,
figure,
blockquote {
  margin: 0;
  padding: 0;
  font: inherit;
}

ol,
ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--faint);
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.3s var(--ease);
}

a:hover {
  text-decoration-color: currentColor;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

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

abbr[title] {
  text-decoration: none;
  cursor: help;
}

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

.skip {
  position: absolute;
  top: var(--edge);
  left: 50%;
  z-index: 10;
  translate: -50% -200%;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 0.75rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.skip:focus {
  translate: -50% 0;
}

/* ———————————————————————————— The field ———————————————————————————— */

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
}

.hero,
.content,
.coda {
  position: relative;
  z-index: 1;
}

/* ———————————————————————————— Hero ———————————————————————————— */

.hero {
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: var(--edge);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

.name {
  font-family: var(--display);
  font-size: min(12vw, 28vh);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  transition: color 1.2s var(--ease);
}

@media (max-width: 640px) {
  .name {
    font-size: min(24vw, 18vh);
    line-height: 1;
    white-space: normal;
  }

  .name span {
    display: block;
  }
}

/* The dust draws the name; the text stays for readers, search and selection. */
.field-pending .name,
.has-field .name {
  color: transparent;
}

.motto {
  margin-top: clamp(18px, 3vh, 36px);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--mute);
  transition: opacity 1.6s var(--ease), translate 1.6s var(--ease);
}

.motto i {
  font-style: normal;
  color: var(--faint);
}

.field-pending .motto,
.has-field .motto {
  opacity: 0;
  translate: 0 6px;
}

.has-field.settled .motto {
  opacity: 1;
  translate: 0 0;
}

.has-field.settled.shape .motto {
  opacity: 0;
  transition-duration: 0.5s;
}

.hud {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  animation: hud-in 1.4s 0.4s var(--ease) both;
}

.hud--tl { top: var(--edge); left: var(--edge); }
.hud--tr { top: var(--edge); right: var(--edge); }
.hud--bl { bottom: var(--edge); left: var(--edge); }
.hud--br { bottom: var(--edge); right: var(--edge); }

.hud abbr {
  font-family: var(--text);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  vertical-align: -0.08em;
}

@keyframes hud-in {
  from { opacity: 0; }
}

.hold {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin: -8px;
  color: var(--mute);
  transition: color 0.4s var(--ease);
  touch-action: none;
}

.hold:hover,
.hold.is-active {
  color: var(--ink);
}

.hold__ring {
  width: 14px;
  height: 14px;
  rotate: -90deg;
  overflow: visible;
}

.hold__ring circle {
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.5;
}

.hold__ring .hold__fill {
  stroke: var(--ink);
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--hold, 0));
}

.hold:not(.is-active) .hold__fill {
  transition: stroke-dashoffset 0.5s var(--ease);
}

.field-off .hold {
  display: none;
}

.cue {
  position: absolute;
  bottom: var(--edge);
  left: 50%;
  translate: -50% 0;
  width: 1px;
  height: 44px;
  overflow: hidden;
  background: var(--line);
  animation: hud-in 1.4s 1.2s var(--ease) both;
}

.cue span {
  position: absolute;
  inset: 0;
  background: var(--ink);
  animation: cue 2.8s var(--ease) infinite;
}

.cue::before {
  content: "";
  position: absolute;
  inset: -12px -20px;
}

@keyframes cue {
  0% { translate: 0 -100%; }
  60%, 100% { translate: 0 100%; }
}

/* ———————————————————————————— Content ———————————————————————————— */

.content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.intro {
  padding: clamp(120px, 22vh, 260px) 0 clamp(120px, 20vh, 240px);
}

.lede {
  max-width: 18em;
  font-family: var(--display);
  font-size: clamp(1.75rem, 1.05rem + 2.7vw, 3.5rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: 36px 0 clamp(96px, 16vh, 180px);
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .block {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    gap: 48px;
  }
}

.label {
  display: flex;
  gap: 14px;
  align-self: start;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  padding-top: 0.55em;
}

@media (min-width: 900px) {
  .label {
    position: sticky;
    top: 32px;
  }
}

.label span {
  color: var(--faint);
}

.rows {
  display: grid;
}

.rows > li + li {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 22px 0 26px;
}

.rows > li:first-child > .row,
.rows > .row:first-child {
  padding-top: 0;
}

@media (min-width: 700px) {
  .row {
    grid-template-columns: 9.5rem minmax(0, 14rem) minmax(0, 1fr) 1.5rem;
    gap: 24px;
    align-items: baseline;
  }
}

.row__meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

.row__title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.row__body {
  max-width: 34em;
  color: var(--mute);
  text-wrap: pretty;
}

.row__go {
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--mute);
  opacity: 0;
  translate: -6px 6px;
  transition: opacity 0.4s var(--ease), translate 0.4s var(--ease), color 0.4s var(--ease);
}

@media (max-width: 699px) {
  .row__go {
    display: none;
  }
}

.row--link {
  text-decoration: none;
}

.row--link .row__title {
  transition: translate 0.5s var(--ease);
}

.row--link .row__body {
  transition: color 0.5s var(--ease);
}

.row--link:hover .row__title,
.row--link:focus-visible .row__title {
  translate: 8px 0;
}

.row--link:hover .row__body,
.row--link:focus-visible .row__body {
  color: var(--ink);
}

.row--link:hover .row__go,
.row--link:focus-visible .row__go {
  opacity: 1;
  translate: 0 0;
  color: var(--ink);
}

.aside {
  margin-top: 40px;
  max-width: 30em;
  font-style: italic;
  color: var(--mute);
}

@media (min-width: 900px) {
  .block > .aside {
    grid-column: 2;
    margin-top: 12px;
  }
}

.aside a {
  color: var(--ink);
}

.quote blockquote p {
  max-width: 13em;
  font-family: var(--display);
  font-size: clamp(2.2rem, 1.05rem + 4.1vw, 5rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.quote blockquote p::before {
  content: "“";
  position: absolute;
  translate: -0.48em 0;
  color: var(--faint);
}

.quote figcaption {
  display: grid;
  gap: 6px;
  margin-top: 36px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.quote cite {
  font-style: normal;
  color: var(--ink);
}

.plain {
  max-width: 22em;
  font-family: var(--display);
  font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.links {
  display: grid;
  margin-top: 56px;
}

.links > li + li {
  border-top: 1px solid var(--line);
}

.link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 18px;
  width: 100%;
  padding: 16px 0;
  text-align: left;
  text-decoration: none;
}

.links > li:first-child .link {
  padding-top: 0;
}

.link kbd {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 5px;
  translate: 0 -0.2em;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}

@media (hover: none), (pointer: coarse) {
  .link {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .link kbd {
    display: none;
  }
}

.link__name {
  font-family: var(--display);
  font-size: clamp(1.3rem, 1.1rem + 0.65vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  transition: translate 0.5s var(--ease);
}

.link__handle {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--mute);
  transition: color 0.4s var(--ease);
}

.link:hover .link__name,
.link:focus-visible .link__name {
  translate: 8px 0;
}

.link:hover .link__handle,
.link:focus-visible .link__handle,
.link.is-copied .link__handle {
  color: var(--ink);
}

.link:focus-visible {
  outline: none;
}

.link:focus-visible kbd {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}

/* ———————————————————————————— Coda ———————————————————————————— */

.coda {
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: clamp(140px, 26vh, 300px) var(--gutter) 56px;
  text-align: center;
}

.coda__line {
  max-width: 14em;
  font-family: var(--display);
  font-size: clamp(1.55rem, 1.05rem + 1.7vw, 2.6rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.coda__meta {
  margin-top: clamp(80px, 14vh, 160px);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.coda__meta a {
  color: var(--ink);
}

/* ———————————————————————————— Reveal ———————————————————————————— */

.js-reveal [data-reveal] {
  opacity: 0;
  translate: 0 14px;
  transition: opacity 1.1s var(--ease), translate 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.js-reveal [data-reveal].is-in {
  opacity: 1;
  translate: 0 0;
}

/* ———————————————————————————— Lost ———————————————————————————— */

.lost .motto a {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hud,
  .cue,
  .cue span {
    animation: none;
  }

  .js-reveal [data-reveal] {
    opacity: 1;
    translate: none;
    transition: none;
  }
}
