/* ============================================================
   Top Dog Math — landing page
   Aesthetic: playful candy-game. Sky world, chunky ink-outlined
   buttons with slab shadows, bold rounded type. Extends the app.
   ============================================================ */

:root {
  --font-display: 'Lilita One', system-ui, sans-serif;
  --font-ui: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;

  --ink: #18233f;            /* deep indigo "outline" ink */
  --text: #24314f;
  --sky-top: #63bdff;
  --sky-mid: #98d7ff;
  --sky-bot: #d3f0ff;

  --blue: #2a9bf4;   --blue-d: #0d4ea3;
  --green: #28b24e;  --green-d: #0e7a30;
  --orange: #ff8a1e; --orange-d: #c25a00;
  --purple: #7c4dd6; --purple-d: #46198f;
  --red: #f0463f;    --red-d: #b0160f;
  --gold: #ffc63a;   --gold-d: #c7910a;

  --radius: 22px;
  --maxw: 1160px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 38%, var(--sky-bot) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------- atmospheric sky */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.sun {
  position: absolute; top: -120px; right: -120px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff6c2 0%, #ffe066 45%, rgba(255,224,102,0) 70%);
}
.sun::after {
  content: ""; position: absolute; inset: -60px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 8deg, rgba(255,238,150,.55) 8deg 12deg, transparent 12deg 30deg);
  animation: spin 60s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cloud {
  position: absolute; background: #fff; border-radius: 100px;
  filter: blur(.3px);
  box-shadow: 0 14px 30px rgba(70,120,170,.18);
  opacity: .92;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: #fff; border-radius: 50%;
}
.cloud--1 { width: 150px; height: 46px; top: 14%; left: -160px; animation: drift 46s linear infinite; }
.cloud--2 { width: 110px; height: 36px; top: 30%; left: -160px; animation: drift 64s linear infinite 6s; opacity:.8; }
.cloud--3 { width: 190px; height: 56px; top: 8%;  left: -220px; animation: drift 80s linear infinite 12s; opacity:.7; }
.cloud--4 { width: 130px; height: 42px; top: 46%; left: -180px; animation: drift 55s linear infinite 3s; opacity:.55; }
.cloud::before { width: 60%; height: 160%; top: -55%; left: 12%; }
.cloud::after  { width: 45%; height: 150%; top: -45%; right: 14%; }
@keyframes drift { to { transform: translateX(120vw); } }

.float-sym {
  position: absolute; width: 56px; height: 56px; opacity: .85;
  filter: drop-shadow(0 8px 10px rgba(40,70,120,.25));
  animation: bob 7s ease-in-out infinite;
}
.float-sym--plus  { top: 22%; left: 6%;  animation-delay: 0s; }
.float-sym--minus { top: 60%; left: 10%; width: 48px; animation-delay: 1.2s; }
.float-sym--times { top: 38%; right: 8%; width: 50px; animation-delay: .6s; }
.float-sym--div   { top: 72%; right: 12%; width: 46px; animation-delay: 1.8s; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-18px) rotate(4deg); } }

/* ---------------------------------------------- layout shell */
.nav, .hero, .stats, .section, .characters, .get, .footer { position: relative; z-index: 1; }

.nav {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-size: 1.35rem; color: var(--ink);
  text-decoration: none; letter-spacing: .3px;
}
.brand img { border-radius: 11px; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.nav__links { display: flex; gap: 26px; font-family: var(--font-ui); font-weight: 600; }
.nav__links a { color: var(--ink); text-decoration: none; opacity: .85; transition: opacity .2s, transform .2s; }
.nav__links a:hover { opacity: 1; transform: translateY(-2px); }
.nav__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 48px; height: 48px; padding: 0 11px; cursor: pointer;
  background: #ffffffdd; border: 2.5px solid var(--ink); border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
}
.nav__toggle span { display: block; height: 3px; border-radius: 3px; background: var(--ink); transition: transform .25s ease, opacity .2s ease; }

