/* ============================================================
   YellowLife® — one colour, turned all the way up
   ============================================================ */
:root {
  --yellow: #ffd400;
  --yellow-2: #f5c400;
  --yellow-deep: #e0ae00;
  --gold: #ffcf33;
  --ink: #0f0b00;
  --ink-70: rgba(15, 11, 0, .7);
  --ink-40: rgba(15, 11, 0, .4);
  --paper: #fffcf0;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--yellow);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--yellow); }

em { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* ============ 3D CANVAS ============ */
#world {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none; /* gestures belong to the world, not page scroll */
}

/* ============ CONTENT LAYER ============ */
.content { position: relative; z-index: 2; pointer-events: none; }
.content a, .content button { pointer-events: auto; }
.panel--solid, .panel--dark, .footer { pointer-events: auto; }

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px);
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
}
.nav.is-scrolled {
  padding-top: 12px; padding-bottom: 12px;
  background: rgba(255, 212, 0, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(15, 11, 0, .12);
}
.nav__logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
  letter-spacing: -.02em; color: var(--ink); text-decoration: none;
}
.nav__logo em { font-weight: 400; font-size: 1.35em; line-height: 0; }
.nav__logo sup { font-size: .5em; font-family: var(--font-body); font-weight: 600; }
.nav__links { display: flex; gap: clamp(14px, 3vw, 36px); }
.nav__links a {
  color: var(--ink); text-decoration: none;
  font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  opacity: .75; transition: opacity .2s;
}
.nav__links a:hover { opacity: 1; }
.nav__cta { font-size: .82rem !important; padding: 10px 20px !important; }
@media (max-width: 640px) { .nav__links { display: none; } }

/* ============ BUTTONS ============ */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  padding: 15px 30px; border-radius: 999px; border: 1.5px solid var(--ink);
  transition: transform .2s cubic-bezier(.2,1,.4,1), background .2s, color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(15,11,0,.45); }
.btn:active { transform: translateY(0); }
.btn--ink { background: var(--ink); color: var(--yellow); }
.btn--ink:hover { color: var(--gold); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: rgba(15,11,0,.06); }
.btn--gold { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

/* ============ HERO ============ */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 120px clamp(20px, 6vw, 90px) 180px;
  max-width: 1200px;
}
.hero__eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-70);
  padding: 8px 14px; border: 1.5px solid rgba(15,11,0,.25); border-radius: 999px;
}
.hero__title {
  margin-top: 28px;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.9rem, 8.5vw, 6.8rem);
  line-height: 1.02; letter-spacing: -.035em;
}
.hero__title span { display: block; }
.hero__title em { font-weight: 400; letter-spacing: -.01em; }
.hero__sub {
  margin-top: 30px; max-width: 460px;
  font-size: 1.06rem; line-height: 1.65; font-weight: 500; color: var(--ink-70);
}
.hero__cta { margin-top: 38px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 34px; left: clamp(20px, 6vw, 90px);
  display: flex; align-items: center; gap: 12px;
  font-size: .72rem; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: var(--ink-70);
}
.hero__scroll span {
  display: block; width: 1.5px; height: 44px; background: var(--ink-40);
  overflow: hidden; position: relative;
}
.hero__scroll span::after {
  content: ""; position: absolute; left: 0; top: -50%; width: 100%; height: 50%;
  background: var(--ink); animation: scrollHint 1.8s ease-in-out infinite;
}
@keyframes scrollHint { to { top: 110%; } }
.hero { position: relative; }

/* entrance */
.pop { opacity: 0; transform: translateY(26px); animation: popIn .9s cubic-bezier(.2,1,.3,1) forwards; animation-delay: var(--d, 0s); }
@keyframes popIn { to { opacity: 1; transform: none; } }

