:root {
  --ink: #111715;
  --dark: #08110e;
  --paper: #e8e5d7;
  --mint: #a8c9b6;
  --mint-bright: #c7f7cf;
  --peach: #f2a184;
  --red: #c14e45;
  --fog: rgba(232, 239, 224, 0.72);
  --line: rgba(215, 235, 219, 0.2);
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --mono: "Courier New", "STFangsong", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--dark); color: var(--paper); }
body { font-family: var(--display); overflow: hidden; cursor: none; }
.lang-en { --display: "Baskerville", "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
button { font: inherit; cursor: none; }
button:focus-visible { outline: 2px solid var(--peach); outline-offset: 4px; }

.screen { position: fixed; inset: 0; opacity: 0; visibility: hidden; transform: scale(1.015); transition: opacity .75s ease, transform .9s ease, visibility .75s; overflow: auto; }
.screen.is-active { opacity: 1; visibility: visible; transform: scale(1); z-index: 2; }
.grain, .scanlines { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.grain { opacity: .16; mix-blend-mode: soft-light; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"); animation: grain .22s steps(2) infinite; }
.scanlines { opacity: .2; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(4, 10, 8, .16) 4px); }
.cursor-dot { position: fixed; left: -20px; top: -20px; width: 12px; height: 12px; z-index: 200; border: 1px solid var(--paper); border-radius: 50%; pointer-events: none; mix-blend-mode: difference; transition: width .2s, height .2s, transform .05s linear; }
.cursor-dot.is-hovering { width: 34px; height: 34px; margin: -11px; background: rgba(255,255,255,.18); }
.language-switch { position: fixed; z-index: 160; top: 20px; right: 35px; min-width: 52px; padding: 8px 11px; border: 1px solid rgba(235,242,226,.25); color: rgba(239,242,226,.76); background: rgba(3,10,8,.28); backdrop-filter: blur(10px); font: 10px/1 var(--mono); letter-spacing: .12em; text-align: center; text-decoration: none; transition: .2s ease; }
.language-switch:hover { color: var(--ink); background: var(--mint-bright); border-color: var(--mint-bright); }
body:has(#landing:not(.is-active)) .language-switch { opacity: 0; visibility: hidden; pointer-events: none; }

.hero-bg, .story-photo, .game-scene-bg { position: absolute; inset: 0; background: center / cover no-repeat url("assets/threshold-pool.jpg"); }
.hero-bg { animation: breathe 18s ease-in-out infinite alternate; }
.vignette { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,14,11,.42), rgba(5,14,11,.08) 42%, rgba(4,10,8,.86)), radial-gradient(circle at 50% 35%, transparent 0 25%, rgba(1,8,6,.45) 92%); }
.topline { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 28px 112px 28px 36px; z-index: 2; font: 11px/1 var(--mono); letter-spacing: .13em; }
.recording { display: flex; gap: 10px; align-items: center; }
.recording i { width: 7px; height: 7px; background: var(--red); border-radius: 50%; box-shadow: 0 0 10px var(--red); animation: blink 1.7s infinite; }
.timestamp { color: rgba(238,242,224,.62); }
.landing-copy { position: relative; z-index: 2; min-height: 100vh; display: flex; align-items: center; flex-direction: column; justify-content: center; text-align: center; padding: 80px 24px 170px; }
.eyebrow { margin: 0 0 16px; color: var(--mint-bright); font: 10px/1.4 var(--mono); letter-spacing: .26em; text-transform: uppercase; }
.landing-copy h1 { margin: 0; line-height: .77; letter-spacing: -.06em; text-shadow: 0 8px 35px rgba(0,0,0,.5); }
.landing-copy h1 span { display: block; font-size: clamp(42px, 6vw, 78px); font-weight: 400; letter-spacing: .3em; padding-left: .3em; color: rgba(238,238,222,.82); }
.landing-copy h1 strong { display: block; font-size: clamp(110px, 15vw, 210px); font-weight: 800; }
.lang-en .landing-copy h1 { line-height: .82; }
.lang-en .landing-copy h1 span { font-size: clamp(28px, 4vw, 58px); letter-spacing: .42em; padding-left: .42em; }
.lang-en .landing-copy h1 strong { font-size: clamp(88px, 14vw, 190px); letter-spacing: -.035em; }
.lang-en .subtitle { letter-spacing: .18em; text-transform: uppercase; }
.lang-en .warning { font-family: var(--mono); letter-spacing: .04em; }
.subtitle { margin: 35px 0 0; font-size: clamp(15px, 1.5vw, 20px); letter-spacing: .28em; }
.warning { margin: 18px 0 30px; color: rgba(226,231,215,.55); font-size: 12px; line-height: 1.8; letter-spacing: .08em; }
.landing-actions { width: min(430px, 90vw); display: grid; gap: 9px; }
.primary-btn { border: 0; min-height: 72px; padding: 0 28px; background: rgba(239,239,224,.94); color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 20px; box-shadow: 0 8px 40px rgba(0,0,0,.28); transition: .25s ease; }
.primary-btn:hover { background: var(--mint-bright); transform: translateY(-3px); box-shadow: 0 15px 50px rgba(7, 25, 18, .4); }
.primary-btn b { display: block; font-size: 17px; letter-spacing: .12em; }
.primary-btn small { display: block; margin-top: 5px; font: 9px var(--mono); opacity: .5; letter-spacing: .08em; }
.play-mark { font: 16px var(--mono); }
.ghost-btn { border: 1px solid rgba(238,242,224,.22); min-height: 43px; background: rgba(5,15,12,.24); color: rgba(239,242,226,.74); transition: .2s; }
.ghost-btn:hover { background: rgba(190,217,195,.16); border-color: rgba(238,242,224,.55); }
.bottom-nav { position: absolute; z-index: 2; bottom: 70px; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; width: min(720px, calc(100% - 40px)); }
.bottom-nav button { flex: 1; color: rgba(231,237,222,.62); background: rgba(3,10,8,.35); border: 1px solid rgba(223,235,220,.1); padding: 13px 8px; font-size: 11px; letter-spacing: .08em; backdrop-filter: blur(10px); transition: .2s; }
.bottom-nav button:hover { color: var(--paper); background: rgba(160,196,174,.18); }
.bottom-nav span { margin-right: 6px; }
.landing-footer { position: absolute; z-index: 2; left: 36px; right: 36px; bottom: 25px; display: flex; justify-content: space-between; color: rgba(228,234,220,.35); font: 9px var(--mono); letter-spacing: .08em; }

.story-screen { background: #0c1311; display: grid; grid-template-columns: 1.1fr .9fr; }
.story-photo { position: relative; filter: grayscale(.25) brightness(.55); }
.story-photo::after { content:""; position:absolute; inset:0; background: linear-gradient(90deg, transparent 55%, #0c1311), linear-gradient(0deg, rgba(8,17,14,.7), transparent 60%); }
.story-sheet { min-height: 100vh; padding: clamp(80px, 9vh, 120px) clamp(40px, 7vw, 110px) 60px 20px; display: flex; justify-content: center; flex-direction: column; position: relative; }
.story-date { color: var(--mint-bright); font: 11px var(--mono); letter-spacing: .12em; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.story-sheet h2 { font-size: clamp(34px, 4.1vw, 62px); margin: 35px 0 28px; font-weight: 500; line-height: 1.15; }
.story-text { color: rgba(239,238,223,.73); font-size: 15px; line-height: 2.1; max-width: 620px; }
.story-text p { margin: 0 0 16px; }
.story-text blockquote { margin: 24px 0; border-left: 1px solid var(--peach); padding: 4px 0 4px 20px; color: var(--peach); }
.compact { width: max-content; min-height: 58px; margin-top: 24px; gap: 45px; }
.tape-counter { margin-top: 30px; color: rgba(220,230,215,.28); font: 9px var(--mono); letter-spacing: .12em; }
.corner-back { position: absolute; z-index: 4; top: 28px; left: 36px; color: rgba(240,241,228,.65); border: 0; background: none; font-size: 11px; letter-spacing: .12em; }

.loadout-screen { background: #0a100e; padding-bottom: 100px; }
.game-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 5vw; position: sticky; top: 0; background: rgba(8,15,13,.9); backdrop-filter: blur(12px); z-index: 4; }
.brand-mini { font-size: 18px; letter-spacing: .12em; }
.brand-mini small { font: 9px var(--mono); color: rgba(232,239,224,.4); }
.resource-pills { display: flex; gap: 10px; font: 10px var(--mono); }
.resource-pills span { border: 1px solid var(--line); padding: 9px 14px; border-radius: 30px; color: rgba(231,237,223,.55); }
.resource-pills b { color: var(--mint-bright); }
.loadout-layout { width: min(1360px, 92vw); margin: 0 auto; display: grid; grid-template-columns: 280px 1fr; gap: 60px; padding: 60px 0 120px; }
.loadout-note { padding-top: 60px; }
.loadout-note h2 { font-size: 48px; font-weight: 500; line-height: 1.18; margin: 0 0 25px; }
.loadout-note > p:not(.eyebrow) { color: rgba(229,235,221,.5); font-size: 13px; line-height: 1.9; }
.paper-note { margin-top: 45px; background: #cdd6b9; color: #273029; padding: 20px; transform: rotate(-2deg); font-size: 12px; line-height: 1.7; box-shadow: 4px 8px 0 rgba(0,0,0,.2); }
.category-row { display: flex; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.category-row button { border: 0; background: transparent; color: rgba(229,235,222,.42); padding: 9px 16px; font-size: 11px; }
.category-row button.is-active { background: rgba(166,203,181,.16); color: var(--mint-bright); }
.item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item-card { min-height: 176px; border: 1px solid var(--line); padding: 22px; background: linear-gradient(135deg, rgba(185,211,191,.055), rgba(255,255,255,.01)); position: relative; transition: .25s; }
.item-card:hover { border-color: rgba(198,244,208,.48); transform: translateY(-2px); }
.item-card.is-selected { background: rgba(146,201,170,.12); border-color: var(--mint-bright); }
.item-top { display: flex; justify-content: space-between; gap: 20px; }
.item-icon { width: 48px; height: 48px; border: 1px solid rgba(230,238,222,.15); display: grid; place-items: center; font-size: 25px; background: rgba(0,0,0,.18); }
.item-card h3 { font-size: 17px; font-weight: 500; margin: 16px 0 7px; }
.item-card p { margin: 0; color: rgba(230,235,224,.43); font-size: 11px; line-height: 1.65; max-width: 75%; }
.item-meta { color: var(--mint-bright); font: 10px var(--mono); text-align: right; line-height: 1.8; }
.item-stepper { position: absolute; right: 20px; bottom: 20px; display: flex; border: 1px solid var(--line); }
.item-stepper button { width: 32px; height: 30px; border: 0; background: rgba(255,255,255,.03); color: var(--paper); }
.item-stepper span { width: 30px; display: grid; place-items: center; font: 11px var(--mono); }
.loadout-bar { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; min-height: 86px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; background: rgba(7,14,11,.94); border-top: 1px solid var(--line); backdrop-filter: blur(15px); }
.text-btn { border: 0; background: transparent; color: rgba(232,237,225,.48); font-size: 11px; }
.selected-summary { font: 10px var(--mono); color: rgba(232,237,225,.38); }

.game-screen { background: #050a08; }
.game-scene-bg { filter: brightness(.42) saturate(.7); transform: scale(1.03); transition: filter 1s ease, transform 3s ease; }
.game-screen.is-active .game-scene-bg { transform: scale(1); }
.game-scene-bg::after { content:""; position:absolute; inset:0; background: linear-gradient(90deg, rgba(3,9,7,.82), transparent 55%), linear-gradient(0deg, rgba(3,9,7,.68), transparent 55%); }
.game-hud { position: relative; z-index: 2; min-height: 100px; display: grid; grid-template-columns: 1fr auto 60px; gap: 40px; align-items: center; padding: 16px 4vw; border-bottom: 1px solid rgba(228,239,225,.13); background: rgba(3,9,7,.55); backdrop-filter: blur(7px); }
.location p { margin: 0 0 5px; color: var(--mint-bright); font: 9px var(--mono); letter-spacing: .16em; }
.location h2 { margin: 0; font-size: 19px; font-weight: 400; }
.vitals { display: grid; grid-template-columns: repeat(4, minmax(95px, 130px)); gap: 18px; }
.vital { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.vital span { font-size: 10px; color: rgba(236,239,227,.52); }
.vital b { font: 9px var(--mono); color: rgba(236,239,227,.65); }
.vital div { grid-column: 1/-1; height: 2px; background: rgba(232,241,228,.15); }
.vital i { display: block; width: var(--value, 50%); height: 100%; background: var(--mint-bright); transition: width .6s ease, background .3s; }
.vital.is-low i { background: var(--peach); }
.pack-btn { border: 1px solid var(--line); background: rgba(0,0,0,.15); color: var(--paper); width: 48px; height: 48px; position: relative; }
.pack-btn span { position: absolute; right: -5px; top: -5px; background: var(--red); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 8px var(--mono); }
.event-layout { position: relative; z-index: 2; min-height: calc(100vh - 150px); display: grid; grid-template-columns: 1fr minmax(430px, 550px); gap: 10vw; align-items: center; padding: 60px 7vw 100px; }
.scene-label { align-self: end; padding-bottom: 40px; }
.scene-label span { font: 58px/1 var(--mono); letter-spacing: -.08em; color: rgba(232,238,225,.42); }
.scene-label p { margin: 9px 0; font: 10px var(--mono); color: rgba(232,238,225,.42); }
.event-card { background: rgba(13,21,17,.82); border: 1px solid rgba(217,235,218,.17); padding: 42px; backdrop-filter: blur(14px); box-shadow: 30px 40px 80px rgba(0,0,0,.28); }
.card-index { font: 9px var(--mono); letter-spacing: .15em; color: var(--mint-bright); }
.card-index span { float: right; color: rgba(231,238,224,.33); }
.event-card h1 { font-size: 36px; font-weight: 400; line-height: 1.25; margin: 35px 0 18px; }
.event-card > p { color: rgba(236,239,227,.62); font-size: 14px; line-height: 1.9; }
.choices { display: grid; gap: 8px; margin-top: 28px; }
.choice-btn { border: 1px solid rgba(220,235,220,.16); background: rgba(255,255,255,.025); color: var(--paper); padding: 15px 17px; text-align: left; display: flex; justify-content: space-between; gap: 15px; font-size: 13px; transition: .22s; }
.choice-btn:hover { background: var(--paper); color: var(--ink); padding-left: 24px; }
.choice-btn small { font: 9px var(--mono); opacity: .55; }
.choice-hint { font: 9px var(--mono) !important; color: rgba(231,238,224,.3) !important; margin: 16px 0 0; }
.lang-en .event-card h1 { font-size: clamp(32px, 3.1vw, 44px); }
.lang-en .choice-btn { font-size: 14px; }
.lang-en .choice-btn small { white-space: nowrap; }
.lang-en .loadout-note h2 { font-size: 39px; line-height: 1.12; }
.lang-en .item-card h3 { letter-spacing: .025em; }
.progress-track { position: absolute; z-index: 3; bottom: 32px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; }
.progress-track i { display:block; width: 40px; height: 2px; background: rgba(232,239,225,.18); }
.progress-track i.done { background: var(--mint-bright); }

.ending-screen { background: #abc5b4; color: #101814; display: grid; grid-template-columns: 1fr 1fr; }
.ending-door { display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, #dbe7ce 0, #9fb9aa 45%, #6e8d7e 100%); }
.ending-door div { width: 230px; height: 470px; background: #fff3c7; border: 18px solid #6f7b6c; box-shadow: 0 0 120px #fff6c9, inset 20px 0 30px rgba(114,104,70,.22); transform: perspective(700px) rotateY(-18deg); transform-origin: left; animation: door 4s ease-in-out infinite alternate; }
.ending-copy { display: flex; flex-direction: column; justify-content: center; padding: 80px clamp(45px, 8vw, 130px); background: rgba(230,231,208,.78); }
.ending-copy .eyebrow { color: #496657; }
.ending-copy h1 { font-size: clamp(40px, 5vw, 72px); line-height: 1.2; font-weight: 500; margin: 15px 0 25px; }
.ending-copy > p:not(.eyebrow) { line-height: 1.8; color: rgba(16,24,20,.65); }
.ending-stats { display: flex; gap: 22px; margin: 25px 0 40px; padding: 18px 0; border-block: 1px solid rgba(16,24,20,.15); font: 10px var(--mono); }
.ending-stats b { display: block; font-size: 22px; margin-bottom: 4px; }

dialog { width: min(560px, calc(100% - 40px)); color: var(--paper); background: rgba(10,17,14,.96); border: 1px solid rgba(212,234,216,.26); padding: 50px; box-shadow: 0 30px 120px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(2,8,6,.78); backdrop-filter: blur(7px); }
.modal-close, .drawer-close { position: absolute; top: 15px; right: 18px; border:0; background:transparent; color:rgba(235,239,227,.55); font: 25px var(--mono); }
.modal-body h2 { font-size: 38px; font-weight: 400; margin: 0 0 25px; }
.modal-body p, .modal-body li { color: rgba(231,236,224,.6); line-height: 1.85; font-size: 13px; }
.modal-body li { margin-bottom: 10px; }
.archive-entry { border-left: 1px solid var(--mint); padding-left: 18px; margin: 22px 0; }
.archive-entry b { display:block; margin-bottom: 5px; }
.archive-entry small { font: 9px var(--mono); color: rgba(230,236,224,.38); }
.pack-drawer { position: fixed; z-index: 90; top: 0; bottom: 0; right: 0; width: min(390px, 100%); background: rgba(8,15,12,.97); border-left: 1px solid var(--line); padding: 70px 36px; transform: translateX(105%); transition: transform .35s ease; }
.pack-drawer.is-open { transform: translateX(0); }
.pack-drawer h2 { font-size: 35px; font-weight: 400; }
.pack-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 15px 0; font-size: 13px; }
.drawer-note { position: absolute; bottom: 30px; color: rgba(232,238,226,.35); font-size: 11px; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; background: var(--paper); color: var(--ink); padding: 12px 22px; font-size: 11px; transition: .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes grain { 0%{transform:translate(0)} 25%{transform:translate(2%,-2%)} 50%{transform:translate(-2%,2%)} 75%{transform:translate(3%,1%)} }
@keyframes breathe { from { transform: scale(1.01); filter: saturate(.75); } to { transform: scale(1.06); filter: saturate(.95); } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes door { from { transform: perspective(700px) rotateY(-10deg); } to { transform: perspective(700px) rotateY(-28deg); } }

@media (max-width: 900px) {
  body { cursor: auto; } button { cursor: pointer; } .cursor-dot { display:none; }
  .story-screen { grid-template-columns: 1fr; } .story-photo { position:absolute; inset:0; opacity:.45; } .story-sheet { padding: 100px 30px 55px; background: linear-gradient(90deg, rgba(8,15,13,.55), rgba(8,15,13,.92)); }
  .loadout-layout { grid-template-columns: 1fr; gap: 15px; padding-top: 30px; } .loadout-note { padding-top:0; } .loadout-note h2 { font-size:38px; } .paper-note { display:none; }
  .game-hud { grid-template-columns: 1fr 48px; gap:15px; } .vitals { grid-row:2; grid-column:1/-1; grid-template-columns:repeat(4,1fr); } .pack-btn { grid-column:2; grid-row:1; }
  .event-layout { grid-template-columns: 1fr; padding: 30px 20px 75px; } .scene-label { display:none; } .event-card { padding: 30px 24px; align-self:center; }
  .ending-screen { grid-template-columns: 1fr; } .ending-door { position:absolute; inset:0; opacity:.28; } .ending-copy { position:relative; min-height:100vh; }
}

@media (max-width: 600px) {
  .topline { padding:20px 90px 20px 20px; } .timestamp { display:none; } .language-switch { top:13px; right:20px; }
  .landing-copy { justify-content:flex-end; padding-bottom:200px; } .landing-copy h1 span { font-size:35px; } .landing-copy h1 strong { font-size:100px; }
  .lang-en .landing-copy h1 span { font-size:23px; } .lang-en .landing-copy h1 strong { font-size:78px; }
  .bottom-nav { bottom:60px; display:grid; grid-template-columns:1fr 1fr; } .landing-footer { left:20px; right:20px; bottom:18px; } .landing-footer span:first-child { display:none; }
  .game-header { padding: 0 18px; } .resource-pills span { padding:8px 10px; } .resource-pills span:first-child { display:none; }
  .loadout-layout { width:calc(100% - 30px); min-width:0; } .loadout-note, .inventory-panel, .item-grid, .item-card { min-width:0; } .inventory-panel { overflow:hidden; }
  .item-grid { grid-template-columns:minmax(0, 1fr); } .category-row { max-width:100%; overflow-x:auto; } .category-row button { flex:0 0 auto; white-space:nowrap; }
  .item-card p { max-width:70%; } .item-meta { max-width:120px; }
  .loadout-bar { padding:10px 18px; } .selected-summary, .text-btn { display:none; }
  .loadout-bar .primary-btn { width:100%; } .event-card h1 { font-size:29px; }
  .vitals { gap:7px; } .vital span { font-size:8px; } dialog { padding:45px 25px 30px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