/* ---------------------------------------------- hero */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center;
  padding: 40px 24px 70px;
}
.eyebrow {
  font-family: var(--font-ui); font-weight: 600; letter-spacing: .5px;
  color: var(--blue-d); background: #ffffffaa; display: inline-block;
  padding: 6px 14px; border-radius: 999px; font-size: .82rem;
  border: 2px solid #ffffff;
}
.hero__title {
  font-family: var(--font-display); line-height: .92; margin: 18px 0 8px;
  font-size: clamp(3.4rem, 9vw, 6.2rem); color: #fff; letter-spacing: .5px;
  /* full ink outline (all 8 directions) for legibility on the sky, plus the
     3D drop and a soft ambient shadow */
  text-shadow:
    -2px -2px 0 var(--ink),  2px -2px 0 var(--ink),
    -2px  2px 0 var(--ink),  2px  2px 0 var(--ink),
     0   -2px 0 var(--ink),  0    2px 0 var(--ink),
    -2px  0   0 var(--ink),  2px  0   0 var(--ink),
     0    5px 0 var(--ink),  0    6px 0 var(--ink),
     0   16px 26px rgba(20,40,80,.42);
}
.hero__title .line { display: block; }
.hero__title .line--2 { color: var(--gold); }
.hero__tagline { font-family: var(--font-ui); font-weight: 700; font-size: 1.45rem; color: var(--ink); margin-bottom: 6px; text-shadow: 0 1px 6px rgba(255,255,255,.6); }
.hero__tagline em { color: var(--red); font-style: normal; }
.hero__sub { font-size: 1.1rem; max-width: 30ch; color: #16284a; font-weight: 600; margin-bottom: 22px; text-shadow: 0 1px 6px rgba(255,255,255,.55); }
.hero__sub strong { color: var(--ink); }

.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 26px; }
.pill {
  font-family: var(--font-ui); font-weight: 700; font-size: .82rem; color: #fff;
  padding: 7px 14px; border-radius: 999px; border: 2.5px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink); letter-spacing: .2px;
}
.pill--green { background: var(--green); }
.pill--blue { background: var(--blue); }
.pill--purple { background: var(--purple); }
.pill--orange { background: var(--orange); }

