:root {
  color-scheme: light;
  font-family: "Hualv Page Sans", sans-serif;
  color: #283c2c;
  background: #f4ecd9;
  --paper: #fbf3dd;
  --pine: #23372a;
  --moss: #435943;
  --muted: #57614d;
  --line: #b6aa84;
  --gold: #efc477;
  --copper: #9a5331;
  --hand: "Hualv Notes", "Hualv Page Sans", sans-serif;
  --display: "Hualv Pixel", var(--hand);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-image: radial-gradient(#88724939 .75px, transparent .75px);
  background-size: 12px 12px;
}
img { display: block; max-width: 100%; height: auto; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
a { color: inherit; }
button, a[href] { cursor: pointer; }
h1, h2, h3, p, figure { margin: 0; }
a:focus-visible, button:focus-visible { outline: 3px solid #a95c33; outline-offset: 4px; }
[hidden] { display: none !important; }
.container { max-width: 78rem; margin-inline: auto; padding-inline: clamp(1.1rem, 4.5vw, 3.9rem); }
.skip-link { position: absolute; transform: translateY(-200%); z-index: 3; padding: .55rem 1rem; background: var(--paper); }
.skip-link:focus { transform: translateY(0); }
.top {
  background: var(--pine);
  color: var(--paper);
  border-bottom: 3px solid #ad8956;
  box-shadow: inset 0 -2px #677259;
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-family: var(--hand); font-weight: 700; letter-spacing: .08em; }
.nav .brand { font-size: 1.31rem; }
.brand img { image-rendering: pixelated; flex: none; }
nav { display: flex; align-items: center; gap: clamp(.9rem, 3vw, 2.35rem); font-size: .875rem; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; text-underline-offset: .3em; }
.nav-download { color: #f6d69b; }
.nav-download span { margin-left: .25rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(0, 1.65fr);
  align-items: center;
  gap: clamp(2.1rem, 5.3vw, 5.25rem);
  padding-block: clamp(3rem, 8vw, 6.6rem);
}
.eyebrow { display: flex; align-items: center; gap: .55rem; font-size: .78rem; font-weight: 700; letter-spacing: .14em; color: var(--moss); }
.square { display: inline-block; flex: none; width: .53rem; height: .53rem; background: #9c6639; box-shadow: 2px 2px #d5b57a; }
.hero h1 {
  font: 400 clamp(3rem, 6.2vw, 5.25rem)/1.13 var(--display);
  letter-spacing: -.055em;
  margin-top: .62rem;
  margin-left: -.07em;
  white-space: nowrap;
  text-shadow: 2px 2px #d8cb9e;
}
.hero-line { font: 700 clamp(1.15rem, 2.3vw, 1.7rem)/1.54 var(--hand); margin-top: 1.1rem; }
.intro { margin: .9rem 0 1.65rem; max-width: 22rem; color: var(--muted); line-height: 1.8; font-size: .98rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 2.6rem;
  border: 1px solid;
  padding: .54rem .85rem;
  text-decoration: none;
  font-weight: 660;
  font-size: .88rem;
  line-height: 1.33;
  transition: transform .14s, box-shadow .14s, background-color .14s;
}
.primary { background: var(--gold); color: #302b20; border-color: #835d35; box-shadow: inset 0 2px #f8dc9f, 3px 3px #7f6b4e; }
.primary:hover:enabled, a.primary:hover { background: #f8d592; transform: translateY(-2px); box-shadow: inset 0 2px #fff0c4, 3px 5px #7f6b4e; }
.secondary { background: #fff9e9; color: var(--pine); border-color: #809071; box-shadow: inset 0 2px #fffaf0, 3px 3px #a6aa8a; }
.secondary:hover:enabled { background: #e8ecd6; transform: translateY(-2px); box-shadow: inset 0 2px #fffaf0, 3px 5px #a6aa8a; }
.button:active:enabled, a.button:active { transform: translate(2px, 2px); box-shadow: none; }
.button:disabled { opacity: .58; cursor: wait; }
.hero .button { min-height: 3rem; padding-inline: 1.12rem; }
.hero .button span { font-size: 1.18rem; }
.hero-window {
  position: relative;
  padding: 8px;
  background: #68462e;
  border: 2px solid #4b3527;
  box-shadow: inset 0 0 0 3px #986743, inset 0 0 0 5px #b38655, 8px 8px #b6a482;
}
.hero-window::after, .hero-window::before {
  content: "";
  position: absolute;
  z-index: 1;
  width: 9px;
  height: 9px;
  background: #e1b773;
  box-shadow: 3px 3px #8c653f;
  pointer-events: none;
}
.hero-window::before { top: -3px; left: -3px; }
.hero-window::after { bottom: -3px; right: -3px; }
.shot { border: 0; display: block; width: 100%; padding: 0; overflow: hidden; background: #ded1ad; cursor: zoom-in; }
.shot img { width: 100%; aspect-ratio: 1.54; object-fit: cover; transition: filter .2s; }
.shot:hover img { filter: brightness(1.065); }
.hero-shot { border: 2px solid #4d3827; }
.hero-window figcaption { display: flex; align-items: center; gap: .55rem; margin: .58rem .28rem .13rem; color: #fff0d0; font-size: .76rem; letter-spacing: .08em; }
.hero-window .square { width: .35rem; height: .35rem; background: #f2ce89; box-shadow: 2px 2px #8c653f; }

.scenes { padding-bottom: clamp(3rem, 7vw, 5.6rem); scroll-margin-top: 1rem; }
.section-head { padding: 1.1rem 0 1.5rem; border-top: 1px solid var(--line); }
h2 { font: 400 clamp(1.5rem, 3.4vw, 2.25rem)/1.3 var(--display); letter-spacing: .02em; }
.scene-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.85rem, 2.6vw, 1.9rem); }
.scene-card { background: #fff7e2; border: 1px solid #b29972; padding: 4px; box-shadow: 4px 4px #d7c5a2; }
.scene-card .shot { border: 1px solid #bda583; }
.scene-card:nth-child(3) .shot img { object-position: 50% 57%; }
.card-copy { padding: .95rem .85rem 1.12rem; }
h3 { font-size: 1.19rem; line-height: 1.45; }
.card-copy h3 { font: 700 1.29rem/1.35 var(--hand); }
.card-copy p, .edition p, .runtime p { color: var(--muted); font-size: .88rem; line-height: 1.7; margin-top: .42rem; }

.download {
  background: #e5e8cf;
  border-block: 2px solid #85916d;
  padding-block: clamp(2.7rem, 6vw, 4.7rem);
}
.download-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.5rem; }
.download-heading h2 { margin-top: .45rem; }
.download-heading > p { color: var(--muted); font-size: .89rem; max-width: 25rem; line-height: 1.7; }
.version { border: 1px solid #9ba884; padding: .06rem .35rem; letter-spacing: .035em; background: #eff1db; }
.edition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.edition, .runtime { border: 1px solid #9fa37e; background: #fcf7e7; padding: clamp(1rem, 3vw, 1.5rem); box-shadow: 4px 4px #b9bf9e; }
.edition.recommended { border-top: 4px solid #9c6639; padding-top: calc(clamp(1rem, 3vw, 1.5rem) - 3px); }
.edition p { margin-bottom: 1.02rem; }
.package { display: flex; flex-wrap: wrap; align-items: center; column-gap: 1.15rem; row-gap: .6rem; }
.edition .package + .package { margin-top: .75rem; }
.button small { font-size: .72rem; font-weight: 550; opacity: .85; white-space: nowrap; }
.direct { font-size: .8rem; font-weight: 600; text-decoration: underline; text-underline-offset: .22em; }
.direct:not([href]) { visibility: hidden; }
.runtime { margin-top: 1.3rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem 1.3rem; }
.runtime h3 { font-size: 1rem; }
.runtime-links { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1.15rem; }
.download-note { color: var(--muted); font-size: .8rem; line-height: 1.7; margin-top: 1.35rem; }
.footer { background: var(--pine); color: #fff0d5; }
.footer-row { min-height: 4.05rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer a { font-size: .82rem; text-underline-offset: .28em; }

dialog { max-width: calc(100vw - 2rem); }
dialog::backdrop { background: #19271fd9; }
.gallery { background: #65472e; border: 2px solid #c39b63; padding: .4rem; box-shadow: 4px 4px #17251a; }
.gallery img { max-width: min(67rem, 87vw); max-height: 84vh; object-fit: contain; }
.gallery .close { position: absolute; right: .55rem; top: .55rem; width: 2.4rem; height: 2.4rem; border: 1px solid #91744f; background: var(--paper); font-size: 1.4rem; font-weight: 700; }
.transfer { width: min(31rem, calc(100vw - 2rem)); border: 2px solid #6b7353; background: var(--paper); color: var(--pine); padding: 1.45rem; box-shadow: 5px 5px #253424; }
.transfer h2 { font-size: 1.55rem; }
.transfer-filename { color: var(--muted); font-size: .76rem; margin-top: .43rem; overflow-wrap: anywhere; }
#transfer-status { margin: 1.1rem 0 .65rem; font-size: .9rem; line-height: 1.65; min-height: 2.8em; }
.transfer progress { width: 100%; accent-color: #557348; height: .85rem; }
.transfer-controls { position: relative; margin-top: 1rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; }

@media (max-width: 57rem) {
  .hero { gap: 2rem; grid-template-columns: minmax(13rem, 1fr) minmax(0, 1.4fr); }
  .hero h1 { font-size: clamp(2.65rem, 7vw, 4.6rem); }
  .scene-grid { gap: .95rem; }
  .card-copy { padding-inline: .58rem; }
}
@media (max-width: 41rem) {
  .nav { min-height: 3.55rem; }
  .nav .brand { font-size: 1.12rem; letter-spacing: .02em; }
  .nav .brand img { width: 32px; height: 32px; }
  nav { gap: 1rem; font-size: .78rem; }
  .hero { grid-template-columns: 1fr; padding-top: 2.25rem; gap: 1.65rem; }
  .hero h1 { font-size: clamp(3.2rem, 11vw, 4.7rem); }
  .hero-line br { display: none; }
  .hero-window { box-shadow: 5px 5px #b6a482; }
  .scene-grid { grid-template-columns: 1fr; gap: 1.05rem; }
  .card-copy { padding-inline: .85rem; }
  .download-heading { align-items: start; flex-direction: column; gap: .55rem; }
  .edition-grid { grid-template-columns: 1fr; gap: .95rem; }
  .runtime { flex-direction: column; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
