/* Koala's Hub. No frameworks, no external requests. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --bark: #1e1510;       /* page */
  --burrow: #2a1e16;     /* raised surfaces */
  --grain: #46342a;      /* lines */
  --cream: #f5e9d4;      /* text */
  --cream-dim: #cdbb9f;  /* secondary text */
  --honey: #f2b23e;      /* keys, primary action */
  --honey-deep: #b8741c;
  --gum: #9cc8a8;        /* eucalyptus, secondary accent */
  --fur: #bcb6c9;

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(2rem, 5vw, 2.75rem);
  --step-4: clamp(3.25rem, 11vw, 6.5rem);

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font: 400 var(--step-0)/1.6 var(--text);
  background-color: var(--bark);
  /* warm lamp glow behind the hero + scattered eucalyptus leaves */
  background-image:
    radial-gradient(60rem 36rem at 78% 8rem, rgba(242, 178, 62, .16), transparent 70%),
    radial-gradient(40rem 30rem at 0% 60rem, rgba(156, 200, 168, .07), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%239cc8a8' stroke-opacity='.07' stroke-width='2'%3E%3Cpath d='M30 60c20-30 55-34 70-28-8 22-38 46-70 28zM30 60l70-28'/%3E%3Cpath d='M150 170c10-34 42-50 58-48-2 24-26 52-58 48zM150 170l58-48'/%3E%3Cpath d='M120 90c-24-18-28-46-22-60 20 6 38 32 22 60zM120 90L98 30'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: scroll;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--honey); text-underline-offset: .2em; text-decoration-thickness: .08em; }
a:hover { color: #ffd27a; }
:focus-visible { outline: 3px solid var(--gum); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--honey); color: var(--bark); padding: .6rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip:focus { top: 1rem; }

/* ---------- header ---------- */
.top {
  max-width: var(--wrap); margin: 0 auto; padding: 1.25rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--cream); text-decoration: none; }
.brand:hover { color: var(--cream); }
.brand-mark { width: 2.75rem; height: 2.4rem; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: var(--step-1); }
.top nav ul { display: flex; gap: .25rem 1.25rem; flex-wrap: wrap; }
.top nav a { color: var(--cream-dim); text-decoration: none; font-weight: 600; padding: .35rem 0; }
.top nav a:hover { color: var(--cream); text-decoration: underline; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .7rem 1.4rem; border-radius: 999px;
  font: 700 var(--step-0)/1 var(--text); text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn-key {
  color: #2b1a08; background: linear-gradient(#ffc95e, var(--honey));
  box-shadow: 0 3px 0 var(--honey-deep), 0 8px 24px rgba(242, 178, 62, .25);
}
.btn-key:hover { color: #2b1a08; transform: translateY(-1px); box-shadow: 0 4px 0 var(--honey-deep), 0 12px 28px rgba(242, 178, 62, .32); }
.btn-key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--honey-deep); }
.btn-quiet { color: var(--cream); border: 2px solid var(--grain); }
.btn-quiet:hover { color: var(--cream); border-color: var(--cream-dim); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) clamp(4rem, 9vw, 7rem);
  display: grid; gap: 2.5rem; align-items: center;
}
.hero h1 {
  font-size: var(--step-4); line-height: .92; letter-spacing: -.035em;
  /* the title is painted like the game's golden keys */
  background: linear-gradient(175deg, #ffe3a1 10%, var(--honey) 55%, #d98a24 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #5a3812);
  padding-bottom: .08em;
}
.lede { margin-top: 1.25rem; max-width: 34ch; font-size: var(--step-1); line-height: 1.5; color: var(--cream); }
.actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; }

