@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800;900&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --road-bottom: clamp(24px, 4.5vh, 50px);
  --road-height: clamp(110px, 22vh, 180px);
  --car-bottom: calc(var(--road-bottom) + clamp(30px, 5.5vh, 54px));
  --plane-bottom: 52%;
  --sign-width: clamp(108px, 12vw, 152px);
  --sign-post-height: clamp(38px, 6.5vh, 66px);
  --camera-offset: 0px;
  --world-width: 100vw;

  --navy:       #1B2A3A;
  --gold:       #FFB800;
  --gold-dark:  #D4920A;
  --cream:      #FDFAF5;
  --card-border:#DDD0B8;
  --ink:        #1B2A3A;
  --muted:      #526070;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  background: var(--navy);
  color: var(--ink);
  font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }

/* ─── SHELL ──────────────────────────────────────────────── */
.presentation-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

/* ─── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(10px, 1.8vw, 22px) clamp(16px, 4vw, 48px);
  background: linear-gradient(135deg, #1B2A3A 0%, #1B2A3A 45%, #3D1C08 100%);
  border-bottom: 3px solid var(--gold);
  z-index: 10;
}
.eyebrow {
  margin: 0 0 0.22rem;
  color: var(--gold);
  font-size: clamp(0.65rem, 1.4vw, 0.82rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}
h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.8vw, 2rem);
  line-height: 1;
  font-family: 'Fredoka One', cursive;
  color: #fff;
}
.slide-counter {
  flex-shrink: 0;
  margin: 0;
  padding: 0.4rem 0.9rem;
  border: 2px solid rgba(255, 184, 0, 0.5);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 184, 0, 0.1);
  white-space: nowrap;
  font-weight: 900;
  font-size: clamp(0.76rem, 1.6vw, 0.92rem);
}

/* ─── STAGE / SKY ────────────────────────────────────────── */
.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  /* Vibrant sky gradient */
  background: linear-gradient(180deg,
    #1A94CC 0%,
    #3CB8E8 18%,
    #78D0F0 38%,
    #C0E8F8 58%,
    #FFF4DC 78%,
    #FFDDA0 100%
  );
  isolation: isolate;
}

/* ─── CLOUDS ─────────────────────────────────────────────── */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  pointer-events: none;
  z-index: 1;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}
.cloud-1 { width: 112px; height: 36px; top: 7%;  left: 5%; }
.cloud-1::before { width: 56px; height: 56px; top: -28px; left: 14px; }
.cloud-1::after  { width: 42px; height: 42px; top: -18px; left: 52px; }

.cloud-2 { width: 84px;  height: 28px; top: 18%; left: 34%; }
.cloud-2::before { width: 44px; height: 44px; top: -22px; left: 11px; }
.cloud-2::after  { width: 33px; height: 33px; top: -14px; left: 40px; }

.cloud-3 { width: 130px; height: 40px; top: 5%;  left: 60%; }
.cloud-3::before { width: 66px; height: 66px; top: -33px; left: 17px; }
.cloud-3::after  { width: 50px; height: 50px; top: -22px; left: 64px; }

.cloud-4 { width: 94px;  height: 30px; top: 22%; left: 80%; }
.cloud-4::before { width: 48px; height: 48px; top: -24px; left: 12px; }
.cloud-4::after  { width: 36px; height: 36px; top: -16px; left: 46px; }

/* ─── WORLD ──────────────────────────────────────────────── */
.world {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--world-width);
  height: 100%;
  transform: translate3d(var(--camera-offset), 0, 0);
  will-change: transform;
  z-index: 2;
}

