/* Story-specific visual direction and scene transitions. */
@layer story {
:root {
  --story-black: #030507;
  --story-ink: #090d11;
  --story-metal: #171d23;
  --story-steel: #303a43;
  --story-white: #f1f4f6;
  --story-red: #f04450;
  --story-cyan: #68d9e8;
  --story-gold: #d8ad55;
  --scene-accent: var(--story-cyan);
}

body {
  background: var(--story-black);
  color: var(--story-white);
}

.scanline {
  z-index: 90;
  height: 10vh;
  opacity: 0.32;
}

.hero {
  min-height: 94svh;
  background: #020304;
  border-bottom: 1px solid rgba(240, 68, 80, 0.34);
}

.hero::before {
  z-index: 1;
  background:
    linear-gradient(90deg, #020304 0%, rgba(2, 3, 4, 0.98) 33%, rgba(2, 3, 4, 0.52) 64%, #020304 100%),
    linear-gradient(180deg, transparent 55%, #020304 100%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(240, 68, 80, 0.055));
  pointer-events: none;
}

.hero__grid {
  z-index: 1;
  opacity: 0.28;
  background-size: 88px 88px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 72%);
}

.hero__flare {
  position: absolute;
  z-index: 1;
  right: 6%;
  top: 23%;
  width: min(46vw, 760px);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(104, 217, 232, 0.52), transparent);
  box-shadow: 0 0 24px rgba(104, 217, 232, 0.24);
}

.hero__mecha {
  position: absolute;
  z-index: 1;
  right: 1vw;
  bottom: 2vh;
  width: clamp(560px, 58vw, 1040px);
  height: min(86vh, 900px);
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(1.1) contrast(1.08) drop-shadow(0 0 48px rgba(240, 68, 80, 0.12));
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 78%, transparent 100%);
}

