/* Layout: one white column of story scenes with a round eyepiece as the recurring object;
   the practicum is set off by hairlines. Controls have a cut corner, like a facet. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f4f7fd;
  --line: #d9deea;
  --fg: #171c30;
  --muted: #556078;
  --paper: #ffffff;
  --ink: #171c30;
  --ink-muted: #556078;
  --ink-line: #d9deea;
  --accent: #2449b8;
  --display: "Forum", "Times New Roman", Georgia, serif;
  --body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cut: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html.still { scroll-behavior: auto; }
html.still *, html.still *::before, html.still *::after { animation: none !important; transition: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
}
img, canvas { max-width: 100%; }
.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 720px; }
.wrap > .narrow { margin: 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; background: var(--paper); color: var(--ink); padding: 8px 12px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.3rem, 7.5vw, 4.2rem); line-height: 1.05; }
h2 { font-size: clamp(1.85rem, 5.2vw, 3rem); line-height: 1.1; }
h3 { font-size: 1.6rem; line-height: 1.2; }
p { margin: 0; }
.eyebrow { font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.pull { font-family: var(--display); font-size: clamp(1.4rem, 3.6vw, 1.9rem); line-height: 1.25; text-wrap: balance; }
.bridge { color: var(--muted); font-style: italic; }
.row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.status { min-height: 1.6em; color: var(--muted); font-size: 0.9375rem; }

.btn, .ghost {
  font: inherit; font-weight: 600; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px;
  border: 0; cursor: pointer; text-decoration: none;
  clip-path: var(--cut);
}
.btn { background: var(--fg); color: var(--bg); }
.btn:hover { background: #000820; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.ghost { background: var(--panel); color: var(--fg); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); }
.ghost:hover { box-shadow: inset 0 0 0 1px var(--muted); }
/* clip-path cuts an outline off, so focus is drawn inside the control */
.btn:focus-visible, .ghost:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--accent); }
a:focus-visible, input:focus-visible, button:focus-visible, label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible, .ghost:focus-visible { outline: none; }

.top__in { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 14px; }
.brand { font-family: var(--display); font-size: 1.25rem; color: var(--fg); text-decoration: none; }
.top .ghost, .foot .ghost { min-height: 44px; padding: 6px 14px; font-size: 0.875rem; }

.scene { padding-block: clamp(56px, 11vw, 120px); }
.scene .wrap, .paper .wrap, .scene .narrow { display: flex; flex-direction: column; gap: 18px; }
.scene h2 { margin-bottom: 8px; }

.eyepiece { display: flex; justify-content: center; padding: 12px; }
/* The rings and the glow are layers under the canvas, not its box-shadow: Firefox repaints a shadow next to a
   canvas on every frame the canvas changes, which halves the frame rate. */
.eye { position: relative; isolation: isolate; width: 100%; max-width: 520px; border-radius: 50%; }
.eye::before, .eye::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.eye::before { inset: -56px -80px -104px;
  background: radial-gradient(closest-side, rgba(36, 73, 184, 0.07) calc(100% - 80px), rgba(36, 73, 184, 0.043) calc(100% - 60px),
    rgba(36, 73, 184, 0.022) calc(100% - 40px), rgba(36, 73, 184, 0.009) calc(100% - 20px), rgba(36, 73, 184, 0)); }
.eye::after { inset: -11px; border: 1px solid var(--fg); background: radial-gradient(closest-side, var(--line) calc(100% - 9px), var(--bg) calc(100% - 8.5px)); }
.eye canvas { position: relative; z-index: 1; display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--bg); }
.hero { padding-top: clamp(20px, 5vw, 56px); }
.hero .hero__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px 48px; align-items: center; }
.hero__text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero__out { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; text-align: center; align-items: center; padding-top: 12px; }

