/* Inter and Space Grotesk (SIL Open Font Licence), self-hosted: latin, latin-ext and greek subsets. */
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-normal-greek.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/space-grotesk-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/space-grotesk-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* The @font-face rules from fonts/fonts.css are prepended to this file by build.py. */

/* ---------- tokens ---------- */
:root {
  --paper: #f6f5f2;
  --paper-2: #eeece7;
  --surface: #ffffff;
  --ink: #11141b;
  --muted: #4a5260;
  --rule: #e2e0da;
  --accent: #c42a1d;
  --accent-ink: #ffffff;
  --accent-soft: #fbeae7;
  --deep: #070a12;
  --deep-2: #0d1220;
  --deep-3: #141b2d;
  --on-deep: #eef0f5;
  --on-deep-muted: #a3acbd;
  --line-deep: rgba(255, 255, 255, 0.1);
  --beam: #ff5a4e;
  --beam-2: #ffb08a;
  --beam-text: #ff9a90;
  --frame: #ffffff;
  --shadow: 0 18px 50px -24px rgba(7, 10, 18, 0.35);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --radius: 18px;
  --head-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b0f18;
    --paper-2: #10151f;
    --surface: #151c29;
    --ink: #eceef2;
    --muted: #a6aebb;
    --rule: #252e3e;
    --accent: #ff8a7e;
    --accent-ink: #1a0c0a;
    --accent-soft: #2a1b1d;
    --frame: #f6f5f2;
    --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--beam); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: calc(var(--head-h) + 24px); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; font-weight: 650; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
