/* Leo's Toy Money Store - full store page
   Theme built from the Concept A rocket badge (assets/logo-badge.svg):
   navy rim, star-yellow rings, car-blue sky, cream lettering, rocket red.
   Mobile-first. Everything is local: no external fonts or assets. */

@font-face {
  font-family: "Titan One";
  src: url("assets/fonts/TitanOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1d2540;
  --ink-2: #16204a;
  --ink-soft: #4a5370;
  --cream: #fff8ec;
  --paper: #ffffff;
  --tint: #fdeccb;
  --red: #e8452c;
  --red-dark: #c2331d;
  --yellow: #ffc93c;
  --orange: #ff8a2a;
  --blue: #2f6fed;
  --green: #2fa56b;
  --glass: #bfe6ff;
  --line: #ecdfc6;
  --radius: 20px;
  --shadow: 0 2px 0 rgba(29, 37, 64, .06), 0 14px 30px -18px rgba(29, 37, 64, .35);
  --display: "Titan One", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --space-bg: url("assets/spaceship-tile.svg");
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 130px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: clamp(2.05rem, 8vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 5.6vw, 2.5rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
a { color: inherit; }
svg { display: block; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

.sprites { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: 10px 14px; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-family: var(--display); font-size: .82rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--red);
  margin-bottom: 10px;
}
.eyebrow-light { color: var(--yellow); }

.fine { font-size: .84rem; color: var(--ink-soft); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 22px; border-radius: 999px;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
  font-family: var(--display); font-size: 1.02rem; letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-light { background: var(--cream); }
.btn-light:hover { background: var(--yellow); }
.hero .btn { box-shadow: 0 4px 0 var(--yellow); }
.hero .btn:active { box-shadow: 0 1px 0 var(--yellow); }
.btn-block { width: 100%; }
.btn-small { min-height: 44px; padding: 8px 16px; font-size: .95rem; box-shadow: 0 3px 0 var(--ink); }
.btn[disabled] {
  background: #e9e3d6; color: #6c7183; border-color: #b9b3a5;
  box-shadow: none; cursor: not-allowed; transform: none;
}

.icon-button {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: inherit;
}
.icon-button:hover { background: rgba(255, 255, 255, .14); }
.icon-button svg { width: 22px; height: 22px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink);
  color: var(--cream);
  border-bottom: 4px solid var(--yellow);
}

.header-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "logo cart" "nav nav";
  align-items: center; gap: 4px 12px;
  padding-top: 8px; padding-bottom: 4px;
}

.logo { grid-area: logo; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo-badge { width: 52px; height: 52px; flex: none; transition: transform .3s ease; }
.logo:hover .logo-badge { transform: rotate(-12deg) scale(1.06); }
.logo-text { display: flex; flex-direction: column; line-height: 1; font-family: var(--display); min-width: 0; }
.logo-name { font-size: 1.12rem; white-space: nowrap; color: var(--cream); text-shadow: 2px 2px 0 var(--red); }
.logo-sub { font-size: .74rem; letter-spacing: .34em; text-transform: uppercase; color: var(--yellow); margin-top: 5px; }

.site-nav { grid-area: nav; display: flex; gap: 0; margin: 0 -8px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 9px 9px; border-radius: 10px; text-decoration: none;
  font-family: var(--display); font-size: .9rem; white-space: nowrap; color: var(--cream);
}
.site-nav a:hover { background: rgba(255, 255, 255, .1); color: var(--yellow); }

.cart-button {
  grid-area: cart;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 6px 7px 6px 14px;
  border: 3px solid var(--ink); border-radius: 999px; background: var(--yellow); color: var(--ink);
  font-family: var(--display); cursor: pointer;
  box-shadow: 0 3px 0 #0d1226;
}
.cart-button:hover { background: #ffd666; }
.cart-button svg { width: 20px; height: 20px; }
.cart-count {
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; font-family: var(--body); font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums;
}
.cart-count.has-items { background: var(--red); }
.cart-count.bump { animation: bump .3s ease; }
@keyframes bump { 50% { transform: scale(1.3); } }

/* ---------- Hero: the badge in deep space ---------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(22, 32, 74, .78), rgba(29, 37, 64, .7) 60%, rgba(33, 60, 140, .6)),
    var(--space-bg) 0 0 / 360px 360px repeat,
    var(--ink);
  animation: drift 90s linear infinite;
  padding: 34px 0 80px;
}
@keyframes drift { to { background-position: 0 0, -360px 360px, 0 0; } }
.hero-copy { position: relative; }

.hero-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.flyer { position: absolute; width: 92px; height: 48px; left: -140px; animation: fly 16s linear infinite; }
.flyer-1 { top: 12%; }
.flyer-2 { top: 58%; width: 64px; height: 34px; animation-duration: 22s; animation-delay: -9s; }
.flyer-3 { top: 84%; width: 78px; height: 40px; animation-duration: 19s; animation-delay: -4s; }
@keyframes fly {
  0% { transform: translate(0, 0) rotate(-6deg); }
  50% { transform: translate(60vw, -24px) rotate(4deg); }
  100% { transform: translate(calc(100vw + 280px), 6px) rotate(-6deg); }
}
.twinkle { position: absolute; width: 18px; height: 18px; fill: var(--yellow); animation: twinkle 2.6s ease-in-out infinite; }
.tw-1 { top: 8%; left: 46%; }
.tw-2 { top: 36%; left: 6%; width: 12px; animation-delay: -1s; fill: var(--cream); }
.tw-3 { top: 70%; left: 52%; width: 14px; animation-delay: -1.7s; }
.tw-4 { top: 22%; right: 6%; width: 12px; animation-delay: -.5s; fill: var(--cream); }
@keyframes twinkle { 50% { transform: scale(.4); opacity: .4; } }

.hero-grid { display: grid; gap: 30px; align-items: center; }
.hero h1 { color: var(--cream); text-shadow: 3px 3px 0 var(--red); }
.hero-copy .lede { margin-top: 16px; font-size: 1.1rem; color: #dfe4f3; max-width: 34em; }
.marker { color: var(--yellow); white-space: nowrap; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.hero-facts { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-facts li {
  font-size: .82rem; font-weight: 700; letter-spacing: .02em;
  padding: 5px 12px; border-radius: 999px;
  border: 2px solid rgba(255, 201, 60, .7); color: var(--yellow); background: rgba(29, 37, 64, .6);
}

.hero-art { position: relative; width: min(68vw, 420px); margin: 26px auto 0; aspect-ratio: 1; }
.hero-badge {
  position: relative; width: 100%;
  filter: drop-shadow(0 12px 0 rgba(13, 18, 38, .55));
  animation: hover 4s ease-in-out infinite;
}
@keyframes hover { 50% { transform: translateY(-10px) rotate(-2deg); } }
.orbit {
  position: absolute; inset: -9%;
  border: 3px dashed rgba(255, 201, 60, .45); border-radius: 50%;
  animation: spin 14s linear infinite;
}
.orbit-ship { position: absolute; top: -20px; left: 50%; width: 70px; height: 36px; margin-left: -35px; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-edge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 56px; }

/* ---------- Sections ---------- */

.section { padding: 56px 0; }
.section-tint { background: var(--tint); }
.section-head { margin-bottom: 26px; max-width: 42em; }
.section-note { margin-top: 10px; color: var(--ink-soft); }
.section-note strong { color: var(--ink); }

.section-space {
  color: var(--cream);
  background:
    linear-gradient(rgba(29, 37, 64, .72), rgba(29, 37, 64, .72)),
    var(--space-bg) 0 0 / 300px 300px repeat,
    var(--ink);
  border-top: 4px solid var(--yellow); border-bottom: 4px solid var(--yellow);
}
.section-space h2 { text-shadow: 3px 3px 0 var(--red); }
.section-space p:not(.eyebrow) { margin-top: 14px; color: #dfe4f3; max-width: 36em; }
.section-space .fine { color: #b8bfd6; }

/* ---------- Products ---------- */

.product-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 6px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--ink); }
.product-art {
  position: relative; background: var(--art-bg, #eef4ff); border-bottom: 3px solid var(--ink); padding: 18px 18px 4px;
  background-image: radial-gradient(circle, rgba(29, 37, 64, .16) 1.6px, transparent 2px);
  background-size: 22px 22px;
}
.product-art svg { width: 100%; height: auto; }
.product-card:hover .product-art svg { animation: roll .6s ease; }
@keyframes roll { 40% { transform: translateX(8px); } 100% { transform: none; } }
.product-sticker {
  position: absolute; top: 10px; right: 10px; width: 46px; height: 46px;
  transform: rotate(12deg); filter: drop-shadow(0 2px 0 rgba(29, 37, 64, .35));
}
.product-info { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 18px; flex: 1; }
.product-desc { color: var(--ink-soft); font-size: .95rem; flex: 1; }
.product-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.product-tags span {
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px; background: var(--cream); border: 2px solid var(--line); color: var(--ink-soft);
}
.product-buy { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.product-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.price { font-family: var(--display); font-size: 1.5rem; line-height: 1; }
.product-art-space { padding: 0; background-image: none; }
.product-art-space .product-img { display: block; width: 100%; height: auto; }
.product-card:hover .product-art .product-img { animation: roll .6s ease; }
.product-flag {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--yellow); border: 3px solid var(--ink); font-family: var(--display); font-size: .95rem; transform: rotate(-6deg);
}
.product-extras {
  list-style: none; margin: 0; padding: 10px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  border-bottom: 3px solid var(--ink); background: var(--cream);
}
.product-extras li { display: grid; gap: 4px; text-align: center; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.product-extras img { width: 100%; height: auto; border-radius: 10px; border: 2px solid var(--ink); }
.product-note { margin-top: 2px; }

.price small { display: block; font-family: var(--body); font-weight: 700; font-size: .68rem; color: var(--red-dark); margin-top: 5px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Leo's money rule (About) ---------- */

.money-rule {
  margin-top: 20px; padding: 16px 18px; border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--paper); box-shadow: 0 5px 0 var(--ink);
}
.money-rule h3 { font-family: var(--display); font-weight: 400; font-size: 1.2rem; margin-bottom: 6px; }

/* ---------- Launch box ---------- */

.box-grid { display: grid; gap: 26px; align-items: center; }
.box-art { position: relative; width: min(100%, 440px); margin: 0 auto; }
.box-art svg { width: 100%; height: auto; }
.sticker { position: absolute; filter: drop-shadow(0 4px 0 rgba(13, 18, 38, .6)); }
.sticker-1 { width: 22%; right: 2%; top: 0; transform: rotate(14deg); animation: hover 5s ease-in-out infinite; }
.sticker-2 { width: 16%; left: 2%; top: 4%; transform: rotate(-10deg); animation: hover 6s ease-in-out infinite -2s; }

/* ---------- How it works ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.step {
  position: relative; background: var(--paper); border: 3px solid var(--ink);
  border-radius: var(--radius); padding: 22px 20px 22px 80px; box-shadow: 0 6px 0 var(--ink);
}
.step p { margin-top: 6px; color: var(--ink-soft); }
.step-num {
  position: absolute; left: 18px; top: 20px;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue); color: var(--cream); border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 3px var(--yellow);
  font-family: var(--display); font-size: 1.3rem;
}

/* ---------- About ---------- */

.about-grid { display: grid; gap: 24px; align-items: center; }
.about-badge { width: 170px; }
.about-badge svg { width: 100%; height: auto; filter: drop-shadow(0 6px 0 rgba(29, 37, 64, .35)); }
.about-grid h2 + p { margin-top: 14px; }
.about-grid p + p { margin-top: 12px; }
.about-grid p:not(.eyebrow) { max-width: 38em; }

/* ---------- Footer ---------- */

.site-footer {
  color: #dfe4f3; padding: 40px 0 46px; text-align: center;
  background:
    linear-gradient(rgba(29, 37, 64, .82), rgba(29, 37, 64, .92)),
    var(--space-bg) 0 0 / 300px 300px repeat,
    var(--ink);
  border-top: 4px solid var(--yellow);
}
.footer-banner { display: none; width: 100%; max-width: 960px; margin: 0 auto 22px; border-radius: 18px; border: 3px solid var(--yellow); }
.footer-badge { width: 120px; margin: 0 auto 18px; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-bottom: 16px; }
.footer-nav a { font-family: var(--display); text-decoration: none; padding: 6px 10px; border-radius: 10px; color: var(--yellow); }
.footer-nav a:hover { background: rgba(255, 255, 255, .1); }
.site-footer p + p { margin-top: 8px; }
.footer-main { font-family: var(--display); font-size: 1.12rem; color: #fff; }
.site-footer .fine { color: #9aa3bf; }

/* ---------- Cart drawer ---------- */

.backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(13, 18, 38, .6); }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: min(420px, 100vw); display: flex; flex-direction: column;
  background: var(--cream); border-left: 3px solid var(--ink);
  transform: translateX(105%); visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.cart-drawer.is-open { transform: none; visibility: visible; transition: transform .25s ease; }

.cart-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px;
  background: var(--ink); color: var(--cream); border-bottom: 4px solid var(--yellow);
}
.cart-head img { width: 40px; height: 40px; }
.cart-head h2 { font-size: 1.5rem; flex: 1; text-shadow: 2px 2px 0 var(--red); }
.cart-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.cart-empty { color: var(--ink-soft); padding: 30px 0; text-align: center; }
.cart-empty svg { width: 110px; height: 57px; margin: 0 auto 12px; transform: rotate(-18deg); }
.cart-empty[hidden] { display: none; }
.cart-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.cart-item {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; padding: 10px;
}
.cart-item-art { background: var(--art-bg, #eef4ff); border-radius: 10px; padding: 6px; }
.cart-item-art svg, .cart-item-art img { display: block; width: 100%; height: auto; border-radius: 6px; }
.cart-item-name { font-family: var(--display); line-height: 1.2; }
.cart-item-price { font-size: .9rem; color: var(--ink-soft); }
.cart-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { width: 36px; height: 34px; border: 0; background: transparent; font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.qty button:hover { background: var(--tint); }
.qty button[disabled] { opacity: .35; cursor: not-allowed; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.link-button { border: 0; background: none; padding: 8px 4px; font-size: .88rem; text-decoration: underline; cursor: pointer; color: var(--ink-soft); }
.link-button:hover { color: var(--red-dark); }

.cart-foot { padding: 16px 18px 22px; border-top: 3px solid var(--ink); background: var(--paper); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; }
.cart-total strong { font-family: var(--display); font-weight: 400; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.cart-placeholder { text-align: right; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red-dark); margin: 2px 0 14px; }
.cart-foot .btn-block { margin-top: 14px; }
.cart-foot .fine { margin-top: 12px; text-align: center; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 50;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; border: 3px solid var(--yellow);
  font-weight: 600; font-size: .95rem; max-width: calc(100vw - 32px); text-align: center;
  transition: transform .2s ease, opacity .2s ease;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Larger screens ---------- */

@media (min-width: 760px) {
  body { font-size: 18px; }
  html { scroll-padding-top: 100px; }
  .wrap { padding: 0 28px; }
  .header-row { grid-template-columns: auto 1fr auto; grid-template-areas: "logo nav cart"; padding-top: 10px; padding-bottom: 10px; }
  .logo-badge { width: 64px; height: 64px; }
  .site-nav { justify-content: center; margin: 0; gap: 4px; }
  .site-nav a { padding: 10px 12px; font-size: 1rem; }
  .logo-name { font-size: 1.3rem; }
  .hero { padding: 64px 0 110px; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 44px; }
  .hero-art { width: 100%; max-width: 440px; margin-top: 0; }
  .hero {
    background:
      linear-gradient(90deg, rgba(22, 32, 74, .9) 0, rgba(22, 32, 74, .72) 50%, rgba(29, 37, 64, .45) 100%),
      linear-gradient(180deg, transparent 60%, rgba(33, 60, 140, .5)),
      var(--space-bg) 0 0 / 360px 360px repeat,
      var(--ink);
  }
  @keyframes drift { to { background-position: 0 0, 0 0, -360px 360px, 0 0; } }
  .hero-edge { height: 80px; }
  .section { padding: 84px 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .box-grid { grid-template-columns: 1fr 1fr; gap: 48px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { padding: 80px 22px 24px; }
  .about-grid { grid-template-columns: auto 1fr; gap: 48px; }
  .about-badge { width: 230px; }
  .footer-banner { display: block; }
  .footer-badge { display: none; }
}

@media (min-width: 1000px) {
  .product-grid { grid-template-columns: 3fr 2fr; align-items: start; }
}

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