/* Nerd Kingdom website. Matches the app: Baloo 2 headings, the app's
   purple, gold and cream, and the store screenshots' bright colours. */

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

:root {
  --primary: #6C4EF2;
  --primary-dark: #4B33B8;
  --accent: #FFC93C;
  --gold: #FFD95A;
  --dark: #2B1F4A;          /* ink */
  --dark2: #1C1433;
  --text: #3A2E52;
  --text-light: #6E6488;
  --cream: #FFF8ED;
  --white: #FFFFFF;
  --orange: #FF7A35;
  --blue: #2E8BFF;
  --green: #20B486;
  --pink: #E84D8A;
  --radius: 22px;
  --shadow: 0 14px 40px rgba(43, 31, 74, 0.14);
  --display: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--body); color: var(--text); background: var(--cream); overflow-x: hidden; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); color: var(--dark); line-height: 1.1; text-wrap: balance; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.eyebrow { font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.section-title { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; margin-bottom: 14px; }
.section-sub { font-size: 1.1rem; color: var(--text-light); max-width: 620px; }
.center { text-align: center; }
.center .section-sub { margin: 0 auto; }

/* ── Nav ─────────────────────────────────────────────────────── */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; background: rgba(28, 20, 51, 0.88); backdrop-filter: blur(12px); }
.nav-inner { max-width: 1140px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--white); font-family: var(--display); font-weight: 800; font-size: 1.3rem; }
.nav-logo img { width: 38px; height: 38px; border-radius: 10px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: rgba(255, 255, 255, .8); font-weight: 700; font-size: .95rem; }
.nav-links a:hover { color: var(--white); }
.nav-links .nav-badge img { height: 40px; width: auto; }
@media (max-width: 760px) { .nav-links a:not(.nav-badge) { display: none; } }

/* ── Buttons ─────────────────────────────────────────────────── */
.store-badge img { height: 56px; width: auto; }
.btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.15rem;
  padding: 12px 26px 13px; border-radius: 999px; transition: transform .15s; }
