/* ==========================================================
   The Science Collection — one-page site styles
   Palette: deep navy, sunshine yellow, coral, sky blue, mint
   ========================================================== */

:root {
  --navy: #1B2A49;
  --navy-2: #243660;
  --yellow: #FFD23F;
  --coral: #FF6B6B;
  --sky: #4CC9F0;
  --mint: #6EE7B7;
  --violet: #A78BFA;
  --cream: #FFF9EC;
  --white: #ffffff;
  --ink: #1f2937;
  --muted: #5b6475;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(27, 42, 73, 0.10);
  --shadow-lg: 0 20px 50px rgba(27, 42, 73, 0.18);
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { width: min(1140px, 92%); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head h2 { margin-bottom: .4em; }
.section-sub { color: var(--muted); font-size: 1.1rem; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  padding: 14px 28px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--yellow); color: var(--navy); box-shadow: 0 8px 20px rgba(255, 210, 63, .45); }
.btn-primary:hover { background: #ffdb62; }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(27, 42, 73, .92);
  backdrop-filter: blur(10px);
  color: var(--white);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.15rem; }
.brand strong { color: var(--yellow); font-weight: 700; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 600; }
.brand-world { font-weight: 400; opacity: .85; }
.brand-sub {
  font-family: var(--font-body); font-size: .62rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--sky); margin-top: 3px;
}
.brand-mark svg { animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.primary-nav { display: flex; align-items: center; gap: 26px; font-weight: 700; font-size: .95rem; }
.primary-nav a { position: relative; padding: 6px 0; opacity: .9; }
.primary-nav a:hover { opacity: 1; }
.primary-nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--yellow); transition: width .2s ease;
}
.primary-nav a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta { background: var(--yellow); color: var(--navy); padding: 9px 18px !important; border-radius: 999px; opacity: 1 !important; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--white); border-radius: 3px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--white);
  background: radial-gradient(1200px 600px at 80% -10%, #3a4f86 0%, transparent 60%),
              radial-gradient(800px 500px at 0% 100%, #2b3f73 0%, transparent 60%),
              var(--navy);
  padding: clamp(80px, 12vw, 150px) 0 clamp(70px, 10vw, 120px);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.22) 1px, transparent 1px);
  background-size: 34px 34px; opacity: .35;
}
.hero-inner { position: relative; z-index: 2; max-width: 780px; }
.hero .eyebrow { color: var(--yellow); }
.hero h1 { color: var(--white); margin-bottom: .45em; }
.highlight {
  background: linear-gradient(120deg, var(--yellow), var(--coral) 60%, var(--sky));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); opacity: .92; max-width: 640px; margin-bottom: 2em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-badges li {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .9rem;
}
.hero-bg { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.float { position: absolute; font-size: clamp(2rem, 5vw, 4rem); opacity: .55; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); animation: bob 6s ease-in-out infinite; }
.f1 { top: 12%; right: 8%; animation-delay: 0s; }
.f2 { top: 48%; right: 18%; animation-delay: -1.5s; font-size: clamp(3rem, 7vw, 6rem); }
.f3 { bottom: 12%; right: 6%; animation-delay: -3s; }
.f4 { top: 20%; right: 34%; animation-delay: -2s; }
.f5 { bottom: 8%; left: 4%; animation-delay: -4s; opacity: .3; }
.f6 { top: 8%; left: 2%; animation-delay: -2.5s; opacity: .3; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg);} 50% { transform: translateY(-18px) rotate(5deg);} }

/* ---------- Mission ---------- */
.mission { background: var(--cream); }
.mission-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.mission-card {
  background: var(--white); border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow); border-top: 6px solid var(--sky);
  transition: transform .2s ease, box-shadow .2s ease;
}
.mission-card:nth-child(1) { border-top-color: var(--coral); }
.mission-card:nth-child(2) { border-top-color: var(--violet); }
.mission-card:nth-child(3) { border-top-color: var(--sky); }
.mission-card:nth-child(4) { border-top-color: var(--mint); }
.mission-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.mission-icon { font-size: 2.4rem; margin-bottom: 12px; }
.mission-card h3 { font-size: 1.15rem; }
.mission-card p { color: var(--muted); margin: 0; font-size: .98rem; }
.mission-note {
  margin-top: 40px; text-align: center; font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--navy);
}
.mission-note em { color: var(--coral); font-style: normal; text-decoration: underline wavy var(--yellow); text-underline-offset: 6px; }