/* the door: a real board screenshot behind an arched frame, a koala peeking over it */
.portal {
  --w: min(78vw, 25rem);
  position: relative; width: var(--w); margin: calc(var(--w) * .26) auto 0;
  justify-self: center;
}
.door {
  position: relative; z-index: 2;
  aspect-ratio: 360 / 478; overflow: hidden;
  border-radius: 50% 50% 1.25rem 1.25rem / 32% 32% 1.25rem 1.25rem;
  border: .7rem solid #8a5a2b;
  box-shadow: 0 0 0 3px #2b1d17, 0 0 0 .55rem var(--honey-deep), 0 30px 60px rgba(0, 0, 0, .5), inset 0 0 40px rgba(0, 0, 0, .45);
  background: #3b2a1c;
}
.door img { width: 100%; height: 100%; object-fit: cover; }
.peek-head {
  position: absolute; z-index: 1;
  width: 44%; height: auto; aspect-ratio: 160 / 136;
  left: 28%; top: calc(var(--w) * -.29);
}
.peek-paws {
  position: absolute; z-index: 3;
  width: 54%; left: 23%; top: calc(var(--w) * -.03); height: auto;
}
.tokens {
  position: absolute; z-index: 4; left: -6%; right: -6%; bottom: -14%;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.tokens li { width: 26%; }
.tokens li:nth-child(2), .tokens li:nth-child(3) { width: 23%; margin-bottom: 4%; }
.tokens img { filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .55)); }

/* one orchestrated load: the door opens, the koala peeks, the pieces hop on */
@media (prefers-reduced-motion: no-preference) {
  .door { animation: door-open .9s cubic-bezier(.2, .8, .2, 1) both; }
  .peek-head { animation: peek .7s cubic-bezier(.3, 1.5, .5, 1) .75s both; }
  .peek-paws { animation: paws .45s ease-out .95s both; }
  .tokens li { animation: hop .55s cubic-bezier(.3, 1.6, .5, 1) both; }
  .tokens li:nth-child(1) { animation-delay: 1.15s; }
  .tokens li:nth-child(2) { animation-delay: 1.25s; }
  .tokens li:nth-child(3) { animation-delay: 1.35s; }
  .tokens li:nth-child(4) { animation-delay: 1.45s; }
}
@keyframes door-open {
  from { opacity: 0; transform: translateY(6%) scale(.94); }
  to { opacity: 1; transform: none; }
}
@keyframes peek { from { transform: translateY(45%); } to { transform: none; } }
@keyframes paws { from { opacity: 0; transform: translateY(40%); } to { opacity: 1; transform: none; } }
@keyframes hop {
  from { opacity: 0; transform: translateY(-40%); }
  to { opacity: 1; transform: none; }
}

/* ---------- section scaffolding ---------- */
.feature, .how, .games { max-width: var(--wrap); margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) var(--gutter); }
.feature h2, .how h2, .games h2 { font-size: var(--step-3); }
.section-lede { margin-top: .75rem; color: var(--cream-dim); max-width: 60ch; }

/* ---------- featured: KeyQuest ---------- */
.feature {
  display: grid; gap: 2rem;
  background: linear-gradient(var(--burrow), rgba(42, 30, 22, .6));
  border: 1px solid var(--grain); border-radius: 1.75rem;
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--wrap) - 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(1rem, 3vw, 2rem);
}
.feature-shot { border-radius: 1.1rem; overflow: hidden; border: 3px solid #8a5a2b; background: #000; transform: rotate(-.6deg); }
.feature-shot img { width: 100%; }
.feature-copy { display: grid; gap: 1.25rem; align-content: center; padding: 0 clamp(0rem, 2vw, 1rem); }
.feature-copy p { color: var(--cream-dim); max-width: 52ch; }
.feature-copy .btn { justify-self: start; }
.facts { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin: 0; }
.facts div { display: grid; }
.facts dt { font-size: var(--step--1); color: var(--cream-dim); }
.facts dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: var(--step-2); color: var(--gum); line-height: 1.2; }

.minis { grid-column: 1 / -1; display: grid; gap: .25rem; margin-top: .5rem; }
.minis h3 { font-size: var(--step-1); }
.minis-hint { font-size: var(--step--1); color: var(--cream-dim); }
.minis-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(72%, 17rem); gap: 1rem;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding: .75rem .25rem 1.25rem; margin-top: .5rem;
  scrollbar-color: var(--honey-deep) transparent;
}
.minis-track:focus-visible { outline-offset: -2px; }
.minis-track li { scroll-snap-align: start; }
.minis-track figure { margin: 0; }
.minis-track img {
  width: 100%; aspect-ratio: 438 / 205; object-fit: cover;
  border-radius: .8rem; border: 2px solid var(--grain);
}
.minis-track figcaption { margin-top: .5rem; font-weight: 600; font-size: var(--step--1); }

