/* Archipelago Games / Short Stack — site styles */

@font-face { font-family: "Baloo 2"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/baloo-2-700.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-weight: 800; font-style: normal; font-display: swap; src: url("/assets/fonts/baloo-2-800.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 200 1000; font-style: normal; font-display: swap; src: url("/assets/fonts/nunito-sans.woff2") format("woff2"); }

:root {
  --walnut: #2C1B10;
  --walnut-2: #3E2817;
  --walnut-ink: #120A04;
  --ink: #3A2314;
  --ink-2: #4B3626;
  --amber: #F5AE45;
  --amber-hi: #FFBC57;
  --amber-edge: #C47A20;
  --cream: #FFFBF3;
  --foam: #E5F2EF;
  --sand: #E3CBAE;
  --gold-text: #FFE2B0;
  --ice: #8FD8DD;
  --steel: #C9CED3;
  --display: "Baloo 2", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, video { display: block; max-width: 100%; object-fit: contain; }  /* if a box is ever mis-sized, the artwork letterboxes instead of stretching */
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.04; margin: 0; letter-spacing: -0.005em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: #0F6F75; }
a:hover { color: #0A5458; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 100; background: var(--amber); color: var(--walnut); padding: 12px 18px; border-radius: 12px; font-weight: 800; text-decoration: none; }
.skip:focus { top: 16px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- navigation ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding: 24px 0; }
.brand { display: block; flex: none; padding: 4px 0; text-decoration: none; }
/* sized by width with a fixed ratio (15:4 artwork): never by height inside a flex row, which Safari can stretch */
.brand img { width: 220px; max-width: none; height: auto; aspect-ratio: 15 / 4; flex: none; filter: drop-shadow(0 2px 10px rgba(20, 10, 2, .35)); }
.nav-links { display: flex; align-items: center; gap: 8px 28px; flex-wrap: wrap; }
.nav-links a, .nav-links button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; background: none; border: 0; cursor: pointer; color: #fff; font: 700 16px/1 var(--body); text-decoration: none; }
.nav-links a:hover, .nav-links button:hover { color: var(--gold-text); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 0 30px; border: 0; border-radius: 18px; cursor: pointer; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; text-decoration: none; transition: background-color .15s ease, transform .15s ease; }
.btn svg { flex: none; }
.btn span { display: block; padding-top: var(--btn-nudge, 0px); }
.btn-amber { background: var(--amber); color: var(--walnut); box-shadow: 0 10px 30px -12px rgba(30, 14, 2, .6); }
.btn-amber:hover { background: var(--amber-hi); color: var(--walnut); }
.btn-dark { background: var(--walnut); color: var(--gold-text); }
.btn-dark:hover { background: var(--walnut-2); color: var(--gold-text); }
.btn:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .btn { transition: background-color .15s ease; } .btn:active { transform: none; } }

/* ---------- phone frames (screenshots keep their own aspect ratio) ---------- */
.phone { width: 300px; padding: 11px; border-radius: 48px; background: #1E140C; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1), 0 40px 70px -24px rgba(25, 12, 2, .7); }
.phone img, .phone video { width: 100%; height: auto; border-radius: 38px; }

/* ---------- hero ---------- */
.hero { position: relative; background: #3b4a2a url("/assets/img/bg.webp") center 18% / cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(28, 16, 6, .5) 0%, rgba(28, 16, 6, 0) 18%), linear-gradient(90deg, rgba(28, 16, 6, .66) 0%, rgba(28, 16, 6, .4) 44%, rgba(28, 16, 6, 0) 72%); }
.hero .wrap { position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: end; padding-top: 32px; }
.hero-copy { padding-bottom: 128px; }
.hero-logo { width: 100%; max-width: 470px; height: auto; filter: drop-shadow(0 12px 24px rgba(30, 14, 2, .45)); }
.hero-lede { max-width: 30ch; margin-top: 32px; color: #fff; font-size: 24px; line-height: 1.4; font-weight: 600; text-shadow: 0 2px 12px rgba(20, 10, 2, .55); }
.hero-platforms { margin-top: 16px; color: #FFF1DC; font-size: 17px; font-weight: 700; text-shadow: 0 1px 8px rgba(20, 10, 2, .6); }
.hero-actions { margin-top: 40px; }
.hero-phone { position: relative; z-index: 2; justify-self: center; margin-bottom: -112px; }

/* ---------- materials ---------- */
.materials { background: var(--walnut); color: #F7E6CF; padding: 176px 0 120px; }
.materials h2 { max-width: 14ch; color: var(--gold-text); font-size: 60px; }
.section-intro { max-width: 46ch; margin-top: 24px; font-size: 20px; }
.materials .section-intro { color: var(--sand); }
.mat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px 32px; margin: 64px 0 0; padding: 0; list-style: none; }
.mat-tile { width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45)); }
.mat-name { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 24px; }
.mat-name h3 { color: #FFF3E0; font-size: 30px; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--amber); color: var(--walnut); font-size: 13px; font-weight: 800; line-height: 1.4; white-space: nowrap; }
.pill-flip { background: var(--ice); }
.pill-static { background: var(--steel); }
.mat-copy { margin-top: 14px; color: var(--sand); font-size: 16px; line-height: 1.6; }

/* ---------- modes ---------- */
.modes { background: var(--foam); padding: 128px 0; }
.modes-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center; }
.phones { position: relative; height: 640px; }
.phones .phone { position: absolute; width: 270px; }
.phones .p1 { left: 4%; top: 40px; transform: rotate(-6deg); }
.phones .p2 { left: 40%; top: 0; transform: rotate(5deg); }
.modes h2 { max-width: 16ch; color: var(--walnut); font-size: 56px; }
.mode-list { display: flex; flex-direction: column; gap: 32px; margin: 48px 0 0; padding: 0; list-style: none; }
.mode { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 24px; align-items: start; }
.mode img { width: 64px; height: auto; }
.mode h3 { color: var(--walnut); font-size: 30px; }
.mode p { max-width: 42ch; margin-top: 8px; color: var(--ink-2); }

/* ---------- styles collection ---------- */
.collect { padding: 128px 0; }
.collect-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 72px; align-items: center; }
.collect h2 { max-width: 12ch; color: var(--walnut); font-size: 56px; }
.collect .section-intro { max-width: 44ch; color: var(--ink-2); }
.tile-row { display: flex; flex-wrap: wrap; row-gap: 24px; margin-top: 56px; padding-left: 6px; }
.tile-row img { width: 62px; height: 62px; margin-left: -6px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(44, 27, 16, .28)); }
.tile-row img:nth-child(even) { transform: translateY(14px); }
.collect-phone { justify-self: center; }

/* ---------- closing band ---------- */
.closing { background: var(--amber); padding: 96px 0; }
.closing-row { display: flex; align-items: center; justify-content: space-between; gap: 32px 48px; flex-wrap: wrap; }
.closing h2 { color: var(--walnut); font-size: 56px; }
.closing p { margin-top: 16px; color: #4A2E14; font-size: 20px; font-weight: 600; }

/* ---------- footer ---------- */
.footer { background: var(--walnut); color: #D9C2A5; padding: 48px 0; font-size: 15px; }
.footer-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 32px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer-brand img { width: 179px; max-width: none; height: auto; aspect-ratio: 15 / 4; flex: none; margin-left: -6px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gold-text); font-weight: 700; text-decoration: none; }
.footer a:hover { color: #fff; }

/* ---------- inner pages (privacy, support, 404) ---------- */
.page-head { background: var(--walnut); color: #F7E6CF; }
.page-head .title { padding: 48px 0 80px; }
.page-head h1 { max-width: 18ch; color: var(--gold-text); font-size: 64px; }
.page-head .meta { margin-top: 16px; color: var(--sand); font-size: 17px; }
.prose { max-width: 760px; padding: 72px 0 112px; }
.prose h2 { margin: 56px 0 0; color: var(--walnut); font-size: 34px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 32px 0 0; color: var(--walnut); font-size: 24px; }
.prose p, .prose ul, .prose ol { margin: 16px 0 0; color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose strong { color: var(--ink); }
.callout { margin-top: 24px; padding: 24px 28px; border-radius: 20px; background: var(--foam); }
.callout p:first-child { margin-top: 0; }
.notfound { padding: 96px 0 128px; }
.notfound p { max-width: 40ch; margin-top: 16px; color: var(--ink-2); font-size: 20px; }
.notfound .btn { margin-top: 40px; }

/* ---------- How it plays overlay ---------- */
.play-icon { width: 22px; height: 22px; }
dialog.howto { width: min(820px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; border-radius: 28px; background: var(--walnut); color: #F7E6CF; box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .7); overflow: auto; }
dialog.howto::backdrop { background: rgba(20, 12, 6, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.howto[open] { animation: howto-in .28s ease-out; }
@keyframes howto-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.howto[open] { animation: none; } }
.howto-inner { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 40px; align-items: center; padding: 32px; }
.howto-close { position: absolute; top: 16px; right: 16px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; }
.howto-close:hover { background: rgba(255, 255, 255, .2); }
.howto-video { position: relative; }
.howto-video .phone { width: auto; padding: 10px; border-radius: 40px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1), 0 30px 60px -24px rgba(0, 0, 0, .8); }
.howto-video video { height: min(640px, calc(100dvh - 128px)); width: auto; aspect-ratio: 780 / 1688; border-radius: 31px; background: #1E140C; }
.howto-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 20px 0 0 16px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font: 700 15px/1 var(--body); cursor: pointer; }
.howto-toggle:hover { background: rgba(255, 255, 255, .18); }
.howto-text h2 { color: var(--gold-text); font-size: 40px; }
.howto-text > p { margin-top: 12px; color: var(--sand); font-size: 17px; }
.chapters { display: flex; flex-direction: column; gap: 4px; margin: 24px 0 0; padding: 0; list-style: none; }
.chapter { position: relative; display: block; width: 100%; padding: 12px 16px 14px; border: 0; border-radius: 14px; background: none; color: #CDB79B; text-align: left; cursor: pointer; font: inherit; }
.chapter:hover { background: rgba(255, 255, 255, .05); }
.chapter b { display: block; font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.2; color: #E9D6BC; }
.chapter span { display: block; margin-top: 4px; font-size: 15px; line-height: 1.45; }
.chapter[aria-current="true"] { background: rgba(245, 174, 69, .14); color: #F7E6CF; }
.chapter[aria-current="true"] b { color: var(--gold-text); }
.chapter i { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.chapter i::after { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: var(--amber); border-radius: 3px; }
.chapter:not([aria-current="true"]) i { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .mat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  :root { --gutter: 20px; }
  .hero-grid, .modes-grid, .collect-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { gap: 40px; padding-top: 16px; }
  .hero-copy { padding-bottom: 0; }
  .hero-lede { font-size: 20px; margin-top: 24px; }
  .hero-actions { margin-top: 32px; }
  .hero-phone { margin-bottom: -88px; }
  .phone { width: 248px; padding: 9px; border-radius: 40px; }
  .phone img, .phone video { border-radius: 31px; }
  .materials { padding: 136px 0 88px; }
  .materials h2, .modes h2, .collect h2, .closing h2 { font-size: 40px; }
  .section-intro { font-size: 18px; }
  .mat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; margin-top: 48px; }
  .mat-tile { width: 88px; height: 88px; }
  .modes, .collect { padding: 88px 0; }
  .modes-grid, .collect-grid { gap: 56px; }
  .phones { height: 520px; }
  .phones .phone { width: 210px; }
  .phones .p2 { left: 38%; }
  .mode-list { margin-top: 40px; }
  .closing { padding: 72px 0; }
  .page-head h1 { font-size: 44px; }
  .page-head .title { padding: 32px 0 56px; }
  .prose { padding: 56px 0 88px; }
  .prose h2 { font-size: 28px; margin-top: 48px; }
}
@media (max-width: 720px) {
  .howto-inner { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 64px 16px 20px; justify-items: center; }
  .howto-video video { height: min(540px, calc(100dvh - 360px)); min-height: 280px; }
  .howto-text { width: 100%; display: flex; flex-direction: column; align-items: center; }
  .howto-text .chapters { width: 100%; }
  .howto-toggle { margin: 12px 0 0; }
  .howto-text h2, .howto-text > p { display: none; }
  .chapters { margin-top: 0; }
  .chapter:not([aria-current="true"]) { display: none; }
  .chapter { text-align: center; padding: 12px 16px 16px; }
}
@media (max-width: 600px) {
  .nav { flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px 0 8px; }
  .nav-links { gap: 0 20px; }
}
@media (max-width: 560px) {
  .mat-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .mat-grid > li { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .mat-grid .mat-tile { width: 72px; height: 72px; grid-row: span 2; }
  .mat-name { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 0; }
  .tile-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-left: 0; margin-top: 40px; }
  .tile-row img { width: 100%; height: auto; margin-left: 0; }
  .tile-row img:nth-child(even) { transform: none; }
  .phones { height: 440px; }
  .phones .phone { width: 180px; }
  .phones .p1 { left: 2%; }
  .phones .p2 { left: auto; right: 4%; }
  .hero-lede { font-size: 19px; }
  .brand img { width: 140px; }
  .footer-brand img { width: 140px; }
}
