@font-face {
  font-family: "Leporid";
  src: url("../assets/fonts/Leporid-Regular.otf") format("opentype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #050505;
  --panel: rgba(18, 18, 18, 0.78);
  --panel-solid: #131313;
  --paper: #f4f0e9;
  --muted: rgba(244, 240, 233, 0.62);
  --line: rgba(244, 240, 233, 0.15);
  --red: #f11222;
  --red-dark: #7f0711;
  --radius: 20px;
  --shell: min(1480px, calc(100vw - 48px));
  --ease: cubic-bezier(0.2, 0.78, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  margin: 0;
  color: var(--paper);
  font-family: "Leporid", Arial, sans-serif;
  background:
    radial-gradient(circle at 82% 9%, rgba(241, 18, 34, 0.12), transparent 30rem),
    var(--black);
  overflow-x: clip;
}

section[id] { scroll-margin-top: 112px; }

a { color: inherit; }
button, input { font: inherit; }

.beta-header {
  position: fixed;
  z-index: 50;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  width: var(--shell);
  min-height: 78px;
  display: grid;
  grid-template-columns: 210px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 12px 18px;
  background: rgba(5, 5, 5, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(1.2);
  transform: translateX(-50%);
  transition: min-height 220ms var(--ease), background 220ms ease;
}

.beta-header.is-compact {
  min-height: 64px;
  background: rgba(5, 5, 5, 0.9);
}

.beta-brand img { display: block; width: 150px; filter: brightness(0) invert(1); }
.beta-header nav { display: flex; justify-content: center; gap: clamp(18px, 3vw, 48px); }
.beta-header nav a,
.beta-footer a { color: var(--muted); text-decoration: none; transition: color 160ms ease; }
.beta-header nav a:hover,
.beta-footer a:hover { color: var(--paper); }

.beta-mark {
  padding: 9px 12px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  border: 1px solid rgba(241, 18, 34, 0.45);
  border-radius: 999px;
}

.beta-hero {
  position: relative;
  min-height: 940px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  align-items: center;
  overflow: hidden;
  padding: 150px max(24px, calc((100vw - 1480px) / 2)) 80px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  opacity: 0.28;
}

.hero-copy { position: relative; z-index: 2; max-width: 900px; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(70px, 9vw, 150px);
  line-height: 0.82;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-copy h1 span { color: var(--red); }
.hero-intro { max-width: 650px; margin: 38px 0 0; color: var(--muted); font-size: 21px; line-height: 1.5; }
.hero-actions { display: flex; gap: 24px; align-items: center; margin-top: 38px; }
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-width: 230px;
  padding: 17px 20px;
  color: white;
  text-decoration: none;
  background: var(--red);
  border-radius: 999px;
  transition: transform 180ms var(--ease), background 180ms ease;
}
.primary-action:hover { background: #ff2634; transform: translateY(-3px); }
.text-action { color: var(--paper); text-underline-offset: 6px; }

.hero-visual { position: relative; z-index: 1; align-self: end; min-height: 720px; }
.hero-visual::before {
  position: absolute;
  inset: 12% 5% 10%;
  content: "";
  background: radial-gradient(circle, rgba(241, 18, 34, 0.38), transparent 66%);
  filter: blur(20px);
}
.hero-visual img { position: absolute; right: -7%; bottom: 0; width: min(830px, 58vw); max-height: 820px; object-fit: contain; object-position: bottom; transition: transform 420ms var(--ease); }
.visual-index { position: absolute; right: 0; bottom: 42px; padding: 10px 14px; background: rgba(5,5,5,.72); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(12px); }
.hero-ticker { position: absolute; z-index: 3; left: 0; bottom: 0; width: 100%; display: flex; gap: 66px; padding: 20px 3vw; color: var(--muted); border-top: 1px solid var(--line); white-space: nowrap; }
.hero-ticker span::before { content: "✦"; margin-right: 66px; color: var(--red); }

.map-section,
.catalog-section,
.library-section { width: var(--shell); margin: 0 auto; padding: 120px 0; }

.section-heading { max-width: 880px; }
.section-heading h2,
.library-copy h2 { margin: 0; font-size: clamp(52px, 6vw, 104px); line-height: 0.94; text-wrap: balance; }
.section-heading > p:last-child,
.library-copy > p:last-child { max-width: 720px; margin: 24px 0 0; color: var(--muted); font-size: 19px; line-height: 1.55; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.45fr); gap: 18px; margin-top: 52px; }
.map-stage { position: relative; min-height: 720px; overflow: hidden; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: var(--radius); }
.map-stage > img { position: absolute; inset: 5%; width: 90%; height: 90%; object-fit: contain; filter: invert(1); opacity: .13; }
.map-points { position: absolute; inset: 7%; }
.map-point { position: absolute; width: 15px; height: 15px; padding: 0; cursor: pointer; background: var(--paper); border: 3px solid var(--black); border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.5), 0 0 0 0 rgba(241,18,34,0); transition: transform 160ms var(--ease), background 160ms ease, box-shadow 160ms ease; }
.map-point::after { position: absolute; top: -34px; left: 50%; padding: 5px 7px; content: attr(aria-label); color: var(--paper); font-size: 12px; white-space: nowrap; pointer-events: none; background: rgba(5,5,5,.84); border: 1px solid var(--line); border-radius: 6px; opacity: 0; transform: translate(-50%, 5px); transition: 160ms ease; }
.map-point:hover,
.map-point:focus-visible,
.map-point.is-active { z-index: 3; background: var(--red); box-shadow: 0 0 0 8px rgba(241,18,34,.16); outline: none; transform: scale(1.25); }
.map-point:hover::after,
.map-point:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.map-caption { position: absolute; left: 22px; bottom: 18px; margin: 0; color: var(--muted); font-size: 12px; }
.map-detail { position: relative; min-height: 720px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 28px; background: linear-gradient(160deg, rgba(241,18,34,.18), transparent 44%), var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); isolation: isolate; }
.map-detail::after { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(to bottom, rgba(19,19,19,.1) 10%, var(--panel-solid) 60%); }
.map-detail-image { position: absolute; z-index: -2; top: 18px; right: -28%; width: 125%; height: 58%; object-fit: contain; object-position: right top; opacity: .78; filter: saturate(.85) contrast(1.05); transition: transform 360ms var(--ease), opacity 240ms ease; }
.detail-number { color: rgba(244,240,233,.2); font-size: 100px; line-height: 1; }
.map-detail h3 { margin: 0 0 18px; font-size: clamp(42px, 4vw, 72px); line-height: .94; }
.map-detail p[data-map-text] { color: var(--muted); font-size: 17px; line-height: 1.5; }
.map-detail a { display: inline-flex; justify-content: space-between; width: 100%; margin-top: 24px; padding-top: 18px; color: var(--paper); text-decoration: none; border-top: 1px solid var(--line); }

.catalog-section { position: relative; border-top: 1px solid var(--line); isolation: isolate; }
.catalog-section::before { position: absolute; z-index: -2; inset: 120px -8vw 40px; content: ""; pointer-events: none; background: url("../assets/far-east-outline.svg") center 38% / min(940px, 80vw) auto no-repeat; filter: invert(1); opacity: .055; }
.catalog-section::after { position: absolute; z-index: -1; inset: 0; content: ""; pointer-events: none; background: linear-gradient(to bottom, var(--black) 0, transparent 12%, transparent 82%, var(--black) 100%); }
.catalog-head { display: grid; grid-template-columns: 1fr minmax(280px, 400px); gap: 40px; align-items: end; }
.search-field { display: grid; gap: 10px; color: var(--muted); font-size: 13px; }
.search-field input { width: 100%; min-height: 54px; padding: 0 18px; color: var(--paper); background: transparent; border: 1px solid var(--line); border-radius: 999px; outline: none; }
.search-field input:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(241,18,34,.12); }
.people-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 52px; }
.people-card { position: relative; min-height: 390px; display: flex; flex-direction: column; overflow: hidden; padding: 18px; color: var(--paper); text-decoration: none; background: rgba(12,12,12,.54); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(7px); transition: transform 220ms var(--ease), background 180ms ease, border-color 180ms ease; isolation: isolate; }
.people-card::after { position: absolute; z-index: 1; inset: 38% 0 0; content: ""; pointer-events: none; background: linear-gradient(to bottom, transparent, rgba(5,5,5,.84) 46%, rgba(5,5,5,.98) 100%); transition: background 180ms ease; }
.people-card:hover { z-index: 2; background: rgba(241,18,34,.72); border-color: rgba(255,255,255,.3); transform: translateY(-6px) scale(1.012); }
.people-card:hover::after { background: linear-gradient(to bottom, transparent, rgba(113,5,13,.72) 44%, rgba(88,3,10,.95) 100%); }
.people-card .card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.people-card h3 { position: relative; z-index: 2; margin: auto 0 12px; font-size: clamp(25px, 2vw, 36px); line-height: .96; }
.people-card.is-long-name h3 { font-size: clamp(21px, 1.65vw, 30px); }
.people-card p { position: relative; z-index: 2; display: -webkit-box; overflow: hidden; margin: 0; color: rgba(244,240,233,.72); font-size: 13px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.people-card img { position: absolute; right: -24%; bottom: 52px; width: 122%; max-width: none; height: 72%; object-fit: contain; object-position: right bottom; pointer-events: none; filter: saturate(.9) drop-shadow(0 20px 20px rgba(0,0,0,.25)); transition: transform 260ms var(--ease); }
.people-card:hover img { transform: translateY(-6px) scale(1.04); }
.empty-state { color: var(--muted); }

.library-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(60px, 9vw, 150px); border-top: 1px solid var(--line); }
.library-route { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.library-route li { display: grid; grid-template-columns: 60px 1fr; gap: 6px 20px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.library-route li > span { grid-row: 1 / span 2; color: var(--red); }
.library-route strong { font-size: 25px; }
.library-route p { margin: 0; color: var(--muted); line-height: 1.45; }

.beta-footer { width: var(--shell); min-height: 180px; display: grid; grid-template-columns: 1fr auto auto; gap: 32px; align-items: center; margin: 0 auto; padding: 34px 0 max(34px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.beta-footer img { width: 150px; filter: brightness(0) invert(1); }
.beta-footer p { color: var(--muted); }

[data-reveal] { opacity: 0; transform: translateY(30px); transition: opacity 520ms ease, transform 650ms var(--ease); transition-delay: calc(var(--reveal-index, 0) * 25ms); }
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .people-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .beta-hero { grid-template-columns: 1fr .72fr; min-height: 860px; }
  .hero-visual img { right: -30%; width: 72vw; }
}

@media (max-width: 760px) {
  :root { --shell: calc(100% - 24px); --radius: 16px; }
  section[id] { scroll-margin-top: 98px; }
  .beta-header { top: max(8px, env(safe-area-inset-top)); min-height: 66px; grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; }
  .beta-brand img { width: 124px; }
  .beta-header nav { position: absolute; top: calc(100% + 7px); left: 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 10px 5px; background: rgba(5,5,5,.88); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(18px); }
  .beta-header nav a { min-width: 0; font-size: 11px; text-align: center; }
  .beta-mark { max-width: 78px; padding: 7px 8px; overflow: hidden; font-size: 9px; white-space: nowrap; }
  .beta-header.is-compact nav { pointer-events: none; opacity: 0; transform: translateY(-8px); }
  .beta-header nav { transition: opacity 180ms ease, transform 220ms var(--ease); }
  .beta-hero { min-height: 850px; display: block; padding: 170px 18px 80px; }
  .hero-copy h1 { max-width: 100%; font-size: clamp(45px, 12.4vw, 57px); line-height: .88; }
  .hero-intro { max-width: 92%; margin-top: 28px; font-size: 17px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; margin-top: 26px; }
  .hero-visual { position: absolute; inset: auto -26% 34px 24%; min-height: 430px; opacity: .66; }
  .hero-visual img { right: 0; width: 125vw; max-height: 500px; }
  .visual-index { right: 20%; bottom: 58px; }
  .hero-ticker { gap: 32px; overflow: hidden; padding: 15px 16px; font-size: 12px; }
  .hero-ticker span::before { margin-right: 32px; }
  .map-section, .catalog-section, .library-section { padding: 82px 0; }
  .section-heading h2, .library-copy h2 { font-size: clamp(44px, 14vw, 68px); }
  .section-heading > p:last-child, .library-copy > p:last-child { font-size: 16px; }
  .map-layout { grid-template-columns: 1fr; }
  .map-stage { min-height: 520px; }
  .map-detail { min-height: 360px; }
  .map-detail-image { right: -12%; width: 86%; height: 72%; opacity: .52; }
  .detail-number { font-size: 70px; }
  .catalog-head { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 32px; }
  .people-card { min-height: 285px; padding: 12px; }
  .people-card h3 { font-size: clamp(20px, 5.5vw, 24px); }
  .people-card.is-long-name h3 { font-size: clamp(17px, 4.7vw, 20px); }
  .people-card p { font-size: 12px; -webkit-line-clamp: 4; }
  .people-card img { right: -34%; bottom: 56px; width: 146%; height: 70%; }
  .library-section { grid-template-columns: 1fr; gap: 42px; }
  .beta-footer { grid-template-columns: 1fr; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