/* ---------- how it works ---------- */
.steps { counter-reset: step; display: grid; gap: 2.5rem; margin-top: 2rem; }
.steps li { counter-increment: step; display: grid; gap: .6rem; position: relative; }
.steps img {
  width: 100%; aspect-ratio: 2.3 / 1; object-fit: cover; border-radius: .9rem;
  border: 2px solid var(--grain); margin-bottom: .6rem;
}
.steps li:nth-child(3) img { object-position: 50% 78%; }
.steps h3 { font-size: var(--step-2); display: flex; align-items: baseline; gap: .65rem; }
.steps h3::before {
  content: counter(step);
  flex: none; display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem;
  border-radius: 50%; background: var(--gum); color: #14231a;
  font-size: var(--step-1); transform: translateY(-.15rem);
}
.steps p { color: var(--cream-dim); max-width: 42ch; }

/* ---------- games shelf ---------- */
.shelf { display: grid; gap: 1.25rem; margin-top: 2rem; }
.game {
  position: relative; display: grid; grid-template-rows: auto 1fr;
  border-radius: 1.25rem; overflow: hidden; background: var(--burrow);
}
.game-live { border: 2px solid var(--honey-deep); }
.game-live:hover { border-color: var(--honey); }
.game-live:focus-within { outline: 3px solid var(--gum); outline-offset: 3px; }
.game-live img { width: 100%; aspect-ratio: 438 / 205; object-fit: cover; }
.game-body { padding: 1.25rem 1.4rem 1.5rem; display: grid; gap: .5rem; align-content: start; }
.game h3 { font-size: var(--step-2); }
.game h3 a { color: var(--cream); text-decoration: none; }
.game h3 a::after { content: ""; position: absolute; inset: 0; }   /* whole card is the link */
.game h3 a:focus-visible { outline: none; }
.game p { color: var(--cream-dim); }
.game .addr { font-size: var(--step--1); color: var(--gum); }
.status { font-size: var(--step--1); font-weight: 700; color: var(--cream-dim); }
.status-live { color: var(--gum); display: inline-flex; align-items: center; gap: .45rem; }
.status-live::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--gum); box-shadow: 0 0 0 4px rgba(156, 200, 168, .2); }
.game-soon { border: 2px dashed var(--grain); background: transparent; }
.game-slot {
  aspect-ratio: 438 / 205; display: grid; place-items: center;
  background: repeating-linear-gradient(-45deg, rgba(70, 52, 42, .35) 0 12px, transparent 12px 24px);
}
.game-slot svg { width: 4.5rem; height: 4rem; opacity: .35; filter: grayscale(1); }
.game-soon a { position: relative; z-index: 1; }

/* ---------- footer ---------- */
.foot {
  max-width: var(--wrap); margin: 2rem auto 0; padding: 2.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--grain); display: grid; gap: 1rem;
  color: var(--cream-dim); font-size: var(--step--1);
}
.foot p { max-width: 70ch; }
.foot-brand { display: flex; align-items: center; gap: .55rem; color: var(--cream); }
.foot-brand .brand-mark { width: 2.2rem; height: 1.9rem; }

/* ---------- wider screens ---------- */
@media (min-width: 48rem) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  .shelf { grid-template-columns: repeat(3, 1fr); }
  .minis-track { grid-auto-columns: 15.5rem; }
}
@media (min-width: 60rem) {
  .hero { grid-template-columns: 1.1fr .9fr; gap: 3rem; }
  .portal { margin-top: calc(var(--w) * .2); }
  .feature { grid-template-columns: 1.35fr 1fr; gap: 2.5rem; }
  .lede { font-size: 1.375rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .hero h1 { background: none; color: CanvasText; filter: none; }
}