sup, sub { line-height: 0; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 12px 18px; border-radius: 10px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.eyebrow {
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 0.85rem;
}
.section-h { font-size: clamp(2rem, 2.6vw + 1rem, 3.25rem); margin: 0; }
.section-h a { color: inherit; text-decoration: none; }
.section-h a:hover { color: var(--accent); }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 50px; padding: 0 1.5rem;
  border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.button:hover { transform: scale(1.02); }
.button:active { transform: scale(0.98); }
.button-primary { background: linear-gradient(135deg, #ff5a4e, #e0301f); color: #fff; box-shadow: 0 10px 30px -12px rgba(255, 90, 78, 0.7); }
.button-primary:hover { box-shadow: 0 16px 40px -12px rgba(255, 90, 78, 0.85); }
.button-ghost { color: var(--on-deep); border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.04); backdrop-filter: blur(6px); }
.button-ghost:hover { border-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.08); }
.button-primary::after, .button-ghost::after { content: "→"; transition: transform 0.2s ease; }
.button:hover::after { transform: translateX(3px); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50; height: var(--head-h);
  background: rgba(7, 10, 18, 0.78); color: var(--on-deep);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-deep);
}
.head-row { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 1rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px;
  color: var(--on-deep); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.main-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border-radius: 999px;
  color: var(--on-deep-muted); font-size: 0.95rem; font-weight: 500; text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.main-nav a:hover { color: var(--on-deep); background: rgba(255, 255, 255, 0.07); }
.main-nav a[aria-current="page"], .main-nav a.is-section { color: var(--on-deep); background: rgba(255, 255, 255, 0.11); }
.menu-button, .menu-close {
  display: none; width: 48px; height: 48px; padding: 12px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; cursor: pointer;
}
.menu-button:hover, .menu-close:hover { background: rgba(127, 127, 127, 0.15); }
@media (max-width: 899px) {
  .main-nav { display: none; }
  .menu-button { display: inline-flex; }
}

/* mobile menu */
.site-menu {
  margin: 0 0 0 auto; height: 100dvh; max-height: none; width: min(380px, 88vw); padding: 0 0 2rem;
  border: 0; background: var(--paper); color: var(--ink); box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.45);
  overflow-y: auto;
}
.site-menu::backdrop { background: rgba(7, 10, 18, 0.6); backdrop-filter: blur(3px); }
.site-menu[open] { animation: slideIn 0.25s ease; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 24px; border-bottom: 1px solid var(--rule); }
.menu-title { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.site-menu .menu-close { display: inline-flex; }
.site-menu nav { padding: 12px 16px; }

/* contents list (menu + sidebar) */
.toc, .toc ul { list-style: none; margin: 0; padding: 0; }
.toc > li { margin: 0.15rem 0; }
.toc a {
  display: flex; align-items: center; min-height: 44px; padding: 0.35rem 0.75rem; border-radius: 10px;
  color: var(--ink); font-size: 0.98rem; font-weight: 600; text-decoration: none;
}
.toc ul { margin: 0 0 0.5rem 0.75rem; padding-left: 0.5rem; border-left: 1px solid var(--rule); }
.toc ul a { font-weight: 450; color: var(--muted); font-size: 0.95rem; }
.toc a:hover { background: var(--paper-2); color: var(--ink); }
.toc a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ---------- home: hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate; color: var(--on-deep); background: var(--deep);
  min-height: min(calc(100svh - var(--head-h)), 880px); display: grid; align-items: center;
  padding-block: clamp(4rem, 10vw, 7rem);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--deep) 0%, rgba(7, 10, 18, 0.94) 38%, rgba(7, 10, 18, 0.55) 62%, rgba(7, 10, 18, 0.15) 100%),
    linear-gradient(0deg, var(--deep) 0%, transparent 22%),
    radial-gradient(40% 60% at 22% 40%, rgba(255, 90, 78, 0.18), transparent 70%);
}
.hero-mosaic {
  position: absolute; z-index: -2; top: -18%; bottom: -18%; left: 46%; right: -6%;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; transform: rotate(-9deg);
}
.mosaic-col { min-width: 0; }
.mosaic-track { display: flex; flex-direction: column; gap: 18px; animation: drift 80s linear infinite; }
.mosaic-col:nth-child(2) .mosaic-track { animation-duration: 95s; animation-direction: reverse; }
.mosaic-col:nth-child(3) .mosaic-track { animation-duration: 70s; }
.mosaic-track img {
  display: block; width: 100%; height: auto; border-radius: 16px; background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
@keyframes drift { to { transform: translateY(calc(-50% - 9px)); } }
@media (max-width: 959px) {
  .hero-mosaic { left: -15%; right: -15%; opacity: 0.4; }
  .hero::before { background: linear-gradient(180deg, rgba(7, 10, 18, 0.7), rgba(7, 10, 18, 0.92) 55%, var(--deep)); }
}
.hero-inner { position: relative; }
.hero-text { max-width: 620px; animation: fadeIn 0.9s ease both; }
.pill {
  display: inline-flex; align-items: center; gap: 0.6rem; margin: 0 0 1.75rem; padding: 0.45rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; background: rgba(255, 255, 255, 0.05);
  font-size: 0.875rem; font-weight: 500; color: var(--on-deep); backdrop-filter: blur(6px);
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--beam); box-shadow: 0 0 0 0 rgba(255, 90, 78, 0.6); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 78, 0.6); } 80%, 100% { box-shadow: 0 0 0 12px rgba(255, 90, 78, 0); } }
.hero h1 {
  font-size: clamp(3rem, 6.5vw + 1rem, 6.75rem); line-height: 0.95; margin: 0 0 1.5rem; font-weight: 700; letter-spacing: -0.045em;
}
.glow {
  background: linear-gradient(95deg, #ff5a4e 10%, #ffb08a 90%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { font-size: clamp(1.15rem, 0.6vw + 1rem, 1.4rem); line-height: 1.55; color: #c6cddb; max-width: 36ch; margin: 0 0 2.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-note { margin: 3rem 0 0; max-width: 46ch; font-size: 0.875rem; color: var(--on-deep-muted); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- home: key figures ---------- */
.facts { background: var(--deep); color: var(--on-deep); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.fact-row { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .fact-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.fact-row a {
  display: block; height: 100%; padding: 1.5rem clamp(1rem, 2vw, 1.5rem); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-deep); color: inherit; text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.fact-row a:hover { transform: translateY(-2px); border-color: rgba(255, 90, 78, 0.45); }
.fact-row strong {
  display: block; font-family: var(--display); font-size: clamp(1.7rem, 2vw + 1rem, 2.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
  background: linear-gradient(95deg, #ff6a5e, #ffc09e); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fact-row span { display: block; margin-top: 0.5rem; font-size: 0.9rem; line-height: 1.45; color: var(--on-deep-muted); }

/* ---------- home: introduction ---------- */
.intro { padding-block: clamp(4rem, 8vw, 7rem); }
.intro-grid { display: grid; gap: 3rem; align-items: start; }
@media (min-width: 1024px) { .intro-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 4.5rem; } }
.intro .section-h { margin-bottom: 2rem; max-width: 18ch; }
.intro .prose .first { font-size: 1.3rem; line-height: 1.6; color: var(--ink); font-weight: 500; }
.intro-aside { position: sticky; top: calc(var(--head-h) + 32px); }
.compare { margin: 0; padding: 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 24px; box-shadow: var(--shadow); }
.compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.compare-pair div { background: #fff; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; }
.compare-pair img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 0.86; object-fit: contain; }
.compare-pair span { margin-top: 0.4rem; text-align: center; font-size: 0.875rem; font-weight: 600; color: #11141b; }
.compare figcaption { margin-top: 1rem; font-size: 0.95rem; line-height: 1.55; color: var(--muted); }
.compare figcaption a { font-weight: 600; white-space: nowrap; }
.compare figcaption a::after { content: " →"; }

/* ---------- home: how it works ---------- */
.how {
  position: relative; overflow: hidden; color: var(--on-deep); padding-block: clamp(4rem, 8vw, 7rem);
  background: radial-gradient(50% 60% at 80% 20%, rgba(255, 90, 78, 0.12), transparent 70%), radial-gradient(40% 50% at 0% 100%, rgba(90, 140, 255, 0.1), transparent 70%), var(--deep);
}
.how .eyebrow, .band .eyebrow, .page-head .eyebrow { color: var(--beam-text); }
.how .section-h a:hover, .band .section-h a:hover { color: var(--beam-text); }
.how-head { margin-bottom: 2.5rem; }
.how-diagram {
  margin: 0 0 2rem; padding: clamp(0.75rem, 2vw, 1.75rem); border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)); border: 1px solid var(--line-deep);
}

/* beamline diagram */
.beamline { display: block; width: 100%; height: auto; color: var(--on-deep); }
.bl-part { fill: rgba(255, 255, 255, 0.04); stroke: currentColor; stroke-opacity: 0.5; stroke-width: 1.4; transition: stroke 0.3s ease, fill 0.3s ease; }
.bl-part path { fill: none; }
.part-stage path:first-child { fill: rgba(255, 255, 255, 0.05); }
.beamline[data-hl="accel"] .part-accel, .beamline[data-hl="lens"] .part-lens,
.beamline[data-hl="stage"] .part-stage, .beamline[data-hl="scan"] .part-scan {
  stroke: var(--beam); stroke-opacity: 1; fill: rgba(255, 90, 78, 0.14); filter: drop-shadow(0 0 10px rgba(255, 90, 78, 0.55));
}
.bl-labels text { font-family: var(--sans); font-size: 14px; font-weight: 500; fill: currentColor; fill-opacity: 0.7; text-anchor: middle; }
.bl-mark circle { fill: var(--beam); stroke: var(--deep); stroke-width: 3; }
.bl-mark text { font-family: var(--display); font-size: 14px; font-weight: 700; fill: #fff; text-anchor: middle; }
.bl-flow { stroke-dasharray: 4 22; animation: flow 1.4s linear infinite; }
.bl-spot { transform-origin: 606px 248px; animation: spot 2.4s ease-in-out infinite; }
@keyframes flow { to { stroke-dashoffset: -52; } }
@keyframes spot { 50% { transform: scale(1.25); opacity: 0.8; } }
@media (max-width: 599px) { .bl-labels { display: none; } }

/* numbered steps (home + instrumentation index) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); counter-reset: none; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.step a {
  display: flex; flex-direction: column; height: 100%; padding: 1.5rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--rule); color: var(--ink); text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.step a:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--beam) 50%, var(--rule)); }
.step-n {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #ff5a4e, #e0301f); color: #fff; font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 8px 24px -8px rgba(255, 90, 78, 0.8);
}
.step h2, .step h3 { font-size: 1.35rem; margin: 1.1rem 0 0.4rem; }
.step p { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.98rem; line-height: 1.55; }
.more { margin-top: auto; font-size: 0.92rem; font-weight: 600; color: var(--accent); }
.more::after { content: " →"; }
.how .step a { background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)); border-color: var(--line-deep); color: var(--on-deep); }
.how .step p { color: var(--on-deep-muted); }
.how .more { color: var(--beam-text); }

/* ---------- picture tiles (home + applications index) ---------- */
.apps { padding-block: clamp(4rem, 8vw, 7rem); background: var(--paper-2); }
.apps-head { margin-bottom: 2.5rem; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile:first-child { grid-column: span 2; } }
@media (min-width: 1024px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 290px; }
  .tile:first-child { grid-column: span 2; grid-row: span 2; }
}
.tile a {
  position: relative; display: block; height: 100%; min-height: 280px; overflow: hidden; border-radius: 22px;
  background: var(--deep-2); color: #fff; text-decoration: none; isolation: isolate;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tile:first-child a { min-height: 380px; }
.tile a:hover { transform: translateY(-3px); box-shadow: 0 28px 60px -28px rgba(7, 10, 18, 0.6); }
.tile-art { position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; }
.tile-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(.2, .7, .2, 1); }
.tile a:hover .tile-art img { transform: scale(1.06); }
.tile-art .magnet-art { width: 88%; align-self: start; margin-top: 1rem; }
.tile:last-child .tile-text { background: linear-gradient(180deg, transparent, rgba(13, 18, 32, 0.96) 45%); }
.tile-text {
  position: absolute; inset: auto 0 0 0; padding: 4rem 1.5rem 1.4rem;
  background: linear-gradient(180deg, transparent, rgba(7, 10, 18, 0.78) 40%, rgba(7, 10, 18, 0.95));
}
.tile h2, .tile h3 { margin: 0 0 0.35rem; font-size: 1.4rem; display: flex; align-items: center; gap: 0.5rem; }
.tile h2::after, .tile h3::after { content: "→"; font-family: var(--sans); font-size: 1.1rem; color: var(--beam-text); transition: transform 0.2s ease; }
.tile a:hover h2::after, .tile a:hover h3::after { transform: translateX(4px); }
.tile p { margin: 0; font-size: 0.95rem; line-height: 1.5; color: #c6cddb; max-width: 44ch; }
.tile:first-child h2, .tile:first-child h3 { font-size: clamp(1.6rem, 1.5vw + 1rem, 2.2rem); }

/* magnetic writing artwork */
.magnet-art { display: block; color: var(--on-deep); }
.magnet-art .track { fill: rgba(255, 90, 78, 0.08); stroke: rgba(255, 90, 78, 0.45); stroke-dasharray: 4 6; }
.spin path { fill: none; stroke: currentColor; stroke-opacity: 0.35; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.spin.on path { stroke: var(--beam); stroke-opacity: 1; }

/* ---------- home: gallery band ---------- */
.band { background: var(--deep); color: var(--on-deep); padding-block: clamp(4rem, 8vw, 7rem); }
.band-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.5rem; }
.band-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .band-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
.band-grid a { position: relative; display: block; overflow: hidden; border-radius: 18px; background: #fff; text-decoration: none; }
.band-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.7s cubic-bezier(.2, .7, .2, 1); }
.band-grid a:hover img { transform: scale(1.06); }
.band-grid span {
  position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 0.35rem 0.75rem; border-radius: 999px;
  background: rgba(7, 10, 18, 0.78); backdrop-filter: blur(6px); color: #fff; font-size: 0.875rem; font-weight: 500; line-height: 1.35;
}

/* ---------- inner pages: header ---------- */
.page-head {
  position: relative; overflow: hidden; color: var(--on-deep);
  background:
    radial-gradient(45% 80% at 85% 30%, rgba(255, 90, 78, 0.16), transparent 70%),
    radial-gradient(40% 70% at 0% 100%, rgba(90, 140, 255, 0.1), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 48px),
    var(--deep);
  padding-block: clamp(1.25rem, 3vw, 2.5rem) clamp(2.5rem, 5vw, 4.5rem);
}
.page-head-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 960px) { .has-visual .page-head-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 4rem; } }
.page-head-text { animation: fadeIn 0.6s ease both; }
.page-head h1 { font-size: clamp(2.2rem, 3vw + 1.2rem, 4rem); line-height: 1.02; letter-spacing: -0.035em; margin: 0; max-width: 20ch; }
.page-head .lead { font-size: clamp(1.1rem, 0.5vw + 1rem, 1.3rem); line-height: 1.55; color: #c6cddb; max-width: 52ch; margin: 1.25rem 0 0; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; list-style: none; margin: 0 0 1rem; padding: 0; font-size: 0.875rem; color: var(--on-deep-muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; color: rgba(255, 255, 255, 0.25); }
.breadcrumb a, .breadcrumb span { display: inline-flex; align-items: center; min-height: 44px; }
.breadcrumb a { color: var(--on-deep-muted); text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }
.head-visual { margin: 0; animation: fadeIn 0.8s 0.1s ease both; }
.head-visual .frame {
  overflow: hidden; border-radius: 22px; background: #fff; border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 40px 90px -40px rgba(255, 90, 78, 0.55), 0 20px 50px -20px rgba(0, 0, 0, 0.8);
}
.head-visual .frame img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: cover; }
.head-visual figcaption { margin-top: 0.85rem; font-size: 0.875rem; color: var(--on-deep-muted); }
.credit-by { opacity: 0.8; }
.head-diagram { padding: clamp(0.5rem, 2vw, 1.25rem); border-radius: 24px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-deep); }
.head-fan { position: relative; aspect-ratio: 4 / 3; max-width: 520px; width: 100%; justify-self: center; }
.head-fan img {
  position: absolute; width: 58%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.9);
  transition: transform 0.4s ease;
}
.head-fan img:nth-child(1) { left: 0; top: 18%; transform: rotate(-8deg); }
.head-fan img:nth-child(2) { right: 0; top: 4%; transform: rotate(7deg); }
.head-fan img:nth-child(3) { left: 21%; bottom: 0; transform: rotate(-1deg); z-index: 1; }
.head-fan:hover img:nth-child(1) { transform: rotate(-11deg) translateX(-8px); }
.head-fan:hover img:nth-child(2) { transform: rotate(10deg) translateX(8px); }

/* ---------- inner pages: body ---------- */
.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3.5rem, 7vw, 6rem); }
.sidebar { display: none; }
@media (min-width: 1024px) {
  .doc { grid-template-columns: 250px minmax(0, 1fr); gap: 4rem; }
  .sidebar { display: block; position: sticky; top: calc(var(--head-h) + 24px); align-self: start; max-height: calc(100vh - var(--head-h) - 48px); overflow-y: auto; }
}
.plain-body { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3.5rem, 7vw, 6rem); }

