:root {
  --bg0: #f3f5f7;
  --bg1: #ffffff;
  --ink: #152028;
  --muted: #5c6b76;
  --line: rgba(21, 32, 40, 0.1);
  --accent: #b86a1f;
  --accent-2: #0b7f6c;
  --danger: #c23b2e;
  --panel: #ffffff;
  --panel-soft: #f7f9fa;
  --shadow: 0 14px 40px rgba(21, 32, 40, 0.08);
  --radius: 16px;
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--bg0);
}

body {
  display: flex;
  flex-direction: column;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(11, 127, 108, 0.1), transparent 55%),
    radial-gradient(800px 480px at 92% 0%, rgba(184, 106, 31, 0.09), transparent 50%),
    linear-gradient(180deg, #eef2f5 0%, #f3f5f7 45%, #f7f8fa 100%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem 1.25rem;
  padding: 0.75rem clamp(1rem, 2vw, 2rem);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.82);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  display: block;
  width: 46px;
  height: 39px;
  object-fit: contain;
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.1;
}

.shell {
  flex: 1 0 auto;
  width: 100%;
  margin: 0;
  padding: 1.5rem clamp(1rem, 2vw, 2rem) 4rem;
}

.seo-intro {
  width: 100%;
  max-width: none;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.seo-long {
  width: 100%;
  max-width: none;
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.seo-long p {
  margin: 0 0 0.95rem;
}

.seo-long p:last-child {
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.4rem;
  margin-bottom: 1rem;
}

#type-switcher-group {
  margin-left: auto;
  text-align: right;
}

#type-switcher-group .switcher {
  justify-content: flex-end;
}

.switcher-group {
  display: grid;
  gap: 0.4rem;
}

.switcher-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font: 600 0.8rem/1 var(--font-body);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.chip:hover {
  color: var(--ink);
  border-color: rgba(11, 127, 108, 0.3);
}

.chip.active {
  color: #fff;
  background: var(--accent-2);
  border-color: transparent;
}

.stage {
  min-height: 280px;
  animation: rise 0.55s ease both;
}

.loading-state,
.empty-state,
.error-state,
.soon-state {
  padding: 2rem 0;
  color: var(--muted);
}

.error-state {
  color: var(--danger);
}

.soon-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg1);
  padding: 1.4rem 1.2rem;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.series-tile {
  appearance: none;
  text-decoration: none;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--bg1);
  border-radius: 16px;
  padding: 0.75rem 0.7rem 0.85rem;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
  min-height: 176px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
}

.series-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(11, 127, 108, 0.4);
  box-shadow: var(--shadow);
}

.series-tile.is-open {
  border-color: rgba(184, 106, 31, 0.55);
  box-shadow: var(--shadow);
}

.series-tile-media {
  width: 100%;
  aspect-ratio: 16 / 11;
  min-height: 104px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 0.55rem 0.55rem 0.75rem;
  box-sizing: border-box;
}

.series-tile-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.series-tile-fallback {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--muted);
}

.series-tile .name {
  font-weight: 700;
  font-size: 0.98rem;
  text-align: center;
  width: 100%;
  line-height: 1.25;
}

.series-tile-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.series-panel {
  display: none;
  grid-column: 1 / -1;
  scroll-margin-top: 5.5rem;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 16px;
  padding: 0.9rem 0.85rem 1rem;
  animation: rise 0.28s ease both;
}

.series-panel.is-open {
  display: block;
}

.series-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.series-panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
}

.series-panel-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.65rem;
}

.card-btn {
  appearance: none;
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--bg1);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
}

.card-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 106, 31, 0.45);
  box-shadow: var(--shadow);
}

.card-btn .media {
  aspect-ratio: 16 / 10;
  height: 96px;
  max-height: 96px;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-btn .media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card-btn .body {
  padding: 0.55rem 0.7rem 0.7rem;
}

.card-btn h3 {
  margin: 0;
  font-size: 0.9rem;
  font-family: var(--font-display);
}

.card-btn p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.foot {
  margin-top: auto;
  padding: 1.5rem clamp(1rem, 2vw, 2rem) 2rem;
  border-top: 1px solid var(--line);
}

.foot-title {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: inherit;
  text-decoration: none;
}

.foot-title:hover {
  color: var(--accent-2);
}

.foot p {
  max-width: 42rem;
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.foot p a {
  color: inherit;
  font-weight: 600;
}

.foot p a:hover {
  color: var(--accent-2);
}