.media-player {
  position: fixed;
  z-index: 80;
  top: 18px;
  right: clamp(12px, 2vw, 28px);
  width: min(340px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid rgba(104, 217, 232, 0.22);
  color: var(--story-white);
  background: linear-gradient(145deg, rgba(17, 23, 28, 0.94), rgba(5, 8, 11, 0.9));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
  transition:
    opacity 320ms ease,
    transform 320ms ease,
    border-color 220ms ease;
}

body.opening-active .media-player {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.media-player.is-playing {
  border-color: rgba(104, 217, 232, 0.46);
}

.media-player__main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.media-player__play,
.media-player__list-toggle {
  min-width: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.media-player__play {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(104, 217, 232, 0.3);
  color: var(--story-cyan);
  background: rgba(104, 217, 232, 0.06);
  font-size: 0.9rem;
}

.media-player__play:hover,
.media-player__play:focus-visible,
.media-player__list-toggle:hover,
.media-player__list-toggle:focus-visible {
  color: white;
  border-color: var(--story-cyan);
  outline: none;
}

.media-player__track {
  min-width: 0;
}

.media-player__track span,
.media-player__track strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-player__track span {
  margin-bottom: 3px;
  color: #68747c;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.media-player__track strong {
  font-size: 0.88rem;
}

.media-player__list-toggle {
  padding: 8px 6px;
  color: #89949b;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.media-player__volume {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 6px 1px;
  color: #68747c;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.media-player__volume input {
  width: 100%;
  height: 3px;
  margin: 0;
  accent-color: var(--story-cyan);
  cursor: pointer;
}

.media-player__volume output {
  color: #9ba7ae;
  text-align: right;
}

.media-player__playlist {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(104, 217, 232, 0.2);
  background: rgba(5, 8, 11, 0.97);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
}

.media-player__playlist[hidden] {
  display: none;
}

.media-player__playlist-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 10px 9px;
  border: 0;
  border-left: 2px solid transparent;
  color: #89949b;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.media-player__playlist-item:hover,
.media-player__playlist-item:focus-visible {
  color: var(--story-white);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.media-player__playlist-item.is-active {
  border-color: var(--story-cyan);
  color: var(--story-white);
  background: linear-gradient(90deg, rgba(104, 217, 232, 0.12), transparent);
}

.media-player__playlist-item span {
  color: var(--story-cyan);
  font-size: 0.62rem;
  font-weight: 900;
}

.media-player__playlist-item strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-player__playlist-item small {
  color: #59656d;
  font-size: 0.62rem;
}

.hero__content {
  z-index: 3;
  width: min(1320px, calc(100% - 48px));
  padding: clamp(120px, 18vh, 190px) 0 12vh;
}

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

.hero h1 {
  max-width: 860px;
  margin-top: 18px;
  font-size: clamp(4rem, 8vw, 8rem);
  line-height: 0.88;
  text-shadow: 0 18px 54px rgba(0, 0, 0, 0.86);
}

.hero__subtitle {
  max-width: 680px;
  margin-top: 28px;
  color: var(--story-white);
  font-size: clamp(1.35rem, 2.4vw, 2.15rem);
  font-weight: 750;
}

.hero__brief {
  max-width: 640px;
  margin-top: 18px;
  color: #aeb7bd;
  font-size: 1rem;
  line-height: 1.9;
}

.story-signals {
  display: flex;
  gap: 28px;
  margin-top: 34px;
  color: #cbd2d7;
  font-size: 0.84rem;
  font-weight: 700;
}

.story-signals span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.story-signals b {
  color: var(--story-red);
  font-size: 0.7rem;
}

.hero__actions {
  display: flex;
  gap: 12px;
  margin-top: 34px;
  align-items: center;
  flex-wrap: wrap;
}

.story-enter {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  margin-top: 0;
  padding: 0 58px 0 24px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
  color: var(--story-white);
  background: linear-gradient(90deg, rgba(240, 68, 80, 0.82), rgba(122, 34, 42, 0.62));
  text-decoration: none;
  font-weight: 800;
  transition: filter 180ms ease, transform 180ms ease;
}

.story-enter--gallery {
  border: 1px solid rgba(104, 217, 232, 0.36);
  color: #c1ccd1;
  background: rgba(7, 11, 14, 0.72);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.story-enter::after {
  content: "";
  position: absolute;
  right: 23px;
  width: 19px;
  height: 1px;
  background: currentColor;
  box-shadow: 6px -3px 0 -0.4px currentColor, 6px 3px 0 -0.4px currentColor;
}

.story-enter:hover,
.story-enter:focus-visible {
  filter: brightness(1.18);
  transform: translateX(4px);
  outline: none;
}

.hero__chapter {
  position: absolute;
  z-index: 3;
  right: clamp(24px, 4vw, 64px);
  bottom: 34px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  color: rgba(255, 255, 255, 0.34);
}

.hero__chapter span {
  padding-bottom: 7px;
  font-size: 0.7rem;
}

.hero__chapter strong {
  color: rgba(255, 255, 255, 0.72);
  font-size: 3.4rem;
  line-height: 1;
}

.database {
  position: relative;
  min-height: 100vh;
  padding: 84px clamp(18px, 4vw, 64px) 120px;
  background:
    linear-gradient(180deg, #050709, #0a0d10 46%, #040607),
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(255, 255, 255, 0.025) 120px);
}

.panel-shell {
  --scene-accent: var(--story-cyan);
  position: relative;
  overflow: visible;
  width: min(1440px, 100%);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.story-section[data-scene="characters"] { --scene-accent: var(--story-red); }
.story-section[data-scene="scalvir"] { --scene-accent: #e9555f; }
.story-section[data-scene="map"] { --scene-accent: var(--story-gold); }
.story-section[data-scene="system"] { --scene-accent: #71b9ff; }
.story-section[data-scene="gallery"] { --scene-accent: #d4d9dc; }

.section-heading {
  max-width: 860px;
  margin-bottom: 38px;
}

.section-heading .eyebrow {
  color: var(--scene-accent);
}

.section-heading h2 {
  margin: 8px 0 12px;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: 0.94;
}

.section-heading > p:last-child {
  max-width: 650px;
  margin: 0;
  color: #929da4;
  line-height: 1.75;
}

.story-section {
  position: relative;
  z-index: 4;
  min-height: 620px;
  padding: clamp(72px, 9vw, 126px) clamp(0px, 2vw, 24px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  scroll-margin-top: 32px;
}

.story-section:first-of-type {
  padding-top: 38px;
}

.story-section__heading {
  display: grid;
  grid-template-columns: clamp(72px, 9vw, 132px) minmax(0, 820px);
  align-items: start;
  gap: clamp(18px, 3vw, 42px);
  margin-bottom: 42px;
}

.story-section__number {
  color: color-mix(in srgb, var(--scene-accent) 84%, white);
  font-family: "Arial Narrow", Impact, sans-serif;
  font-size: clamp(3.8rem, 8vw, 7.2rem);
  font-weight: 900;
  line-height: 0.78;
  letter-spacing: -0.06em;
  opacity: 0.34;
}

.story-section__heading .eyebrow {
  margin: 0 0 10px;
}

.story-section__heading h2 {
  margin: 0 0 14px;
  color: var(--story-white);
  font-size: clamp(2.25rem, 5vw, 4.7rem);
  line-height: 0.98;
}

.story-section__heading p:last-child {
  max-width: 680px;
  margin: 0;
  color: #929da4;
  line-height: 1.75;
}

.scroll-reveal-ready .story-section {
  opacity: 0;
  transform: translateY(44px);
  transition:
    opacity 760ms ease,
    transform 820ms cubic-bezier(0.16, 0.8, 0.24, 1);
}

.scroll-reveal-ready .story-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-ready .story-section > .sub-tabs,
.scroll-reveal-ready .story-section > .sub-panel,
.scroll-reveal-ready .story-section > .character-layout,
.scroll-reveal-ready .story-section > .map-layout,
.scroll-reveal-ready .story-section > .gallery-grid {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 620ms ease 100ms,
    transform 720ms cubic-bezier(0.16, 0.8, 0.24, 1) 100ms;
}

.scroll-reveal-ready .story-section.is-visible > .sub-tabs,
.scroll-reveal-ready .story-section.is-visible > .sub-panel,
.scroll-reveal-ready .story-section.is-visible > .character-layout,
.scroll-reveal-ready .story-section.is-visible > .map-layout,
.scroll-reveal-ready .story-section.is-visible > .gallery-grid {
  opacity: 1;
  transform: translateY(0);
}

.sub-tabs {
  gap: 22px;
  margin-bottom: 28px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sub-tab {
  min-width: 0;
  padding: 8px 0;
  clip-path: none;
  border: 0;
  color: #778289;
  background: none;
  font-size: 0.82rem;
  font-weight: 800;
}

.sub-tab.is-active {
  color: var(--story-white);
  border: 0;
  box-shadow: inset 0 -2px 0 var(--scene-accent);
}

.sub-tab--restricted {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8a4b50;
  white-space: nowrap;
}

.sub-tab--restricted svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.sub-tab--restricted:hover,
.sub-tab--restricted:focus-visible {
  color: #d46870;
  outline: none;
}

.sub-tab--restricted.is-unlocked {
  color: var(--story-red);
}

.sub-tab--restricted.is-unlocked svg {
  filter: drop-shadow(0 0 7px rgba(240, 68, 80, 0.66));
}

.sub-tab--restricted.is-authorizing {
  animation: restrictedTabGlitch 680ms steps(2, end) both;
}

.restricted-access-status {
  display: flex;
  min-height: 18px;
  margin: -18px 0 18px auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: #8f9a9f;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.restricted-access-status strong {
  color: var(--story-red);
}

.restricted-access-status.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes restrictedTabGlitch {
  0%, 100% { transform: translate(0); filter: none; }
  18% { transform: translate(-2px, 1px); filter: brightness(1.8); }
  36% { transform: translate(3px, -1px); }
  54% { transform: translate(-1px); filter: brightness(0.7); }
  72% { transform: translate(2px, 1px); filter: brightness(1.5); }
}

.text-panel,
.faction-card,
.team-brief,
.pilot-detail,
.overmind-panel,
.map-info {
  background: linear-gradient(120deg, rgba(20, 26, 31, 0.76), rgba(7, 10, 12, 0.44));
  border: 0;
  border-left: 3px solid var(--scene-accent);
  box-shadow: none;
}

.text-panel h3,
.faction-card h3,
.overmind-panel h3,
.map-info h3,
.pilot-detail h3 {
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.panel-label,
.eyebrow {
  color: var(--scene-accent);
}

.spec,
.facility,
.region-list article,
.sortie-grid article,
.enemy-card,
.gallery-card,
.pilot-card {
  border-color: rgba(255, 255, 255, 0.11);
  background: linear-gradient(145deg, rgba(24, 30, 35, 0.9), rgba(7, 10, 13, 0.92));
  box-shadow: none;
}

.spec:hover,
.facility:hover,
.region-list article:hover,
.enemy-card:hover,
.gallery-card:hover,
.pilot-card:hover {
  border-color: color-mix(in srgb, var(--scene-accent) 56%, transparent);
}

.versus-layout {
  grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr);
}

.versus-core {
  border: 0;
  color: var(--story-red);
  background: linear-gradient(180deg, transparent, rgba(240, 68, 80, 0.11), transparent);
}

.character-layout {
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(22px, 3vw, 44px);
}

.character-roster {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.roster-group {
  display: grid;
  gap: 6px;
}

.roster-team {
  padding: 0 12px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--team-color) 50%, transparent);
}

.roster-team span,
.roster-team small {
  display: block;
}

.roster-team span {
  margin-bottom: 5px;
  color: var(--team-color);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.roster-team strong {
  display: block;
  color: var(--story-white);
  font-size: 1.12rem;
}

.roster-team small {
  margin-top: 5px;
  color: #778289;
  font-size: 0.72rem;
  line-height: 1.45;
}

.roster-pilots {
  display: grid;
  gap: 3px;
}

.roster-pilot {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 0;
  border-left: 2px solid transparent;
  color: #89949b;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.roster-pilot span {
  color: #4f5a61;
  font-size: 0.64rem;
  font-weight: 900;
}

.roster-pilot strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-pilot:hover,
.roster-pilot:focus-visible {
  color: var(--story-white);
  background: rgba(255, 255, 255, 0.035);
  outline: none;
}

.roster-pilot.is-active {
  color: var(--story-white);
  border-color: var(--team-color);
  background: linear-gradient(90deg, color-mix(in srgb, var(--team-color) 14%, #101519), transparent);
  transform: translateX(6px);
}

.pilot-detail {
  min-width: 0;
  min-height: 620px;
  padding: clamp(22px, 3vw, 42px);
}

.pilot-detail__lead {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  margin-bottom: 28px;
}

.pilot-detail__copy {
  min-width: 0;
}

.pilot-detail__copy h3 {
  margin-top: 14px;
  font-size: clamp(2.5rem, 5vw, 5.4rem);
  line-height: 0.95;
}

.pilot-detail__squad {
  display: block;
  margin-top: 22px;
  color: var(--pilot-accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.pilot-detail__meta {
  margin-top: 12px;
}

.pilot-detail__personality {
  max-width: 700px;
  margin-top: 26px;
}

.pilot-portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pilot-accent) 42%, #303941);
  background: #090d10;
}

.pilot-portrait__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 1;
}

.mecha-loadout {
  margin-top: 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.mecha-loadout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 4px;
}

.mecha-loadout__header span,
.mecha-loadout__header small,
.mecha-loadout__overview > span,
.mecha-loadout__weapon > span {
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mecha-loadout__header span {
  color: var(--pilot-accent);
}

.mecha-loadout__header small {
  color: #566168;
}

.mecha-loadout__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.mecha-loadout__visual {
  min-width: 0;
  min-height: 260px;
  margin: 0;
  overflow: hidden;
  background: #070a0c;
}

.mecha-loadout__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.mecha-loadout__overview,
.mecha-loadout__weapon {
  min-width: 0;
  padding: clamp(22px, 3vw, 36px);
  background: linear-gradient(145deg, rgba(24, 30, 35, 0.96), rgba(8, 11, 14, 0.98));
}

.mecha-loadout__overview {
  display: flex;
  min-height: 220px;
  grid-column: 1 / -1;
  flex-direction: column;
  justify-content: center;
}

.mecha-loadout.has-visual .mecha-loadout__overview {
  grid-column: auto;
}

.mecha-loadout__overview > span,
.mecha-loadout__weapon > span {
  color: var(--pilot-accent);
}

.mecha-loadout__overview h4 {
  margin: 12px 0 10px;
  color: var(--story-white);
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.mecha-loadout__overview p,
.mecha-loadout__weapon p {
  margin: 0;
  color: #8d999f;
  line-height: 1.7;
}

.mecha-loadout__weapon {
  min-height: 156px;
}

.mecha-loadout__weapon strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--story-white);
  font-size: clamp(1rem, 1.65vw, 1.28rem);
}

.overmind-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.overmind-layout.has-visual {
  grid-template-columns: minmax(300px, 0.72fr) minmax(420px, 1.08fr);
}

.overmind-visual {
  min-height: 520px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(240, 68, 80, 0.34);
  background: #090708;
}

.overmind-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.overmind-panel {
  min-height: 520px;
  padding: clamp(28px, 4vw, 54px);
}

.overmind-panel p {
  max-width: 760px;
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.9;
}

.enemy-grid {
  gap: clamp(14px, 2vw, 24px);
}

.enemy-card {
  position: relative;
  isolation: isolate;
  display: block;
  min-height: clamp(340px, 38vw, 520px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(240, 68, 80, 0.26);
  color: var(--story-white);
  background:
    radial-gradient(circle at 68% 25%, rgba(240, 68, 80, 0.12), transparent 34%),
    linear-gradient(145deg, #171216, #06080a 72%);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.enemy-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(3, 5, 7, 0.04) 15%, rgba(3, 5, 7, 0.24) 52%, rgba(3, 5, 7, 0.96) 100%),
    linear-gradient(90deg, rgba(240, 68, 80, 0.13), transparent 42%);
  pointer-events: none;
}

.enemy-card::after {
  content: "";
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 18px;
  width: 34px;
  height: 8px;
  border-right: 2px solid rgba(240, 68, 80, 0.7);
  border-bottom: 2px solid rgba(240, 68, 80, 0.7);
  transition: width 220ms ease;
  pointer-events: none;
}

.enemy-card__visual {
  position: absolute;
  z-index: 0;
  inset: 0;
  margin: 0;
  background: #09090b;
}

.enemy-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.05) brightness(0.82);
  transform: scale(1.002);
  transition: transform 650ms cubic-bezier(0.16, 0.8, 0.24, 1), filter 300ms ease;
}

.enemy-card__content {
  position: absolute;
  z-index: 2;
  right: clamp(22px, 3vw, 38px);
  bottom: clamp(24px, 3vw, 38px);
  left: clamp(22px, 3vw, 38px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.enemy-card .enemy-card__content small {
  margin-bottom: 9px;
  color: #e2666f;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.enemy-card .enemy-card__content strong {
  color: white;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 950;
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.92);
}

.enemy-card .enemy-card__content em {
  margin-top: 13px;
  color: #aeb8bd;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 800;
}

.enemy-card:hover,
.enemy-card:focus-visible {
  border-color: rgba(240, 68, 80, 0.86);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.46), 0 0 30px rgba(240, 68, 80, 0.12);
  transform: translateY(-5px);
  outline: none;
}

.enemy-card:hover::after,
.enemy-card:focus-visible::after {
  width: 68px;
}

.enemy-card:hover .enemy-card__visual img,
.enemy-card:focus-visible .enemy-card__visual img {
  filter: saturate(1) contrast(1.08) brightness(0.96);
  transform: scale(1.055);
}

body.enemy-modal-open {
  overflow: hidden;
}

.enemy-modal {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  background: rgba(1, 3, 5, 0.88);
  backdrop-filter: blur(12px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.enemy-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.enemy-modal__dialog {
  position: relative;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(240, 68, 80, 0.42);
  background: #080a0c;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.82);
  transform: translateY(14px) scale(0.985);
  transition: transform 280ms cubic-bezier(0.16, 0.8, 0.24, 1);
}

.enemy-modal.is-open .enemy-modal__dialog {
  transform: none;
}

.enemy-modal__content {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 520px;
}

.enemy-modal__dialog.has-visual .enemy-modal__content {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.enemy-modal__media {
  min-width: 0;
  min-height: 520px;
  margin: 0;
  overflow: hidden;
  background: #070709;
}

.enemy-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.enemy-modal__copy {
  display: flex;
  min-width: 0;
  padding: clamp(36px, 5vw, 72px);
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(240, 68, 80, 0.2);
}

.enemy-modal__copy h3 {
  margin: 16px 0 10px;
  color: white;
  font-size: clamp(3.2rem, 7vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.enemy-modal__type {
  margin: 6px 0 32px;
  color: #aab4b9;
  font-size: 0.94rem;
  font-weight: 800;
}

.enemy-modal__data {
  display: grid;
  gap: 1px;
  margin: 0;
  background: rgba(255, 255, 255, 0.1);
}

.enemy-modal__data div {
  padding: 18px;
  background: #0e1215;
}

.enemy-modal__data dt {
  margin-bottom: 8px;
  color: var(--story-red);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.enemy-modal__data dd {
  margin: 0;
  color: #aab4b9;
  line-height: 1.72;
}

.enemy-modal__close {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #aab3b8;
  background: rgba(3, 5, 7, 0.88);
  cursor: pointer;
}

.enemy-modal__close svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.8;
}

.enemy-modal__close:hover,
.enemy-modal__close:focus-visible {
  border-color: var(--story-red);
  color: white;
  outline: none;
}

.map-layout {
  display: block;
}

.tactical-map {
  isolation: isolate;
  min-height: clamp(680px, 76vh, 880px);
  background:
    radial-gradient(circle at 50% 46%, rgba(104, 217, 232, 0.13), transparent 19rem),
    linear-gradient(135deg, rgba(216, 173, 85, 0.08), transparent 48%),
    #060a0d;
  border-color: rgba(104, 217, 232, 0.24);
}

.tactical-map::after {
  content: none;
}

.map-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(rgba(104, 217, 232, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 217, 232, 0.05) 1px, transparent 1px),
    linear-gradient(135deg, transparent 49.8%, rgba(104, 217, 232, 0.08) 50%, transparent 50.2%);
  background-size: 64px 64px, 64px 64px, 100% 100%;
}

.map-hotspot {
  z-index: 2;
  width: auto;
  min-width: 136px;
  min-height: 46px;
  padding: 0 18px;
  border-color: rgba(104, 217, 232, 0.46);
  color: #c7d1d6;
  background: rgba(5, 10, 13, 0.9);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.map-hotspot::before {
  inset: -9px;
  border-color: rgba(104, 217, 232, 0.2);
  transform: rotate(0deg);
  transition: inset 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.map-hotspot:hover,
.map-hotspot:focus-visible {
  border-color: var(--story-cyan);
  color: var(--story-white);
  box-shadow: 0 0 28px rgba(104, 217, 232, 0.2);
  transform: translateY(-4px);
  outline: none;
}

.map-hotspot:hover::before,
.map-hotspot:focus-visible::before {
  inset: -13px;
  border-color: rgba(104, 217, 232, 0.42);
  transform: rotate(2deg);
}

.map-hotspot.is-active {
  z-index: 4;
  border-color: var(--story-gold);
  color: white;
  box-shadow: 0 0 32px rgba(216, 173, 85, 0.28);
}

.academy { left: 46%; top: 44%; }
.west { left: 13%; top: 27%; }
.east { right: 11%; top: 29%; }
.central { left: 42%; bottom: 15%; }

.region-brief {
  position: absolute;
  z-index: 8;
  inset: clamp(26px, 5vw, 72px);
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(216, 173, 85, 0.42);
  background: rgba(5, 8, 10, 0.97);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72);
  animation: regionBriefIn 280ms cubic-bezier(0.16, 0.8, 0.24, 1) both;
}

.region-brief[hidden] {
  display: none;
}

.region-brief.has-visual {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.region-brief__media {
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #080a0c;
}

.region-brief__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.region-brief__copy {
  display: flex;
  min-width: 0;
  padding: clamp(36px, 5vw, 76px);
  flex-direction: column;
  justify-content: center;
}

.region-brief__copy h3 {
  margin: 14px 0 22px;
  color: var(--story-white);
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 0.98;
}

.region-brief__copy > p {
  max-width: 660px;
  margin: 0;
  color: #9da8ae;
  font-size: clamp(0.96rem, 1.2vw, 1.08rem);
  line-height: 1.85;
}

.region-brief__meta {
  display: grid;
  gap: 1px;
  margin: 34px 0 0;
  background: rgba(255, 255, 255, 0.1);
}

.region-brief__meta div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 16px;
  background: #0d1215;
}

.region-brief__meta dt {
  color: #657178;
  font-size: 0.7rem;
  font-weight: 900;
}

.region-brief__meta dd {
  margin: 0;
  color: #d8dfe2;
  font-size: 0.82rem;
  font-weight: 800;
}

.region-brief__close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #aab3b8;
  background: rgba(3, 5, 7, 0.86);
  cursor: pointer;
}

.region-brief__close svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.8;
}

.region-brief__close:hover,
.region-brief__close:focus-visible {
  border-color: var(--story-gold);
  color: white;
  outline: none;
}

@keyframes regionBriefIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

body.gallery-active {
  overflow: hidden;
}

.media-player.is-gallery-mode {
  border-color: rgba(240, 68, 80, 0.5);
}

.media-player.is-gallery-mode .media-player__play {
  border-color: rgba(240, 68, 80, 0.42);
  color: var(--story-red);
  background: rgba(240, 68, 80, 0.07);
}

.media-player__list-toggle:disabled {
  opacity: 0.28;
  cursor: default;
}

.gallery-screen {
  position: fixed;
  z-index: 70;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--story-white);
  background:
    radial-gradient(circle at 82% 12%, rgba(240, 68, 80, 0.1), transparent 30rem),
    linear-gradient(180deg, #05080a, #020304 72%);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 360ms ease, transform 420ms cubic-bezier(0.16, 0.8, 0.24, 1);
}

.gallery-screen[hidden] { display: none; }
.gallery-screen.is-active { opacity: 1; transform: none; }

.gallery-screen__grid {
  position: fixed;
  inset: 0;
  opacity: 0.24;
  background:
    linear-gradient(rgba(104, 217, 232, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 217, 232, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, #000, transparent 74%);
  pointer-events: none;
}

.gallery-screen__topbar {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  min-height: 92px;
  padding: 18px max(24px, calc((100vw - 1320px) / 2));
  padding-right: max(390px, calc((100vw - 1320px) / 2));
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #59656c;
  background: rgba(4, 7, 9, 0.84);
  backdrop-filter: blur(14px);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.gallery-screen__back {
  display: inline-flex;
  min-height: 42px;
  padding: 0 16px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(104, 217, 232, 0.26);
  color: #adb8bd;
  background: rgba(8, 12, 15, 0.76);
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.gallery-screen__back svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.gallery-screen__back:hover,
.gallery-screen__back:focus-visible {
  border-color: var(--story-cyan);
  color: white;
  transform: translateX(-3px);
  outline: none;
}

.gallery-screen__inner {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(68px, 9vw, 132px) 0 120px;
}

.gallery-screen__heading {
  display: grid;
  grid-template-columns: clamp(130px, 15vw, 230px) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 70px);
  margin-bottom: clamp(56px, 8vw, 110px);
  align-items: end;
}

.gallery-screen__number {
  color: rgba(240, 68, 80, 0.3);
  font-size: clamp(7rem, 14vw, 13rem);
  font-weight: 950;
  line-height: 0.72;
  letter-spacing: -0.09em;
}

.gallery-screen__heading p {
  margin: 0 0 14px;
  color: var(--story-red);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-screen__heading h2 {
  margin: 0;
  color: white;
  font-size: clamp(3.5rem, 8vw, 7.4rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.gallery-screen__heading div > span {
  display: block;
  margin-top: 24px;
  color: #859198;
  line-height: 1.7;
}

.gallery-screen__audio-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  margin-top: 28px;
  padding: 12px 16px;
  border: 1px solid rgba(240, 68, 80, 0.34);
  border-left: 3px solid var(--story-red);
  background: rgba(240, 68, 80, 0.08);
  color: #d9e0e4;
  line-height: 1.55;
}

.gallery-screen__audio-notice > span {
  flex: 0 0 auto;
  color: var(--story-red);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.gallery-screen__audio-notice > strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.character-gallery {
  display: grid;
  gap: clamp(54px, 7vw, 88px);
}

.character-gallery__team {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
}

.character-gallery__team-heading {
  position: sticky;
  top: 112px;
  display: flex;
  height: max-content;
  padding-left: 18px;
  flex-direction: column;
  border-left: 2px solid var(--gallery-team-color);
}

.character-gallery__team-heading span {
  color: var(--gallery-team-color);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.character-gallery__team-heading strong {
  margin-top: 13px;
  color: white;
  font-size: 1.28rem;
}

.character-gallery__team-heading small {
  margin-top: 9px;
  color: #707d84;
  line-height: 1.6;
}

.character-gallery__list { display: grid; gap: 14px; }
.character-gallery__item { min-width: 0; }

.character-gallery__trigger {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  min-height: clamp(180px, 18vw, 230px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  background: #090c0f;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.character-gallery__trigger::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 5, 7, 0.94) 0%, rgba(3, 5, 7, 0.56) 48%, rgba(3, 5, 7, 0.12) 78%),
    linear-gradient(180deg, transparent 52%, rgba(3, 5, 7, 0.6));
  pointer-events: none;
}

.character-gallery__trigger > img {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: saturate(0.78) contrast(1.08) brightness(0.74);
  transform: scale(1.002);
  transition: transform 720ms cubic-bezier(0.16, 0.8, 0.24, 1), filter 280ms ease;
}

.character-gallery__trigger-copy {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: clamp(24px, 4vw, 58px);
  display: flex;
  max-width: 62%;
  flex-direction: column;
  transform: translateY(-50%);
}

.character-gallery__trigger-copy small {
  margin-bottom: 11px;
  color: var(--gallery-team-color);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-gallery__trigger-copy strong {
  color: white;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.74);
}

.character-gallery__trigger-copy em {
  margin-top: 13px;
  color: #b2bcc1;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
}

.character-gallery__trigger > svg {
  position: absolute;
  z-index: 2;
  right: clamp(22px, 3vw, 42px);
  bottom: 28px;
  width: 24px;
  fill: none;
  stroke: white;
  stroke-width: 1.6;
  transition: transform 260ms ease, color 180ms ease;
}

.character-gallery__trigger:hover,
.character-gallery__trigger:focus-visible,
.character-gallery__item.is-open .character-gallery__trigger {
  border-color: color-mix(in srgb, var(--gallery-team-color) 78%, transparent);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  outline: none;
}

.character-gallery__trigger:hover,
.character-gallery__trigger:focus-visible { transform: translateY(-3px); }

.character-gallery__trigger:hover > img,
.character-gallery__trigger:focus-visible > img,
.character-gallery__item.is-open .character-gallery__trigger > img {
  filter: saturate(1) contrast(1.06) brightness(0.9);
  transform: scale(1.045);
}

.character-gallery__item.is-open .character-gallery__trigger > svg {
  color: var(--gallery-team-color);
  transform: rotate(180deg);
}

.character-gallery__panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 420ms cubic-bezier(0.16, 0.8, 0.24, 1), opacity 260ms ease;
}

.character-gallery__item.is-open .character-gallery__panel {
  grid-template-rows: 1fr;
  opacity: 1;
}

.character-gallery__panel-inner { min-height: 0; overflow: hidden; }

.character-gallery__images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
}

.character-gallery__image {
  position: relative;
  aspect-ratio: 16 / 10;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #090c0f;
  cursor: zoom-in;
}

.character-gallery__image[hidden] { display: none; }

.character-gallery__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease, filter 220ms ease;
}

.character-gallery__image:hover,
.character-gallery__image:focus-visible {
  border-color: var(--gallery-team-color);
  outline: none;
}

.character-gallery__image:hover img,
.character-gallery__image:focus-visible img {
  filter: brightness(1.08);
  transform: scale(1.035);
}

.character-gallery__empty {
  margin: 12px 0 0;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #647078;
  background: rgba(8, 12, 15, 0.68);
  text-align: center;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.character-gallery__empty[hidden] { display: none; }

.gallery-lightbox {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: grid;
  padding: 42px 90px;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  background: rgba(1, 3, 5, 0.94);
  backdrop-filter: blur(14px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.gallery-lightbox.is-open { visibility: visible; opacity: 1; }

.gallery-lightbox__figure {
  display: grid;
  max-width: min(1400px, 100%);
  max-height: calc(100vh - 84px);
  margin: 0;
  gap: 12px;
  place-items: center;
}

.gallery-lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8);
}

.gallery-lightbox__figure img[hidden] { display: none; }

.gallery-lightbox__figure figcaption {
  color: #77838a;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
  display: grid;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #aab4b9;
  background: rgba(4, 7, 9, 0.86);
  cursor: pointer;
}

.gallery-lightbox__close {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 46px;
  height: 46px;
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 72px;
  transform: translateY(-50%);
}

.gallery-lightbox__nav--prev { left: 24px; }
.gallery-lightbox__nav--next { right: 24px; }

.gallery-lightbox__close svg,
.gallery-lightbox__nav svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible {
  border-color: var(--story-cyan);
  color: white;
  outline: none;
}

.gallery-lightbox__nav:disabled { visibility: hidden; }

.gallery-card {
  aspect-ratio: 4 / 3;
  min-height: 0;
}

.gallery-card::before {
  background:
    linear-gradient(145deg, transparent 46%, rgba(240, 68, 80, 0.14) 47% 50%, transparent 51%),
    linear-gradient(30deg, rgba(104, 217, 232, 0.08), transparent 62%);
}

@media (max-width: 1080px) {
  .hero__mecha {
    right: -18vw;
    opacity: 0.66;
  }

  .character-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .pilot-detail__lead {
    grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1fr);
  }

  .overmind-layout.has-visual,
  .region-brief.has-visual {
    grid-template-columns: minmax(260px, 0.8fr) minmax(340px, 1fr);
  }

  .enemy-modal__dialog.has-visual .enemy-modal__content {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  }

  .character-gallery__team {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 92svh;
  }

  .media-player {
    top: 10px;
    width: min(320px, calc(100vw - 20px));
  }

  .hero::before {
    background: linear-gradient(180deg, rgba(2, 3, 4, 0.34), #020304 74%);
  }

  .hero__mecha {
    right: 50%;
    bottom: 18%;
    width: 720px;
    height: 68vh;
    opacity: 0.48;
    transform: translateX(50%);
  }

  .hero__content {
    width: min(100% - 32px, 1320px);
    padding: 44vh 0 10vh;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 17vw, 5.3rem);
  }

  .hero__brief {
    font-size: 0.92rem;
  }

  .story-signals {
    gap: 16px;
  }

  .hero__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .story-enter {
    justify-content: flex-start;
    min-width: 0;
    padding: 0 48px 0 18px;
  }

  .hero__chapter {
    display: none;
  }

  .database {
    padding: 64px 14px 90px;
  }

  .section-heading h2 {
    font-size: 3.1rem;
  }

  .scroll-reveal-ready .story-section {
    transform: translateY(28px);
  }

  .story-section {
    min-height: 0;
    padding: 74px 4px;
  }

  .story-section:first-of-type {
    padding-top: 34px;
  }

  .story-section__heading {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 32px;
  }

  .story-section__number {
    font-size: 3.2rem;
  }

  .sub-tabs {
    gap: 18px;
  }

  .restricted-access-status {
    min-height: 32px;
    margin-top: -20px;
    align-items: flex-end;
    flex-direction: column;
    gap: 2px;
  }

  .character-layout,
  .pilot-detail__lead {
    grid-template-columns: 1fr;
  }

  .character-roster {
    max-height: 520px;
    padding-right: 6px;
    overflow-y: auto;
  }

  .pilot-portrait {
    min-height: 0;
  }

  .mecha-loadout.has-visual .mecha-loadout__visual,
  .mecha-loadout.has-visual .mecha-loadout__overview {
    grid-column: 1 / -1;
  }

  .mecha-loadout__visual {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .overmind-layout.has-visual,
  .region-brief.has-visual {
    grid-template-columns: 1fr;
  }

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

  .enemy-card {
    min-height: min(118vw, 500px);
  }

  .enemy-modal {
    padding: 10px;
  }

  .enemy-modal__dialog {
    max-height: calc(100svh - 20px);
  }

  .enemy-modal__dialog.has-visual .enemy-modal__content {
    grid-template-columns: 1fr;
  }

  .enemy-modal__content {
    min-height: 0;
  }

  .enemy-modal__media {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .enemy-modal__copy {
    padding: 34px 22px 28px;
    border-top: 1px solid rgba(240, 68, 80, 0.2);
    border-left: 0;
  }

  .enemy-modal__copy h3 {
    padding-right: 38px;
    font-size: clamp(3rem, 17vw, 5rem);
  }

  .gallery-screen__topbar {
    min-height: 170px;
    padding: 112px 14px 12px;
  }

  .gallery-screen__topbar > span {
    display: none;
  }

  .gallery-screen__back {
    max-width: 100%;
    min-height: 38px;
    padding-inline: 12px;
    font-size: 0.62rem;
  }

  .gallery-screen__inner {
    width: calc(100% - 28px);
    padding: 96px 0 80px;
  }

  .gallery-screen__heading {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 58px;
  }

  .gallery-screen__number {
    font-size: 5rem;
  }

  .gallery-screen__heading h2 {
    font-size: clamp(3.25rem, 16vw, 5rem);
  }

  .gallery-screen__audio-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .character-gallery {
    gap: 58px;
  }

  .character-gallery__team {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .character-gallery__team-heading {
    position: static;
  }

  .character-gallery__trigger {
    min-height: 148px;
  }

  .character-gallery__trigger-copy {
    right: 56px;
    left: 20px;
    max-width: none;
  }

  .character-gallery__trigger-copy strong {
    font-size: clamp(1.9rem, 9vw, 2.8rem);
  }

  .character-gallery__trigger-copy em {
    overflow: hidden;
    max-width: 86%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .character-gallery__trigger > svg {
    right: 18px;
    bottom: 18px;
  }

  .character-gallery__images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .character-gallery__empty {
    padding: 22px 14px;
  }

  .gallery-lightbox {
    padding: 70px 12px 52px;
  }

  .gallery-lightbox__close {
    top: 12px;
    right: 12px;
  }

  .gallery-lightbox__nav {
    top: auto;
    bottom: 8px;
    width: 46px;
    height: 38px;
    transform: none;
  }

  .gallery-lightbox__nav--prev { left: calc(50% - 52px); }
  .gallery-lightbox__nav--next { right: calc(50% - 52px); }

  .overmind-visual {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .tactical-map {
    min-height: 640px;
  }

  .map-hotspot {
    min-width: 112px;
    min-height: 42px;
    padding-inline: 12px;
    font-size: 0.68rem;
  }

  .academy { left: 32%; top: 43%; }
  .west { left: 5%; top: 24%; }
  .east { right: 4%; top: 24%; }
  .central { left: 29%; bottom: 14%; }

  .region-brief {
    inset: 14px;
    max-height: calc(100% - 28px);
    overflow-y: auto;
  }

  .region-brief__media {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .region-brief__copy {
    padding: 34px 22px 26px;
  }

  .region-brief__copy h3 {
    padding-right: 30px;
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .region-brief__meta div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .versus-layout {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 440px) {
  .mecha-loadout__grid {
    grid-template-columns: 1fr;
  }

  .mecha-loadout__overview,
  .mecha-loadout__weapon {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-reveal-ready .story-section,
  .scroll-reveal-ready .story-section > .sub-tabs,
  .scroll-reveal-ready .story-section > .sub-panel,
  .scroll-reveal-ready .story-section > .character-layout,
  .scroll-reveal-ready .story-section > .map-layout,
  .scroll-reveal-ready .story-section > .gallery-grid {
    opacity: 1 !important;
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .sub-tab--restricted.is-authorizing,
  .enemy-card,
  .enemy-card__visual img,
  .enemy-modal,
  .enemy-modal__dialog,
  .gallery-screen,
  .character-gallery__panel,
  .character-gallery__trigger,
  .character-gallery__trigger > img,
  .gallery-lightbox {
    animation: none !important;
    transition: none !important;
  }
}
}