/* ─── GRASS ──────────────────────────────────────────────── */
.grass-strip {
  position: absolute;
  left: 0; bottom: 0;
  width: var(--world-width);
  height: calc(var(--road-bottom) + 6px);
  background: linear-gradient(180deg, #6DD86D 0%, #3DB83D 55%, #268C26 100%);
}

/* ─── ROAD ───────────────────────────────────────────────── */
.road {
  position: absolute;
  left: 0;
  bottom: var(--road-bottom);
  width: var(--world-width);
  height: var(--road-height);
  background: linear-gradient(180deg, #6B7280 0%, #4B5563 50%, #374151 100%);
  border-top: 4px solid #9CA3AF;
  border-bottom: 4px solid #1F2937;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.18);
  z-index: 1;
}
.road-edge {
  position: absolute;
  left: 0; width: 100%;
  height: clamp(5px, 1vh, 9px);
  background: repeating-linear-gradient(90deg, var(--gold) 0 34px, #fff 34px 56px);
  opacity: 0.9;
}
.road-edge-top    { top: clamp(9px, 1.8vh, 16px); }
.road-edge-bottom { bottom: clamp(9px, 1.8vh, 16px); opacity: 0.45; }
.lane-line {
  position: absolute;
  left: 0; top: 52%;
  width: 100%;
  height: clamp(4px, 0.9vh, 8px);
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, #fff 0 46px, transparent 46px 92px);
  opacity: 0.8;
}

/* ─── SLIDES LAYER ───────────────────────────────────────── */
.slides-layer { position: absolute; inset: 0; z-index: 2; }

/* ─── SLIDE CARD ─────────────────────────────────────────── */
.slide-card {
  position: absolute;
  top: clamp(20px, 4.5vh, 60px);
  width: clamp(240px, 40vw, 540px);
  padding: clamp(14px, 2.4vw, 28px);
  border-radius: clamp(16px, 2.5vw, 28px);
  background: var(--cream);
  border: 2px solid var(--card-border);
  box-shadow:
    0 5px 0 var(--card-border),
    0 12px 36px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.slide-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--card-accent, var(--gold));
  border-radius: 16px 16px 0 0;
}
.slide-emoji {
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  line-height: 1;
  display: block;
  margin-bottom: 0.28rem;
}
.slide-kicker {
  margin: 0 0 0.35rem;
  color: var(--card-accent, var(--gold-dark));
  font-size: clamp(0.7rem, 1.4vw, 0.86rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.slide-title {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2.8rem);
  line-height: 1.05;
  font-family: 'Fredoka One', cursive;
  color: var(--navy);
}
.slide-copy {
  margin: clamp(6px, 1.2vw, 12px) 0 0;
  color: var(--muted);
  font-size: clamp(0.88rem, 1.7vw, 1.1rem);
  line-height: 1.6;
  max-width: 40ch;
  font-weight: 600;
}

/* ─── ROAD SIGN ──────────────────────────────────────────── */
.slide-marker {
  position: absolute;
  bottom: calc(var(--road-bottom) + var(--road-height) - 4px);
  width: var(--sign-width);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
}
.sign-board {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: clamp(56px, 9.5vh, 84px);
  display: grid;
  place-items: center;
  gap: 0.08rem;
  padding: clamp(6px, 1.3vw, 11px);
  text-align: center;
  color: #fff;
  background: var(--sign-color, #2563EB);
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: clamp(8px, 1.6vw, 14px);
  box-shadow: 0 5px 0 rgba(0,0,0,0.26), 0 10px 22px rgba(0,0,0,0.16);
}
.sign-board::before, .sign-board::after {
  content: '';
  position: absolute;
  top: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.sign-board::before { left: 7px; }
.sign-board::after  { right: 7px; }
.sign-emoji  { font-size: clamp(1rem, 2.2vw, 1.5rem); line-height: 1; display: block; }
.sign-title  { display: block; font-family: 'Fredoka One', cursive; font-size: clamp(0.78rem, 1.8vw, 1.1rem); line-height: 1.1; }
.sign-subtitle {
  display: block;
  margin-top: 0.1rem;
  font-size: clamp(0.5rem, 1vw, 0.62rem);
  font-weight: 800;
  opacity: 0.88;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sign-posts {
  height: var(--sign-post-height);
  display: flex;
  justify-content: center;
  gap: calc(var(--sign-width) * 0.38);
  margin-top: -2px;
}
.sign-post {
  width: clamp(5px, 0.7vw, 8px);
  height: 100%;
  background: linear-gradient(90deg, #8A9AAA, #E4EAF0 45%, #6A7A8A);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

/* ─── VEHICLE BASE ───────────────────────────────────────── */
.car, .plane {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  z-index: 4;
  will-change: left;
  transition: opacity 0.45s ease;
}
.car.vehicle-hidden,
.plane.vehicle-hidden { opacity: 0; pointer-events: none; }
.car.reverse   { transform: translateX(-50%) scaleX(-1); }
.plane.reverse { transform: translateX(-50%) scaleX(-1); }

/* ─── CAR ────────────────────────────────────────────────── */
.car {
  bottom: var(--car-bottom);
  width: clamp(86px, 12vw, 142px);
  height: clamp(42px, 6.5vw, 68px);
}
.car-top {
  position: absolute;
  left: 22%; top: 0;
  width: 50%; height: 46%;
  background: linear-gradient(180deg, #F97316 0%, #C2410C 100%);
  border-radius: 55% 55% 10% 10%;
  border: 2px solid rgba(120, 35, 5, 0.4);
  border-bottom: none;
}
.car-body {
  position: absolute;
  left: 5%; right: 4%; bottom: 16%; height: 54%;
  background: linear-gradient(180deg, #FB923C 0%, #F97316 55%, #C2410C 100%);
  border-radius: 22px 28px 12px 12px;
  border: 2px solid rgba(120, 35, 5, 0.4);
  box-shadow: inset 0 -6px 0 rgba(100, 25, 5, 0.12);
}
.window {
  position: absolute;
  top: -34%; width: 24%; height: 48%;
  background: linear-gradient(180deg, #BAE6FD, #7DD3FC);
  border: 2px solid rgba(15,23,42,0.2);
}
.window-left  { left: 24%; border-radius: 10px 4px 4px 4px; }
.window-right { left: 50%; border-radius: 4px 10px 4px 4px; }
.headlight, .taillight { position: absolute; top: 40%; width: 9%; height: 22%; border-radius: 999px; }
.headlight { right: 3%; background: #FEF3C7; box-shadow: 0 0 6px 2px rgba(254,243,199,0.55); }
.taillight  { left:  1%; background: #7F1D1D; }
.wheel {
  position: absolute;
  bottom: 0; width: 24%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #E5E7EB 0 18%, #111827 20% 46%, #030712 47% 100%);
  border: 2px solid #030712;
}
.wheel::after {
  content: '';
  position: absolute;
  inset: 22%; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.4);
}
.wheel-left  { left: 17%; }
.wheel-right { right: 14%; }
.car.is-driving .wheel { animation: wheelSpin 0.32s linear infinite; }
@keyframes wheelSpin { to { transform: rotate(360deg); } }

/* ─── PLANE ──────────────────────────────────────────────── */
/*
  Inspired by Dribbble #7617197 — yellow/gold body, dark outlines,
  clean silhouette, smooth bob + dual vapor trails when flying.
*/
.plane {
  bottom: var(--plane-bottom);
  width: clamp(100px, 15vw, 168px);
  height: clamp(52px, 8vw, 90px);
}

/* ── Vapor trails — behind the tail (left side = right: 100%) */
.plane::before,
.plane::after {
  content: '';
  position: absolute;
  right: 95%;      /* left of the plane body = behind it */
  border-radius: 999px;
  width: 0;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.75) 100%);
  transition: none;
}
.plane::before { top: 34%; height: 3px; }
.plane::after  { top: 52%; height: 2px; }

/* Animate trails while flying */
.plane.is-driving::before {
  animation: trailTop 1.4s ease-in-out infinite;
}
.plane.is-driving::after {
  animation: trailBot 1.4s ease-in-out infinite 0.3s;
}
@keyframes trailTop {
  0%   { width: 20px; opacity: 0.3; }
  40%  { width: 72px; opacity: 0.85; }
  100% { width: 20px; opacity: 0.3; }
}
@keyframes trailBot {
  0%   { width: 14px; opacity: 0.2; }
  40%  { width: 52px; opacity: 0.65; }
  100% { width: 14px; opacity: 0.2; }
}

/* Gentle bob while flying */
.plane.is-driving {
  animation: planeFly 2s ease-in-out infinite;
}
.plane.is-driving.reverse {
  animation: planeFlyReverse 2s ease-in-out infinite;
}
@keyframes planeFly {
  0%, 100% { transform: translateX(-50%) translateY(0px) rotate(0deg); }
  30%       { transform: translateX(-50%) translateY(-9px) rotate(-4deg); }
  70%       { transform: translateX(-50%) translateY(-4px) rotate(-2deg); }
}
@keyframes planeFlyReverse {
  0%, 100% { transform: translateX(-50%) scaleX(-1) translateY(0px); }
  50%       { transform: translateX(-50%) scaleX(-1) translateY(-8px); }
}

/* ── Vertical tail fin (at tail / left end) */
.pln-fin {
  position: absolute;
  left: 9%; top: 4%;
  width: 15%; height: 33%;
  background: linear-gradient(155deg, #FFD045 0%, #F9B105 100%);
  border: 2px solid #7A5508;
  clip-path: polygon(0 100%, 100% 100%, 100% 22%);
  border-radius: 0 4px 0 0;
}

/* ── Fuselage — nose points RIGHT */
.pln-body {
  position: absolute;
  left: 7%; right: 0;
  top: 26%; height: 37%;
  background: linear-gradient(180deg, #FFE066 0%, #F9B105 55%, #E8A000 100%);
  border: 2.5px solid #7A5508;
  border-radius: 5px 52% 52% 5px;
  overflow: hidden;
}
/* Shine strip on top of fuselage */
.pln-body::before {
  content: '';
  position: absolute;
  top: 5%; left: 8%; right: 20%;
  height: 30%;
  background: rgba(255,255,255,0.35);
  border-radius: 999px;
}

/* ── Windows */
.pln-win {
  position: absolute;
  top: 18%; width: 13%; aspect-ratio: 1;
  background: #87CEEB;
  border-radius: 50%;
  border: 1.5px solid #3A9EC8;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
}
.pln-win.w1 { left: 20%; }
.pln-win.w2 { left: 38%; }
.pln-win.w3 { left: 56%; }

/* ── Main wing — sweeps downward */
.pln-wing {
  position: absolute;
  left: 26%; top: 50%;
  width: 46%; height: 50%;
  background: linear-gradient(155deg, #FFD045 0%, #D4920A 100%);
  border: 2px solid #7A5508;
  clip-path: polygon(10% 0%, 100% 100%, 0% 100%);
}

/* ── Horizontal stabilizer */
.pln-stab {
  position: absolute;
  left: 8%; top: 53%;
  width: 22%; height: 38%;
  background: linear-gradient(155deg, #FFD045 0%, #D4920A 100%);
  border: 2px solid #7A5508;
  clip-path: polygon(70% 0%, 100% 100%, 0% 100%);
}

/* ─── CONTROLS ───────────────────────────────────────────── */
.controls {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 2.2vw, 16px);
  padding: clamp(12px, 2vw, 20px) clamp(16px, 3vw, 32px);
  padding-bottom: max(clamp(12px, 2vw, 20px), env(safe-area-inset-bottom));
  background: var(--navy);
  border-top: 3px solid var(--gold);
  z-index: 5;
}
.control-button {
  min-width: clamp(120px, 20vw, 172px);
  min-height: 50px;
  padding: 0.85rem 1.4rem;
  border: 2px solid rgba(255,184,0,0.4);
  border-radius: 999px;
  color: var(--gold);
  background: transparent;
  font-weight: 900;
  font-size: clamp(0.88rem, 1.7vw, 1.02rem);
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.control-button.primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.control-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(255, 184, 0, 0.3);
}
.control-button:active:not(:disabled) { transform: scale(0.97); }
.control-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.control-button:disabled { cursor: not-allowed; opacity: 0.28; box-shadow: none; transform: none; }

/* ─── MOBILE (≤ 640px) ───────────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --road-bottom: 18px;
    --road-height: clamp(96px, 19vh, 130px);
    --sign-width: 100px;
    --sign-post-height: 38px;
    --plane-bottom: 50%;
  }
  .topbar { padding: 9px 14px; gap: 0.6rem; }
  .eyebrow { font-size: 0.62rem; }
  h1 { font-size: 1.15rem; }
  .slide-counter { padding: 0.32rem 0.6rem; font-size: 0.72rem; }

  /* Card floats in the middle sky area — clouds above, road below */
  .slide-card {
    top: 22%;
    width: calc(100vw - 28px);
    max-height: clamp(130px, 28dvh, 185px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 11px 13px 13px;
    border-radius: 14px;
    box-shadow: 0 4px 0 var(--card-border), 0 8px 24px rgba(0,0,0,0.1);
  }
  .slide-card::before { border-radius: 12px 12px 0 0; }
  .slide-emoji   { font-size: 1.55rem; margin-bottom: 0.18rem; }
  .slide-kicker  { font-size: 0.65rem; margin-bottom: 0.18rem; }
  .slide-title   { font-size: 1.38rem; line-height: 1; }
  .slide-copy    { font-size: 0.82rem; line-height: 1.46; margin-top: 5px; max-width: none; }

  /* Fewer clouds */
  .cloud-2, .cloud-4 { display: none; }
  .cloud-1 { width: 80px; height: 26px; }
  .cloud-1::before { width: 40px; height: 40px; top: -20px; left: 10px; }
  .cloud-1::after  { width: 30px; height: 30px; top: -13px; left: 38px; }
  .cloud-3 { width: 90px; height: 28px; left: 58%; }
  .cloud-3::before { width: 46px; height: 46px; top: -23px; left: 12px; }
  .cloud-3::after  { width: 34px; height: 34px; top: -16px; left: 44px; }

  .car   { width: clamp(72px, 21vw, 96px);  height: clamp(36px, 10vw, 50px); }
  .plane { width: clamp(82px, 24vw, 110px); height: clamp(44px, 13vw, 60px); }

  .controls { padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); gap: 8px; }
  .control-button { flex: 1 1 0; min-width: 0; min-height: 54px; font-size: 0.92rem; }
}

/* ─── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