/* ============ TICKER ============ */
.ticker {
  pointer-events: auto;
  background: var(--ink); color: var(--yellow);
  overflow: hidden; padding: 16px 0; position: relative; z-index: 2;
}
.ticker__track { display: flex; align-items: center; gap: 28px; width: max-content; animation: ticker 30s linear infinite; }
.ticker__track span {
  font-family: var(--font-display); font-weight: 500; font-size: .84rem;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
.ticker__track i { font-style: normal; color: var(--gold); font-size: .7rem; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ============ PANELS ============ */
.panel { position: relative; scroll-margin-top: 76px; }
.panel--solid { background: var(--yellow); box-shadow: 0 -1px 0 rgba(15,11,0,.1); }
.panel--dark { background: var(--ink); color: var(--paper); }
.panel--open { /* transparent — the 3D world shows through */ }
.panel__inner {
  max-width: 1150px; margin: 0 auto;
  padding: clamp(90px, 12vw, 150px) clamp(20px, 5vw, 60px);
}
.panel__inner--narrow { max-width: 760px; text-align: center; }
.panel__spacer { height: 26svh; }

.eyebrow {
  font-size: .74rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ink-70); margin-bottom: 22px;
}
.eyebrow--gold { color: var(--gold); }

.h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 1.06; letter-spacing: -.03em;
}
.h2 em { font-weight: 400; }
.lead {
  margin-top: 24px; max-width: 560px;
  font-size: 1.05rem; line-height: 1.7; font-weight: 500; color: var(--ink-70);
}
.panel__inner--narrow .lead { margin-left: auto; margin-right: auto; }
.panel--dark .lead { color: rgba(255, 252, 240, .65); }

/* grid cells */
.grid3 {
  margin-top: clamp(50px, 7vw, 90px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5px; background: rgba(15,11,0,.18);
  border: 1.5px solid rgba(15,11,0,.18); border-radius: 20px; overflow: hidden;
}
.cell { background: var(--yellow); padding: 38px 30px 44px; transition: background .25s ease; }
.cell:hover { background: var(--gold); }
.cell__num {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--ink); font-family: var(--font-serif); font-style: italic; font-size: 1.1rem;
}
.cell h3 { margin: 20px 0 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; }
.cell p { font-size: .94rem; line-height: 1.65; color: var(--ink-70); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-top: 10px; }
.stat__num {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(3rem, 7vw, 5rem); letter-spacing: -.04em; color: var(--yellow);
}
.stat p { margin-top: 6px; font-size: .86rem; font-weight: 500; letter-spacing: .04em; color: rgba(255,252,240,.55); }

/* controls */
.controls { margin-top: 42px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  pointer-events: auto; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: .88rem;
  padding: 12px 22px; border-radius: 999px;
  background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink);
  transition: transform .18s cubic-bezier(.2,1.4,.4,1), background .18s, color .18s;
}
.chip:hover { transform: translateY(-2px) scale(1.03); }
.chip:active { transform: scale(.96); }
.chip--ink { background: var(--ink); color: var(--yellow); }
.hint { margin-top: 26px; font-family: var(--font-serif); font-style: italic; font-size: 1.05rem; color: var(--ink-70); }

/* ============ FOOTER ============ */
.footer { background: var(--ink); color: var(--paper); text-align: center; position: relative; z-index: 2; scroll-margin-top: 76px; }
.footer__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(3rem, 9vw, 7rem); letter-spacing: -.04em; color: var(--yellow);
}
.footer__title em { font-weight: 400; }
.footer__sub { margin: 22px auto 34px; max-width: 420px; line-height: 1.7; color: rgba(255,252,240,.6); }
.footer__base {
  margin-top: 80px; padding-top: 26px;
  border-top: 1px solid rgba(255, 252, 240, .14);
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  font-size: .76rem; letter-spacing: .06em; color: rgba(255,252,240,.45);
}
.footer__credits { margin-top: 18px; font-size: .68rem; line-height: 1.8; color: rgba(255,252,240,.32); }
.footer__credits a { color: rgba(255,252,240,.5); }

