:root {
  color-scheme: dark;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #e7f2ff;
  background: #080d16;
  --cyan: #66e4ff;
  --muted: #91a6bb;
  --line: #244052;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, #122536 0, #0b1420 38%, #080d16 76%);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(#47708a12 1px, transparent 1px),
    linear-gradient(90deg, #47708a12 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(transparent, #000 20%, #000 85%, transparent);
  pointer-events: none;
}

.masthead {
  width: min(100% - 3rem, 88rem);
  margin: 0 auto;
  padding: 2rem 0 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #27404e;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #e7f2ff;
  font-size: .88rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  color: var(--cyan);
  filter: drop-shadow(0 0 6px #66e4ff45);
}

.edition {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

main { padding: clamp(2.5rem, 7vh, 5rem) 0 2.5rem; }

.intro {
  width: min(100% - 3rem, 88rem);
  margin: 0 auto 2.4rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 .75rem;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 850;
  letter-spacing: -.065em;
  line-height: .98;
  text-transform: uppercase;
  text-shadow: 0 0 42px #58dfff24;
}

.logo-neon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(68%, 28rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(.35rem, 1.5vw, 1.5rem);
  width: min(100%, 56rem);
  margin: 0 auto;
  color: #ff405e;
  animation: neon-cycle 12s linear infinite;
}

.title-art {
  grid-column: 2;
  grid-row: 1;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 3px currentColor) drop-shadow(0 0 14px currentColor);
}

.title-art > g {
  fill: #ecf6ff;
  stroke: currentColor;
}

.logo-circuit {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 5px currentColor);
}

.logo-circuit--left { grid-column: 1; grid-row: 1; }
.logo-circuit--right { grid-column: 3; grid-row: 1; transform: scaleX(-1); }

.logo-circuit .trace { opacity: .4; }
.logo-circuit .node { fill: currentColor; }
.logo-circuit .flow {
  stroke-width: 2;
  stroke-dasharray: 10 90;
  animation: circuit-flow 3s linear infinite;
  animation-delay: calc(var(--i) * -.8s);
}

@keyframes neon-cycle {
  0%, 100% { color: #ff405e; }
  33.333% { color: #408aff; }
  66.667% { color: #36ff8b; }
}

@keyframes circuit-flow {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

.archive {
  position: relative;
  padding: 1rem 0 2.2rem;
  border-top: 1px solid #1c3442;
  border-bottom: 1px solid #1c3442;
  background: linear-gradient(180deg, #0b1420a8, #0a111b80);
}

.character-name {
  display: block;
  color: #f0f8ff;
  font-size: .95rem;
  font-weight: 750;
  line-height: 1.2;
}

.character-title {
  display: block;
  margin-top: .3rem;
  color: #98afc1;
  font-size: .74rem;
  line-height: 1.3;
}

.section-heading {
  width: min(100% - 3rem, 88rem);
  margin: 0 auto 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.card-count, .interaction-hint {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.carousel-shell { position: relative; }

.carousel {
  overflow-x: auto;
  padding: 1.3rem max(1.5rem, calc((100vw - 88rem) / 2)) 1.8rem;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

.carousel::-webkit-scrollbar { display: none; }

.track {
  width: max-content;
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2.1vw, 1.7rem);
}

.character-card {
  position: relative;
  width: clamp(12.5rem, 21vw, 17rem);
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid #385266;
  border-radius: .55rem;
  background: linear-gradient(145deg, #182a39, #0c1520 72%);
  box-shadow: 0 18px 42px #0007, inset 0 1px #b5e9ff12;
  cursor: pointer;
  transform: scale(1);
  transition: border-color .25s ease, box-shadow .25s ease, transform .35s ease;
}

.character-card:hover {
  z-index: 1;
  border-color: var(--cyan);
  box-shadow: 0 24px 54px #000a, 0 0 24px #54dbff24;
  transform: translateY(-.25rem) scale(1.04);
}

.character-card img {
  width: 100%;
  height: auto;
  display: block;
  background: #111d29;
}

.card-caption {
  min-height: 4.2rem;
  padding: .8rem .9rem .9rem;
  border-top: 1px solid #294151;
}

.character-name {
  display: block;
  color: #f0f8ff;
  font-size: .95rem;
  font-weight: 750;
  line-height: 1.2;
}

.character-title {
  display: block;
  margin-top: .3rem;
  color: #98afc1;
  font-size: .74rem;
  line-height: 1.3;
}

.card-description {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: .8rem .9rem 1rem;
  border-top: 1px solid #66e4ff70;
  color: #e7f2ff;
  background: linear-gradient(180deg, #0c1824eb, #080d16f5);
  font-size: .76rem;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity .25s ease, transform .3s ease, visibility .3s ease;
  visibility: hidden;
}

.character-card:hover .card-description,
.character-card:focus-within .card-description {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.card-description {
  z-index: 2;
  pointer-events: none;
}

.character-link {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  color: inherit;
  text-decoration: none;
}

.character-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.carousel-control {
  position: absolute;
  z-index: 2;
  top: 42%;
  width: 4.5rem;
  height: 5.5rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--cyan);
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 0 10px #43dcff40);
  transition: color .2s ease, filter .2s ease, transform .2s ease;
}

.carousel-control:hover, .carousel-control:focus-visible {
  color: #d3f8ff;
  filter: drop-shadow(0 0 16px #43dcffbb);
  outline: none;
  transform: scale(1.12);
}

.carousel-control:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; }
.carousel-control svg { width: 4.2rem; height: 4.2rem; overflow: visible; }
.carousel-control--left { left: .15rem; }
.carousel-control--right { right: .15rem; }
.carousel-control--left svg { transform: rotate(180deg); }
.chip-fill { fill: #091724f5; stroke: currentColor; stroke-width: 1.5; }
.chip-trace { fill: none; stroke: currentColor; stroke-linecap: square; stroke-width: 1.5; }
.chip-die { fill: #163848; stroke: currentColor; stroke-width: .7; }
.chip-arrow { fill: none; stroke: currentColor; stroke-width: 3; stroke-linejoin: bevel; }
.chip-node { fill: #b9f5ff; }
.carousel-control:hover .chip-die { fill: #236078; }
.carousel { touch-action: pan-x pan-y; cursor: grab; }
.carousel.is-dragging, .carousel.is-dragging .character-card {
  cursor: grabbing;
  user-select: none;
}

.interaction-hint {
  width: min(100% - 3rem, 88rem);
  margin: .5rem auto .7rem;
  text-align: center;
}

.asset-links {
  width: min(100% - 3rem, 88rem);
  margin: 0 auto 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem;
}

.asset-link {
  padding: .45rem .7rem;
  border: 1px solid #294151;
  border-radius: 999px;
  color: #bcefff;
  background: #101e2b;
  font-size: .72rem;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.asset-link:hover, .asset-link:focus-visible {
  border-color: var(--cyan);
  color: #fff;
  background: #163144;
  outline: none;
}


/* Shared navigation and image grids. */
.masthead { position: relative; padding: 1.2rem 0; gap: 1rem; }
.brand-navigation { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.menu-toggle { display: grid; place-items: center; flex: 0 0 auto; padding: .25rem; border: 0; background: transparent; cursor: pointer; }
.menu-toggle:hover, .menu-toggle[aria-expanded="true"] { filter: drop-shadow(0 0 7px #66e4ff80); }
.menu-toggle:focus-visible, .art-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; min-width: 0; }
.breadcrumb-current { color: #a7bbce; font-size: .85rem; }
.breadcrumb-current::before { content: "/"; margin-right: .6rem; color: #47677d; }
.site-menu { position: absolute; z-index: 10; left: 0; top: calc(100% + .5rem); width: min(19rem, 100%); padding: .5rem; border: 1px solid #385266; border-radius: .6rem; background: #0d1a28; box-shadow: 0 18px 48px #0009; }
.site-menu a { display: block; padding: .7rem .9rem; border-radius: .3rem; color: #c6d9e8; font-size: .88rem; text-decoration: none; }
.site-menu a:hover, .site-menu a:focus-visible, .site-menu a[aria-current] { background: #183246; color: #a8eeff; }
.logo-home { display: block; color: inherit; text-decoration: none; }
body:not([data-view="home"]) main { padding: 1.25rem 0 2.5rem; }
body:not([data-view="home"]) .season-menu { display: none; }
.season-menu { flex: none; }
.season-menu summary {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.5rem;
  padding: .45rem .8rem;
  border: 1px solid #385266;
  border-radius: .4rem;
  background: #0d1a28;
  color: #e7f2ff;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
}
.season-menu summary::-webkit-details-marker { display: none; }
.season-menu summary::after {
  flex: none;
  width: .42rem;
  height: .42rem;
  border: solid var(--cyan);
  border-width: 0 2px 2px 0;
  transform: translateY(-.12rem) rotate(45deg);
  content: "";
}
.season-menu[open] summary::after { transform: translateY(.12rem) rotate(225deg); }
.season-menu summary:hover, .season-menu[open] summary { border-color: var(--cyan); color: var(--cyan); }
.season-menu summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.season-links { left: auto; right: 0; width: min(10rem, 100%); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.gallery-toolbar { width: min(100% - 3rem, 88rem); margin: 0 auto 1.2rem; display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1.5rem; }
.gallery-toolbar h2 { margin: 0; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.group-selection, .sort-selection { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: #a7bbce; }
.group-selection { margin-left: auto; }
.group-filter, .sort-select { max-width: 100%; padding: .6rem 2rem .6rem .7rem; border: 1px solid #385266; border-radius: .35rem; background: #101e2b; color: #e7f2ff; font: inherit; }
.group-filter:focus-visible, .sort-select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.group-filter, .sort-select { color-scheme: dark; }
.group-filter option, .sort-select option { background: #101e2b; color: #e7f2ff; }

/* Render the picker in-page where supported, keeping native keyboard handling. */
@supports (appearance: base-select) {
  .group-filter, .sort-select { appearance: base-select; gap: .7rem; padding-inline: .7rem; }
  .group-filter::picker(select), .sort-select::picker(select) {
    appearance: base-select;
    max-height: min(24rem, 60vh);
    max-width: calc(100vw - 2rem);
    overflow: auto;
    margin-block-start: .35rem;
    padding: .3rem;
    border: 1px solid #385266;
    border-radius: .4rem;
    color: #e7f2ff;
    background: #101e2b;
    box-shadow: 0 12px 30px #0008;
    animation: none;
    transition: none;
  }
  .group-filter option, .sort-select option { padding: .6rem .8rem; border-radius: .25rem; }
  .group-filter option:hover, .group-filter option:focus, .group-filter option:checked,
  .sort-select option:hover, .sort-select option:focus, .sort-select option:checked {
    color: #e7faff;
    background: #234157;
  }
  .group-filter::picker-icon, .sort-select::picker-icon { color: var(--cyan); }
}
.card-count, .asset-archive-count { margin: 0; color: var(--muted); font-size: .75rem; }
.card-grid, .asset-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); align-items: start; gap: clamp(.8rem, 1.8vw, 1.5rem); }
.card-grid { width: min(100% - 3rem, 88rem); margin: 0 auto; }
.art-card { display: block; min-width: 0; width: 100%; padding: 0; border: 0; border-radius: .2rem; background: transparent; color: inherit; cursor: zoom-in; }
.art-card img { display: block; width: 100%; height: auto; border-radius: inherit; }
.art-card:hover { filter: drop-shadow(0 0 8px #66e4ff45); }
.archive-toolbar { width: 100%; }
.archive-toolbar .group-selection { margin-left: 0; }
.archive-toolbar .asset-archive-count { margin-left: auto; }
.sorting-note { margin: -.35rem 0 1rem; color: var(--muted); font-size: .75rem; }
.viewer-open { overflow: hidden; }
.art-viewer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #050a12f7; color: #e7f2ff; }
.art-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.art-viewer::backdrop { background: #050a12; }
.viewer-toolbar { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid #244052; font-size: .85rem; }
.viewer-profile { margin-left: auto; color: var(--cyan); text-decoration: none; }
.viewer-image-wrap { min-height: 0; display: flex; justify-content: center; align-items: center; padding: .75rem 3.5rem; }
.viewer-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.viewer-close, .viewer-previous, .viewer-next { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; padding: 0; border: 1px solid #385266; border-radius: .4rem; background: #102334; color: #bcefff; font: inherit; font-size: 1.8rem; cursor: pointer; }
.viewer-previous, .viewer-next { position: absolute; top: 50%; }
.viewer-previous { left: .4rem; }
.viewer-next { right: .4rem; }
.viewer-previous:disabled, .viewer-next:disabled { opacity: .3; cursor: default; }
.viewer-close:focus-visible, .viewer-previous:focus-visible, .viewer-next:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

[hidden] { display: none !important; }

.character-profile {
  width: min(100% - 3rem, 88rem);
  margin: 0 auto;
}

.profile-back {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.4rem;
  padding: .65rem .9rem;
  border: 1px solid #385266;
  border-radius: .35rem;
  color: #bcefff;
  background: #101e2b;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}

.profile-back:hover, .profile-back:focus-visible {
  border-color: var(--cyan);
  color: #fff;
  outline: none;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 24rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 4vw, 3.5rem);
}

.profile-identity, .portfolio-panel, .sheet-card {
  border: 1px solid #294151;
  border-radius: .55rem;
  background: linear-gradient(145deg, #142333, #0b131e 80%);
  box-shadow: 0 18px 42px #0005;
}

.profile-identity { overflow: hidden; }

.profile-card-image {
  width: 100%;
  height: auto;
  display: block;
  background: #111d29;
}

.profile-card-caption { padding: 1rem 1.1rem 1.1rem; }
.profile-card-caption .character-name { font-size: 1.25rem; }
.profile-card-caption .character-title { font-size: .82rem; }

.portfolio-panel {
  margin-top: .9rem;
  padding: 1.1rem;
}

.profile-kicker, .sheet-kicker {
  margin: 0 0 .45rem;
  color: var(--cyan);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.portfolio-panel p:last-child {
  margin: 0;
  color: #c0d0df;
  font-size: .9rem;
  line-height: 1.65;
}

.profile-ability {
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid #294151;
  color: #95adbf;
  font-size: .8rem;
}

.profile-ability strong { color: #e4f6ff; }

.profile-artwork h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  letter-spacing: -.025em;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.sheet-card { overflow: hidden; }

.sheet-card h3 {
  margin: 0;
  padding: .75rem .9rem;
  border-bottom: 1px solid #294151;
  color: #eaf6ff;
  font-size: .82rem;
}

.sheet-image-wrap {
  min-height: 12rem;
  display: grid;
  place-items: center;
  padding: .65rem;
  background: #080e17;
}

.sheet-image {
  width: 100%;
  max-height: 28rem;
  display: block;
  object-fit: contain;
}

.sheet-unavailable {
  margin: 0;
  padding: 2rem 1rem;
  color: #91a6bb;
  font-size: .8rem;
  text-align: center;
}

.asset-archive {
  width: min(100% - 3rem, 88rem);
  margin: 0 auto;
}

footer {
  width: min(100% - 3rem, 88rem);
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  color: #73889a;
  font-size: .72rem;
  text-align: center;
}

@media (max-width: 600px) {
  .masthead { width: calc(100% - 2rem); padding-top: 1.3rem; }
  .masthead { gap: .75rem; }
  .brand { font-size: .78rem; }
  .season-menu summary { gap: .45rem; padding-inline: .6rem; font-size: .65rem; }
  .intro, footer { width: calc(100% - 2rem); }
  .character-profile, .asset-archive { width: calc(100% - 2rem); }
  .intro { margin-bottom: 1.8rem; }
  .breadcrumbs { gap: .25rem .5rem; }
  .breadcrumb-current { font-size: .75rem; }
  .gallery-toolbar, .card-grid { width: calc(100% - 2rem); }
  .archive-toolbar { width: 100%; }
  .gallery-toolbar h2 { flex-basis: 100%; }
  .group-selection, .sort-selection { margin-left: 0; min-width: 0; }
  .group-filter, .sort-select { min-width: 0; }
  .character-card { width: min(64vw, 15rem); }
  .carousel-control { width: 3.3rem; }
  .carousel-control svg { width: 3rem; }
  .card-grid, .asset-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer-toolbar { gap: .5rem; font-size: .75rem; }
  .viewer-image-wrap { padding: .4rem 2.8rem; }
  .viewer-previous, .viewer-next { width: 2.2rem; }
  .profile-layout { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .profile-identity { width: min(100%, 25rem); margin: 0 auto; }
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .sheet-image-wrap { min-height: 9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .logo-neon { animation: none; color: #66e4ff; }
  .logo-circuit .flow { animation: none; }
}
