/* ==========================================================================
   Fahad Alsehami — personal site
   Three looks share one layout:
     html[data-mode="starlight"]  the night sky every visit opens in
     html[data-mode="lit"]        the site with the lights on
       html[data-theme="light"|"dark"]
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader.woff2") format("woff2-variations"), url("../fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist.woff2") format("woff2-variations"), url("../fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2-variations"), url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat.woff2") format("woff2-variations"), url("../fonts/caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #EEEAE0;
  --ink: #181713;
  --ink-2: #6B665E;
  --ink-3: #6D675F;
  --ink-4: #8F897F;
  --rule: #CBC4B8;
  --rule-2: #DDD7CB;
  --accent: #AD4B2B;
  --hover: rgba(255, 255, 255, 0.4);
  --disc: #E2DDD2;
  --surface: #F5F2EB;
  --shadow: 0 28px 50px -30px rgba(52, 38, 24, 0.55), 0 2px 6px -2px rgba(52, 38, 24, 0.12);
  --crayon-red: #D2462C;
  --crayon-blue: #4D5BC2;
  --crayon-green: #8DB66B;
  --paper: #F7F4EC;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --hand: "Caveat", "Bradley Hand", "Comic Sans MS", cursive;

  --wrap: 940px;
  --gutter: 24px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #181714;
  --ink: #EEE9DE;
  --ink-2: #A9A39A;
  --ink-3: #88827A;
  --ink-4: #6C675E;
  --rule: #34312B;
  --rule-2: #2A2823;
  --accent: #D96945;
  --hover: rgba(255, 255, 255, 0.025);
  --disc: #262420;
  --surface: #1F1D19;
  --shadow: 0 28px 50px -30px rgba(0, 0, 0, 0.9), 0 2px 6px -2px rgba(0, 0, 0, 0.5);
  --paper: #EDE7DA;
  color-scheme: dark;
}

:root[data-mode="starlight"] {
  --bg: #050508;
  --ink: #F4F0E8;
  --ink-2: #CFC9BE;
  --ink-3: #ABA59A;
  --ink-4: #7E786F;
  --rule: rgba(244, 240, 232, 0.2);
  --rule-2: rgba(244, 240, 232, 0.1);
  --accent: #E99474;
  --hover: transparent;
  --disc: transparent;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.6s ease, color 0.6s ease;
}

img,
svg,
canvas { display: block; }

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

main:focus { outline: none; }

/* ---------- Page frame ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 56px var(--gutter) 0;
}

.top {
  position: relative;
  height: 152px;
}

/* Portrait */
.portrait {
  position: relative;
  display: block;
  width: 152px;
  height: 152px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  perspective: 600px;
}
.portrait-disc {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--disc);
  transition: background-color 0.6s ease, opacity 0.6s ease;
}
.portrait-img {
  position: absolute;
  left: 4%;
  top: 1%;
  width: 92%;
  height: 102%;
  object-fit: cover;
  object-position: center top;
  transform: rotateY(var(--turn-y, 0deg)) rotateX(var(--turn-x, 0deg)) translate(var(--shift-x, 0px), var(--shift-y, 0px));
  transform-origin: 50% 70%;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.6s ease;
  will-change: transform;
}
:root[data-theme="dark"] .portrait-img { filter: grayscale(1) contrast(1.06) brightness(0.96); }
.portrait-particles {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
:root[data-mode="starlight"] .portrait-disc { opacity: 0; }
:root[data-mode="starlight"] .portrait-particles { opacity: 1; }

/* Controls */
.controls {
  position: absolute;
  top: -1px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.controls-label {
  margin-right: 2px;
  font-family: var(--mono);
  font-size: 11.2px;
  color: var(--ink-3);
  letter-spacing: -0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.controls.is-hinting .controls-label,
.controls:has(.control-star:hover) .controls-label,
.controls:has(.control-star:focus-visible) .controls-label { opacity: 1; }
:root[data-mode="starlight"] .controls-label { opacity: 0; }

.control {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease, box-shadow 0.4s ease;
}
.control:hover { border-color: var(--ink-3); }
.control svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.control-star svg circle { transition: transform 0.6s ease; transform-origin: 12px 12px; }
.control-star:hover svg circle { transform: scale(1.12); }

:root[data-mode="starlight"] .control-star {
  border-color: rgba(244, 240, 232, 0.55);
  box-shadow: 0 0 0 4px rgba(233, 148, 116, 0.08), 0 0 22px 2px rgba(233, 148, 116, 0.22);
  animation: beacon 3.2s ease-in-out infinite;
}
:root[data-mode="starlight"] .control-theme { opacity: 0.45; cursor: default; }
:root[data-mode="starlight"] .control-star {
  position: fixed;
  z-index: 20;
  top: 55px;
  right: max(calc(var(--gutter) + 52px), calc(50% - var(--wrap) / 2 + 52px));
  background: rgba(5, 5, 8, 0.6);
}
:root[data-mode="starlight"] .portrait { cursor: pointer; }
:root.portrait-plain[data-mode="starlight"] .portrait-disc {
  opacity: 1;
  background: transparent;
  -webkit-mask-image: var(--grain, none);
  mask-image: var(--grain, none);
  -webkit-mask-size: 120px 120px;
  mask-size: 120px 120px;
}
:root.portrait-plain[data-mode="starlight"] .portrait-img { filter: brightness(1.15) saturate(0.9); }
@keyframes beacon {
  50% { box-shadow: 0 0 0 7px rgba(233, 148, 116, 0.05), 0 0 30px 6px rgba(233, 148, 116, 0.3); }
}

/* ---------- Hero ---------- */
.hero { padding-top: 26px; }

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.75rem, 1.4rem + 4.2vw, 4.1rem);
  font-weight: 400;
  line-height: 0.97;
  letter-spacing: -0.035em;
}

.intro {
  max-width: 636px;
  margin: 30px 0 0;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: -0.026em;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 54px;
  height: 56px;
  margin-top: 52px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  flex: none;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12.64px;
  font-weight: 540;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.25s ease;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab:focus-visible { outline-offset: -4px; }

/* ---------- Panels ---------- */
.panels { padding-top: 80px; }
.panel[hidden] { display: none; }
.panel { animation: panel-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 368px;
  align-items: end;
  gap: 24px;
}
.panel-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.panel-note {
  max-width: 340px;
  margin: 0 0 6px 0;
  justify-self: start;
  font-family: var(--mono);
  font-size: 13.6px;
  line-height: 1.72;
  letter-spacing: -0.018em;
  color: var(--ink-2);
}

/* ---------- About ---------- */
.statement {
  max-width: 640px;
  margin: 0;
  font-family: var(--serif);
  font-size: 49px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.statement span { display: block; }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 532px) minmax(0, 298px);
  justify-content: space-between;
  gap: 48px;
  margin-top: 70px;
}

.about-copy p {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 13.6px;
  line-height: 1.8;
  letter-spacing: -0.018em;
}
.about-copy p:last-child { margin-bottom: 0; }
.about-copy a,
.prose-link {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
.about-copy a:hover,
.prose-link:hover { text-decoration-color: var(--accent); }

.facts {
  margin: 0;
  border-bottom: 1px solid var(--rule-2);
}
.fact {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr);
  gap: 0;
  padding: 15px 0 16px;
  border-top: 1px solid var(--rule-2);
  font-family: var(--mono);
  font-size: 11.2px;
  line-height: 1.6;
  letter-spacing: -0.01em;
}
.fact dt { color: var(--ink-3); }
.fact dd { margin: 0; }

.emblem {
  width: 132px;
  height: 132px;
  margin: 46px auto 0;
}

/* ---------- Contact ---------- */
.contact { padding-top: 150px; }

.contact-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 26px;
}
.contact-title {
  position: relative;
  margin: 0;
  width: 176px;
  height: 58px;
}
.hello-canvas {
  position: absolute;
  left: -4px;
  top: -6px;
  width: 190px;
  height: 72px;
}
.contact-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 13.6px;
  letter-spacing: -0.018em;
  color: var(--ink-2);
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 46px 0 0;
  padding: 26px 0 24px;
  list-style: none;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.contact-item { position: relative; min-width: 0; }
