@charset "UTF-8";

:root {
  color-scheme: dark;
  --ink: #f3e8d9;
  --muted: #bdb2a6;
  --quiet: #9b928a;
  --amber: #e9a76d;
  --amber-light: #f7c99b;
  --line: rgba(239, 214, 185, .22);
  --panel: rgba(16, 18, 19, .76);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --gutter: clamp(24px, 5.7vw, 104px);
  font-family: var(--sans);
  font-synthesis: none;
  background: #101112;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; min-height: 100svh; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, input { touch-action: manipulation; }
a { color: var(--amber-light); text-underline-offset: 4px; }
a:hover { color: #fff1df; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid #ffd1a0;
  outline-offset: 5px;
}
button:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
::selection { background: #b66f40; color: white; }
img, svg { max-width: 100%; }
svg { flex-shrink: 0; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-weight: 400; }
.sr-only, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The actual WebGL world stays exposed between lightweight narrative overlays. */
.world { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #211c19; }
.world-image {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  background-image: url("../../public/images/last-light-hero.webp");
  background-position: 63% center;
  background-size: cover;
  object-fit: cover;
  object-position: 63% center;
  transform: scale(1.025);
  filter: saturate(.76) brightness(.79);
  transition: filter 2.8s ease, opacity 2.8s ease;
}
.world[data-fallback="true"] .world-image { display: block; }
#atmosphere { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1; pointer-events: auto; touch-action: none; }
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(9, 13, 16, .77) 0%, rgba(11, 14, 16, .45) 28%, transparent 60%),
    linear-gradient(180deg, rgba(9, 12, 15, .32), transparent 20%, transparent 75%, rgba(9, 12, 15, .55));
}
.world::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 180px rgba(0, 0, 0, .12); pointer-events: none; }
body[data-environment="day"] .world-image { filter: saturate(.75) brightness(.93); }
body[data-environment="sunset"] .world-image { filter: sepia(.2) saturate(.9) brightness(.7); }
body[data-environment="storm"] .world-image { filter: sepia(.55) saturate(.65) brightness(.47) blur(.6px); }
body[data-environment="night"] .world-image { filter: sepia(.1) saturate(.24) brightness(.24); }
body[data-environment="earth"] .world-image { filter: saturate(.24) brightness(.26); }
body[data-screen="game"] .vignette {
  background:
    linear-gradient(90deg, rgba(9, 13, 16, .63), rgba(9, 13, 16, .15) 36%, transparent 60%),
    linear-gradient(180deg, rgba(9, 12, 15, .25), transparent 18%, transparent 75%, rgba(9, 12, 15, .45));
}
body[data-screen="ending"] .vignette { background: rgba(9, 13, 16, .78); }

