:root {
  --background: #11151a;
  --panel: #181e25;
  --panel-light: #202832;
  --text: #f7f8fa;
  --text-soft: #c6ccd4;
  --text-muted: #8993a0;
  --line: rgba(255, 255, 255, 0.1);
  --yellow: #f4cf2c;
  --green: #4fcf9b;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] {
  --background: #f4f5f2;
  --panel: #ffffff;
  --panel-light: #f3f5f1;
  --text: #161b21;
  --text-soft: #505b67;
  --text-muted: #7b8590;
  --line: rgba(20, 27, 34, 0.11);
  --shadow: 0 18px 45px rgba(40, 48, 58, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Inter, sans-serif;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.series-page {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: auto;
  display: flex;
  flex-direction: column;
}

.series-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(16px);
}

.series-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 20px;
  font-weight: 900;
}

.series-brand b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #11151a;
}

.series-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.series-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.series-nav a {
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  transition: background 0.16s ease, color 0.16s ease;
}

.series-nav a:hover {
  color: var(--text);
  background: var(--panel-light);
}

.series-nav a.is-active {
  background: var(--yellow);
  color: #11151a;
}

.series-nav-icon {
  display: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.series-nav-icon .nav-icon-fill {
  fill: currentColor;
  stroke: none;
}

.series-theme-toggle {
  width: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

main { flex: 1; }

.series-intro {
  padding: 68px 0 34px;
  text-align: center;
}

.series-intro > span {
  color: var(--yellow);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.series-intro h1 {
  margin: 9px 0 10px;
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -0.055em;
}

.series-intro p {
  margin: auto;
  color: var(--text-soft);
  font-size: 12px;
}

.series-grid {
  width: min(100%, 980px);
  margin: 0 auto 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.series-filters {
  width: min(100%, 980px);
  margin: 0 auto 18px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.series-filters > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.series-filters strong {
  color: var(--text);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.filter-options {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.filter-options button {
  min-height: 31px;
  padding: 0 11px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-light);
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 850;
  cursor: pointer;
}

.filter-options button.is-active {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #11151a;
}

.series-choice {
  min-width: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.series-choice.is-locked { opacity: 0.65; }

.series-choice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.series-choice-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--panel-light);
  font-size: 24px;
}

.series-choice-status {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--panel-light);
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.is-available .series-choice-status {
  background: color-mix(in srgb, var(--green) 13%, transparent);
  color: var(--green);
}

.series-choice-copy h2 {
  margin: 0 0 7px;
  font-size: 18px;
}

.series-choice-tags {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.series-choice-tags span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 7px;
  font-weight: 800;
}

.series-choice-copy p {
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.55;
}

.series-choice-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.series-choice-metrics > span {
  min-width: 0;
  padding: 9px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
  background: var(--panel-light);
}

.series-choice-metrics small {
  color: var(--text-muted);
  font-size: 7px;
  font-weight: 850;
  text-transform: uppercase;
}

.series-choice-metrics strong {
  color: var(--text);
  font-size: 12px;
}

.series-choice > a,
.series-choice > button {
  min-height: 42px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: var(--yellow);
  color: #11151a;
  font-size: 10px;
  font-weight: 900;
}

.series-choice > button {
  background: var(--panel-light);
  color: var(--text-muted);
}

.series-loading {
  grid-column: 1 / -1;
  color: var(--text-muted);
  text-align: center;
}

.footer-road-message {
  min-height: 68px;
  margin-top: 42px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;

  border-bottom: 1px solid var(--line);

  color: var(--text);
  font-size: 14px;
}

.footer-road-message strong { font-weight: 800; }

.footer-road-line {
  min-width: 80px;
  height: 26px;
  padding: 0 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  border-radius: 999px;
  background: var(--panel-light);
}

.footer-road-line span {
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: var(--yellow);
}

.site-footer {
  min-height: 94px;
  padding: 24px 0 30px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;

  color: var(--text-muted);
  font-size: 12px;
}

.footer-brand { justify-self: start; }

.footer-logo-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.footer-logo-text {
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.07em;
}

.footer-logo-badge {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #11151a;
  font-size: 15px;
  font-weight: 950;
}

.site-footer p {
  margin: 0;
  text-align: center;
}

.footer-credit {
  justify-self: end;
  text-align: right !important;
}

.footer-credit a {
  color: var(--yellow);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 700px) {
  .series-page { width: calc(100% - 20px); }
  .series-header { min-height: 58px; }
  .series-brand { font-size: 16px; }
  .series-brand b { width: 30px; height: 30px; }
  .series-nav { gap: 2px; padding: 3px; border-radius: 12px; }
  .series-nav a { width: 34px; min-height: 30px; padding: 0; border-radius: 9px; }
  .series-nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .series-nav-icon { display: block; }
  .series-header-actions { gap: 6px; }
  .series-theme-toggle { width: 36px; min-height: 36px; border-radius: 10px; }
  .series-intro { padding: 42px 8px 24px; }
  .series-intro h1 { font-size: 34px; }
  .series-grid { grid-template-columns: 1fr; gap: 12px; }
  .series-filters { padding: 12px; grid-template-columns: 1fr; gap: 12px; }
  .series-choice { padding: 17px; border-radius: 16px; }
  .site-footer {
    min-height: 0;
    padding: 22px 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
  }
  .footer-brand,
  .footer-credit {
    justify-self: auto;
    text-align: center !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media (orientation: landscape) and (max-height: 500px) and (min-width: 500px) {
  .series-header { min-height: 54px; }
  .series-intro { padding: 22px 8px 16px; }
  .series-intro h1 { margin: 5px 0 6px; font-size: 27px; }
  .series-intro p { font-size: 10px; }
}
