:root {
  color-scheme: light;
  --ink: #132238;
  --muted: #526273;
  --paper: #f4f7f5;
  --panel: #ffffff;
  --panel-soft: #eef5f1;
  --line: #d7e1dc;
  --mint: #168b6b;
  --coral: #d95a42;
  --gold: #b98019;
  --sea: #116d7d;
  --shadow: 0 18px 45px rgba(19, 34, 56, 0.09);
  --header: rgba(244, 247, 245, 0.9);
}

:root[data-theme="night"] {
  color-scheme: dark;
  --ink: #eef6f3;
  --muted: #a9b8c1;
  --paper: #0c1420;
  --panel: #121e2b;
  --panel-soft: #182737;
  --line: #27384a;
  --mint: #39c99a;
  --coral: #ff8069;
  --gold: #f0b84f;
  --sea: #53bfd0;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  --header: rgba(12, 20, 32, 0.9);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  transition: background 180ms ease, color 180ms ease;
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.language-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.language-select {
  min-height: 38px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

nav a {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

nav a[aria-current="page"], nav a:hover {
  color: var(--ink);
  background: var(--panel-soft);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--sea);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(19, 34, 56, 0.08);
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-moon { display: none; }

:root[data-theme="night"] .icon-sun { display: none; }
:root[data-theme="night"] .icon-moon { display: block; }

.theme-toggle:hover,
.language-select:hover {
  border-color: var(--sea);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(18px, 4vw, 38px);
  align-items: center;
  margin: 24px 0 28px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-visual {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1b2a;
}

.hero-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.06) contrast(1.02);
}

.hero-copy {
  display: grid;
  align-content: center;
  min-height: 300px;
}

.eyebrow, .kicker {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow { color: var(--sea); }

h1, h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2.8rem, 6.4vw, 5.6rem);
}

h2 { font-size: clamp(1.35rem, 2.2vw, 2rem); }

p { color: var(--muted); }

.hero p:not(.eyebrow) {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.button, .large-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 6px;
  background: var(--mint);
  color: white;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, filter 160ms ease;
}

.button + .button { background: var(--coral); }
.button:hover, .large-link:hover { transform: translateY(-1px); filter: brightness(1.05); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

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

.guide-card, .panel {
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.guide-card h2, .panel h2 { margin-bottom: 10px; }

.guide-card p, .panel p { margin: 0 0 18px; }

.guide-card a {
  color: var(--sea);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.band, .sources, .timeline {
  margin: 28px 0;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

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

.stat {
  min-height: 96px;
  padding: 16px;
  border-left: 4px solid var(--gold);
  background: var(--panel-soft);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.16rem;
}

.steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.steps span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sea);
  color: white;
  font-weight: 800;
}

.link-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.source-link {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  background: var(--panel-soft);
}

.source-link:hover { border-color: var(--sea); }
.source-link span { color: var(--muted); }

.code-table {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.code-row {
  display: grid;
  grid-template-columns: 180px 170px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

code {
  padding: 3px 6px;
  border-radius: 4px;
  background: #172033;
  color: #f8faf7;
  white-space: nowrap;
}

.note {
  margin-top: 16px;
  color: var(--gold);
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:first-child { padding-top: 0; }
.timeline-item:last-child { border-bottom: 0; padding-bottom: 0; }

.timeline-item time {
  color: var(--sea);
  font-weight: 800;
}

.sources ul {
  columns: 2;
  padding-left: 18px;
}

.sources li { margin: 8px 0; break-inside: avoid; }

@media (max-width: 820px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; align-items: flex-start; flex-direction: column; }
  nav { justify-content: flex-start; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .language-label { width: 100%; justify-content: space-between; }
  h1 { font-size: clamp(2.7rem, 14vw, 4.8rem); }
  .grid, .two, .split, .stat-grid, .timeline-item, .code-row {
    grid-template-columns: 1fr;
  }
  .large-link { width: 100%; }
  .sources ul { columns: 1; }
}
