/* Cinematic chapter view: the artwork carries the scene, WebGL adds motion and depth. */
.auth-mode, .overview-mode { background: #0b0a09; }
.auth-mode .topbar, .overview-mode .topbar {
  position: absolute; z-index: 30; inset: 0 0 auto; min-height: 76px;
  padding-inline: clamp(20px, 3vw, 56px); border: 0; background: linear-gradient(#0b0b0ae0, #0b0b0a00);
  box-shadow: none; backdrop-filter: none;
}
.auth-mode .topbar::before, .overview-mode .topbar::before { display: none; }
.auth-mode .main, .overview-mode .main { width: 100%; max-width: none; padding: 0; }
.auth-mode .main::before, .overview-mode .main::before { display: none; }
.overview-mode .nav { min-width: 0; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; scrollbar-width: none; }
.overview-mode .nav::-webkit-scrollbar { display: none; }
.overview-mode .nav a { flex: none; }
.auth-mode .brand img, .overview-mode .brand img { width: 29px; height: 29px; border: 0; background: transparent; }
.auth-mode .brand strong, .overview-mode .brand strong { font-size: 1.1rem; }

/* One unbroken environment replaces the paired login cards. */
.auth-shell { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(345px, 415px); gap: 0;
  align-items: center; min-height: 100svh; padding: 95px clamp(24px, 6vw, 100px) 45px; overflow: hidden; }
.auth-showcase { position: absolute; inset: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
  background: url('/visuals/old-camp-gate.webp') center center / cover no-repeat #14120f; }
.auth-showcase::before { z-index: 2; background: linear-gradient(90deg, rgb(7 8 8 / .48), transparent 71%),
  linear-gradient(0deg, rgb(5 5 5 / .68), transparent 35%); }
.auth-showcase::after { z-index: 2; inset: 0; border: 0; box-shadow: inset 0 0 100px rgb(0 0 0 / .34); }
.auth-showcase .arcane-viewport, .cinematic-stage .arcane-viewport { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; opacity: 1; overflow: hidden; cursor: crosshair; touch-action: pan-y; }
.auth-showcase .arcane-viewport canvas, .cinematic-stage .arcane-viewport canvas { width: 100%; height: 100%; filter: none; }
.auth-showcase-copy { position: absolute; z-index: 4; top: 26%; left: clamp(28px, 6vw, 100px); width: min(51vw, 680px); }
.auth-showcase-copy .eyebrow { color: #d6be96; font-size: .7rem; }
.auth-showcase-copy h2 { max-width: 9ch; margin: 19px 0 25px; color: #fff1d9;
  font-size: clamp(4.1rem, 7vw, 8.8rem); line-height: .91; letter-spacing: -.073em; font-weight: 500;
  text-wrap: balance; text-shadow: 0 8px 35px rgb(0 0 0 / .48); }
.auth-showcase-copy p { max-width: 29ch; color: #e8dfd1; font-family: var(--display); font-size: clamp(1.05rem, 1.45vw, 1.48rem); line-height: 1.38; }
.auth-showcase-footer { position: absolute; z-index: 4; right: clamp(24px, 6vw, 100px); bottom: 29px;
  left: clamp(24px, 6vw, 100px); padding-top: 13px; border-top: 1px solid rgb(233 214 180 / .3); }
.auth-card { position: relative; z-index: 6; grid-column: 2; width: 100%; align-self: center; margin: 0;
  padding: clamp(27px, 3vw, 44px); border: 1px solid rgb(236 215 177 / .31); border-radius: 0;
  background: rgb(17 17 15 / .69); box-shadow: 0 25px 80px rgb(0 0 0 / .34); backdrop-filter: blur(20px); }
.auth-card::before { display: none; }
.auth-card-head h1 { font-size: clamp(2.3rem, 3.1vw, 3.4rem); }

.scene-action, .scene-scroll, .chapter-open { border: 0; background: none; color: #f0dfc3; cursor: pointer;
  font: 600 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.scene-action, .scene-scroll { display: inline-flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid rgb(230 207 169 / .62); transition: color .25s, border-color .25s, transform .25s; }
.scene-action::before { content: '✦'; color: #c4a06f; font-size: 1rem; }
.scene-action:hover, .scene-action:focus-visible, .scene-scroll:hover, .scene-scroll:focus-visible,
.chapter-open:hover, .chapter-open:focus-visible { color: #fff; border-color: #fff0cd; transform: translateY(-2px); }
.scene-action:focus-visible, .scene-scroll:focus-visible, .chapter-open:focus-visible,
.chapter-button:focus-visible, .cinematic-news summary:focus-visible { outline: 2px solid #e2bc81; outline-offset: 5px; }
.auth-showcase > .scene-action { position: absolute; z-index: 5; bottom: 105px; left: clamp(28px, 6vw, 100px); }

/* The overview is a cinematic chapter selector. Operational controls continue below it. */
.cinematic-stage { position: relative; isolation: isolate; min-height: min(920px, 100svh); overflow: hidden;
  background: url('/visuals/old-camp-gate.webp') center center / cover no-repeat #14120f; }
.cinematic-stage[data-chapter='1'] { background-image: url('/visuals/ore-mine.webp'); }
.cinematic-stage[data-chapter='2'] { background-image: url('/visuals/barrier-watch.webp'); }
.cinematic-stage::after { content: ''; position: absolute; z-index: 2; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(7 8 8 / .62), rgb(7 8 8 / .12) 62%, rgb(7 8 8 / .25)),
    linear-gradient(0deg, rgb(5 6 6 / .88), transparent 43%),
    linear-gradient(180deg, rgb(5 6 6 / .22), transparent 24%); }
.cinematic-copy, .chapter-focus, .chapter-navigation, .cinematic-actions, .cinematic-news { position: absolute; z-index: 4; }
.cinematic-copy { top: clamp(158px, 22vh, 248px); left: clamp(27px, 6vw, 105px); width: min(53vw, 760px); }
.cinematic-copy .eyebrow { color: #d6bd93; }
.cinematic-copy h1 { max-width: 9ch; margin: 20px 0 26px; color: #fff2dc; font-family: var(--display); font-size: clamp(4.7rem, 8vw, 10rem);
  line-height: .86; letter-spacing: -.072em; font-weight: 500; text-shadow: 0 8px 40px rgb(0 0 0 / .38); }
.cinematic-copy p { max-width: 32ch; color: #e9e1d2; font-family: var(--display);
  font-size: clamp(1.12rem, 1.5vw, 1.52rem); line-height: 1.36; }
.chapter-focus { right: clamp(27px, 6vw, 105px); bottom: clamp(93px, 12vh, 145px); width: min(34vw, 392px);
  padding: 22px 24px 24px; border: 1px solid rgb(229 201 157 / .58);
  background: linear-gradient(135deg, rgb(17 18 16 / .83), rgb(13 14 13 / .68));
  box-shadow: 0 28px 70px rgb(0 0 0 / .35), inset 0 0 0 1px rgb(255 239 207 / .05);
  backdrop-filter: blur(14px); text-shadow: 0 3px 20px rgb(0 0 0 / .6); }
.chapter-focus-top { display: flex; gap: 12px; align-items: baseline; color: #dcc7a5; font: 600 .68rem var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.chapter-number { color: #fff0d2; font: italic 2.1rem var(--display); letter-spacing: -.06em; }
.chapter-name { margin: 9px 0 8px; color: #fff3dd; font-size: clamp(1.8rem, 2.8vw, 3.2rem); line-height: 1.05; }
.chapter-description { margin: 0 0 16px; color: #d3c7b4; font-size: .81rem; }
.chapter-status { display: grid; gap: 7px; margin: 16px 0 22px; }
.chapter-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .73rem; }
.chapter-status-row > span:first-child { width: 98px; color: #d1c5b4; font: 600 .65rem var(--mono); text-transform: uppercase; }
.chapter-open { display: inline-block; padding: 0 0 8px; border-bottom: 1px solid #dcc59c; }
.chapter-open::after { content: ' ↗'; margin-left: 7px; }
.chapter-navigation { bottom: 38px; left: clamp(27px, 6vw, 105px); display: flex; gap: 10px; max-width: min(65vw, 800px); }
.chapter-button { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
  width: clamp(142px, 15vw, 218px); padding: 13px 10px 4px 0; border: 0; border-top: 1px solid rgb(230 210 176 / .4);
  background: transparent; color: #c3b8a6; text-align: left; cursor: pointer; transition: color .25s, border-color .25s, transform .25s; }
.chapter-button:hover { color: #fff2da; transform: translateY(-3px); }
.chapter-button[aria-pressed='true'] { border-top: 2px solid #e4c89c; color: #fff2da; }
.chapter-button-index { font: italic 1.7rem var(--display); }
.chapter-button-name { font: 650 .65rem var(--mono); line-height: 1.3; text-transform: uppercase; }
.cinematic-actions { bottom: clamp(124px, 16vh, 176px); left: clamp(27px, 6vw, 105px); display: flex; gap: 28px; }
.cinematic-news { top: 105px; right: clamp(27px, 6vw, 105px); width: 310px; color: #f0e3ce; }
.cinematic-news summary { display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 8px 0; border-bottom: 1px solid rgb(232 207 166 / .68); cursor: pointer;
  font: 600 .69rem var(--mono); letter-spacing: .14em; text-transform: uppercase; list-style: none; }
.cinematic-news summary::-webkit-details-marker { display: none; }
.cinematic-news summary > span { color: #c0a27c; }
.cinematic-news-inner { max-height: min(62vh, 510px); overflow: auto; margin-top: 1px; padding: 18px 21px 12px;
  border: 1px solid rgb(209 179 135 / .36); background: rgb(16 17 15 / .89); box-shadow: 0 24px 60px rgb(0 0 0 / .36); backdrop-filter: blur(22px); }
.cinematic-news .news-item { grid-template-columns: 23px 1fr; }
.cinematic-news .news-item h3 { font-size: 1rem; }
.cinematic-operations { min-height: 440px; padding: clamp(60px, 8vw, 115px) clamp(28px, 6vw, 105px);
  background: radial-gradient(ellipse at 70% 0%, rgb(93 70 49 / .12), transparent 54%), #0d0d0b; }
.operations-heading { max-width: 1280px; margin: 0 auto 40px; }
.operations-heading h2 { margin: 13px 0; font-size: clamp(2.6rem, 4.7vw, 5.2rem); }
.operations-heading p { color: #b8b0a4; }
.cinematic-operations > .grid { display: grid; grid-template-columns: 1fr; max-width: 1280px; margin: 0 auto;
  border-top: 1px solid rgb(185 150 99 / .3); }

@media (max-width: 1100px) {
  .auth-showcase-copy { top: 19%; width: 52vw; }
  .auth-showcase-copy h2 { font-size: clamp(3.6rem, 7.5vw, 6.8rem); }
  .auth-card { width: min(380px, 100%); }
  .cinematic-copy { top: 21%; width: 58vw; }
  .cinematic-copy h1 { font-size: clamp(4rem, 8vw, 7rem); }
  .chapter-focus { width: min(34vw, 320px); }
}
@media (max-width: 800px) {
  .overview-mode .topbar { display: grid; grid-template-columns: 1fr auto; gap: 0; min-height: 112px; }
  .overview-mode .nav { grid-row: 2; grid-column: 1 / -1; }
  .overview-mode .topbar-right { grid-row: 1; grid-column: 2; }
  .auth-shell { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 0;
    min-height: 950px; padding: 420px 25px 70px; }
  .auth-showcase-copy { top: 140px; left: 25px; width: min(82vw, 550px); }
  .auth-showcase-copy h2 { max-width: 10ch; font-size: clamp(3.8rem, 9vw, 6rem); }
  .auth-card { align-self: flex-end; width: min(420px, 100%); }
  .auth-showcase > .scene-action { bottom: 30px; left: 25px; }
  .auth-showcase-footer { display: none; }
  .cinematic-stage { min-height: 880px; }
  .cinematic-copy { top: 150px; left: 28px; width: 70vw; }
  .cinematic-copy h1 { font-size: clamp(4rem, 10vw, 6rem); }
  .chapter-focus { right: 28px; bottom: 145px; width: min(41vw, 330px); }
  .chapter-navigation { bottom: 27px; left: 28px; max-width: calc(100% - 56px); }
  .chapter-button { width: clamp(120px, 24vw, 205px); }
  .cinematic-actions { left: 28px; bottom: 150px; flex-direction: column; gap: 1px; }
  .cinematic-news { top: 128px; right: 28px; width: min(270px, 36vw); }
}
@media (max-width: 600px) {
  .auth-mode .topbar, .overview-mode .topbar { padding-inline: 19px; }
  .auth-mode .brand-lockup small, .overview-mode .brand-lockup small { display: none; }
  .auth-mode .topbar-right, .overview-mode .topbar-right { gap: 6px; }
  .auth-mode .language, .overview-mode .language { min-width: 92px; }
  .overview-mode #logout { padding-inline: 5px; font-size: .67rem; }
  .auth-shell { min-height: 1010px; padding: 460px 18px 75px; }
  .auth-showcase { background-position: 63% center; }
  .auth-showcase-copy { top: 132px; left: 20px; width: calc(100% - 40px); }
  .auth-showcase-copy h2 { max-width: 9ch; font-size: clamp(3.7rem, 13vw, 5.4rem); }
  .auth-showcase-copy p { max-width: 26ch; font-size: 1rem; }
  .auth-card { width: 100%; padding: 27px 24px; }
  .auth-showcase > .scene-action { left: 20px; bottom: 23px; }
  .cinematic-stage { min-height: 1040px; background-position: 63% center; }
  .cinematic-copy { top: 175px; left: 20px; width: calc(100% - 40px); }
  .cinematic-copy h1 { max-width: 8ch; font-size: clamp(4rem, 14vw, 6rem); }
  .cinematic-copy p { max-width: 26ch; font-size: 1.06rem; }
  .cinematic-news { top: 116px; right: 20px; width: min(255px, 65vw); }
  .chapter-focus { right: 20px; bottom: 155px; left: 20px; width: auto; padding-top: 12px; }
  .chapter-name { font-size: 2rem; }
  .chapter-navigation { right: 20px; bottom: 20px; left: 20px; gap: 5px; max-width: none; }
  .chapter-button { width: 33.33%; gap: 5px; }
  .chapter-button-index { font-size: 1.3rem; }
  .chapter-button-name { font-size: .55rem; }
  .cinematic-actions { bottom: 415px; left: 20px; flex-direction: row; gap: 18px; }
  .scene-action, .scene-scroll { font-size: .6rem; }
  .cinematic-operations { padding: 65px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-action, .scene-scroll, .chapter-button { transition: none; }
}