.contact-label {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11.2px;
  color: var(--ink-3);
}
.contact-value {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  max-width: 100%;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.contact-value:hover { color: var(--accent); }
.contact-value .arrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  transition: transform 0.2s ease;
}
a.contact-value:hover .arrow { transform: translate(2px, -2px); }
.contact-item.is-primary::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 33px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.2px;
  cursor: pointer;
}
.copy-btn:hover { color: var(--ink); }
.copy-btn svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.copy-btn .done { display: none; color: var(--accent); }
.copy-btn.is-copied .idle { display: none; }
.copy-btn.is-copied .done { display: inline; }

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 28px;
  padding: 24px 0 72px;
  font-family: var(--mono);
  font-size: 11.2px;
  color: var(--ink-3);
}
.foot-who { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 0; }
.foot-top { text-decoration: none; }
.foot-top:hover { color: var(--ink); }

.noscript {
  margin-top: 60px;
  font-family: var(--mono);
  font-size: 13.6px;
  line-height: 1.8;
}

/* ---------- Experience ---------- */
.roles {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--rule);
}
.role {
  position: relative;
  display: grid;
  grid-template-columns: 206px minmax(0, 300px) minmax(0, 1fr);
  padding: 42px 0 44px;
  border-top: 1px solid var(--rule);
}
.role::before,
.role::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.role::before { left: -18px; right: -18px; background: var(--hover); }
.role::after { left: -18px; width: 2px; background: var(--accent); }
.role:hover::before,
.role:hover::after { opacity: 1; }
.role > * { position: relative; z-index: 1; }

