/* Tolka: the app's own register. Near-black, one teal, EB Garamond for the words that are read,
   Inter for the words about them. Both faces are SIL Open Font License, self-hosted. */
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ground: #070B0D;
  --raised: #0D1518;
  --line: #22343A;
  --text: #E9EEF0;
  --muted: #9BB0B7;
  --teal: #30BFD9;
  --teal-deep: #0E4753;
  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --gutter: 40px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ground); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.button {
  display: inline-block; padding: 13px 22px; border-radius: 999px;
  background: var(--teal); color: #04161A; font-weight: 500; font-size: 15px; text-decoration: none;
  transition: background-color 0.15s;
}
.button:hover { background: #6FD6E9; color: #04161A; }
.button.small { padding: 9px 16px; font-size: 14px; }

/* ---- the bar ---- */
.bar { padding-top: 18px; padding-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; }
.bar .home { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-size: 28px; line-height: 1; }
.bar .home img { width: 36px; height: 36px; border-radius: 9px; }
.bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; font-size: 15px; }
.bar nav a:not(.button) { text-decoration: none; padding: 10px 0; color: var(--muted); }
.bar nav a:not(.button):hover { color: var(--text); }

/* ---- the hero ---- */
.hero {
  padding-top: 56px; padding-bottom: 96px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: center;
}
.hero h1 { font-size: clamp(44px, 6.2vw, 84px); line-height: 1.02; letter-spacing: -0.015em; font-style: italic; text-wrap: balance; }
.hero .lede { margin-top: 28px; max-width: 34em; font-size: 18px; color: var(--muted); }
.hero .actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.hero .quiet { font-size: 15px; color: var(--muted); }

.reader { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.ring {
  width: min(100%, 440px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid #3A4C52;
  background: radial-gradient(circle at 50% 50%, #0A1215 0, #0A1215 38%, var(--ground) 70%);
  box-shadow: 0 0 0 10px rgba(48, 191, 217, 0.05), 0 0 80px rgba(48, 191, 217, 0.10);
  display: grid; place-items: center; overflow: hidden;
}
/* The focus letter stays on the ring's centre line: the word is laid out around it. */
.word {
  width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline;
  font-family: var(--serif); font-size: clamp(30px, 4.4vw, 46px); line-height: 1.2; white-space: pre;
}
.word .pre { text-align: right; }
.word .focus { color: var(--teal); }
.word .post { text-align: left; }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; font-size: 14px; color: var(--muted); }
.controls button {
  font: inherit; color: var(--text); background: transparent; border: 1px solid #3A4C52; border-radius: 999px;
  padding: 8px 18px; min-width: 76px; cursor: pointer;
}
.controls button:hover { border-color: var(--teal); color: var(--teal); }

/* ---- how it works ---- */
.how { padding-top: 24px; padding-bottom: 96px; }
.how > h2, .research h2, footer h2 { font-size: clamp(34px, 4vw, 48px); line-height: 1.1; }
.how > h2 { padding-bottom: 12px; }
.feature {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center;
  padding: 56px 0; border-top: 1px solid var(--line);
}
.feature.flip .text { order: 2; }
.feature h3 { font-size: 30px; line-height: 1.15; margin-bottom: 14px; }
.feature p { color: #C4D1D5; max-width: 34em; }
.feature figure { margin: 0; }
.feature figure img, .feature figure video { width: 100%; border-radius: 18px; border: 1px solid var(--line); background: #000; }

/* ---- research ---- */
.research { background: var(--raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.research .wrap { padding-top: 80px; padding-bottom: 88px; }
.research .intro { margin-top: 16px; max-width: 40em; color: var(--muted); font-size: 18px; }
.papers { list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.papers li { padding: 28px 0 30px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.papers .who { font-size: 13px; letter-spacing: 0.04em; color: var(--teal); }
.papers h3 { font-size: 23px; line-height: 1.2; font-style: italic; }
.papers p { color: #C4D1D5; font-size: 15px; }
.papers a { align-self: flex-start; margin-top: 2px; padding: 6px 0; font-size: 15px; font-weight: 500; }

/* ---- the foot ---- */
footer { padding-top: 72px; padding-bottom: 72px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px 48px; }
footer h2 { margin-bottom: 14px; }
footer p { color: var(--muted); }
footer .end { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
footer .small { font-size: 14px; }

@media (max-width: 860px) {
  :root { --gutter: 22px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 28px; padding-bottom: 72px; gap: 44px; }
  .ring { width: min(100%, 340px); }
  .feature { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 44px 0; }
  .feature.flip .text { order: 0; }
  .papers { grid-template-columns: minmax(0, 1fr); }
  footer { align-items: flex-start; }
  footer .end { align-items: flex-start; }
  .bar nav { gap: 2px 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .button { transition: none; } }
