:root {
  color-scheme: dark;
  --sea: #131b2b;
  --ivory: #fff3d9;
  --brass: #dec195;
  --paper: #f3e5c9;
  --ink: #252a29;
  --seal: #82392f;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color: var(--ivory);
  background: var(--sea);
  font-family: var(--sans);
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #ffca64; outline-offset: 4px; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 2; padding: .8rem; background: var(--sea); }
.skip:focus { top: 1rem; }

.hero {
  --mast-height: clamp(60px, 7.8svh, 86px);
  --scene-height: clamp(34rem, 100svh, 60vw);
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  background: var(--sea);
}
.scene, .scene img, .scene::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene { height: var(--scene-height); z-index: -1; overflow: hidden; }
.scene img { object-fit: cover; object-position: 64% 49%; }
.scene::after {
  content: "";
  background:
    linear-gradient(0deg, var(--sea) 0%, rgba(19,27,43,.70) 13%, transparent 40%),
    linear-gradient(90deg, rgba(14,22,31,.70), rgba(14,22,31,.24) 24%, transparent 47%),
    linear-gradient(180deg, rgba(23,22,26,.39), transparent 22%);
}
.poster { width: min(90%, 1440px); margin-inline: auto; }
.mast { height: var(--mast-height); display: flex; align-items: center; gap: 1.2rem; }
.mast::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #f6e4c279, #f6e4c20a); }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-shadow: 0 1px 8px #121722; }
.brand img { width: 37px; height: 34px; object-fit: contain; }
.brand span { font: 600 1rem/1.1 var(--serif); letter-spacing: .16em; }
.brand small { display: block; margin-top: .25rem; font: .66rem/1 Georgia, serif; letter-spacing: .08em; }

.title-field {
  min-height: calc(var(--scene-height) * .735 - var(--mast-height));
  display: grid;
  align-content: center;
  padding: 1rem 0 2rem;
}
h1 { width: fit-content; filter: drop-shadow(0 2px 9px #11182799); }
h1 img { display: block; width: auto; height: clamp(155px, min(19vw,32svh), 305px); }
h1 span {
  display: block;
  margin-top: .7rem;
  color: #ffe5b9;
  font: italic 400 clamp(1.4rem,2.15vw,2.35rem)/1.1 Georgia, serif;
}

.downloads { padding-bottom: clamp(26px,4.2vw,65px); }
.release-heading { display: flex; align-items: center; gap: .85rem; margin-bottom: .9rem; }
.release-heading::before { content: ""; flex: 1; order: 1; height: 3px; border-block: 1px solid #e6c59166; }
.release-heading h2 { font: 650 clamp(1.25rem,1.55vw,1.65rem)/1.25 var(--serif); letter-spacing: .1em; }
.version { order: 2; color: #f5d49e; font: .84rem/1.5 var(--mono); }
.platforms {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: .85rem clamp(10px,1.15vw,20px);
}
.platform { min-width: 0; display: grid; grid-template-rows: 1fr auto; }
@supports (grid-template-rows: subgrid) {
  .platform { grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
}
.get {
  --stub: clamp(36px,3.4vw,54px);
  --tear: calc(100% - var(--stub));
  display: grid;
  grid-template-columns: minmax(0,1fr) var(--stub);
  color: var(--ink);
  position: relative;
  /* Two notches mark the perforation between the ticket and its download stub. */
  mask:
    radial-gradient(circle at var(--tear) 0, transparent 4px, black 4.8px) top / 100% 51% no-repeat,
    radial-gradient(circle at var(--tear) 100%, transparent 4px, black 4.8px) bottom / 100% 51% no-repeat;
}
.get:focus-visible { outline: none; }
.get:focus-visible .ticket-body, .get:focus-visible .ticket-stub { box-shadow: inset 0 0 0 3px #bf6a14; }
.ticket-body {
  display: grid;
  align-content: center;
  gap: .6rem;
  min-width: 0;
  padding: clamp(15px,1.55vw,26px) clamp(12px,1.35vw,22px);
  background: linear-gradient(108deg, #fff2d7, var(--paper) 76%, #e5d3b4);
  box-shadow: inset 0 1px #fff7e6, inset 0 -1px #bba384;
}
.platform-head { display: flex; gap: .55rem; align-items: center; }
.platform-head :is(svg,img) { width: 23px; height: 23px; flex: none; fill: currentColor; object-fit: contain; }
.platform-head h3 { font: 500 clamp(1.3rem,1.95vw,1.9rem)/1.1 Georgia, serif; }
.meta { display: flex; flex-wrap: wrap; gap: .18rem .5rem; align-items: baseline; color: #554c40; font-size: .78rem; line-height: 1.4; }
.size { white-space: nowrap; font: .76rem/1.4 var(--mono); }
.size::before { content: "·"; padding-right: .5rem; }
.ticket-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border-left: 1px dashed #efd6ac;
  color: #fff0d3;
  background: var(--seal);
  font: 600 .67rem/1 var(--mono);
  letter-spacing: .09em;
}
.ticket-stub svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.get:hover .ticket-stub, .get:focus-visible .ticket-stub { background: #663129; }
.get:hover .ticket-body { background: #fff3da; }
details { margin-top: .2rem; color: #ecdfc7; font-size: .79rem; }
summary { display: flex; align-items: center; gap: .4rem; width: fit-content; min-height: 34px; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; color: var(--brass); font: .95rem/1 var(--mono); }
details[open] summary::before { content: "−"; }
summary:hover { color: white; }
details p { line-height: 1.6; margin: .2rem 0 .55rem; }
details small { display: block; font: .65rem/1.4 var(--mono); color: var(--brass); }
code { font: .73rem/1.4 var(--mono); overflow-wrap: anywhere; user-select: all; }

@media (max-width: 900px) {
  .hero { --scene-height: clamp(24rem,65vw,36rem); --mast-height: 60px; }
  .platforms { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .title-field { padding-bottom: .8rem; }
  h1 img { height: clamp(120px,20vw,170px); }
  .get { --stub: 43px; }
}
@media (max-width: 580px) {
  .hero { --mast-height: 54px; --scene-height: clamp(21rem,87vw,30rem); }
  .poster { width: 92%; }
  .brand { gap: .45rem; }
  .brand img { width: 29px; height: 27px; }
  .brand span { font-size: .84rem; }
  .brand small { font-size: .58rem; }
  .scene img { object-position: 70% center; }
  .title-field { min-height: calc(var(--scene-height) * .78 - var(--mast-height)); padding-block: .75rem 1.1rem; }
  h1 img { height: clamp(100px,23vw,128px); }
  h1 span { font-size: 1.2rem; }
  .release-heading { gap: .65rem; margin-bottom: .65rem; }
  .platforms { gap: .6rem .55rem; }
  .get { --stub: 33px; }
  .ticket-body { padding: .85rem .62rem; gap: .45rem; align-content: start; }
  .platform-head { gap: .35rem; }
  .platform-head h3 { font-size: 1.22rem; }
  .platform-head :is(svg,img) { width: 17px; height: 17px; }
  .meta { display: grid; gap: .12rem; font-size: .70rem; }
  .size { font-size: .69rem; }
  .size::before { content: none; }
  .ticket-stub { font-size: .60rem; }
  .ticket-stub svg { width: 17px; height: 17px; }
}
@media (max-width: 350px) {
  .get { --stub: 27px; }
  .platform-head h3 { font-size: 1.1rem; }
  .ticket-body { padding-inline: .45rem; }
}

@media (orientation: portrait) {
  .hero {
    --water-overlap: clamp(54px,9svh,115px);
    display: grid;
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: var(--mast-height) minmax(clamp(140px,20svh,260px),1fr) auto;
  }
  .poster { display: contents; }
  .mast, .title-field, .downloads { grid-column: 1; width: min(90%,1440px); margin-inline: auto; }
  .scene {
    position: relative;
    inset: auto;
    grid-area: 1 / 1 / 3 / 2;
    height: auto;
    margin-bottom: calc(-1 * var(--water-overlap));
    background: #c58a43 url("art/cover.webp") 50% 0 / 160% 1600% no-repeat;
  }
  .scene img {
    inset: auto 0 0;
    height: min(100%,78vw);
    object-position: 93% 50%;
    mask-image: linear-gradient(to bottom,transparent,black 18%);
  }
  .mast { grid-row: 1; }
  .title-field { grid-row: 2; min-height: 0; }
  .downloads {
    grid-row: 3;
    padding-bottom: max(12px,2svh,env(safe-area-inset-bottom));
  }
  .platforms { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .get { min-height: clamp(85px,10svh,128px); }
}

@media (orientation: portrait) and (max-width: 580px) {
  .mast, .title-field, .downloads { width: 92%; }
  .title-field { align-content: start; padding-top: clamp(12px,3svh,28px); }
  h1 img { height: clamp(108px,27vw,145px); }
  .platforms { grid-template-columns: minmax(0,1fr); row-gap: clamp(3px,.6svh,7px); }
  .platform { grid-row: auto; grid-template-rows: auto auto; }
  .get { --stub: clamp(42px,13vw,60px); min-height: clamp(60px,8.8svh,86px); }
  .ticket-body {
    grid-template-columns: auto minmax(0,1fr);
    align-content: center;
    align-items: center;
    gap: .55rem;
    padding: .65rem clamp(10px,3vw,18px);
  }
  .platform-head { gap: .5rem; }
  .platform-head :is(svg,img) { width: 21px; height: 21px; }
  .platform-head h3 { font-size: clamp(1.22rem,5.6vw,1.65rem); }
  .meta { text-align: right; justify-items: end; font-size: .73rem; }
  .size { font-size: .71rem; }
  .ticket-stub svg { width: 20px; height: 20px; }
  .ticket-stub { font-size: .64rem; }
  details { margin-top: 0; }
  summary { min-height: 28px; }
}