.role-when {
  display: flex;
  align-items: center;
  gap: 14px;
  align-self: start;
  margin-top: -5px;
}
.role-logo {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
}
.role-dates {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.2px;
  color: var(--ink-3);
}
.role-title {
  margin: 0;
  padding-right: 24px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.role-org {
  margin: 14px 0 0;
  padding-right: 24px;
  font-family: var(--mono);
  font-size: 11.2px;
  line-height: 1.6;
  color: var(--ink-3);
}
.role-org a {
  color: var(--ink-3);
  text-decoration-line: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}
.role-org a:hover { color: var(--ink); text-decoration-color: var(--accent); }
.role-detail {
  margin: 0;
  font-family: var(--mono);
  font-size: 13.6px;
  line-height: 1.78;
  letter-spacing: -0.018em;
  color: var(--ink-2);
}

/* ---------- Projects ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px 28px;
  margin: 52px 0 0;
  padding: 0;
  list-style: none;
}
.work-media {
  position: relative;
  display: block;
  aspect-ratio: 456 / 285;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: var(--shadow);
  isolation: isolate;
  transform: translateZ(0);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.45s ease;
}
a.work-media:hover { transform: translateY(-3px); }
.work-eyebrow {
  margin: 27px 0 0;
  font-family: var(--mono);
  font-size: 10.88px;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.work-title {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.work-title a { text-decoration: none; }
.work-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--accent); }
.work-detail {
  margin: 14px 0 0;
  font-family: var(--sans);
  font-size: 14.72px;
  line-height: 1.62;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}
.work-tags {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 10.56px;
  letter-spacing: -0.01em;
  color: var(--ink-3);
}

/* ---------- Interests ---------- */
.interests-rule { margin: 44px 0 0; border: 0; border-top: 1px solid var(--rule); }
.interests-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 6px;
  max-width: 760px;
  margin: 34px auto 0;
  padding: 0;
  list-style: none;
}
.interest {
  display: grid;
  justify-items: center;
  width: 186px;
  padding: 6px 0 10px;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 12px;
}
.interest canvas { width: 170px; height: 150px; }
.interest-label {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 13.2px;
  color: var(--ink-2);
  transition: color 0.2s ease;
}
.interest:hover .interest-label,
.interest:focus-visible .interest-label { color: var(--ink); }
.interests-end { margin: 30px 0 0; border: 0; border-top: 1px solid var(--rule); }

.interest-detail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  min-height: 420px;
  padding: 40px 0;
}
.interest-detail canvas { width: 100%; max-width: 440px; aspect-ratio: 440 / 330; height: auto; margin: 0 auto; }
.interest-detail h3:focus:not(:focus-visible) { outline: none; }
.interest-detail h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.interest-detail p {
  max-width: 400px;
  margin: 16px 0 0;
  font-family: var(--sans);
  font-size: 14.72px;
  line-height: 1.62;
  color: var(--ink-2);
}
.interest-close {
  position: absolute;
  top: 18px;
  right: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.interest-close:hover { border-color: var(--ink-3); }
.interest-close svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.interest-nav {
  display: flex;
  gap: 18px;
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 11.2px;
}
.interest-nav button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.interest-nav button:hover { color: var(--ink); }

.polaroids {
  display: flex;
  margin-top: 26px;
  padding-left: 6px;
}
.polaroid {
  width: 132px;
  margin: 0 0 0 -14px;
  padding: 7px 7px 26px;
  background: #FBF9F4;
  box-shadow: 0 10px 22px -12px rgba(40, 30, 20, 0.5), 0 1px 2px rgba(40, 30, 20, 0.15);
  transform: rotate(var(--tilt, -3deg));
  transition: transform 0.3s ease;
}
.polaroid:first-child { margin-left: 0; }
.polaroid:hover { transform: rotate(0deg) translateY(-4px); z-index: 2; }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.polaroid figcaption {
  margin-top: 6px;
  font-family: var(--hand);
  font-size: 16px;
  line-height: 1.1;
  text-align: center;
  color: #3A3630;
}

/* ---------- Play Me ---------- */
.play-area {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 352px);
  justify-content: space-between;
  align-items: start;
  gap: 32px;
  margin-top: 46px;
}