.topbar {
  min-height: 100px;
  padding: 26px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 14px; font: 11px/1.3 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.brand svg { width: 26px; height: 26px; color: var(--amber); }
.brand small { font-size: 9px; color: var(--muted); letter-spacing: .14em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-actions button, .icon-button {
  min-width: 44px;
  min-height: 44px;
  padding: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: rgba(15, 18, 21, .24);
  color: #d6c7b5;
  transition: border-color .2s, background .2s, color .2s;
}
.topbar-actions button:hover, .icon-button:hover { color: var(--ink); border-color: var(--line); background: rgba(15, 18, 21, .65); }
.topbar-actions button[aria-pressed="true"] { color: var(--amber-light); }
.topbar-actions svg, .icon-button svg { width: 18px; height: 18px; }
.topbar-actions button span { font: 10px var(--mono); letter-spacing: .05em; }
.topbar-actions button:has(span) { border-radius: 3px; }

#app { position: relative; z-index: 2; pointer-events: none; }
#app button, #app a, #app input, #app select, #app details { pointer-events: auto; }
.title-screen {
  min-height: calc(100svh - 100px);
  padding: clamp(36px, 8.2vh, 105px) var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}
.eyebrow, .title-kicker {
  font: 10px/1.7 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 24px;
}
.eyebrow::before { content: ""; display: inline-block; width: 24px; height: 1px; background: currentColor; vertical-align: middle; margin-right: 13px; opacity: .8; }
.title-kicker { margin-bottom: 20px; color: var(--muted); }
h1.title {
  font: 400 clamp(84px, 10.4vw, 164px)/.86 var(--serif);
  letter-spacing: -.065em;
  margin: 5px 0 34px -5px;
  max-width: 690px;
  text-wrap: balance;
  text-shadow: 0 4px 40px rgba(0, 0, 0, .2);
}
.title em, .title i { color: var(--amber-light); font-weight: 400; }
.title-description { max-width: 365px; font-size: 15px; line-height: 1.85; color: #d3c9bd; margin-bottom: 31px; }
.title-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  min-height: 52px;
  padding: 16px 24px;
  border: 1px solid var(--amber);
  border-radius: 2px;
  background: var(--amber);
  color: #20170f;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .035em;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}
.primary-button:hover { background: #f3c08f; border-color: #f3c08f; color: #20170f; transform: translateY(-1px); }
.primary-button svg { width: 16px; height: 16px; }
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(13, 17, 21, .35);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.secondary-button:hover { border-color: #b99776; background: rgba(39, 33, 29, .8); }
.session-note { margin: 18px 0 0; font: 10px/1.8 var(--mono); color: var(--muted); }
.title-bottom { margin-top: auto; padding-top: 64px; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.coordinates, .mission-mark { color: #beb3a6; font: 9px/1.9 var(--mono); text-transform: uppercase; letter-spacing: .13em; }
.coordinates strong, .mission-mark strong { display: block; color: #f0d8bb; font-weight: 400; }
.mission-mark { text-align: right; max-width: 250px; }
.mission-mark::before { content: ""; display: block; margin: 0 0 12px auto; width: 34px; height: 1px; background: var(--amber); }

.game-screen { padding: 20px var(--gutter) 30px; min-height: calc(100svh - 100px); }
.chapter-bar { display: flex; align-items: center; gap: 13px; width: 100%; padding-bottom: 22px; border-bottom: 1px solid var(--line); font: 10px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.chapter-number { color: var(--amber); }
.chapter-name { color: var(--muted); }
.sol-label { margin-left: auto; color: #e0c5a5; }
.game-layout { display: grid; grid-template-columns: minmax(0, 455px) minmax(140px, 190px); justify-content: space-between; gap: 70px; padding-top: clamp(28px, 6vh, 65px); align-items: start; }
.story-panel { min-width: 0; animation: enter .55s ease both; padding: 26px; margin-left: -26px; border: 1px solid rgba(225, 204, 179, .12); background: linear-gradient(120deg, rgba(10, 15, 18, .84), rgba(10, 15, 18, .64)); backdrop-filter: blur(7px); border-radius: 3px; pointer-events: auto; box-shadow: 0 15px 60px rgba(0, 0, 0, .12); }
.story-panel > .eyebrow { margin-bottom: 14px; font-size: 9px; }
.scene-title { font: 400 clamp(34px, 3.5vw, 51px)/1.04 var(--serif); letter-spacing: -.045em; margin: 0 0 21px; max-width: 450px; text-wrap: balance; }
.scene-text { font-size: 14px; line-height: 1.8; max-width: 440px; color: #d1c8bc; }
.scene-text p { margin-bottom: 1.05em; }
.thought { margin: 20px 0 24px; max-width: 440px; font: italic 19px/1.5 var(--serif); color: #ead1b4; border-left: 1px solid #a26d46; padding-left: 16px; }
.observation-panel { border-top: 1px solid var(--line); margin: 29px 0 22px; padding: 21px 0 0; max-width: 570px; animation: enter .4s ease both; }
.observation-panel h2 { margin: 0 0 13px; color: var(--amber-light); font: 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.observation-panel p { font-size: 14px; line-height: 1.75; color: #d3c9bd; }
.science-note { margin-top: 18px; padding: 14px 16px; background: rgba(193, 142, 95, .065); border-left: 1px solid rgba(224, 168, 117, .5); color: #c7bbae; font: 12px/1.7 var(--sans); }
.science-note p { margin: 0; font-size: inherit; }
.science-note a { font-size: 11px; }
.choices { display: grid; gap: 10px; margin: 21px 0 16px; max-width: 570px; }
.choice { text-align: left; display: grid; grid-template-columns: 26px 1fr; column-gap: 13px; padding: 17px 19px; border: 1px solid rgba(231, 201, 164, .25); background: rgba(14, 19, 22, .7); border-radius: 2px; transition: background .18s, border-color .18s, transform .18s; }
.choice:hover { border-color: #c28d5e; background: rgba(53, 39, 29, .8); transform: translateX(3px); }
.choice-number { grid-row: span 2; padding-top: 2px; color: #ba885b; font: 10px/1.6 var(--mono); }
.choice-label { color: #f3e4d1; font-size: 14px; line-height: 1.4; }
.choice-detail { color: #bdb4aa; font-size: 12px; line-height: 1.6; margin-top: 5px; }
.choice[aria-pressed="true"] { border-color: var(--amber); background: rgba(75, 49, 28, .8); }
.transmission-panel { max-width: 570px; padding: 22px 24px; margin: 26px 0 24px; border: 1px solid rgba(224, 168, 117, .28); background: rgba(11, 17, 21, .84); position: relative; animation: enter .5s ease both; }
.transmission-panel::before { content: ""; position: absolute; top: -1px; left: -1px; width: 26px; height: 1px; background: var(--amber); }
.transmission-label { font: 9px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--amber); margin-bottom: 13px; }
.transmission-text { font: 15px/1.85 var(--mono); color: #ddd5c9; margin-bottom: 0; white-space: pre-line; }
.transmission-panel .hint { margin-bottom: 0; }
.hint { max-width: 530px; font-size: 11px; line-height: 1.75; color: #afa69b; margin: 13px 0 0; }
.story-panel > .primary-button { margin-top: 8px; }
.telemetry { padding: 18px; margin-right: -18px; color: #ddd0bf; align-self: start; background: rgba(10, 15, 18, .64); border: 1px solid rgba(225, 204, 179, .12); border-radius: 3px; backdrop-filter: blur(5px); }
.telemetry-heading { font: 9px/1.7 var(--mono); text-transform: uppercase; letter-spacing: .2em; color: #d8c8b4; padding-bottom: 15px; border-bottom: 1px solid var(--line); margin-bottom: 23px; }
.telemetry-heading::before { content: ""; display: inline-block; width: 4px; height: 4px; background: var(--amber); margin-right: 10px; border-radius: 50%; vertical-align: middle; }
.telemetry-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 22px 0 10px; font: 10px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.telemetry-row strong { font-weight: 400; color: var(--amber-light); }
.meter { height: 2px; background: rgba(220, 205, 183, .18); width: 100%; overflow: hidden; }
.meter-fill { height: 100%; background: var(--amber); transition: width 1.5s ease; }
.signal-bars { display: flex; gap: 4px; height: 18px; align-items: flex-end; }
.signal-bars i { display: block; width: 5px; height: 6px; background: var(--amber); opacity: .65; }
.signal-bars i:nth-child(2) { height: 9px; }
.signal-bars i:nth-child(3) { height: 12px; }
.signal-bars i:nth-child(4) { height: 15px; }
.signal-bars i:nth-child(5) { height: 18px; }
.signal-bars i.off { opacity: .15; }
.mission-log { margin-top: 28px; padding-top: 17px; border-top: 1px solid var(--line); }
.mission-log h2, .mission-log h3 { color: #c3b39e; font: 9px/1.7 var(--mono); text-transform: uppercase; letter-spacing: .14em; margin: 0 0 20px; }
.log-entry { margin: 16px 0; padding-left: 12px; border-left: 1px solid #8f6c4d; font: 11px/1.65 var(--mono); color: #c0b5a6; }
.log-entry strong { display: block; color: #dfc8aa; font-weight: 400; margin-bottom: 4px; }
.memory-count { color: #d5b48f; font: 10px/1.8 var(--mono); margin-top: 25px; }
.telemetry .hint { font-size: 10px; margin-top: 20px; max-width: 200px; }
.journey-nav { display: flex; align-items: center; gap: 9px; margin-top: 50px; padding-top: 20px; border-top: 1px solid var(--line); min-height: 40px; }
.journey-dot { width: 4px; height: 4px; border-radius: 50%; background: #685b4e; flex-shrink: 0; }
.journey-dot.active, .journey-dot[aria-current="step"] { background: var(--amber-light); width: 20px; border-radius: 3px; }
.journey-dot.complete, .journey-dot.visited { background: #c18b5b; }
.journey-label { margin-left: auto; text-transform: uppercase; color: #c0ad97; font: 9px/1.6 var(--mono); letter-spacing: .13em; }

.ending-screen { max-width: 1040px; margin: 0 auto; padding: 50px var(--gutter) 80px; animation: enter 1.4s ease both; pointer-events: auto; }
.ending-screen > .eyebrow { margin-bottom: 27px; }
.ending-title { font: 400 clamp(48px, 6.5vw, 88px)/1.02 var(--serif); letter-spacing: -.055em; max-width: 760px; margin: 0 0 30px; text-wrap: balance; }
.ending-text { max-width: 600px; color: #d2c8bc; font-size: 16px; line-height: 1.9; }
.ending-text .thought { margin: 32px 0; }
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; margin: 40px 0 35px; }
.memory-card { padding: 23px 0 24px; border-top: 1px solid var(--line); }
.memory-card h2, .memory-card h3 { font: 22px/1.2 var(--serif); margin: 0 0 12px; color: #ead3b5; }
.memory-card p { margin: 0; font-size: 13px; line-height: 1.8; color: #bfb4a7; }
.memory-card small, .memory-card .eyebrow { font: 9px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: #bd8f67; display: block; margin-bottom: 11px; }
.ending-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 25px 0; }
.sources-list { padding: 0; list-style: none; }
.sources-list li { border-top: 1px solid var(--line); padding: 14px 0; font-size: 13px; line-height: 1.7; }
.sources-list small { display: block; color: var(--muted); }
.ending-screen > h2 { font: 10px/1.6 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); margin-top: 45px; }

.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: min(85svh, 800px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  border: 1px solid #594b3d;
  border-radius: 3px;
  background: #15191c;
  box-shadow: 0 35px 120px rgba(0, 0, 0, .7);
}
.modal::backdrop { background: rgba(2, 5, 8, .78); backdrop-filter: blur(6px); }
.modal-inner { padding: 28px 32px 32px; }
.modal-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 18px; }
.modal-header h2 { font: 32px/1.15 var(--serif); letter-spacing: -.025em; margin: 0; }
.close-button { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 22px; border-radius: 50%; }
.close-button:hover { color: white; border-color: var(--amber); }
.modal p { font-size: 14px; line-height: 1.8; color: #c8bdb0; }
.modal h3 { font: 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--amber); margin: 25px 0 12px; }
.settings-list { margin: 24px 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); font-size: 14px; }
.setting-row small { display: block; max-width: 330px; font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 5px; }
.setting-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--amber); flex-shrink: 0; cursor: pointer; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 15px; }
.modal ul:not(.sources-list) { padding-left: 20px; font-size: 13px; line-height: 1.9; color: #c8bdb0; }

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

@media (min-width: 1600px) {
  .game-layout { grid-template-columns: minmax(0, 490px) minmax(170px, 210px); }
  .scene-text { font-size: 15px; }
  .title-description { font-size: 17px; max-width: 420px; }
}

@media (max-width: 1000px) {
  .game-layout { grid-template-columns: minmax(0, 425px) minmax(130px, 160px); gap: 36px; }
  .topbar { min-height: 88px; padding-top: 20px; padding-bottom: 20px; }
  .title-screen { min-height: calc(100svh - 88px); }
  .telemetry { font-size: 11px; }
  .telemetry-heading { font-size: 8px; }
}

@media (max-width: 760px) {
  :root { --gutter: 26px; }
  .topbar { min-height: 80px; padding-top: 16px; padding-bottom: 16px; }
  .brand { font-size: 10px; gap: 10px; letter-spacing: .15em; }
  .brand small { display: none; }
  .topbar-actions { gap: 4px; }
  .world-image { background-position: 67% center; object-position: 67% center; }
  .vignette { background: linear-gradient(90deg, rgba(8, 12, 15, .6), rgba(8, 12, 15, .1)), linear-gradient(180deg, rgba(8, 12, 15, .2), transparent 35%, rgba(8, 12, 15, .65)); }
  .title-screen { min-height: calc(100svh - 80px); padding-top: 12vh; padding-bottom: 27px; }
  h1.title { font-size: clamp(82px, 18vw, 124px); max-width: 480px; margin-bottom: 28px; }
  .title-description { max-width: 330px; font-size: 14px; }
  .title-bottom { padding-top: 60px; }
  .coordinates, .mission-mark { font-size: 8px; }
  .game-screen { padding-top: 10px; min-height: calc(100svh - 80px); }
  .chapter-bar { font-size: 9px; gap: 9px; padding-bottom: 18px; }
  .game-layout { display: flex; flex-direction: column; gap: 22px; padding-top: 26svh; }
  .story-panel { width: 100%; margin-left: 0; padding: 22px; background: rgba(10, 15, 18, .93); }
  .scene-title { font-size: clamp(37px, 8vw, 57px); }
  .scene-text { max-width: 590px; font-size: 15px; }
  .thought { font-size: 20px; }
  body[data-screen="game"] .vignette { background: linear-gradient(180deg, rgba(9, 13, 16, .2), transparent 20%, transparent 35%, rgba(9, 13, 16, .4)); }
  .telemetry { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 30px; padding: 17px; margin-right: 0; border-top: 1px solid var(--line); }
  .telemetry-heading { grid-column: 1/-1; border: 0; padding-bottom: 0; margin-bottom: 5px; }
  .telemetry > .telemetry-row { margin-top: 14px; }
  .telemetry .mission-log { display: none; }
  .telemetry .memory-count { margin-top: 10px; }
  .telemetry .hint { grid-column: 1/-1; max-width: none; margin-top: 14px; }
  .journey-nav { margin-top: 24px; }
  .ending-screen { padding-top: 33px; }
  .ending-title { font-size: clamp(44px, 10vw, 72px); }
  .ending-text { font-size: 15px; }
  .archive-grid { gap: 0 22px; }
}

@media (max-width: 440px) {
  :root { --gutter: 22px; }
  .topbar-actions button .button-label { display: none; }
  .topbar-actions button span[aria-hidden] { display: inline; font-size: 18px; }
  .title-screen { padding-top: 9vh; }
  h1.title { font-size: 88px; }
  .title-description { font-size: 14px; }
  .title-actions { gap: 10px; }
  .title-actions .primary-button { padding-inline: 19px; }
  .title-actions .secondary-button { padding-inline: 14px; }
  .title-bottom { gap: 15px; padding-top: 45px; }
  .mission-mark { max-width: 135px; }
  .eyebrow { letter-spacing: .13em; font-size: 9px; }
  .chapter-name { max-width: 140px; }
  .sol-label { font-size: 8px; white-space: nowrap; }
  .choice { padding: 15px 14px; column-gap: 8px; }
  .choice-label { font-size: 13px; }
  .choice-detail { font-size: 11px; }
  .transmission-panel { padding: 20px; }
  .transmission-text { font-size: 13px; }
  .archive-grid { grid-template-columns: 1fr; }
  .modal-inner { padding: 22px; }
  .modal-header h2 { font-size: 29px; }
}
