@font-face {
  font-family: Manrope;
  src: url("assets/manrope-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f7f1;
  --ink: #19211c;
  --muted: #4f5e54;
  --rule: #c6cfc4;
  --forest: #1b3429;
  --gold: #f5cc87;
  --latin: Manrope, "Segoe UI", Arial, sans-serif;
  --body: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --gutter: clamp(1.25rem, 5.8vw, 6rem);
  --bar-height: 5.6rem;
  --ease: cubic-bezier(.2,.75,.22,1);
  --spring: cubic-bezier(.22,.92,.22,1.08);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-height);
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body:has(.editor[open]) { overflow: hidden; }
button, input { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary, label { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, p, dl, dd { margin: 0; }
:focus-visible {
  outline: 3px solid #995612;
  outline-offset: 4px;
}
[hidden] { display: none !important; }
::selection { color: #15241c; background: #f3ce94; }
.wrap {
  width: min(80rem, calc(100% - var(--gutter) - var(--gutter)));
  margin-inline: auto;
}
.sr-only, .editor-controls legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: .5rem;
  left: .75rem;
  z-index: 10;
  padding: .6rem 1rem;
  transform: translateY(-155%);
  background: var(--paper);
}
.skip-link:focus { transform: none; }

.wordmark {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  font: 700 1.52rem/1 var(--latin);
  letter-spacing: -.06em;
}
.brand-mark { display: block; flex: none; width: 2rem; height: 2rem; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.5); }
.launcher-meta {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font: 700 .875rem/1.4 var(--latin);
}
.window-mark {
  display: inline-block;
  width: 15px;
  height: 15px;
  background:
    linear-gradient(currentColor, currentColor) top left / 6px 6px,
    linear-gradient(currentColor, currentColor) top right / 6px 6px,
    linear-gradient(currentColor, currentColor) bottom left / 6px 6px,
    linear-gradient(currentColor, currentColor) bottom right / 6px 6px;
  background-repeat: no-repeat;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fffdf5;
  background: #263c32;
}
.hero-art, .hero::after { position: absolute; inset: 0; }
.hero-art { z-index: -2; inset: -34px -12px; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 54%; }
.hero::after {
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgb(7 17 14 / 57%), rgb(9 20 17 / 34%) 31%, transparent 68%),
    linear-gradient(0deg, rgb(7 13 12 / 48%), transparent 22%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: clamp(36.5rem, 46.5vw, 45rem);
  padding-block: clamp(6.8rem, 8.3vw, 9rem) clamp(3.9rem, 5vw, 5.5rem);
}
.hero-copy { width: min(100%, 35rem); }
.hero-context {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.32rem;
  color: #fcf0d8;
  font-size: .96rem;
  font-weight: 600;
}
.hero-context::before { content: ""; width: 1.8rem; height: 2px; background: var(--gold); }
.hero h1 {
  font: 700 clamp(4.6rem, 7.8vw, 7.6rem)/.94 var(--latin);
  letter-spacing: -.067em;
  margin-left: -.055em;
}
.hero-description {
  max-width: 25.8rem;
  margin-top: 1.5rem;
  color: #f5f4e9;
  font-size: clamp(1rem, 1.25vw, 1.14rem);
  line-height: 1.78;
  text-wrap: pretty;
}
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .68rem;
  min-height: 3.12rem;
  margin-top: 1.65rem;
  padding: .66rem 1.35rem;
  border: 1px solid transparent;
  border-radius: .28rem;
  color: #25271d;
  background: var(--gold);
  font-weight: 680;
  transition: background-color .18s, transform .18s;
}
.primary-action:hover { background: #ffda9d; transform: translateY(-2px); }
.primary-action:active { transform: translateY(0); }
.hero :focus-visible { outline-color: #ffedc9; }
.scene-caption {
  position: absolute;
  right: 0;
  bottom: 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: .58rem;
  color: #fffdf5;
  font-size: .79rem;
  font-weight: 550;
  text-shadow: 0 1px 5px #101a14;
}
.scene-caption > span:first-child { width: 1.5rem; height: 1px; background: currentColor; }
.caption-divider { opacity: .72; }

.features {
  display: grid;
  grid-template-columns: minmax(0, .87fr) minmax(0, 1.45fr);
  gap: clamp(3rem, 8.5vw, 8rem);
  padding-block: clamp(4.4rem, 7.2vw, 7rem);
}
.feature-intro h2 {
  font-size: clamp(2.15rem, 3.15vw, 3.15rem);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1.22;
}
.feature-intro p, .entry-body p, .launcher-lead, .launcher-functions dd {
  font-size: 1rem;
  line-height: 1.85;
  text-wrap: pretty;
}
.feature-intro p { max-width: 25rem; margin-top: 1.1rem; color: var(--muted); }
.feature-list { border-top: 1px solid #9eafa1; }
.feature-entry { border-bottom: 1px solid var(--rule); }
.feature-entry summary {
  display: grid;
  grid-template-columns: 1fr auto 1.15rem;
  gap: 1.4rem;
  align-items: center;
  min-height: 4.65rem;
  padding: 1.05rem .15rem;
  cursor: pointer;
  list-style: none;
}
.feature-entry summary::-webkit-details-marker { display: none; }
.entry-name { font-size: clamp(1.15rem, 1.58vw, 1.5rem); line-height: 1.4; font-weight: 640; }
.feature-entry summary:hover .entry-name { color: #3e614c; }
.entry-code { color: #5a695e; font: 700 .85rem/1.45 var(--latin); }
.expand-mark { position: relative; display: block; width: 1rem; height: 1rem; }
.expand-mark::after, .expand-mark::before {
  content: "";
  position: absolute;
  top: calc(50% - 1px);
  left: 0;
  width: 1rem;
  height: 2px;
  background: var(--forest);
}
.expand-mark::after { transform: rotate(90deg); transition: transform .16s ease; }
.feature-entry[open] .expand-mark::after { transform: rotate(0); }
.entry-body { padding: 0 .15rem 1.45rem; }
.entry-body p { max-width: 41rem; color: var(--muted); }
.hud-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; }
.text-action {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--forest);
  font-size: .94rem;
  font-weight: 620;
  text-decoration: underline;
  text-underline-offset: .33em;
  text-decoration-color: #8c9f90;
}
.text-action { margin-top: .35rem; padding: 0; border: 0; background: transparent; }
.text-action:hover { text-decoration-color: currentColor; }
.key-model {
  align-self: center;
  display: grid;
  grid-template-areas: ". w ." "a s d";
  gap: 4px;
  margin: -.4rem .9rem 0 .3rem;
  transform: rotate(-7deg);
}
.model-key {
  display: grid;
  place-items: center;
  width: clamp(1.85rem, 2.5vw, 2.45rem);
  aspect-ratio: 1;
  border: 1px solid #acb7aa;
  border-bottom: 4px solid #a3af9f;
  border-radius: 5px;
  color: #3c4d3e;
  background: #e5eae0;
  font: 700 .89rem/1 var(--latin);
}
.model-key.key-w { color: #493722; background: #f3d59d; border-color: #c6a97a; border-bottom-color: #b39565; }
.key-w { grid-area: w; }
.key-a { grid-area: a; }
.key-s { grid-area: s; }
.key-d { grid-area: d; }
.style-names {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.05rem;
  margin: .8rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--forest);
  font: 700 .91rem/1.6 var(--latin);
}

.launcher { color: #f4f5ed; background: #192d24; }
.launcher-inner {
  display: grid;
  grid-template-columns: minmax(0, .87fr) minmax(0, 1.45fr);
  gap: clamp(3rem, 8.5vw, 8rem);
  align-items: center;
  padding-block: clamp(3.8rem, 6.4vw, 6.5rem);
}
.launcher-meta { color: #efd39e; }
.meta-divider { color: #9fafa0; margin-inline: .12rem; }
.launcher-heading h2 {
  margin: 1.1rem 0 1.25rem -.045em;
  font: 700 clamp(2.8rem, 4.3vw, 4.3rem)/1.03 var(--latin);
  letter-spacing: -.057em;
}
.launcher-lead { max-width: 25rem; color: #d3ded3; }
.launcher-functions { border-top: 1px solid #5b6f60; }
.launcher-functions > div {
  display: grid;
  grid-template-columns: minmax(5.5rem, .37fr) 1fr;
  gap: clamp(1.2rem, 2.7vw, 2.6rem);
  padding: 1.55rem .1rem;
  border-bottom: 1px solid #4c6052;
}
.launcher-functions dt { font-size: 1.12rem; font-weight: 650; }
.launcher-functions dd { color: #d3ded3; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.38rem; }
.footer .wordmark { font-size: 1.25rem; }

.editor {
  position: fixed;
  inset: 0;
  width: min(56rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #c4cfc0;
  border-radius: .65rem;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 20px 80px rgb(5 14 9 / 32%);
}
.editor::backdrop { background: rgb(7 15 11 / 75%); }
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.45rem;
}
.editor-kicker { color: var(--muted); font-size: .82rem; }
.editor-head h2 { font-size: 1.4rem; line-height: 1.35; }
.close-editor {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--rule);
  border-radius: .3rem;
  background: transparent;
  color: var(--ink);
}
.close-editor svg { width: 1.25rem; height: 1.25rem; }
.close-editor:hover, .reset-action:hover { background: #e8ede4; }
.hud-stage {
  position: relative;
  isolation: isolate;
  height: clamp(14rem, 42vh, 27rem);
  overflow: hidden;
  background: #294434 url("assets/november-valley.webp") 65% 55% / cover;
  user-select: none;
}
.aim-point {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  opacity: .9;
  filter: drop-shadow(0 1px 1px #161c15);
}
.aim-point::before, .aim-point::after { content: ""; position: absolute; background: #fffef4; }
.aim-point::before { inset: 5px 0; }
.aim-point::after { inset: 0 5px; }
.hud-widget {
  position: absolute;
  z-index: 1;
  inset: 0 auto auto 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: white;
  background: transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.hud-widget:focus-visible { outline: 3px solid #ffd08a; outline-offset: 3px; }
.hud-widget > * { pointer-events: none; }
.hud-widget.is-dragging { z-index: 2; cursor: grabbing; }
.hud-keys {
  display: grid;
  grid-template-areas: ". w ." "a s d" "space space space";
  gap: 3px;
  width: max-content;
}
.game-key {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 3px;
  font: 700 1rem/1 var(--latin);
  background: rgb(15 24 20 / 84%);
}
.game-key.is-down { color: #2b3125; border-color: var(--gold); background: #f9d79a; }
.spacebar { grid-area: space; width: auto; height: .92rem; }
.spacebar::after { content: ""; width: 1.6rem; height: 1px; background: currentColor; }
.hud-clock { width: 5.7rem; aspect-ratio: 1; border-radius: 50%; }
.clock-face { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 5px rgb(15 26 18 / 24%)); }
.clock-face text { font: 600 13px var(--body); }
.editor-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem 1rem;
  padding: .75rem 1.45rem 0;
}
.editor-controls fieldset { display: flex; align-items: center; gap: 1rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.editor-controls label { display: flex; align-items: center; gap: .45rem; min-height: 2.75rem; cursor: pointer; }
.editor-controls input { width: 1rem; height: 1rem; margin: 0; accent-color: #355a43; }
.reset-action {
  min-height: 2.75rem;
  padding: .35rem .85rem;
  border: 1px solid #abb8aa;
  border-radius: .28rem;
  color: var(--forest);
  background: transparent;
}
.editor-instructions { margin: .5rem 1.45rem 1.2rem; color: var(--muted); font-size: .9rem; }

.title-line, .title-line > span { display: block; }
.title-line { overflow: clip; padding: .07em .09em .1em 0; margin: -.07em -.09em -.1em 0; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.6rem; margin-top: 1.6rem; }
.hero-actions .primary-action { margin: 0; }
.hero-manual { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0; border: 0; background: transparent; color: #fff1d7; font-size: .96rem; font-weight: 620; text-decoration: underline; text-decoration-color: #d0bb92; text-underline-offset: .36em; }
.hero-manual:hover { text-decoration-color: #fff; }
.valley-air { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.valley-air i {
  position: absolute; left: var(--x); top: var(--y); width: var(--size, 3px); height: var(--size, 3px);
  background: #ffe2a2; box-shadow: 0 0 6px #ffcb7d; opacity: 0;
}
.valley-air i:nth-child(1) { --x: 52%; --y: 59%; --delay: -2s; }
.valley-air i:nth-child(2) { --x: 58%; --y: 42%; --delay: -6s; --size: 2px; }
.valley-air i:nth-child(3) { --x: 65%; --y: 74%; --delay: -4.2s; }
.valley-air i:nth-child(4) { --x: 74%; --y: 47%; --delay: -.4s; --size: 2px; }
.valley-air i:nth-child(5) { --x: 78%; --y: 66%; --delay: -7.3s; }
.valley-air i:nth-child(6) { --x: 83%; --y: 38%; --delay: -3s; --size: 2px; }
.valley-air i:nth-child(7) { --x: 91%; --y: 78%; --delay: -5.4s; }
.valley-air i:nth-child(8) { --x: 97%; --y: 54%; --delay: -1.3s; --size: 2px; }
.journal { background: #21372a; color: #f5f2e6; }
.journal-inner { display: grid; grid-template-columns: minmax(10rem, .52fr) minmax(0, 1.48fr); gap: clamp(2rem, 6vw, 6rem); padding-block: clamp(2rem, 4vw, 3.75rem); }
.journal-heading h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.2; }
.journal-heading a { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; margin-top: .25rem; color: var(--gold); font-size: .9rem; }
.journal-posts { margin: 0; padding: 0; list-style: none; border-top: 1px solid #63776a; }
.journal-posts li { border-bottom: 1px solid #516657; }
.journal-posts a { display: grid; grid-template-columns: 5.8rem minmax(0, 1fr) auto; gap: clamp(.8rem, 2vw, 2rem); align-items: baseline; padding-block: 1rem; }
.journal-posts time { color: #e3c68f; font: 700 .82rem/1.5 var(--latin); font-variant-numeric: tabular-nums; }
.journal-title { font-size: clamp(1.02rem, 1.5vw, 1.22rem); font-weight: 620; line-height: 1.5; }
.journal-topic { color: #c9d6c8; font-size: .82rem; }
.journal a:hover .journal-title, .journal-heading a:hover { text-decoration: underline; text-underline-offset: .28em; }
.journal :focus-visible { outline-color: var(--gold); }
.game-key { transition: transform .12s, background-color .12s; }
.game-key.is-down { transform: translateY(2px) scale(.95); }

@media (max-width: 800px) {
  :root { --gutter: clamp(1.25rem, 4.8vw, 2.5rem); --bar-height: 5rem; }
  .features, .launcher-inner { grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr); gap: 2.2rem; }
  .hud-entry { gap: .8rem; }
  .key-model { margin-right: .3rem; }
  .model-key { width: 1.65rem; }
  .launcher-functions > div { grid-template-columns: 1fr; gap: .4rem; }
}
@media (max-width: 640px) {
  :root { --bar-height: 4.9rem; }
  .wordmark { gap: .32rem; font-size: 1.27rem; }
  .hero-inner { align-items: flex-end; min-height: clamp(33rem, 132vw, 38rem); padding-block: 7.2rem 3.8rem; }
  .hero-art img { object-position: 62% 47%; }
  .hero::after {
    background: linear-gradient(0deg, rgb(8 17 14 / 91%) 0%, rgb(11 21 15 / 58%) 42%, rgb(11 21 15 / 9%) 83%),
                linear-gradient(90deg, rgb(9 20 15 / 25%), transparent 88%);
  }
  .hero-actions { gap: .3rem 1.05rem; margin-top: 1.15rem; }
  .journal-inner { grid-template-columns: 1fr; gap: .9rem; padding-block: 1.65rem 2rem; }
  .journal-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
  .journal-heading a { margin: 0; }
  .journal-posts a { grid-template-columns: auto 1fr; gap: .22rem .75rem; padding-block: .8rem; }
  .journal-posts time { grid-column: 1; grid-row: 1; }
  .journal-topic { grid-column: 2; grid-row: 1; }
  .journal-title { grid-column: 1 / -1; grid-row: 2; }
  .hero-context { gap: .58rem; margin-bottom: 1.1rem; font-size: .89rem; }
  .hero-context::before { width: 1.5rem; }
  .hero h1 { font-size: clamp(3.72rem, 14.3vw, 5.25rem); }
  .hero-description { max-width: 22rem; margin-top: 1.05rem; font-size: 1rem; }
  .primary-action { min-height: 2.92rem; margin-top: 1.25rem; padding-inline: 1.12rem; }
  .scene-caption { bottom: .75rem; font-size: .75rem; }
  .features, .launcher-inner { grid-template-columns: 1fr; gap: 1.85rem; padding-block: 3.25rem; }
  .feature-intro h2 { font-size: 2.14rem; }
  .feature-intro p { margin-top: .65rem; max-width: none; }
  .feature-entry summary { min-height: 4.1rem; gap: .85rem; }
  .entry-body { padding-bottom: 1.05rem; }
  .hud-entry { gap: .85rem; }
  .key-model { margin: 0 .4rem 0 0; }
  .model-key { width: 1.7rem; }
  .launcher-heading h2 { font-size: 3.05rem; }
  .launcher-functions > div { padding-block: 1.12rem; }
  .footer-inner { padding-block: .95rem; }
  .editor { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .editor-head { padding: .8rem 1rem; }
  .hud-stage { height: clamp(13rem, 35dvh, 21rem); background-image: url("assets/november-valley-mobile.webp"); }
  .editor-controls { padding: .6rem 1rem 0; }
  .editor-controls fieldset { gap: .7rem; }
  .editor-instructions { margin: .35rem 1rem 1rem; }
}
@media (max-width: 360px) {
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 0; }
  .hud-entry { grid-template-columns: 1fr; }
  .key-model { display: none; }
  .editor-controls { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
  .primary-action:hover { transform: none; }
}