.court-wrap {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1.06;
  margin: 0 auto;
  border-radius: 18px;
  cursor: crosshair;
  outline: none;
}
.court-wrap:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.court-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.bun {
  position: absolute;
  width: 46px;
  height: 46px;
  pointer-events: none;
}
.bun-me { top: 3%; right: 3%; }
.bun-you { bottom: 15%; left: 3%; }
.bun .zz {
  font-family: var(--hand);
  font-size: 14px;
  fill: var(--ink-3);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.bun.is-asleep .zz { opacity: 1; animation: zz 2.6s ease-in-out infinite; }
@keyframes zz { 50% { transform: translate(2px, -3px); } }
.bun .eyes-open { display: none; }
.bun.is-awake .eyes-open { display: inline; }
.bun.is-awake .eyes-closed { display: none; }

.court-hint {
  margin: 14px auto 0;
  max-width: 420px;
  font-family: var(--mono);
  font-size: 11.2px;
  line-height: 1.6;
  text-align: center;
  color: var(--ink-3);
}

.turn-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  margin: 0;
  font-family: var(--hand);
  font-size: 37.6px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: var(--crayon-red);
}
.turn-note.is-mine { color: var(--crayon-blue); }
.turn-note svg { display: block; width: 140px; height: 10px; margin: 2px auto 0; }
.turn-note path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.play-again {
  display: block;
  margin: 18px auto 0;
  padding: 6px 16px 7px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: none;
  font-family: var(--mono);
  font-size: 11.2px;
  color: var(--ink);
  cursor: pointer;
}
.play-again:hover { border-color: var(--ink-3); }
.play-again[hidden] { display: none; }