.ages { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; justify-content: space-between; gap: 8px; }
.ages li { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ages canvas { width: 40px; height: 40px; }
.ages b { font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 12vw, 5.5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.thesis { margin: 24px 0 0; padding: 28px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; }
.thesis blockquote { margin: 0; font-family: var(--display); font-size: clamp(1.7rem, 4.6vw, 2.6rem); line-height: 1.15; text-wrap: balance; }
.thesis figcaption { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.9375rem; line-height: 1.35; }
.thesis figcaption b { color: var(--fg); font-weight: 600; }
.thesis img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }

.seven { display: flex; justify-content: space-between; gap: 4px; margin-block: 12px; }
.seven canvas { width: 13%; max-width: 84px; aspect-ratio: 1; opacity: 0.22; transition: opacity 0.9s ease; }
.seven.in canvas { opacity: 1; }
.seven.in canvas:nth-child(2) { transition-delay: 0.25s; }
.seven.in canvas:nth-child(3) { transition-delay: 0.5s; }
.seven.in canvas:nth-child(4) { transition-delay: 0.75s; }
.seven.in canvas:nth-child(5) { transition-delay: 1s; }
.seven.in canvas:nth-child(6) { transition-delay: 1.25s; }
.seven.in canvas:nth-child(7) { transition-delay: 1.5s; }

.picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.picker button {
  font: inherit; font-size: 0.875rem; line-height: 1.2; color: var(--muted);
  background: none; border: 0; padding: 8px 2px; min-height: 48px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  border-bottom: 2px solid transparent; overflow-wrap: anywhere; hyphens: auto;
}
.picker canvas { width: 100%; max-width: 76px; aspect-ratio: 1; transition: transform 0.3s ease; }
.picker button[aria-pressed="true"] { color: var(--c); border-bottom-color: var(--c); }
.picker button[aria-pressed="true"] canvas { transform: scale(1.18); }
.cx { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px 40px; align-items: start; background: var(--panel); padding: clamp(18px, 4vw, 36px); clip-path: polygon(24px 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%, 0 24px); }
.cx > canvas { width: 100%; max-width: 300px; aspect-ratio: 1; justify-self: center; }
.cx__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cx h3 { font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--c); text-transform: uppercase; letter-spacing: 0.04em; }
.cx__promise { font-family: var(--display); font-size: 1.45rem; line-height: 1.25; }
.q { color: var(--fg); font-weight: 500; padding-left: 14px; border-left: 2px solid var(--c, var(--muted)); }
.cx dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cx dt { font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.cx dd { margin: 0; }
.cx .ghost { align-self: flex-start; }

.scrolly__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.scrolly__stage { position: sticky; top: 8vh; display: flex; flex-direction: column; gap: 10px; align-items: center; min-width: 0; }
.eyepiece--stage { width: 100%; }
.eyepiece--stage .eye { max-width: min(520px, 68vh); }
.caption { min-height: 3.2em; text-align: center; color: var(--muted); font-size: 0.9375rem; max-width: 40ch; }
.scrolly__steps { min-width: 0; }
.step { min-height: 88vh; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding-block: 32px; }
.num { display: block; font-family: var(--body); font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.formula { font-family: var(--display); font-size: 1.6rem; line-height: 1.2; }
.trio { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.trio div { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 12px; align-items: baseline; }
.trio dt { font-family: var(--display); font-size: 1.45rem; }
.trio dd { margin: 0; color: var(--muted); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs .ghost[aria-pressed="true"] { background: var(--fg); color: var(--bg); box-shadow: none; }
.web { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px 48px; align-items: center; }
.web__dia { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; justify-self: center; }
.web__dia svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.web__dia canvas { position: absolute; width: 20%; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0.2; transition: opacity 0.5s ease; }
.web__dia canvas.on { opacity: 1; }
.web__dia .hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center; background: var(--panel); box-shadow: 0 0 0 1px var(--line); font-family: var(--display); font-size: clamp(1rem, 3.6vw, 1.3rem); line-height: 1.1; padding: 6px; }
.web__text { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.web__text ol, .web__text ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.web__text ol li { display: grid; grid-template-columns: 8.2em minmax(0, 1fr); gap: 10px; }
.web__text ol b { font-weight: 500; color: var(--muted); }
.web__text ul li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: center; }
.web__text ul canvas { width: 22px; height: 22px; }
.web__text ul b { font-weight: 600; }

.band { margin-block: 28px; }
.band canvas { display: block; width: 100%; height: min(62vh, 520px); }
.slider { display: flex; flex-direction: column; gap: 10px; }
.slider label { font-weight: 600; }
.slider__row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 10px; align-items: center; }
.slider__row .ghost { padding: 0; }
input[type="range"] { width: 100%; height: 44px; margin: 0; accent-color: var(--fg); }

.paper { background: var(--paper); color: var(--ink); border-block: 1px solid var(--line); padding-block: clamp(48px, 9vw, 96px); }
.paper .eyebrow, .paper .muted { color: var(--ink-muted); }
.paper .btn { background: var(--ink); color: #ffffff; }
.paper .btn:hover { background: #000820; }
.paper .ghost { background: #ffffff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-line); }
.paper .ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-muted); }
.paper .btn:focus-visible, .paper .ghost:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.paper a:focus-visible, .paper input:focus-visible, .paper label:focus-within { outline-color: var(--accent); }
#pr { display: flex; flex-direction: column; gap: 18px; }
.pr__count { font-size: 0.875rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pr__q { font-size: 1.1rem; }
.picks { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pick { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 52px; padding: 10px 14px; border: 1px solid var(--ink-line); cursor: pointer; }
.pick--gem { grid-template-columns: 24px 48px minmax(0, 1fr); }
.pick canvas { width: 48px; height: 48px; }
.pick input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.pick:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pick b { display: block; font-weight: 600; color: var(--c, var(--ink)); }
.pick small { color: var(--ink-muted); font-size: 0.9375rem; }
.own { display: flex; flex-direction: column; gap: 6px; }
.own label { font-size: 0.9375rem; color: var(--ink-muted); }
.own input { font: inherit; color: var(--ink); background: #ffffff; border: 1px solid var(--ink-line); padding: 12px 14px; min-height: 48px; width: 100%; }
.card { background: var(--panel); color: var(--fg); padding: clamp(18px, 5vw, 36px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 20px 32px; align-items: center; clip-path: polygon(24px 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%, 0 24px); }
.card dl { margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card dt { font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.card dd { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.card dd.big { font-family: var(--display); font-size: 1.9rem; line-height: 1.1; color: var(--c); }
.card canvas { width: 100%; max-width: 220px; aspect-ratio: 1; border-radius: 50%; justify-self: center; }
.copybox { font: inherit; font-size: 0.9375rem; width: 100%; min-height: 9em; padding: 12px; border: 1px solid var(--ink-line); color: var(--ink); background: #ffffff; }
.preview { max-width: 280px; border: 1px solid var(--ink-line); }

.author { margin-top: 40px; display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr); gap: 28px 56px; align-items: center; }
.author__photos { position: relative; padding: 0 18% 9% 0; }
.ph { display: block; object-fit: cover; height: auto; clip-path: polygon(28px 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%, 0 28px); }
.ph--main { width: 100%; aspect-ratio: 4 / 5; }
.ph--side { position: absolute; right: 0; bottom: 0; width: 40%; aspect-ratio: 3 / 4; object-position: 50% 22%; outline: 6px solid var(--bg); }
.author__text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.author__text h3 { font-size: clamp(2rem, 5vw, 2.8rem); }
.author__text blockquote { margin: 0; padding-left: 16px; border-left: 2px solid var(--muted); font-family: var(--display); font-size: 1.4rem; line-height: 1.3; }

.about { border-top: 1px solid var(--line); }
.sum { font-family: var(--display); font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.3; }
.sum b { font-weight: 400; font-size: 1.5em; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.foot__in { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-block: 28px 40px; }
.foot__motto { color: var(--fg); font-family: var(--display); font-size: 1.15rem; }

@media (max-width: 820px) {
  .hero .hero__in { grid-template-columns: minmax(0, 1fr); }
  .eyepiece .eye { max-width: min(440px, 100%); }
  .picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cx, .web, .author, .card { grid-template-columns: minmax(0, 1fr); }
  .cx > canvas { max-width: 200px; }
  .card canvas { order: -1; max-width: 180px; }
  .scrolly__in { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* the stage stays pinned at the top while the steps scroll under it */
  .scrolly__stage { top: 0; z-index: 2; background: var(--bg); padding-block: 8px 4px; margin-inline: -16px; padding-inline: 16px; border-bottom: 1px solid var(--line); }
  .eyepiece--stage { padding: 12px; }
  .eyepiece--stage .eye { max-width: min(300px, 36vh); }
  .caption { min-height: 2.9em; font-size: 0.8125rem; line-height: 1.4; }
  .step { min-height: 62vh; justify-content: flex-start; padding-block: 36px; }
  .step:last-child { min-height: 50vh; }
  .web__text ol li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .band canvas { height: 46vh; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

h2[tabindex="-1"]:focus { outline: none; }
.top .ghost { white-space: nowrap; }
@media (max-width: 480px) { .brand { font-size: 1.05rem; } .top .ghost, .foot .ghost { font-size: 0.8125rem; padding-inline: 12px; } }