/* ============ SCROLL REVEALS ============ */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,1,.4,1); transition-delay: var(--d, 0s); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============ 3D SPEECH BUBBLES ============ */
.bubble3d {
  position: fixed; z-index: 5; pointer-events: none;
  transform: translate(-50%, -100%);
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 12px;
  padding: 6px 14px;
  font-family: var(--font-display); font-weight: 600; font-size: .9rem;
  white-space: nowrap;
  animation: bubblePop .3s cubic-bezier(.2,1.6,.4,1), bubbleFade .4s ease 1.4s forwards;
}
.bubble3d::after {
  content: ""; position: absolute; top: 100%; left: 50%; translate: -50%;
  border: 6px solid transparent; border-top-color: var(--ink);
}
@keyframes bubblePop { from { scale: 0; } }
@keyframes bubbleFade { to { opacity: 0; scale: .7; } }

@media (prefers-reduced-motion: reduce) {
  .pop, .reveal { animation: none; transition: none; opacity: 1; transform: none; }
  .ticker__track { animation-duration: 240s; }
}

/* held-item pill (garden) */
.held-pill {
  position: fixed; bottom: 26px; left: 50%; translate: -50%;
  z-index: 20; pointer-events: none;
  background: var(--ink); color: var(--yellow);
  font-family: var(--font-display); font-weight: 600; font-size: .92rem;
  padding: 11px 22px; border-radius: 999px;
  box-shadow: 0 10px 30px -12px rgba(15,11,0,.5);
  animation: pillIn .3s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pillIn { from { translate: -50% 20px; opacity: 0; } }

/* ============ MINIMAP ============ */
.minimap {
  position: fixed; top: 84px; right: 18px; z-index: 15;
  width: 130px; height: 130px; cursor: pointer;
  filter: drop-shadow(0 8px 20px rgba(15,11,0,.25));
  transition: width .3s cubic-bezier(.2,1.2,.4,1), height .3s cubic-bezier(.2,1.2,.4,1);
}
.minimap canvas { width: 100%; height: 100%; display: block; }
.minimap.is-collapsed { width: 40px; height: 40px; }
@media (max-width: 640px) { .minimap { top: 74px; right: 12px; width: 104px; height: 104px; } }

/* ============ DRIVING PAD ============ */
.dpad[hidden] { display: none !important; }
.dpad {
  position: fixed; bottom: 24px; right: 20px; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px);
  gap: 8px;
  grid-template-areas: ". up ." "left honk right" ". down .";
}
.dpad button {
  font-size: 1.15rem; line-height: 1; cursor: pointer;
  background: var(--ink); color: var(--yellow);
  border: none; border-radius: 14px;
  box-shadow: 0 6px 16px -6px rgba(15,11,0,.5);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.dpad button:active { transform: scale(.92); background: #241c05; }
.dpad button[data-d="up"] { grid-area: up; }
.dpad button[data-d="left"] { grid-area: left; }
.dpad button[data-d="honk"] { grid-area: honk; background: var(--yellow); color: var(--ink); font-size: .78rem; font-family: var(--font-display); font-weight: 700; }
.dpad button[data-d="right"] { grid-area: right; }
.dpad button[data-d="down"] { grid-area: down; }

/* ============ SPEEDOMETER ============ */
.speedo[hidden] { display: none !important; }
.speedo {
  position: fixed; bottom: 26px; left: 20px; z-index: 20;
  width: 96px; height: 96px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--ink) 58%, transparent 59%),
    conic-gradient(from 210deg, var(--yellow) calc(var(--p, 0) * 300deg), rgba(255,252,240,.15) 0deg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px -10px rgba(15,11,0,.55);
  pointer-events: none;
}
.speedo__num {
  font-family: var(--font-display); font-weight: 800; font-size: 1.7rem;
  color: var(--yellow); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.speedo__unit {
  font-family: var(--font-display); font-weight: 600; font-size: .6rem;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(255,252,240,.55);
  margin-top: 3px;
}