.scoreboard {
  position: relative;
  margin: 46px 0 0;
  padding: 44px 22px 22px 44px;
  background:
    linear-gradient(90deg, transparent 31px, rgba(210, 70, 44, 0.45) 31px, rgba(210, 70, 44, 0.45) 32px, transparent 32px),
    repeating-linear-gradient(180deg, var(--paper) 0, var(--paper) 31px, rgba(77, 91, 194, 0.16) 31px, rgba(77, 91, 194, 0.16) 32px);
  color: #1F1C17;
  box-shadow: 0 22px 38px -24px rgba(40, 30, 20, 0.55), 0 1px 3px rgba(40, 30, 20, 0.15);
  transform: rotate(0.6deg);
}
.scoreboard::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 88px;
  height: 26px;
  margin-left: -44px;
  background: rgba(240, 206, 122, 0.78);
  transform: rotate(-1.5deg);
}
.scoreboard h3 {
  margin: 0 0 10px;
  font-family: var(--hand);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.score-row {
  display: grid;
  grid-template-columns: 40px auto minmax(20px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}
.score-row svg { width: 38px; height: 38px; }
.score-name {
  font-family: var(--hand);
  font-size: 22.4px;
  font-weight: 500;
  line-height: 1;
}
.score-name small { display: block; font-family: var(--mono); font-size: 10px; color: #6D675F; }
.score-dots { border-bottom: 2px dotted rgba(31, 28, 23, 0.25); transform: translateY(-4px); }
.score-num {
  min-width: 26px;
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 700;
  text-align: right;
}
.score-game {
  margin: 14px 0 0;
  font-family: var(--hand);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: #1F1C17;
}
.score-foot {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: #4E4A43;
}

/* ---------- Bookshelf ---------- */
.shelf-title {
  max-width: 780px;
  margin: 0;
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.shelf-hint {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 11.2px;
  color: var(--ink-3);
}
.shelf-stage {
  position: relative;
  margin-top: 36px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(60% 40% at 50% 104%, rgba(180, 84, 52, 0.22), transparent 70%),
    radial-gradient(120% 90% at 50% 0%, #17172C 0%, #0D0C17 58%, #090812 100%);
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-select: none;
}
.shelf-stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.shelf-scroller {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  perspective: 1100px;
  perspective-origin: 50% 42%;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}
.shelf-scroller::-webkit-scrollbar { display: none; }
.shelf-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  width: max-content;
  min-width: 100%;
  height: 430px;
  padding: 0 calc(56px + var(--pad-r, 0px)) 64px calc(56px + var(--pad-l, 0px));
  transform-style: preserve-3d;
  cursor: grab;
}
.shelf-track.is-dragging { cursor: grabbing; }

/* The floor has the scroller's box and perspective, so the plank's top recedes
   exactly as it would under the books, but it never scrolls. */
.shelf-floor {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 430px;
  perspective: 1100px;
  perspective-origin: 50% 42%;
  pointer-events: none;
}
.shelf-plank {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 64px);
  height: 30px;
  transform-style: preserve-3d;
  pointer-events: none;
}
.plank-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 230px;
  background: linear-gradient(180deg, #6E4C44 0%, #553A34 45%, #2E211E 100%);
  transform-origin: top center;
  transform: rotateX(-90deg);
}
.plank-front {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #7A564D 0%, #5A3D36 30%, #3E2A26 100%);
  box-shadow: 0 1px 0 rgba(255, 236, 220, 0.2) inset, 0 24px 34px -8px rgba(0, 0, 0, 0.65);
}

.book {
  position: relative;
  flex: none;
  width: var(--sw, 58px);
  height: var(--bh, 286px);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-on, #F4F0E8);
  transform-style: preserve-3d;
  transform-origin: 50% 50% calc(var(--bd, 196px) * -0.5);
  transition: transform 0.6s cubic-bezier(0.2, 0.75, 0.2, 1);
  cursor: pointer;
}
.book:hover,
.book:focus-visible { transform: translateY(-14px) translateZ(12px); }
.book:focus-visible { outline: none; }
.book:focus-visible .book-spine { box-shadow: 0 0 0 2px #E99474, inset 4px 0 6px rgba(255, 255, 255, 0.12), inset -6px 0 10px rgba(0, 0, 0, 0.28); }
.book.is-open { transform: translateY(-26px) translateZ(120px) rotateY(-90deg); }
.has-open .book:not(.is-open) { transform: translateZ(-6px); filter: brightness(0.7); }
.has-open .book:not(.is-open):hover { transform: translateY(-8px); }

.book-spine,
.book-cover,
.book-back {
  position: absolute;
  top: 0;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book-spine {
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-2) 0%, var(--color) 16%, var(--color-3) 52%, var(--color) 84%, var(--color-2) 100%);
  box-shadow: inset 4px 0 6px rgba(255, 255, 255, 0.1), inset -6px 0 10px rgba(0, 0, 0, 0.24);
}
.book-spine .rule {
  flex: none;
  width: 64%;
  height: 2px;
  background: var(--book-accent);
  box-shadow: 0 5px 0 var(--book-accent);
}
.book-spine .rule:last-child { box-shadow: 0 -5px 0 var(--book-accent); }
.book-spine .title {
  flex: 1;
  min-height: 0;
  margin: 18px 0 8px;
  writing-mode: vertical-rl;
  font-family: var(--sans);
  font-size: var(--title-size, 13px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-spine .title.is-multi { line-height: 1.12; }
.book.is-serif .book-spine .title {
  font-family: var(--serif);
  font-size: var(--title-size, 16px);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.book-spine .dot { flex: none; width: 4px; height: 4px; margin: 6px 0; border-radius: 50%; background: var(--book-accent); }
.book-spine .author {
  flex: none;
  max-height: 40%;
  margin-bottom: 14px;
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: var(--author-size, 12px);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0.85;
}
.book-cover {
  left: 100%;
  width: var(--bd, 196px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 22px 18px;
  overflow: hidden;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--color-2) 0%, var(--color) 10%, var(--color-3) 100%);
  text-align: left;
  transform-origin: left center;
  transform: rotateY(90deg);
}
.book-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-cover .cover-rule { width: 40px; height: 3px; background: var(--book-accent); }
.book-cover .cover-title {
  font-family: var(--serif);
  font-size: var(--cover-size, 25px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.book-cover .cover-author { font-family: var(--sans); font-size: 11.5px; opacity: 0.8; }
.book-back {
  right: 100%;
  width: var(--bd, 196px);
  background: linear-gradient(90deg, var(--color-2), var(--color));
  transform-origin: right center;
  transform: rotateY(-90deg);
}

.shelf-caption {
  position: relative;
  min-height: 176px;
  padding: 44px 24px 54px;
  text-align: center;
  color: #F1ECE3;
}
.shelf-caption.is-fresh { animation: caption-in 0.35s ease both; }
@keyframes caption-in { from { opacity: 0; transform: translateY(4px); } }
.shelf-caption h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.shelf-caption .by { margin: 8px 0 0; font-family: var(--sans); font-size: 14px; color: #B7AFA3; }
.shelf-caption .note { max-width: 520px; margin: 16px auto 0; font-family: var(--sans); font-size: 14px; line-height: 1.6; color: #D2CBBF; }
.shelf-caption .note[hidden] { display: none; }

/* ---------- Project mini interfaces ---------- */
.mini {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  color: #1D1B17;
}
.mini-card {
  width: 68%;
  border-radius: 10px;
  background: #F6F2EA;
  box-shadow: 0 24px 40px -18px rgba(30, 14, 6, 0.55), 0 2px 6px rgba(30, 14, 6, 0.18);
  overflow: hidden;
}
.mini-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 30px;
  margin: 0 16px;
  border-top: 1px solid rgba(30, 27, 22, 0.1);
  font-size: 10px;
}
.mini-row .k { color: #8A847A; font-size: 9.5px; }
.mini-row .v { font-family: var(--sans); font-size: 12.5px; color: #1D1B17; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px 11px;
  font-size: 10px;
  color: #6F695F;
}
.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
}
.mini-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.caret {
  display: inline-block;
  width: 1px;
  height: 13px;
  margin-left: 1px;
  vertical-align: -2px;
  background: #1D1B17;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* session */
.mini-session { background: #B4532E; }
.mini-session .stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  color: #2E6B47;
  background: rgba(46, 107, 71, 0.12);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.mini-session .stamp.is-on { opacity: 1; transform: none; }
.mini-session .mini-row { opacity: 0.25; transition: opacity 0.35s ease; }
.mini-session .mini-row.is-on { opacity: 1; }

/* leaderboard */
.mini-board { background: #1C1A17; color: #EEE9DE; }
.mini-board .panel-inner { width: 84%; }
.mini-board .lb-head { display: flex; justify-content: space-between; font-size: 9.5px; color: #8F897F; margin-bottom: 12px; }
.mini-board .lb-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 72px 46px;
  align-items: center;
  gap: 10px;
  height: 31px;
  border-top: 1px solid rgba(238, 233, 222, 0.1);
  font-size: 10px;
}
.mini-board .lb-row .n { color: #8F897F; }
.mini-board .lb-row .name { font-family: var(--sans); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-board .lb-row.is-ours .name { color: #fff; }
.mini-board .bar { height: 4px; border-radius: 2px; background: rgba(238, 233, 222, 0.12); overflow: hidden; }
.mini-board .bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: #8F897F; transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.mini-board .lb-row.is-ours .bar i { background: #E4704C; }
.mini-board .wer { text-align: right; font-size: 10.5px; }

/* chart */
.mini-chart { background: #3D4357; }
.mini-chart .mini-card { width: 74%; }
.mini-chart .mini-row { grid-template-columns: minmax(0, 1fr) auto; }
.mini-chart .mini-row .v { font-size: 12px; }
.mini-chart .tick {
  font-size: 9.5px;
  color: #8A847A;
  transition: color 0.3s ease;
}
.mini-chart .tick.is-done { color: #2E6B47; }
.mini-chart .foot-line { padding: 10px 16px 12px; font-size: 9.5px; color: #8A847A; border-top: 1px solid rgba(30, 27, 22, 0.1); display: flex; justify-content: space-between; }

/* globe */
.mini-globe { background: #E8D8B8; color: #2B2620; }
.mini-globe .globe-wrap { display: grid; grid-template-columns: 46% 54%; align-items: center; width: 92%; }
.mini-globe svg { width: 100%; height: auto; overflow: visible; }
.mini-globe .globe-line { fill: none; stroke: #6E6252; stroke-width: 0.8; }
.mini-globe .arc { fill: none; stroke: #B4532E; stroke-width: 1.4; stroke-dasharray: 3 5; animation: arcflow 1.6s linear infinite; }
.mini-globe .dot { fill: #B4532E; }
.mini-globe .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; padding-left: 8px; }
.mini-globe .stat .k { display: block; font-size: 9.5px; color: #6E6252; }
.mini-globe .stat .v { display: block; margin-top: 2px; font-family: var(--serif); font-size: 26px; line-height: 1; letter-spacing: -0.02em; color: #2B2620; }
@keyframes arcflow { to { stroke-dashoffset: -16; } }

/* consensus */
.mini-consensus { background: #23262E; color: #EEE9DE; }
.mini-consensus .mini-card { width: 76%; background: #F3EFE6; color: #1D1B17; }
.mini-consensus .claim { padding: 4px 16px 12px; font-family: var(--sans); font-size: 12.5px; line-height: 1.5; }
.mini-consensus .votes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 16px 12px; }
.mini-consensus .vote { display: grid; justify-items: center; gap: 4px; padding: 6px 0; border-radius: 6px; background: rgba(30, 27, 22, 0.05); font-size: 9px; color: #6F695F; opacity: 0.35; transition: opacity 0.3s ease, background-color 0.3s ease; }
.mini-consensus .vote.is-on { opacity: 1; }
.mini-consensus .vote b { font-family: var(--sans); font-size: 12px; }
.mini-consensus .vote.yes b { color: #2E6B47; }
.mini-consensus .vote.no b { color: #B4532E; }
.mini-consensus .verdict { display: flex; justify-content: space-between; padding: 10px 16px 12px; border-top: 1px solid rgba(30, 27, 22, 0.1); font-size: 9.5px; color: #6F695F; }
.mini-consensus .verdict b { font-weight: 500; }
.mini-consensus .verdict b.ok { color: #2E6B47; }
.mini-consensus .verdict b.flag { color: #B4532E; }
.mini-consensus .foot-note { margin-top: 12px; font-size: 9.5px; color: #A3A6B2; text-align: center; }

/* topological deep learning: a cell complex in particles */
.mini-complex {
  background:
    radial-gradient(70% 80% at 70% 20%, rgba(91, 112, 190, 0.35), transparent 65%),
    radial-gradient(60% 70% at 15% 90%, rgba(180, 83, 46, 0.25), transparent 65%),
    #0F131D;
}
.mini-complex canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.complex-key {
  position: absolute;
  left: 18px;
  bottom: 14px;
  display: flex;
  gap: 14px;
  font-size: 9.5px;
  color: #A9B1C6;
}
.complex-key span { display: inline-flex; align-items: center; gap: 6px; }
.complex-key i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.complex-key .k-cell { background: rgba(240, 150, 112, 0.85); }
.complex-key .k-edge { width: 12px; height: 2px; background: #E2E8F4; }
.complex-key .k-node { width: 5px; height: 5px; border-radius: 50%; background: #E2E8F4; }

/* a card someone linked to */
.work.is-flash .work-media { animation: flash 1.6s ease; }
@keyframes flash {
  0%, 100% { box-shadow: var(--shadow); }
  25% { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
}
.interest-link {
  display: inline-flex;
  gap: 6px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11.2px;
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}
.interest-link:hover { text-decoration-color: var(--accent); }

/* framed screenshot */
.mini-frame {
  background:
    radial-gradient(80% 90% at 85% 0%, rgba(176, 196, 255, 0.55), transparent 60%),
    radial-gradient(70% 80% at 0% 100%, rgba(229, 215, 255, 0.7), transparent 60%),
    #EEF1FB;
}
.mini-frame.tone-sky {
  background:
    radial-gradient(80% 90% at 90% 0%, rgba(189, 227, 255, 0.95), transparent 62%),
    radial-gradient(70% 80% at 0% 100%, rgba(213, 237, 223, 0.95), transparent 62%),
    #EEF5F8;
}
.mini-frame.tone-mint {
  background:
    radial-gradient(80% 90% at 10% 0%, rgba(213, 237, 223, 1), transparent 62%),
    radial-gradient(70% 80% at 100% 100%, rgba(189, 227, 255, 0.85), transparent 62%),
    #EFF6F1;
}
.mini-frame.tone-lilac {
  background:
    radial-gradient(80% 90% at 85% 0%, rgba(176, 196, 255, 0.55), transparent 60%),
    radial-gradient(70% 80% at 0% 100%, rgba(229, 215, 255, 0.7), transparent 60%),
    #EEF1FB;
}
.mini-frame.tone-blue {
  background:
    radial-gradient(90% 90% at 80% 0%, rgba(124, 146, 255, 0.55), transparent 60%),
    linear-gradient(160deg, #2A45D8 0%, #0B2AA8 100%);
}
.mini-frame.tone-paper {
  background:
    radial-gradient(80% 90% at 90% 0%, rgba(233, 196, 106, 0.35), transparent 62%),
    radial-gradient(70% 80% at 0% 100%, rgba(180, 83, 46, 0.18), transparent 62%),
    #F3EDE2;
}
.mini-frame.tone-rust { background: #B4532E; }
.mini-frame .window {
  width: 82%;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 26px 40px -22px rgba(40, 46, 90, 0.55), 0 1px 3px rgba(40, 46, 90, 0.18);
  transform: translateY(6px);
}
.mini-frame .window-bar { display: flex; gap: 5px; padding: 8px 10px; background: #F4F4F7; border-bottom: 1px solid #E6E6EC; }
.mini-frame .window-bar i { width: 7px; height: 7px; border-radius: 50%; background: #D9D9E0; }
.mini-frame img { width: 100%; height: auto; aspect-ratio: 1288 / 700; object-fit: cover; object-position: top; }

/* ---------- Starlight ---------- */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}
:root[data-mode="starlight"] .starfield { opacity: 1; }

:root[data-mode="starlight"] main,
:root[data-mode="starlight"] .foot {
  -webkit-mask-image: var(--grain, none);
  mask-image: var(--grain, none);
  -webkit-mask-size: 180px 180px;
  mask-size: 180px 180px;
  text-shadow: 0 0 1px rgba(255, 246, 232, 0.55), 0 0 14px rgba(255, 214, 190, 0.18);
}
:root[data-mode="starlight"] .work-media { box-shadow: none; }
:root[data-mode="starlight"] .tab { cursor: default; }

.light-pool {
  position: fixed;
  z-index: 5;
  left: 0;
  top: 0;
  width: 380px;
  height: 380px;
  margin: -190px 0 0 -190px;
  border-radius: 47% 53% 61% 39% / 45% 39% 61% 55%;
  background: #EEEAE0;
  mix-blend-mode: difference;
  box-shadow: 0 0 40px 10px rgba(238, 234, 224, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(var(--lx, -999px), var(--ly, -999px)) scale(0.2);
  transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.light-pool.is-on {
  opacity: 1;
  transform: translate(var(--lx), var(--ly)) scale(1);
  animation: wobble 7s ease-in-out infinite;
}
:root:not([data-mode="starlight"]) .light-pool { opacity: 0; }
@keyframes wobble {
  33% { border-radius: 58% 42% 47% 53% / 52% 58% 42% 48%; }
  66% { border-radius: 42% 58% 55% 45% / 41% 47% 53% 59%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .facts-col { max-width: 420px; }
  .role { grid-template-columns: 196px minmax(0, 1fr); row-gap: 14px; }
  .role-detail { grid-column: 2; }
  .play-area { grid-template-columns: minmax(0, 1fr); }
  .scoreboard { max-width: 380px; margin: 40px auto 0; }
  .contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .page { padding-top: 32px; }
  .top { height: 112px; }
  .portrait { width: 112px; height: 112px; }
  .control { width: 38px; height: 38px; }
  .controls { gap: 8px; }
  .controls-label { display: none; }
  :root[data-mode="starlight"] .control-star { top: 31px; right: calc(var(--gutter) + 46px); }
  .hero h1 { font-size: 44px; }
  .intro { margin-top: 22px; font-size: 14.5px; }
  .tabs { gap: 30px; margin: 40px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter); }
  :root[data-mode="starlight"] .tabs { margin-left: 0; margin-right: 0; padding: 0; }
  .mini-card { width: 80%; }
  .mini-chart .mini-card, .mini-consensus .mini-card { width: 86%; }
  .panels { padding-top: 52px; }
  .panel-head { grid-template-columns: 1fr; gap: 14px; }
  .panel-title { font-size: 40px; }
  .panel-note { margin: 0; }
  .statement { font-size: 34px; }
  .about-grid { margin-top: 44px; }
  .role { grid-template-columns: minmax(0, 1fr); padding: 30px 0 32px; }
  .role-when { margin: 0 0 4px; }
  .role-detail { grid-column: auto; }
  .role-title { font-size: 26px; }
  .work-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; margin-top: 36px; }
  .mini { font-size: 90%; }
  .interest { width: 46%; }
  .interest canvas { width: 140px; height: 124px; }
  .interest-detail { grid-template-columns: minmax(0, 1fr); padding-top: 64px; }
  .shelf-title { font-size: 32px; }
  .shelf-track { height: 380px; padding: 0 calc(28px + var(--pad-r, 0px)) 64px calc(28px + var(--pad-l, 0px)); }
  .shelf-floor { height: 380px; }
  .shelf-caption h3 { font-size: 26px; }
  .contact { padding-top: 110px; }
  .contact-list { grid-template-columns: minmax(0, 1fr); }
  .contact-item.is-primary::before { display: none; }
  .foot { padding-bottom: 48px; }
  .light-pool { width: 260px; height: 260px; margin: -130px 0 0 -130px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .controls,
  .starfield,
  .light-pool,
  .tabs { display: none !important; }
  :root { --bg: #fff; }
  main, .foot { -webkit-mask-image: none !important; mask-image: none !important; text-shadow: none !important; }
}
