:root {
  --bg: #050505;
  --bg-soft: #0d0f12;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f0e8;
  --muted: rgba(244, 240, 232, 0.7);
  --accent: #f3b26c;
  --accent-soft: rgba(243, 178, 108, 0.14);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(243, 178, 108, 0.14), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(90, 123, 255, 0.12), transparent 22%),
    linear-gradient(180deg, #060606, #090b0f 28%, #050505 100%);
  font-family: "Manrope", sans-serif;
}

a {
  color: inherit;
}

.paper-link {
  text-decoration: none;
}

button {
  font: inherit;
}

code {
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.page-shell {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
  padding-bottom: 72px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.82), rgba(5, 5, 5, 0.28));
}

.brand {
  text-decoration: none;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.toc-shell {
  position: sticky;
  top: 104px;
}

.toc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: var(--shadow);
}

.toc-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc {
  display: grid;
  gap: 10px;
}

.toc a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  transition: background-color 160ms ease, color 160ms ease;
}

.toc a:hover,
.toc a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.article {
  display: grid;
  gap: 46px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 36px;
  padding: 32px 0 10px;
}

.hero-heading {
  grid-column: 1 / -1;
}

.eyebrow,
.kicker {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.content-block h2 {
  margin: 12px 0 0;
  font-family: "Cormorant Garamond", serif;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero h1 {
  font-size: clamp(3rem, 5vw, 4.8rem);
  font-weight: 600;
  max-width: none;
  white-space: nowrap;
}

.content-block h2 {
  max-width: min(1200px);
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  font-weight: 600;
  margin: 8px 0 12px;
}

.hero-subtitle {
  margin: 4px 0 0;
  color: rgba(244, 240, 232, 0.78);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  font-size: 1.28rem;
  line-height: 1.35;
}

.hero-lead,
.content-block p,
.section-note,
.hero-caption {
  color: var(--muted);
  line-height: 1.9;
}

.hero-lead {
  margin: 0;
  max-width: 760px;
  font-size: 1.08rem;
}

.hero-copy {
  align-self: start;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.lang-pill {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.lang-pill.is-active {
  color: #111;
  background: linear-gradient(135deg, #f8d39c, #f0ab62);
}

.lang-panel {
  display: none;
}

.lang-panel.is-active {
  display: block;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 18px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
}

.button-primary {
  color: #111;
  background: linear-gradient(135deg, #f8d39c, #f0ab62);
  border-color: transparent;
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.hero-media {
  align-self: end;
}

.hero-video-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #000;
  box-shadow: var(--shadow);
}

.hero-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.hero-play {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  color: #111;
  background: rgba(244, 240, 232, 0.94);
  cursor: pointer;
}

.content-block {
  display: grid;
  gap: 20px;
  padding: 6px 0;
}

.content-block p {
  max-width: 860px;
  margin: 0;
  font-size: 1.05rem;
}

.content-block .kicker {
  display: inline-block;
  max-width: 860px;
  margin-bottom: 2px;
}

.insert-note {
  display: inline-flex;
  width: fit-content;
  padding: 10px 14px;
  border: 1px dashed rgba(243, 178, 108, 0.48);
  border-radius: 999px;
  background: var(--accent-soft);
  color: rgba(244, 240, 232, 0.88);
}

.framework-figure {
  margin: 10px 0 2px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: calc(var(--radius-xl) + 2px);
  background:
    radial-gradient(circle at top left, rgba(88, 147, 255, 0.12), transparent 34%),
    radial-gradient(circle at 82% 16%, rgba(93, 224, 199, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
}

.framework-figure-body {
  box-sizing: border-box;
  width: min(100%, 860px);
}

.framework-embed {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius-xl) - 2px);
  background: #08111b;
}

.framework-video {
  object-fit: contain;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.framework-caption {
  margin-top: 12px;
  color: rgba(244, 240, 232, 0.72);
  line-height: 1.75;
  font-size: 0.95rem;
}

.media-block {
  display: grid;
  gap: 12px;
  width: min(100%, 860px);
  margin-top: 12px;
}

.media-block > .inline-visual-grid,
.media-block > .transfer-carousel,
.media-block > .framework-figure {
  width: 100%;
  max-width: none;
  margin-top: 0;
}

.media-caption {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  color: rgba(244, 240, 232, 0.72);
  line-height: 1.75;
  font-size: 0.93rem;
  text-align: center;
  text-wrap: balance;
}

.rank-sep {
  display: inline-block;
  margin: 0 0.16em;
  color: #f3b26c;
  font-weight: 800;
  font-size: 1.12em;
  line-height: 1;
  letter-spacing: 0.02em;
  transform: translateY(-0.02em);
  text-shadow: 0 0 10px rgba(243, 178, 108, 0.22);
}

.rank-sep-strong {
  font-size: 1.22em;
  letter-spacing: 0.08em;
}

.video-card {
  position: relative;
  cursor: pointer;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  background: #030406;
  overflow: hidden;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.video-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--video-pos, 50% 50%);
  background: #000;
  transform: scale(1.025);
  transition: transform 180ms ease;
}

.video-card:hover video {
  transform: scale(1.055);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 6px;
}

.video-grid-wide {
  align-items: stretch;
}

.inline-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 860px;
  margin-top: 0;
}

.transfer-carousel {
  width: 100%;
  max-width: 860px;
  margin-top: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: calc(var(--radius-xl) + 2px);
  background:
    radial-gradient(circle at top left, rgba(88, 147, 255, 0.1), transparent 34%),
    radial-gradient(circle at 82% 16%, rgba(93, 224, 199, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
  outline: none;
}

.transfer-carousel:focus-visible {
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(243, 178, 108, 0.6);
}

.transfer-carousel-viewport {
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - 2px);
  background: #000;
  aspect-ratio: var(--transfer-aspect, 1710 / 486);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.transfer-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 320ms ease;
  will-change: transform;
}

.transfer-slide {
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  background: #000;
}

.transfer-slide video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.transfer-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.transfer-carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.transfer-carousel-arrow:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
}

.transfer-carousel-arrow span {
  font-size: 1.18rem;
  line-height: 1;
}

.transfer-carousel-status {
  flex: 1;
  text-align: center;
  color: rgba(244, 240, 232, 0.72);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.video-card {
  aspect-ratio: 1.86 / 1;
  min-height: 0;
  padding: 0;
}

.video-card-inline {
  aspect-ratio: 1.74 / 1;
}

.video-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 11, 0.04) 0%, rgba(5, 7, 11, 0) 26%, rgba(5, 7, 11, 0.84) 100%),
    linear-gradient(90deg, rgba(5, 7, 11, 0.08) 0%, rgba(5, 7, 11, 0) 40%);
}

.video-card-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 15px;
  z-index: 1;
  display: grid;
  gap: 4px;
}

.video-card-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.48rem;
  font-weight: 600;
}

.video-card-meta {
  color: rgba(244, 240, 232, 0.64);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.video-card-note {
  color: rgba(244, 240, 232, 0.82);
  font-size: 0.9rem;
}

.video-card-inline .video-card-copy {
  display: none;
  left: 12px;
  right: 12px;
  bottom: 12px;
  gap: 2px;
}

.video-card-inline .video-card-title {
  font-size: 1.2rem;
}

.video-card-inline .video-card-meta {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
}

.video-card-inline .video-card-note {
  font-size: 0.8rem;
  line-height: 1.35;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  text-decoration: none;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.video-modal.is-open {
  display: block;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 3, 4, 0.8);
  backdrop-filter: blur(10px);
}

.video-modal-dialog {
  position: relative;
  width: min(1180px, calc(100vw - 32px));
  margin: min(5vh, 32px) auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #0a0d11;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.video-modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.video-modal-close {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.video-modal-body {
  background: #000;
}

.video-modal-body video {
  display: block;
  width: 100%;
  max-height: 78vh;
  background: #000;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .toc-shell {
    position: static;
  }

  .toc-card {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-visual-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 22px, 1440px);
  }

  .site-header {
    padding: 16px 0;
  }

  .header-links {
    gap: 12px;
    font-size: 0.9rem;
  }

  .hero {
    gap: 22px;
  }

  .hero h1 {
    white-space: normal;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .media-block {
    gap: 10px;
  }

  .media-caption {
    padding: 0 10px;
  }

  .framework-figure {
    padding: 10px;
  }

  .lang-switch {
    flex-wrap: wrap;
    border-radius: 18px;
  }

  .video-card {
    aspect-ratio: 16 / 10;
  }
}
