:root {
  color-scheme: dark;
  --ink: #080e15;
  --deep: #0b131e;
  --panel: #101c29;
  --paper: #f3efe8;
  --muted: #a9bacb;
  --signal: #9adddf;
  --copper: #e8a879;
  --line: #324556;
  --max: 1180px;
  font: 16px/1.57 Inter, system-ui, sans-serif;
  color: var(--paper);
  background: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1; }
main:focus { outline: none; }
img, video { display: block; max-width: 100%; }
figure, h1, h2, h3, p { margin: 0; }
p + p { margin-top: .8rem; }
h1, h2, h3 { font-weight: 650; }
h1 { font-size: clamp(2.8rem, 8vw, 6rem); line-height: .98; letter-spacing: -.063em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.9rem, 4.4vw, 3.15rem); line-height: 1.05; letter-spacing: -.043em; }
h3 { font-size: clamp(1.17rem, 2.7vw, 1.55rem); line-height: 1.15; letter-spacing: -.026em; }
a { color: var(--signal); text-underline-offset: .25em; }
a:hover { color: var(--paper); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
[dir="rtl"] .back-link span { rotate: 180deg; }

.wrap { width: min(var(--max), calc(100% - 84px)); margin-inline: auto; }
.section-padded { padding-block: clamp(42px, 7vw, 86px); }
.lede { color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.24rem); max-width: 58ch; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.label { color: var(--signal); font: 620 .75rem/1.4 "IBM Plex Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .075em; }

.skip-link {
  position: absolute;
  z-index: 5;
  inset: .7rem auto auto .7rem;
  padding: .65rem 1rem;
  transform: translateY(-200%);
  background: var(--ink);
}
.skip-link:focus { transform: none; }
.masthead { background: #0a111a; border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 11px 25px; }
.wordmark { display: inline-flex; align-items: center; gap: .72rem; min-height: 44px; color: var(--paper); font-size: .77rem; font-weight: 760; letter-spacing: .15em; white-space: nowrap; text-decoration: none; }
.wordmark img { flex: none; }
.masthead nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 26px; }
.masthead nav a, .language-menu summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .91rem; text-decoration: none; }
.masthead nav a[aria-current], .masthead nav a:hover { color: var(--signal); text-decoration: underline; text-underline-offset: .44em; }
.masthead-actions { display: flex; align-items: center; gap: .65rem; }
.language-menu { position: relative; }
.language-menu summary { cursor: pointer; gap: .35em; }
.language-menu summary::after { content: "▾"; }
.language-menu ul { position: absolute; z-index: 3; inset-inline-end: 0; top: 100%; min-width: 7rem; margin: 0; padding: .4em .7em; list-style: none; border: 1px solid var(--line); background: var(--panel); }
.language-menu a { display: flex; align-items: center; min-height: 40px; }
.language-menu a[aria-current] { color: var(--paper); font-weight: 700; }

.button, .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .44rem;
  min-height: 44px;
  font-weight: 680;
  text-decoration: none;
}
.button { padding: .55em .88em; border: 1px solid #68869d; border-radius: 6px; text-align: center; }
.button.primary { background: var(--copper); border-color: var(--copper); color: var(--ink); }
.button.primary:hover { background: #f6bf99; border-color: #f6bf99; }
.button.quiet { background: #101c29ab; color: var(--paper); }
.button.quiet:hover { border-color: var(--signal); color: var(--signal); }
.account-link { min-height: 44px; font-size: .87rem; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.15rem; }

.hero { position: relative; isolation: isolate; min-height: clamp(555px, 52vw, 735px); display: grid; align-items: center; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-image { position: absolute; z-index: -3; width: 100%; height: 100%; object-fit: cover; object-position: 68% center; }
.hero::before { content: ""; position: absolute; z-index: -2; inset: 0; background: linear-gradient(90deg, #081018f4 0%, #0a121bde 25%, #0a121b77 54%, transparent 80%), linear-gradient(0deg, #080e159c, transparent 48%); }
.hero-inner { padding-block: 42px 55px; }
.hero-copy { max-width: 570px; }
.hero h1 { margin: .28rem 0 .5rem; font-size: clamp(3.8rem, 9.2vw, 7.8rem); line-height: .95; text-transform: uppercase; }
.hero h1 span { display: block; }
.hero-line { font-size: clamp(1.34rem, 3vw, 2.05rem); line-height: 1.17; letter-spacing: -.032em; font-weight: 580; }
.hero .lede { margin-top: .82rem; color: #d3dce7; max-width: 46ch; }
.platforms { margin-top: 1rem; color: #b9c9d9; font-size: .84rem; }
.hero-credit { position: absolute; inset: auto 1.05rem .65rem auto; color: #d8e2eb; background: #080e15b0; padding: .17em .45em; border-radius: 4px; font-size: .71rem; }

.mark-story { border-bottom: 1px solid var(--line); }
.mark-story summary { display: flex; align-items: center; gap: .65rem; min-height: 52px; padding-block: .45rem; color: var(--signal); cursor: pointer; }
.mark-story summary img { flex: none; }
.mark-story summary::after, .devlog-intro summary::after { content: "+"; margin-inline-start: .25em; }
.mark-story[open] summary::after, .devlog-intro[open] summary::after { content: "−"; }
.mark-answer { padding-block: .2rem 1rem; padding-inline-start: 2.4rem; }
.mark-answer [lang="la"] { margin-top: .25rem; font-size: 1.18rem; }
.mark-answer p:last-child { margin-top: .25rem; color: var(--muted); }

.split { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.45fr); align-items: center; gap: clamp(23px, 5vw, 65px); }
.split h2 { margin-block: .28rem .72rem; }
.split p:not(.label) { color: var(--muted); }
.split .text-link { margin-top: .6rem; }
.video-frame { overflow: hidden; background: var(--deep); border: 1px solid var(--line); border-radius: 8px; }
.video-frame video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-frame figcaption, .media-frame figcaption { margin: 0; padding: .48rem .7rem; color: var(--muted); font-size: .79rem; }
.transcript { margin-top: .55rem; color: var(--muted); }
.transcript summary { display: flex; align-items: center; min-height: 44px; color: var(--signal); cursor: pointer; }
.transcript summary::before { content: "▸"; margin-inline-end: .45rem; }
.transcript[open] summary::before { content: "▾"; }
.transcript > div { border-inline-start: 2px solid var(--line); padding: .1rem 1rem 1rem; }
#gameplay-video { scroll-margin-top: 16px; }

.mechanics { background: var(--deep); border-block: 1px solid var(--line); }
.section-heading { margin-bottom: 1.1rem; }
.section-heading p { margin-top: .38rem; color: var(--muted); }
.section-heading.has-link { display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.mechanics-grid, .teaser-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mechanics-grid article, .teaser { min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; }
.mechanics-grid img, .teaser img { width: 100%; aspect-ratio: 16 / 8.3; object-fit: cover; border-bottom: 1px solid var(--line); }
.mechanics-grid article > div, .teaser-body { padding: 1rem 1.08rem 1.15rem; }
.mechanics-grid article h3, .teaser h3 { margin-block: .35rem .44rem; }
.mechanics-grid article h3 + p, .teaser p:not(.label) { color: var(--muted); }
.teaser { position: relative; }
.teaser:focus-within, .teaser:hover { border-color: var(--signal); }
.teaser a { color: var(--paper); text-decoration: none; }
.teaser a:hover { color: var(--signal); }
.teaser a::after { content: ""; position: absolute; inset: 0; }
.teaser a span { color: var(--signal); }
.teaser h3, .teaser p { overflow-wrap: anywhere; }

.follow-section { background: #121f2a; border-top: 1px solid var(--line); }
.follow-section .actions { margin-top: 0; justify-content: flex-end; }
.follow-section h2 { margin-top: 0; }

.section-title { position: relative; isolation: isolate; min-height: clamp(238px, 31vw, 325px); display: grid; align-items: end; border-bottom: 1px solid var(--line); overflow: hidden; }
.section-title img { position: absolute; z-index: -3; width: 100%; height: 100%; object-fit: cover; object-position: 69% 42%; }
.section-title::before { content: ""; position: absolute; z-index: -2; inset: 0; background: linear-gradient(90deg, #081018ed 3%, #081018c7 44%, #08101848 100%), linear-gradient(0deg, #080e15af, transparent 68%); }
.section-title header { padding-block: 2.4rem 1.85rem; }
.section-title .lede { margin-top: .48rem; color: #d3dce7; }
.devlog-host { margin-bottom: clamp(1.8rem, 5vw, 3.25rem); padding: clamp(1rem, 3vw, 1.8rem); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); scroll-margin-top: 1rem; }
.devlog-host-intro { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 1.6rem); }
.devlog-host-portrait { flex: none; width: clamp(74px, 15vw, 140px); height: auto; aspect-ratio: 1; border-radius: 6px; object-fit: cover; object-position: center top; }
.devlog-host h2 { font-size: clamp(1.45rem, 4vw, 2.6rem); }
.devlog-host p { margin-top: .42rem; color: var(--muted); }
.devlog-intro { margin-top: .95rem; }
.devlog-intro summary { cursor: pointer; }
.devlog-intro .video-frame { width: min(100%, 21rem); margin: .88rem auto 0; }
.devlog-intro .video-frame video { aspect-ratio: 1080 / 1340; }
.devlog-intro .transcript { max-width: 33rem; margin-inline: auto; }

.category-nav { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.8rem; }
.guide-group h2 { margin-bottom: .82rem; font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
.guide-group + .guide-group { margin-top: 2.4rem; }
.guide-group { scroll-margin-top: 1rem; }

.article { max-width: 870px; padding-block: clamp(25px, 6vw, 62px); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: .88rem; color: var(--muted); font-size: .9rem; }
.breadcrumb a { display: inline-flex; min-height: 44px; align-items: center; }
.article header { border-bottom: 1px solid var(--line); padding-bottom: 1.3rem; margin-bottom: 1.4rem; }
.article h1 { font-size: clamp(2.5rem, 7vw, 5.15rem); margin-block: .22rem .55rem; }
.article-status { color: var(--copper); margin-top: .72rem; font-size: .86rem; }
.article-visual { margin-bottom: 1.4rem; }
.media-frame { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--deep); }
.media-frame img { width: 100%; max-height: 560px; object-fit: contain; }
.article-prose { max-width: 68ch; color: #e0e6ec; font-size: clamp(1rem, 2.2vw, 1.12rem); overflow-wrap: anywhere; }
.article-prose h2 { margin-block: 1.15rem .45rem; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.article-prose h2:first-child { margin-top: 0; }
.article-feedback { margin-top: 2rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.article-feedback h2 { font-size: 1.35rem; margin-bottom: .4rem; }
.article-feedback .button { margin-top: .8rem; }
.back-link { margin-top: 1.2rem; }
.press-page { max-width: 1120px; }
.press-gallery { margin-top: 2.5rem; }
.press-gallery h2 { margin-bottom: 1rem; }
.press-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 1rem; }
.press-grid img { display: block; height: auto; }
.press-grid figcaption a, .contact-topics a { text-underline-offset: .2em; }
.contact-topics { display: grid; gap: .8rem; margin-block: 1.25rem; }
.contact-topics > div { padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.contact-topics p { margin-bottom: .45rem; }

.sensor-diagram { position: relative; overflow: hidden; aspect-ratio: 16 / 6.4; min-height: 145px; background: radial-gradient(circle at 50% 56%, #1a4a5f, #101b28 65%); }
.sensor-diagram::before, .sensor-diagram::after { content: ""; position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); width: min(31%, 15rem); aspect-ratio: 1; border: 1px solid #648b9b; border-radius: 50%; }
.sensor-diagram::after { width: min(55%, 26rem); border-style: dashed; }
.sensor-ship { position: absolute; z-index: 1; left: 50%; top: 56%; transform: translate(-50%, -50%) rotate(-15deg); font-size: clamp(26px, 7vw, 68px); color: var(--copper); }
.sensor-side, .sensor-nose { position: absolute; z-index: 1; padding: .2rem .48rem; border: 1px solid #648b9b; color: #d4edf0; background: var(--deep); font: .77rem/1.4 "IBM Plex Mono", ui-monospace, monospace; }
.sensor-side { right: 57%; top: 23%; }
.sensor-nose { left: 65%; top: 45%; }

.site-footer { border-top: 1px solid var(--line); background: #0a111a; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1fr 1.3fr auto; align-items: start; gap: 1rem; padding-block: 1.5rem; font-size: .88rem; }
.footer-brand { color: var(--paper); font-size: 1rem; font-weight: 680; }
.footer-grid p + p { margin-top: .28rem; }
.footer-grid nav { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.footer-grid nav a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 850px) {
  .wrap { width: min(var(--max), calc(100% - 42px)); }
  .masthead nav { column-gap: 13px; }
  .split { gap: 23px; }
  .mechanics-grid, .teaser-grid { gap: 12px; }
  .hero::before { background: linear-gradient(90deg, #081018f4 0%, #0a121bcd 32%, #0a121b67 65%, transparent 95%), linear-gradient(0deg, #080e159c, transparent 48%); }
}

@media (max-width: 660px) {
  .wrap { width: min(var(--max), calc(100% - 32px)); }
  .masthead-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .55rem; padding-block: .5rem .1rem; }
  .masthead nav { grid-column: 1 / -1; grid-row: 2; }
  .masthead-actions { grid-column: 2; grid-row: 1; }
  .account-link { font-size: .78rem; padding-inline: .5rem; }
  .wordmark { gap: .38rem; font-size: .66rem; letter-spacing: .055em; }
  .wordmark img { width: 36px; height: auto; }
  .language-menu summary { font-size: .76rem; }
  .hero { min-height: clamp(540px, 106vw, 590px); align-items: end; }
  .hero-image { object-position: 62% center; }
  .hero::before { background: linear-gradient(0deg, #080e15 1%, #080e15e0 53%, #060d197a 80%, #080e1533 100%); }
  .hero-inner { padding-block: 105px 43px; }
  .hero h1 { font-size: clamp(3.55rem, 13vw, 5.7rem); }
  .hero .label { font-size: .69rem; }
  .split, .mechanics-grid, .teaser-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .section-padded { padding-block: 34px; }
  .follow-section .actions { justify-content: flex-start; }
  .section-title { min-height: 205px; }
  .footer-grid { padding-block: 1.25rem; gap: .45rem; }
}