/* prose */
.prose { max-width: 70ch; }
.prose > p, .prose li { font-size: 1.0625rem; line-height: 1.8; }
.prose > p:first-child { font-size: 1.2rem; line-height: 1.7; color: var(--ink); }
.prose h2 { font-size: clamp(1.5rem, 1vw + 1rem, 2rem); margin: 3rem 0 0.85rem; }
.prose > h2:first-child { margin-top: 0; }
.prose sup, .prose sub { font-size: 0.72em; }
.prose a.cite { font-size: max(14px, 0.82em); font-weight: 600; text-decoration: none; white-space: nowrap; }
.prose a.cite:hover { text-decoration: underline; }
.points { counter-reset: pt; list-style: none; padding: 0; margin: 1.25rem 0 1.75rem; display: grid; gap: 0.75rem; }
.points li { counter-increment: pt; position: relative; padding: 1rem 1.25rem 1rem 3.75rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.points li::before {
  content: counter(pt, lower-roman); position: absolute; left: 1rem; top: 1rem; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-family: var(--display); font-weight: 700; font-size: 0.875rem;
}
.points li p { margin: 0; }
.note {
  margin: 2.25rem 0; padding: 1.4rem 1.6rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: inset 4px 0 0 var(--beam);
}
.note p { margin: 0.4rem 0; font-size: 1rem; line-height: 1.7; }
.credit { color: var(--muted); font-size: 0.95rem; }

/* figures */
.fig { margin: 2.5rem 0; }
.fig img, .fig video {
  display: block; margin-inline: auto; background: var(--frame); border: 1px solid var(--rule); border-radius: 16px;
  padding: clamp(6px, 1.5vw, 16px); box-shadow: var(--shadow);
}
.fig figcaption { margin-top: 0.9rem; font-size: 0.95rem; line-height: 1.55; color: var(--muted); }
.fig figcaption strong { color: var(--ink); }
.fig-small img { max-width: min(100%, 360px); width: 100%; }
.fig-tall img { max-width: min(100%, 460px); }
.fig-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.fig-row img { margin: 0; flex: 1 1 260px; max-width: 380px; }
.fig-video video { padding: 0; width: 100%; max-width: 720px; background: #000; }

/* references */
.references { margin-top: 3.5rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.references h2 { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.references ol { counter-reset: ref; list-style: none; margin: 0; padding: 0; }
.references li { counter-increment: ref; position: relative; padding: 0.35rem 0.5rem 0.35rem 2.75rem; font-size: 0.95rem; line-height: 1.55; border-radius: 8px; overflow-wrap: anywhere; }
.references li::before { content: "[" counter(ref) "]"; position: absolute; left: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--accent); top: 0.4rem; }
.references li:target { background: var(--accent-soft); }

/* previous / next */
.pager { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 3.5rem; }
.pager a {
  display: block; padding: 1.1rem 1.35rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 1.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pager a:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--beam) 45%, var(--rule)); }
.pager span { display: block; font-family: var(--sans); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }
.pager-prev span::before { content: "← "; }
.pager-next { text-align: right; grid-column: -2; }
.pager-next span::after { content: " →"; }

/* gallery */
.chips { position: sticky; top: calc(var(--head-h) + 8px); z-index: 5; margin-bottom: 2.5rem; }
.chips ul { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--rule); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.chips a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 1.1rem; border-radius: 999px; color: var(--ink); font-weight: 600; text-decoration: none; }
.chips a:hover { background: var(--accent-soft); color: var(--accent); }
.chips a span { font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.gallery-group + .gallery-group { margin-top: 4rem; }
.gallery-group h2 { font-size: clamp(1.5rem, 1vw + 1rem, 2rem); margin: 0 0 1.5rem; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.gallery figure { margin: 0; }
.gallery .shot { position: relative; display: block; overflow: hidden; border-radius: 16px; border: 1px solid var(--rule); background: var(--frame); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; transition: transform 0.5s ease; }
.gallery .shot:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.gallery .shot:hover img { transform: scale(1.03); }
.zoom {
  position: absolute; right: 10px; top: 10px; width: 38px; height: 38px; border-radius: 50%; opacity: 0;
  background: rgba(7, 10, 18, 0.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 20px no-repeat;
  transition: opacity 0.2s ease;
}
.gallery .shot:hover .zoom, .gallery .shot:focus-visible .zoom { opacity: 1; }
.gallery figcaption { margin-top: 0.7rem; font-size: 0.92rem; line-height: 1.45; color: var(--muted); }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(7, 10, 18, 0.95); color: #f1efe9; }
.lightbox::backdrop { background: rgba(7, 10, 18, 0.6); }
.lightbox figure { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; margin: 0; padding: 64px 16px 24px; }
.lightbox img { max-width: min(100%, 1000px); max-height: calc(100dvh - 160px); width: auto; height: auto; object-fit: contain; background: #fff; border-radius: 10px; }
.lightbox figcaption { margin-top: 1rem; max-width: 70ch; text-align: center; font-size: 0.98rem; color: #c9cfda; }
.lightbox button { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, 0.22); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; } }

.notfound { padding-bottom: 2rem; }

/* ---------- footer ---------- */
.site-foot { background: var(--deep); color: var(--on-deep-muted); font-size: 0.95rem; border-top: 1px solid var(--line-deep); }
.foot-grid { display: grid; gap: 2.5rem; padding-block: 4rem 2.5rem; }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.foot-brand { font-family: var(--display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; color: var(--on-deep); margin: 0 0 0.75rem; }
.foot-about p:last-child { max-width: 40ch; line-height: 1.6; }
.foot-h { color: var(--on-deep); font-weight: 600; font-size: 0.875rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 0.75rem; }
.foot-links, .foot-links ul { list-style: none; margin: 0; padding: 0; }
.foot-links ul { margin: 0 0 0.5rem 0.9rem; }
.foot-links a { display: inline-flex; align-items: center; min-height: 36px; color: var(--on-deep-muted); text-decoration: none; font-size: 0.95rem; }
.foot-links > li > a { color: var(--on-deep); }
.foot-links a:hover { color: #fff; text-decoration: underline; }
.foot-base { border-top: 1px solid var(--line-deep); padding-block: 1.25rem 1.75rem; font-size: 0.875rem; }
.foot-base p { margin: 0; }

/* ---------- motion ---------- */
/* Scroll-driven reveals ignore animation-duration, so they must be opted into, not overridden below. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: revealUp 0.6s ease both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
  }
}
@keyframes revealUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .site-head, .site-menu, .sidebar, .pager, .site-foot, .hero-mosaic, .head-visual, .skip-link, .chips { display: none !important; }
  body { background: #fff; color: #000; }
  .page-head, .hero { background: none; color: #000; min-height: 0; }
}
