@font-face { font-family: 'Barlow Condensed'; src: url('assets/barlow-condensed-bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
:root {
  --ink: #162c36;
  --paper: #f3f6f4;
  --night: #142b35;
  --gold: #ecd373;
  --hairline: #b8cacc;
  color: var(--ink);
  background: var(--paper);
  font: 500 100%/1.55 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body, figure, h1, h2, h3 { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .3em; }
a:focus-visible { outline: 3px solid #cf552b; outline-offset: 5px; }
button:focus-visible { outline: 3px solid #62edff; outline-offset: 3px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: absolute; z-index: 3; background: white; padding: 1rem; }

/* Type */
.brand, h2, h3, .hook, .button, button, .view-bar label, nav, #level-control {
  font-family: 'Barlow Condensed', Impact, sans-serif; font-weight: 700;
}
.brand, nav, .button, button, .view-bar label, h2, .hook, #level-control { text-transform: uppercase; }
h2 { font-size: clamp(3rem, 5.5vw, 5.7rem); line-height: .91; letter-spacing: -.025em; text-wrap: balance; }
h3 { font-size: 1.6rem; line-height: 1.1; letter-spacing: -.01em; }
.eyebrow { font: bold .85rem/1.4 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .105em; margin: 0 0 1.35rem; }

/* Layout */
.wrap { width: min(88%, 78rem); margin-inline: auto; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lab { display: grid; grid-template-columns: .85fr 1.15fr; gap: 6%; align-items: center; padding-block: clamp(3rem, 6vw, 6rem); }
.lab p { max-width: 34rem; }

/* Header and footer */
header { background: var(--night); color: white; }
header .bar { min-height: 4.2rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 2rem; letter-spacing: -.025em; text-decoration: none; }
.brand img { height: 3.3rem; width: auto; }
nav { display: flex; gap: clamp(1rem, 3vw, 3rem); font-size: 1.1rem; }
nav a { text-decoration: none; padding: .75rem 0; white-space: nowrap; }
nav a:hover, footer a:hover { text-decoration: underline; }
footer .bar { min-height: 6rem; }

/* Buttons and fields */
.button { display: inline-block; padding: .83rem 1.5rem; font-size: 1.15rem; text-decoration: none; color: #192d32; background: var(--gold); border: 1px solid #c3a854; border-radius: .15rem; cursor: pointer; }
.button:hover { background: #f4e09a; }
.button:disabled { opacity: .65; cursor: default; }
.lab select { max-width: 100%; padding: .4rem .55rem; font: inherit; color: #17323b; background: #f0f5f1; border: 1px solid #acbdba; }

/* Hero */
.hero { background: linear-gradient(155deg, #c0d9dc, #dde9e6 65%, #edf0e5); color: #16303b; }
.hero-grid { width: min(94%, 91rem); display: grid; grid-template-columns: .68fr 1.32fr; gap: 3%; align-items: center; padding-block: 3.25rem; }
.hero-copy { padding-left: 4%; }
.hero .eyebrow { color: #326065; }
.hero h1 { margin-left: -2%; }
.hero h1 img { width: 100%; filter: drop-shadow(0 3px 1px #193b4355); }
.hook { font-size: clamp(2.4rem, 4.3vw, 4.3rem); line-height: .94; letter-spacing: -.025em; margin: .7rem 0 0; text-wrap: balance; }
.hook em { font-style: normal; color: #216b70; }
.deck { max-width: 29rem; font-size: 1.12rem; color: #334f58; }
.hero .button { margin-top: .4rem; }

/* Island viewer */
.island-view { min-width: 0; position: relative; margin: 0; padding: 0; border: 0; }
.island-view input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.captures { position: relative; aspect-ratio: 1.45; }
.captures img, .captures canvas { width: 100%; height: 100%; object-fit: cover; }
.captures canvas { position: absolute; inset: 0; visibility: hidden; touch-action: pan-y; }
.roots, #roots-view:checked ~ .captures .crown { display: none; }
#roots-view:checked ~ .captures .roots { display: block; }
.live .captures { mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 6%, #000 91%, transparent); mask-composite: intersect; }
.live .captures canvas { visibility: visible; cursor: grab; }
.live .captures img { visibility: hidden; }
.live .fallback { display: none; }
.view-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .6rem; padding: .65rem 1rem; color: #143854; }
.view-bar span { font: bold .85rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: .09em; }
.view-bar div { background: #173a53; padding: .22rem; border-radius: 1.4rem; }
.view-bar label { display: inline-block; padding: .4rem 1.05rem; border-radius: 1.3rem; color: #e7f1e3; cursor: pointer; }
#crown-view:checked ~ .view-bar [for=crown-view], #roots-view:checked ~ .view-bar [for=roots-view] { color: #163c43; background: #ffcf62; }
#crown-view:focus-visible ~ .view-bar [for=crown-view], #roots-view:focus-visible ~ .view-bar [for=roots-view] { outline: 3px solid white; outline-offset: 2px; }
#wind { display: none; padding: .3rem .75rem; font: inherit; text-transform: none; color: #26454d; background: transparent; border: 0; text-decoration: underline; cursor: pointer; }
.live #wind { display: block; }
.inspector { max-width: 40rem; margin: .7rem auto 0; padding: 1rem 0; color: #173744; border-top: 1px solid #9eb7bb; }
#exhibits { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
#exhibits button { padding: .55rem .8rem; font-size: 1rem; color: #24414a; background: transparent; border: 1px solid #9db3b5; border-radius: .2rem; cursor: pointer; }
#exhibits button[aria-pressed=true] { color: white; background: #244651; border-color: #244651; }
#model-story { min-height: 3.2em; margin: .6rem 0 0; text-align: center; color: #2e4d55; text-wrap: balance; }
#level-control { margin-top: .4rem; justify-content: center; align-items: center; gap: .65rem; }
#level-control:not([hidden]) { display: flex; }
#level { width: 7rem; accent-color: #ffc34a; }

/* How it plays */
.game { padding-block: clamp(3rem, 6vw, 6rem); border-bottom: 1px solid var(--hairline); }
.features { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.features li { border-top: 2px solid var(--ink); padding-top: 1rem; }
.features p { margin: .45rem 0 0; }

/* Sky chart */
.chart { padding-block: clamp(3rem, 6vw, 6rem); background: #e6eeeb; }
.chart-head { display: grid; grid-template-columns: .85fr 1.15fr; gap: 6%; align-items: end; }
.chart-head p { margin: 0; max-width: 38rem; font-size: 1.08rem; }
.chart-body { display: grid; grid-template-columns: 1fr 19rem; gap: 1.5rem; margin-top: 2.2rem; align-items: start; }
#sky-chart { display: block; width: 100%; aspect-ratio: 2.05; border: 2px solid #8a5a3b; border-radius: 14px; touch-action: manipulation; }
.chart-panel { padding: 1.1rem 1.2rem 1.2rem; background: #fff8ea; border: 2px solid #8a5a3b; border-radius: 14px; color: #3a2e3f; }
.here-kind { margin: 0; font-size: .85rem; font-weight: 700; color: #7a6b7d; }
#here-name { margin-top: .15rem; font-size: 1.9rem; }
#here-story { margin: .35rem 0 0; min-height: 3.1em; }
.routes-title { margin: 1rem 0 .45rem; font-size: .85rem; font-weight: 700; color: #7a6b7d; }
#routes { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
#routes button { width: 100%; display: grid; gap: .05rem; padding: .5rem .7rem .5rem 1.9rem; text-align: left; text-transform: none; font: inherit; color: inherit; background: rgba(255,255,255,.78) linear-gradient(var(--flag), var(--flag)) .7rem .8rem / .65rem .65rem no-repeat; border: 1px solid #d9c6a3; border-radius: .5rem; cursor: pointer; }
#routes button:hover:not(:disabled) { border-color: #8a5a3b; background-color: #fff; }
#routes button:disabled { opacity: .5; cursor: default; }
#routes span { font-weight: 800; }
#routes small { font-size: .82rem; color: #7a6b7d; }

/* Heist */
.raid { background: #1a313b; color: #eef3ee; }
.raid .eyebrow { color: #a8d7cf; }
.commentary { min-height: 3.2em; margin-top: 1.4rem; padding-left: .9rem; border-left: 3px solid var(--gold); font-size: 1.1rem; color: #fff; }
.model-stage { position: relative; min-width: 0; overflow: hidden; }
.model-stage canvas { display: block; width: 100%; height: 100%; }
#raid-stage { aspect-ratio: 1.42; background: linear-gradient(#92b3c3, #c4d5d6 70%, #e8e8dc); border-bottom: 3px solid #87aaa8; }
.raid-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .5rem; }
#raid-readout { color: #c5d8d9; font-variant-numeric: tabular-nums; }
#raid-pause { padding: .35rem .9rem; font-size: 1rem; color: #eef3ee; background: transparent; border: 1px solid #a8d7cf; border-radius: .15rem; cursor: pointer; }
#raid-pause:hover { background: #24434f; }

/* Release */
#release { background: #d8e5df; border-block: 1px solid var(--hairline); }
.release { display: grid; grid-template-columns: 1fr 1fr; gap: 9%; align-items: center; padding-block: 3.5rem; }
.release p { font-size: 1.125rem; margin: 0; }

@media (max-width: 1100px) {
  .features { grid-template-columns: 1fr 1fr; }
  .chart-body { grid-template-columns: 1fr; }
  .chart-panel #routes { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
}
@media (max-width: 740px) {
  .wrap { width: min(89%, 37rem); }
  .brand { font-size: 1.5rem; gap: .4rem; }
  .brand img { height: 2.6rem; }
  nav { gap: .9rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 1rem; padding-block: 2rem; }
  .hero-copy { padding: 0; width: 94%; margin: auto; }
  .hero h1 { max-width: 27rem; }
  .hook { font-size: 2.6rem; }
  .deck { margin-block: .6rem 1rem; }
  .view-bar { padding-inline: .65rem; }
  .inspector { width: 94%; }
  .lab, .release, .chart-head, .chart-body { grid-template-columns: 1fr; gap: 1.5rem; }
  #sky-chart { aspect-ratio: 1.15; }
  .features { grid-template-columns: 1fr; gap: 1.6rem; }
  .release { gap: 1rem; }
}
@media (max-width: 480px) {
  .brand { font-size: 1.35rem; }
  nav { gap: .7rem; font-size: 1rem; }
}
@media (max-width: 345px) {
  header .bar { flex-wrap: wrap; gap: 0; padding-block: .6rem; }
}