/* candy store buttons */
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.cta-row--center { justify-content: center; }
.store-btn {
  --c: var(--ink); --cd: #000;
  display: inline-flex; align-items: center; gap: 11px;
  padding: 12px 20px 12px 16px; border-radius: 18px;
  background: var(--c); color: #fff; text-decoration: none;
  border: 3px solid var(--ink);
  box-shadow: 0 6px 0 var(--cd), 0 11px 18px rgba(20,40,80,.28);
  transition: transform .12s ease, box-shadow .12s ease;
  font-family: var(--font-ui);
}
.store-btn svg { width: 26px; height: 26px; fill: #fff; flex: none; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.05; font-weight: 700; font-size: 1.05rem; }
.store-btn small { font-weight: 500; font-size: .68rem; opacity: .85; letter-spacing: .3px; }
.store-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--cd), 0 14px 22px rgba(20,40,80,.32); }
.store-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--cd), 0 5px 10px rgba(20,40,80,.3); }
.store-btn--ink    { --c: #1d2742; --cd: #0a1124; }
.store-btn--green  { --c: var(--green); --cd: var(--green-d); }
.store-btn--blue   { --c: var(--blue);  --cd: var(--blue-d); }
.store-btn--orange { --c: var(--orange);--cd: var(--orange-d); }
/* "Coming soon" state — dimmed, not clickable (Mac App Store, in review) */
.store-btn--soon { opacity: .5; pointer-events: none; box-shadow: 0 3px 0 var(--cd); filter: grayscale(.3); }

.microcopy { margin-top: 16px; font-weight: 700; color: #1d3a66; font-size: .92rem; text-shadow: 0 1px 5px rgba(255,255,255,.55); }

/* hero art — device + flash card */
.hero__art { display: flex; flex-direction: column; align-items: center; position: relative; }
.device {
  width: min(380px, 86vw); padding: 26px 22px 30px;
  background: linear-gradient(180deg,#eafaff,#ffffff);
  border: 5px solid var(--ink); border-radius: 34px;
  box-shadow: 0 16px 0 #c9dcea, 0 30px 50px rgba(20,40,80,.35);
  transform: rotate(-2deg);
}
.device__icon {
  width: 84px; height: 84px; border-radius: 20px; display: block; margin: 0 auto 18px;
  border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink);
}
.card {
  position: relative; background: #fff; border: 4px solid var(--ink);
  border-radius: 22px; padding: 22px 18px 18px; box-shadow: 0 8px 0 #d7e6f2;
}
.card__badge {
  position: absolute; top: -12px; left: 16px; background: var(--green);
  color: #fff; font-family: var(--font-ui); font-weight: 700; font-size: .7rem;
  letter-spacing: 1.5px; padding: 4px 10px; border-radius: 9px;
  border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.card__problem { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.card__num { font-family: var(--font-display); font-size: 3.4rem; color: var(--ink); line-height: 1; }
.card__row { display: flex; align-items: center; gap: 14px; }
.card__op { font-family: var(--font-display); font-size: 2.4rem; color: var(--blue); }
.card__rule { height: 7px; width: 100%; background: var(--ink); border-radius: 4px; margin: 8px 0 4px; }
.card__answer { font-family: var(--font-display); font-size: 3rem; color: var(--green); line-height: 1; }

.answer-chips { display: flex; gap: 10px; margin-top: 16px; }
.achip {
  flex: 1; text-align: center; font-family: var(--font-display); font-size: 1.5rem; color: #fff;
  padding: 10px 0; border-radius: 16px; border: 3px solid var(--ink);
  box-shadow: 0 5px 0 rgba(0,0,0,.35);
}
.achip--blue { background: var(--blue); }
.achip--green { background: var(--green); position: relative; }
.achip--orange { background: var(--orange); }
.achip.is-correct { animation: pop 1.8s ease-in-out infinite; }
@keyframes pop { 0%,88%,100% { transform: scale(1); } 92% { transform: scale(1.12); } }

.streak {
  margin-top: 22px; background: var(--orange); color: #fff;
  font-family: var(--font-ui); font-weight: 700; letter-spacing: .5px;
  padding: 9px 18px; border-radius: 14px; border: 3px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink); transform: rotate(3deg);
}

/* ---------------------------------------------- stats band */
.stats {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(4,1fr); gap: 16px;
  transform: translateY(10px);
}
.stat {
  background: #fff; border: 4px solid var(--ink); border-radius: 20px;
  padding: 20px 10px; text-align: center; box-shadow: 0 8px 0 #c9dcea;
}
.stat__num { display: block; font-family: var(--font-display); font-size: 2.8rem; color: var(--ink); line-height: 1; }
.stat__label { font-family: var(--font-ui); font-weight: 600; color: #5a6b88; font-size: .9rem; }

/* ---------------------------------------------- generic section */
.section { max-width: var(--maxw); margin: 0 auto; padding: 80px 24px; }
.section__title {
  font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); color: var(--ink);
  text-align: center; text-shadow: 0 3px 0 #fff;
}
.section__title--light { color: #fff; text-shadow: 0 3px 0 var(--purple-d); }
.section__lead { text-align: center; max-width: 62ch; margin: 14px auto 0; font-size: 1.1rem; color: #1f3a5e; font-weight: 600; text-shadow: 0 1px 5px rgba(255,255,255,.5); }
.section__lead--light { color: #f6efff; font-weight: 500; text-shadow: 0 1px 4px rgba(0,0,0,.25); }

.grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; margin-top: 46px; }
.feature {
  --c: var(--blue);
  background: #fff; border: 4px solid var(--ink); border-radius: var(--radius);
  padding: 26px 24px 24px; box-shadow: 0 9px 0 #c9dcea;
  transition: transform .18s ease, box-shadow .18s ease;
}
.feature:hover { transform: translateY(-5px); box-shadow: 0 14px 0 #c9dcea; }
.feature__icon {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 60px; height: 60px; padding: 0 12px; margin-bottom: 14px;
  background: var(--c); color: #fff; border-radius: 16px;
  border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  font-family: var(--font-ui); font-weight: 700; font-size: 1.4rem;
}
.feature h3 { font-family: var(--font-ui); font-weight: 700; font-size: 1.25rem; color: var(--ink); margin-bottom: 6px; }
.feature p { color: #44567a; }
.feature--blue   { --c: var(--blue); }
.feature--green  { --c: var(--green); }
.feature--orange { --c: var(--orange); }
.feature--purple { --c: var(--purple); }
.feature--red    { --c: var(--red); }
.feature--gold   { --c: var(--gold); }

/* ---------------------------------------------- characters band */
.characters {
  background: linear-gradient(180deg, var(--purple), var(--purple-d));
  padding: 70px 24px; text-align: center; margin-top: 20px;
  border-top: 5px solid var(--ink); border-bottom: 5px solid var(--ink);
}
.char-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px;
  max-width: var(--maxw); margin: 40px auto 0;
}
.char-row img {
  width: 92px; height: 92px; border-radius: 50%;
  background: #fff; border: 4px solid var(--ink); box-shadow: 0 7px 0 var(--ink);
  transition: transform .2s ease;
}
.char-row img:hover { transform: translateY(-7px) rotate(-5deg); }

/* ---------------------------------------------- screenshots gallery */
.shots { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 80px 24px 40px; text-align: center; }

/* featured: big iPad / desktop shots — the centerpiece */
.ipad-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 26px;
  max-width: 940px; margin: 46px auto 0;
}
.ipad-shot {
  width: 100%; height: auto; display: block; border-radius: 22px; background: #fff;
  border: 5px solid var(--ink);
  box-shadow: 0 14px 0 #b9d2e6, 0 28px 46px rgba(20,40,80,.34);
  transition: transform .22s ease, box-shadow .22s ease;
}
.ipad-shot:hover { transform: translateY(-8px); box-shadow: 0 18px 0 #b9d2e6, 0 36px 56px rgba(20,40,80,.4); }

/* secondary: smaller phone strip */
.shots-sub {
  margin: 56px 0 0; font-family: var(--font-ui); font-weight: 700;
  font-size: 1.15rem; color: var(--ink);
}
.shot-row {
  display: flex; gap: 16px; margin-top: 22px; justify-content: center;
  overflow-x: auto; padding: 10px 24px 26px; scroll-snap-type: x mandatory;
  scroll-padding: 24px; -webkit-overflow-scrolling: touch;
}
.shot-row::-webkit-scrollbar { height: 9px; }
.shot-row::-webkit-scrollbar-thumb { background: #ffffffcc; border-radius: 10px; border: 2px solid var(--ink); }
.shot-row::-webkit-scrollbar-track { background: transparent; }
.shot {
  flex: 0 0 auto; width: 150px; height: auto; border-radius: 18px; background: #fff;
  border: 3px solid var(--ink); box-shadow: 0 7px 0 #c9dcea, 0 12px 18px rgba(20,40,80,.22);
  scroll-snap-align: center; transition: transform .2s ease, box-shadow .2s ease; opacity: .96;
}
.shot:nth-child(odd)  { transform: rotate(-1.6deg); }
.shot:nth-child(even) { transform: rotate(1.6deg); }
.shot:hover { transform: translateY(-6px) rotate(0); box-shadow: 0 10px 0 #c9dcea, 0 18px 26px rgba(20,40,80,.3); opacity: 1; }

/* ---------------------------------------------- faq */
.faq { max-width: 840px; }
.faq__list { margin-top: 42px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.faq-item {
  background: #fff; border: 3.5px solid var(--ink); border-radius: 18px;
  box-shadow: 0 6px 0 #c9dcea; overflow: hidden;
}
.faq-item summary {
  list-style: none; cursor: pointer; padding: 18px 22px; gap: 16px;
  font-family: var(--font-ui); font-weight: 700; font-size: 1.12rem; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-family: var(--font-display); font-size: 1.7rem; line-height: .6;
  color: var(--blue); flex: none;
}
.faq-item[open] summary { color: var(--blue-d); }
.faq-item[open] summary::after { content: "\2013"; color: var(--red); }
.faq-item p { padding: 0 22px 20px; color: #44567a; }
.faq-item[open] p { animation: faq-in .26s ease; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------- split (parents/kids) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.why {
  border: 4px solid var(--ink); border-radius: 26px; padding: 34px 30px;
  box-shadow: 0 10px 0 #c9dcea;
}
.why--parents { background: #fff; }
.why--kids { background: linear-gradient(180deg,#fff6dc,#ffe9b8); box-shadow: 0 10px 0 #e6c98a; }
.why h2 { font-family: var(--font-display); font-size: 1.9rem; color: var(--ink); margin-bottom: 16px; }
.why ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.why li { padding-left: 30px; position: relative; color: #3a4c6f; }
.why li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: #fff; background: var(--green); width: 21px; height: 21px;
  display: grid; place-items: center; border-radius: 7px; font-size: .8rem;
  border: 2px solid var(--ink);
}
.why b { color: var(--ink); }
.why--kids p { font-size: 1.12rem; color: #5a431c; }
.kid-emojis { font-size: 2.4rem; margin-top: 20px; letter-spacing: 8px; }

/* ---------------------------------------------- get the app */
.get { padding: 30px 24px 90px; }
.get__inner {
  max-width: 760px; margin: 0 auto; text-align: center;
  background: linear-gradient(180deg,#ffffff,#eafaff);
  border: 5px solid var(--ink); border-radius: 34px; padding: 46px 30px;
  box-shadow: 0 16px 0 #c9dcea, 0 30px 50px rgba(20,40,80,.28);
}
.get__icon { width: 92px; height: 92px; border-radius: 22px; border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.get h2 { font-family: var(--font-display); font-size: clamp(2rem,5vw,2.8rem); color: var(--ink); margin: 16px 0 6px; }
.get p { color: #44567a; margin-bottom: 26px; font-size: 1.1rem; }

/* ---------------------------------------------- footer */
.footer {
  background: var(--ink); color: #cdd8ee; text-align: center;
  padding: 40px 24px; border-top: 5px solid #0a1124;
}
.footer__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.3rem; color: #fff; }
.footer__brand img { border-radius: 9px; }
.footer__links { display: flex; gap: 22px; justify-content: center; margin: 16px 0; font-family: var(--font-ui); font-weight: 600; }
.footer__links a { color: var(--gold); text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }
.footer__legal { font-size: .85rem; opacity: .7; }

/* ---------------------------------------------- reveals */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------- responsive */
@media (max-width: 860px) {
  /* hamburger navigation */
  .nav { flex-wrap: wrap; z-index: 50; }
  .nav__toggle { display: flex; }
  .nav__links {
    flex-direction: column; gap: 0;
    position: absolute; top: calc(100% + 6px); right: 24px; left: 24px; z-index: 40;
    background: #fff; border: 2.5px solid var(--ink); border-radius: 18px; padding: 8px;
    box-shadow: 0 8px 0 #c9dcea, 0 16px 28px rgba(20,40,80,.25);
    opacity: 0; transform: translateY(-10px); pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .nav.open .nav__links { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 13px 14px; border-radius: 12px; opacity: 1; }
  .nav__links a:hover { transform: none; background: #eaf4ff; }
  .nav.open .nav__toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav.open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav__toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 16px; }
  .hero__copy { display: flex; flex-direction: column; align-items: center; }
  .cta-row { justify-content: center; }
  .grid { grid-template-columns: 1fr 1fr; }
  .ipad-grid { grid-template-columns: 1fr; max-width: 460px; }
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2,1fr); }

  /* calmer sky on small screens */
  .sun { width: 170px; height: 170px; top: -78px; right: -66px; }
  .sun::after { display: none; }
  .float-sym { width: 30px; height: 30px; opacity: .38; }
  .float-sym--minus, .float-sym--div { display: none; }
}
@media (max-width: 540px) {
  .grid { grid-template-columns: 1fr; }
  .hero__sub { max-width: none; }
  .store-btn { flex: 1 1 100%; justify-content: center; }
  .eyebrow { font-size: .74rem; white-space: normal; line-height: 1.5; max-width: 90vw; }
}

@media (prefers-reduced-motion: reduce) {
  .sun::after, .cloud, .float-sym, .achip.is-correct { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
}