/* ---------- Story ---------- */
.story { background: var(--white); }
.story-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 64px; align-items: center; }
.story-text p { font-size: 1.08rem; }
.pull-quote {
  margin: 32px 0 0; padding: 24px 28px; border-left: 6px solid var(--yellow);
  background: var(--cream); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display); font-size: 1.4rem; color: var(--navy);
}
.pull-quote cite { display: block; margin-top: 8px; font-family: var(--font-body); font-size: .9rem; font-style: normal; color: var(--muted); }

.story-flow { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.flow-step { text-align: center; width: 100%; max-width: 320px; }
.flow-art {
  width: 110px; height: 110px; margin: 0 auto 14px; display: grid; place-items: center;
  font-size: 3rem; border-radius: 28px; box-shadow: var(--shadow);
}
.flow-art.poster { background: linear-gradient(135deg, var(--sky), #8fe3ff); }
.flow-art.book { background: linear-gradient(135deg, var(--coral), #ff9a9a); }
.flow-art.tee { background: linear-gradient(135deg, var(--mint), #b6f5d8); }
.flow-step h3 { font-size: 1.15rem; margin-bottom: .2em; }
.flow-step p { color: var(--muted); margin: 0; }
.flow-arrow { font-size: 1.8rem; color: var(--yellow); font-weight: 800; line-height: 1; }

/* ---------- Collection ---------- */
.collection { background: var(--navy); color: var(--white); }
.collection h2, .collection h3 { color: var(--white); }
.collection .section-sub { color: rgba(255,255,255,.75); }
.collection .eyebrow { color: var(--yellow); }
.collection-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.book-card {
  background: var(--white); color: var(--ink); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.book-card:hover { transform: translateY(-8px) rotate(-1deg); }
.book-cover {
  position: relative; aspect-ratio: 3 / 3.6; display: grid; place-items: center;
  background-image: radial-gradient(rgba(255,255,255,.35) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
}
.theme-body .book-cover { background-color: var(--coral); }
.theme-matter .book-cover { background-color: var(--violet); }
.theme-space .book-cover { background-color: #2d6cdf; }
.theme-air .book-cover { background-color: #22c7a9; }
.theme-sun .book-cover { background-color: #f59e0b; }
a.book-cover { cursor: pointer; transition: filter .2s ease; }
a.book-cover:hover { filter: brightness(1.08); }
.books-11 { grid-template-columns: repeat(4, 1fr); }
.btn-buy {
  margin-top: 16px; width: 100%; font: inherit; font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  padding: 11px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--yellow); color: var(--navy); box-shadow: 0 6px 16px rgba(255,210,63,.4);
  transition: transform .15s ease, background .15s ease;
}
.btn-buy:hover { transform: translateY(-2px); background: #ffdb62; }
.btn-buy .price { font-weight: 400; opacity: .8; margin-left: 6px; }
.shop-note {
  margin: 44px auto 0; max-width: 680px; text-align: center; color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 22px 26px;
}
.shop-note p { margin: 0; }
.shop-note-sub { margin-top: 8px !important; font-size: .95rem; color: rgba(255,255,255,.7); }
.shop-note a { color: var(--yellow); border-bottom: 1px solid currentColor; }

/* Checkout modal (shown when a book has no checkout link configured yet) */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(18,29,53,.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white); color: var(--ink); border-radius: var(--radius); padding: 32px; max-width: 440px; width: 100%;
  box-shadow: var(--shadow-lg); text-align: center; position: relative;
}
.modal h3 { font-size: 1.4rem; }
.modal p { color: var(--muted); }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); line-height: 1; }
.modal .btn { margin-top: 8px; }
.book-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
  transition: transform .3s ease;
}
.book-card:hover .book-cover img { transform: scale(1.04); }
.book-cover img ~ .cover-emoji { display: none; }
.cover-emoji { font-size: 4.5rem; filter: drop-shadow(0 8px 12px rgba(0,0,0,.25)); }
.cover-lock {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(255,255,255,.92); border-radius: 999px; width: 32px; height: 32px;
  display: grid; place-items: center; font-size: .95rem; box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.cover-label {
  position: absolute; top: 14px; left: 14px; z-index: 2; background: var(--navy); color: var(--yellow);
  font-family: var(--font-display); font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.book-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.book-question { font-style: italic; color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.book-card h3 { color: var(--navy); font-size: 1.3rem; }
.book-body > p:not(.book-question) { color: var(--muted); font-size: .95rem; flex: 1; }
.format-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.format-tags li {
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--cream); color: var(--navy);
}
.collection-more { margin: 44px 0 0; text-align: center; color: rgba(255,255,255,.8); font-size: 1.05rem; }

/* ---------- Formats ---------- */
.formats { background: var(--cream); }
.formats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.format-card {
  background: var(--white); border-radius: var(--radius); padding: 34px 28px; text-align: center;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.format-card::before {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 220px; height: 220px; border-radius: 50%;
  background: var(--yellow); opacity: .18;
}
.format-card:nth-child(2)::before { background: var(--coral); }
.format-card:nth-child(3)::before { background: var(--sky); }
.format-icon { font-size: 3rem; margin-bottom: 10px; }
.format-card p { color: var(--muted); margin: 0; position: relative; }

/* ---------- About ---------- */
.about { background: var(--white); }
.about-inner { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: center; }
.portrait-circle {
  width: 260px; height: 260px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 4.5rem; color: var(--navy);
  background: conic-gradient(from 20deg, var(--yellow), var(--coral), var(--sky), var(--mint), var(--yellow));
  box-shadow: var(--shadow-lg); position: relative;
}
.portrait-circle::after {
  content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--cream); z-index: 0;
}
.portrait-circle { isolation: isolate; }
.portrait-circle::after { z-index: -1; }
.about-text p { font-size: 1.08rem; }
.about-facts { margin-top: 24px; display: grid; gap: 10px; }
.about-facts li { display: flex; gap: 14px; align-items: baseline; padding: 10px 16px; background: var(--cream); border-radius: 12px; }
.about-facts strong { font-family: var(--font-display); color: var(--coral); min-width: 60px; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Contact ---------- */
.contact { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: var(--white); }
.contact h2 { color: var(--white); }
.contact .eyebrow { color: var(--yellow); }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.contact-text p { opacity: .85; font-size: 1.08rem; }
.contact-form { background: var(--white); color: var(--ink); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-lg); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 800; font-size: .85rem; margin-bottom: 6px; color: var(--navy); }
.field input, .field textarea {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid #e5e7eb; background: #fafafa;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(76,201,240,.25); }
.field textarea { resize: vertical; }
.form-note { margin: 14px 0 0; font-size: .9rem; min-height: 1.4em; color: var(--navy); font-weight: 700; }
.form-note.error { color: #c0392b; }
.form-note.ok { color: #0f9d58; }

/* ---------- Footer ---------- */
.site-footer { background: #121d35; color: rgba(255,255,255,.8); padding: 44px 0; text-align: center; }
.footer-brand { font-family: var(--font-display); font-size: 1.2rem; color: var(--white); margin-bottom: 4px; }
.footer-brand strong { color: var(--yellow); }
.footer-brand span { font-size: .9rem; color: rgba(255,255,255,.6); font-family: var(--font-body); }
.footer-sub { font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--sky); margin: 0 0 6px; }
.footer-tag { font-size: .95rem; margin-bottom: 18px; }
.footer-nav { display: flex; justify-content: center; gap: 22px; margin-bottom: 18px; font-weight: 700; font-size: .9rem; }
.footer-nav a:hover { color: var(--yellow); }
.copyright { font-size: .8rem; color: rgba(255,255,255,.5); margin: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .float, .brand-mark svg { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .mission-grid, .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-world { display: none; }
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    display: none;
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy); padding: 10px 4% 18px;
    box-shadow: 0 20px 30px rgba(0,0,0,.25);
  }
  .primary-nav.open { display: flex; animation: navIn .2s ease; }
  @keyframes navIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
  .primary-nav a { padding: 14px 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .primary-nav a::after { display: none; }
  .nav-cta { margin-top: 12px; text-align: center; border-bottom: 0 !important; }

  .story-grid, .about-inner, .contact-inner { grid-template-columns: 1fr; gap: 40px; }
  .formats-grid { grid-template-columns: 1fr; }
  .about-portrait { order: -1; }
  .portrait-circle { width: 200px; height: 200px; font-size: 3.4rem; }
  .float { opacity: .3; }
}
@media (max-width: 560px) {
  .mission-grid, .collection-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .contact-form { padding: 24px 20px; }
  .f2, .f4 { display: none; }
  .brand { font-size: 1rem; }
}