.btn:active { transform: translateY(3px); }
.btn-gold { background: var(--accent); color: var(--dark); box-shadow: 0 5px 0 #D99A12; }
.btn-white { background: var(--white); color: var(--primary); box-shadow: 0 5px 0 #D6CFE8; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero { position: relative; padding: 130px 0 0; color: var(--white); overflow: hidden;
  background: radial-gradient(1200px 600px at 80% 10%, #8B6CFF 0%, transparent 60%),
              linear-gradient(165deg, #7B5CF5 0%, #4B33B8 70%, #3A2894 100%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 { color: var(--white); font-size: clamp(2.6rem, 6vw, 4.3rem); font-weight: 800; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-sub { font-size: 1.2rem; color: rgba(255, 255, 255, .88); max-width: 520px; margin-bottom: 28px; }
.hero-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-qr { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .8); font-size: .9rem; font-weight: 700; }
.hero-qr img { width: 76px; height: 76px; border-radius: 10px; background: var(--white); padding: 5px; }
@media (max-width: 900px) { .hero-qr { display: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: .9rem; }
.chip b { color: var(--gold); }

.hero-shots { position: relative; height: 640px; }
.hero-shots img { position: absolute; width: 270px; border-radius: 30px; box-shadow: 0 30px 60px rgba(15, 8, 40, .45); }
.hero-shots .s1 { left: 50%; top: 10px; transform: translateX(-50%) rotate(0deg); z-index: 3; width: 300px; }
.hero-shots .s2 { left: 2%; top: 90px; transform: rotate(-9deg); z-index: 2; }
.hero-shots .s3 { right: 2%; top: 90px; transform: rotate(9deg); z-index: 2; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta, .chips { justify-content: center; }
  .hero-shots { height: 520px; }
  .hero-shots img { width: 210px; }
  .hero-shots .s1 { width: 240px; }
}
@media (max-width: 480px) { .hero-shots .s2, .hero-shots .s3 { display: none; } .hero-shots { height: 540px; } .hero-shots .s1 { width: 250px; } }

/* ── Screenshot strip ────────────────────────────────────────── */
.gallery { background: var(--cream); }
.strip { display: flex; gap: 22px; overflow-x: auto; padding: 36px 24px 30px; scroll-snap-type: x mandatory;
  max-width: 1400px; margin: 0 auto; scrollbar-width: thin; }
.strip img { flex: 0 0 auto; width: 250px; border-radius: 26px; box-shadow: var(--shadow); scroll-snap-align: center; }

/* ── Parents ─────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-top: 44px; }
.card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); border-top: 6px solid var(--c, var(--primary)); }
.card .icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 16px;
  background: color-mix(in srgb, var(--c, var(--primary)) 16%, white); }
.card h3 { font-size: 1.35rem; margin-bottom: 8px; }
.card p { color: var(--text-light); }

/* ── Worlds ──────────────────────────────────────────────────── */
.worlds { background: var(--white); }
.world-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 44px; }
.world { border-radius: var(--radius); padding: 30px; color: var(--white); position: relative; overflow: hidden; min-height: 230px; }
.world .sym { font-family: var(--display); font-size: 4.5rem; line-height: 1; font-weight: 800; opacity: .95; }
.world h3 { color: var(--white); font-size: 1.6rem; margin: 6px 0 4px; }
.world p { color: rgba(255, 255, 255, .88); font-weight: 700; }
.world img { position: absolute; right: -10px; bottom: -10px; width: 120px; height: 120px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .7); }
.world.mul { background: linear-gradient(150deg, #7B5CF5, #4B33B8); }
.world.add { background: linear-gradient(150deg, #2BC48F, #13806A); }
.world.sub { background: linear-gradient(150deg, #3B97FF, #1F4FC7); }
@media (max-width: 860px) { .world-grid { grid-template-columns: 1fr; } }

/* ── Teachers ────────────────────────────────────────────────── */
.teachers { background: linear-gradient(160deg, #FF8A3D, #E0542B); color: var(--white); }
.teachers h2, .teachers .eyebrow { color: var(--white); }
.teachers .section-sub { color: rgba(255, 255, 255, .9); }
.teach-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.teach-grid ul { list-style: none; margin: 22px 0 30px; display: grid; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.teach-grid li::before { content: "✓"; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px;
  border-radius: 50%; background: rgba(255, 255, 255, .22); font-weight: 900; }
.teach-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.teach-link { font-weight: 800; background: rgba(0, 0, 0, .16); padding: 10px 16px; border-radius: 12px; font-family: ui-monospace, Menlo, monospace; font-size: .95rem; }
.flyer img { border-radius: 24px; box-shadow: 0 30px 60px rgba(80, 20, 0, .35); transform: rotate(3deg); max-width: 380px; margin: 0 auto; }
@media (max-width: 860px) { .teach-grid { grid-template-columns: 1fr; } }

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq-list { max-width: 760px; margin: 40px auto 0; display: grid; gap: 12px; }
.faq-list details { background: var(--white); border-radius: 18px; padding: 4px 22px; box-shadow: 0 4px 16px rgba(43, 31, 74, .07); }
.faq-list summary { cursor: pointer; list-style: none; padding: 16px 0; font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--dark);
  display: flex; justify-content: space-between; gap: 16px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--primary); font-size: 1.5rem; line-height: 1; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { padding: 0 0 18px; color: var(--text-light); }

/* ── Final CTA ───────────────────────────────────────────────── */
.final { background: linear-gradient(165deg, #E84D8A, #B02E66); color: var(--white); text-align: center; }
.final h2 { color: var(--white); font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 12px; }
.final p { font-size: 1.15rem; opacity: .9; margin-bottom: 28px; }
.final .mascots { display: flex; justify-content: center; gap: 14px; margin-bottom: 24px; }
.final .mascots img { width: 86px; height: 86px; border-radius: 50%; border: 4px solid var(--white); }

/* ── Footer (shared with privacy and support) ────────────────── */
.footer { background: var(--dark2); color: rgba(255, 255, 255, .6); padding: 36px 0; font-size: .92rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer a { color: rgba(255, 255, 255, .75); }
.footer a:hover { color: var(--white); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* Keep the tilted flyer and long link inside the screen on phones. */
.teachers { overflow: hidden; }
.flyer img { max-width: min(380px, 88%); }
.teach-link { overflow-wrap: anywhere; }

/* ── Content pages (chart, guide) ───────────────────────────── */
.page-hero { padding: 120px 0 56px; background: linear-gradient(165deg, #7B5CF5, #4B33B8); color: var(--white); }
.page-hero h1 { color: var(--white); font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 12px; }
.page-hero p { font-size: 1.15rem; color: rgba(255, 255, 255, .9); max-width: 680px; }
.prose { max-width: 760px; margin: 0 auto; padding: 56px 24px 24px; font-size: 1.08rem; }
.prose h2 { font-size: 1.9rem; margin: 40px 0 12px; }
.prose h3 { font-size: 1.35rem; margin: 26px 0 8px; }
.prose p, .prose li { margin-bottom: 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose a { color: var(--primary); font-weight: 700; }
.tip { background: var(--white); border-left: 6px solid var(--accent); border-radius: 14px; padding: 16px 20px; margin: 18px 0; box-shadow: 0 4px 16px rgba(43,31,74,.07); }
.app-box { display: flex; gap: 20px; align-items: center; background: linear-gradient(150deg, #7B5CF5, #4B33B8); color: var(--white);
  border-radius: var(--radius); padding: 24px; margin: 36px 0; flex-wrap: wrap; }
.app-box img.icon { width: 72px; height: 72px; border-radius: 18px; }
.app-box div { flex: 1 1 260px; }
.app-box strong { font-family: var(--display); font-size: 1.35rem; display: block; }
.app-box p { margin: 4px 0 0; color: rgba(255,255,255,.9); }
.app-box .store-badge img { height: 48px; }

.chart-wrap { max-width: 900px; margin: 0 auto; padding: 40px 24px 0; }
.chart-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 22px; }
.btn-purple { background: var(--primary); color: var(--white); box-shadow: 0 5px 0 #3F2A9E; }
.chart-scroll { overflow-x: auto; }
table.times { border-collapse: separate; border-spacing: 4px; margin: 0 auto; font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
table.times th, table.times td { width: 54px; height: 46px; text-align: center; border-radius: 10px; }
table.times th { background: var(--primary); color: var(--white); }
table.times thead th:first-child { background: var(--accent); color: var(--dark); }
table.times td { background: var(--white); color: var(--dark); box-shadow: 0 2px 6px rgba(43,31,74,.08); }
table.times td.sq { background: #FFE9A8; }
table.times tr:hover td, table.times td:hover { background: #EDE7FF; }
.chart-caption { text-align: center; color: var(--text-light); margin-top: 14px; font-size: .95rem; }

@media print {
  .nav, .footer, .chart-actions, .page-hero p, .no-print, .app-box .store-badge { display: none !important; }
  .page-hero { padding: 0 0 8px; background: none; color: #000; }
  .page-hero h1 { color: #000; font-size: 22pt; }
  body { background: #fff; }
  table.times th, table.times td { width: 46px; height: 40px; box-shadow: none; border: 1px solid #ccc; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .prose { display: none; }
}
