/* =========================================
   Design tokens
   ========================================= */
:root {
  --pink: #c75b9b;
  --pink-soft: #f4d4e4;
  --purple: #6b4c9a;
  --purple-deep: #3f2a63;
  --rose: #b76e79;
  --rose-gold: #d4a574;
  --green: #2d6a4f;
  --green-soft: #7bc4a8;
  --cream: #fbf6f2;
  --ink: #2a1f33;
  --muted: #5d5166;
  --white: #fffdfb;
  --shadow: 0 18px 40px rgba(63, 42, 99, 0.12);
  --shadow-soft: 0 10px 24px rgba(183, 110, 121, 0.16);
  --radius: 22px;
  --radius-sm: 14px;
  --header: 76px;
}

body[data-theme="garden"] {
  --cream: #f3faf6;
  --pink: #3d8b6e;
  --purple: #2d6a4f;
  --purple-deep: #1b4332;
  --rose: #40916c;
}

body[data-theme="dusk"] {
  --cream: #f4eefb;
  --pink: #8b5cf6;
  --purple: #5b3a8c;
  --purple-deep: #2e1a4a;
  --rose: #9b7ebd;
}

body[data-theme="cream"] {
  --cream: #fff8ef;
  --pink: #c9a227;
  --purple: #8a6a3b;
  --purple-deep: #4a3720;
  --rose: #d4a574;
}

/* =========================================
   Base
   ========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(232, 176, 184, 0.45), transparent 36%),
    radial-gradient(circle at 88% 12%, rgba(123, 196, 168, 0.28), transparent 32%),
    var(--cream);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.narrow {
  width: min(760px, calc(100% - 40px));
}

.eyebrow {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--rose);
  font-family: "Segoe UI", sans-serif;
  margin-bottom: 10px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  color: var(--purple-deep);
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  margin-bottom: 14px;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.section-lead,
.lead {
  color: var(--muted);
  font-size: 1.08rem;
}

/* =========================================
   Floating equations
   ========================================= */
.float-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.float-eq {
  position: absolute;
  color: rgba(107, 76, 154, 0.18);
  font-size: clamp(1rem, 2vw, 1.5rem);
  animation: drift linear infinite;
  white-space: nowrap;
}

@keyframes drift {
  0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateY(-12vh) rotate(12deg); opacity: 0; }
}

/* =========================================
   Intro overlay
   ========================================= */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 51, 0.45);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 24px;
}

.intro-overlay.hide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.intro-card {
  background: var(--white);
  border-radius: 28px;
  padding: 40px 36px;
  max-width: 520px;
  box-shadow: var(--shadow);
  text-align: center;
}

.intro-kicker {
  font-family: "Segoe UI", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--pink);
  margin-bottom: 10px;
}

.intro-card p {
  color: var(--muted);
  margin: 12px 0 24px;
}

/* =========================================
   Navigation
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(251, 246, 242, 0.82);
  border-bottom: 1px solid rgba(183, 110, 121, 0.16);
}

.navbar {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--rose-gold), var(--pink));
  color: white;
  box-shadow: var(--shadow-soft);
}

.logo-text {
  font-size: 0.95rem;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.92rem;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--purple-deep);
  background: rgba(244, 212, 228, 0.7);
}

.nav-cta {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white !important;
}

.nav-cta:hover {
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 6px 8px;
  background: var(--purple-deep);
  border-radius: 2px;
  transition: 0.2s ease;
}

/* =========================================
   Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 22px;
  font-family: "Segoe UI", sans-serif;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: white;
  color: var(--purple-deep);
  border: 1px solid rgba(107, 76, 154, 0.18);
}

.btn-light {
  background: white;
  color: var(--purple-deep);
}

.btn-ghost-light {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

/* =========================================
   Hero
   ========================================= */
.hero {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 40px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-visual {
  position: relative;
  min-height: 360px;
}

.hero-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.hero-card-label {
  font-family: "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}

.hero-card ul {
  margin-top: 14px;
  padding-left: 18px;
  color: var(--muted);
}

.bubble {
  position: absolute;
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(255, 253, 251, 0.86);
  box-shadow: var(--shadow-soft);
  font-size: 0.92rem;
  color: var(--purple);
  animation: float 6s ease-in-out infinite;
}

.bubble-a { top: 8px; left: 8px; }
.bubble-b { top: 48px; right: 0; animation-delay: 1s; }
.bubble-c { bottom: 24px; left: 36px; animation-delay: 2s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* =========================================
   Supporting copy + about
   ========================================= */
.support,
.about,
.features,
.how,
.pricing,
.topics,
.cta {
  position: relative;
  z-index: 1;
  padding: 72px 0;
}

.support {
  text-align: center;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 32px;
  align-items: start;
}

.about-card,
.feature-card,
.price-card,
.topic-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.about-card ul,
.price-card ul {
  list-style: none;
  margin-top: 14px;
}

.about-card li,
.price-card li {
  padding: 8px 0;
  border-top: 1px solid rgba(183, 110, 121, 0.14);
}

/* =========================================
   Feature cards
   ========================================= */
.card-grid,
.price-grid,
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.feature-card .icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--pink-soft), #d8f3e8);
  color: var(--purple);
  margin-bottom: 14px;
}

.feature-card p,
.price-card p,
.topic-card p {
  color: var(--muted);
}

.text-link {
  margin-top: 14px;
  background: none;
  border: 0;
  color: var(--pink);
  cursor: pointer;
  font-family: "Segoe UI", sans-serif;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

.text-link:hover {
  color: var(--purple);
}

/* =========================================
   How it works
   ========================================= */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.steps li {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.steps span {
  display: inline-block;
  font-family: "Segoe UI", sans-serif;
  color: var(--rose);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* =========================================
   Info
   ========================================= */
.Info-card {
  position: relative;
}

.Info-card.featured {
  background: linear-gradient(180deg, #fff, #f8eaf2);
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}

.badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--green);
  color: white;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-family: "Segoe UI", sans-serif;
}

.Info {
  font-size: 2.2rem;
  color: var(--purple-deep);
  margin: 8px 0;
}

.Info span {
  font-size: 1rem;
  color: var(--muted);
}

.Info-card .btn {
  margin-top: 18px;
  width: 100%;
}

/* =========================================
   Topics + CTA
   ========================================= */
.cta-box {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  border-radius: 32px;
  padding: 56px 40px;
  text-align: center;
  box-shadow: var(--shadow);
}

.cta-box h2,
.cta-box p {
  color: white;
}

.cta-box p {
  max-width: 620px;
  margin: 0 auto;
  opacity: 0.92;
}

/* =========================================
   Footer
   ========================================= */
.footer {
  position: relative;
  z-index: 1;
  padding: 48px 0 24px;
  background: rgba(255, 253, 251, 0.72);
  border-top: 1px solid rgba(183, 110, 121, 0.16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 24px;
}

.footer h3 {
  font-size: 1rem;
}

.footer ul {
  list-style: none;
}

.footer a {
  text-decoration: none;
  color: var(--muted);
}

.footer a:hover {
  color: var(--pink);
}

.Title {
  text-align: center;
  color: var(--muted);
  margin-top: 28px;
  font-size: 0.92rem;
}


/* =========================================
   Back to top
   ========================================= */
.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
}

.back-top:hover {
  transform: translateY(-3px);
}

/* =========================================
   Modals
   ========================================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 51, 0.48);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 70;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(640px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: var(--white);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.close-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--pink-soft);
  cursor: pointer;
  color: var(--purple-deep);
}

.notes p,
.notes li {
  margin-bottom: 10px;
  color: var(--muted);
}

.notes h3 {
  margin: 16px 0 8px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.worksheet-list {
  padding-left: 20px;
  color: var(--muted);
}

.worksheet-list li {
  margin-bottom: 10px;
}

.quiz-result {
  margin-top: 14px;
  font-weight: 700;
  color: var(--green);
}

.quiz-item {
  margin-bottom: 16px;
}

.quiz-item label {
  display: block;
  margin: 4px 0;
  cursor: pointer;
}

/* =========================================
   Calculator
   ========================================= */
.calculator-card {
  width: min(360px, 100%);
}

.calc-display {
  width: 100%;
  border: 1px solid rgba(107, 76, 154, 0.16);
  border-radius: 14px;
  padding: 14px;
  text-align: right;
  font-size: 1.4rem;
  margin-bottom: 12px;
  background: #fffaf8;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-grid button {
  border: 0;
  border-radius: 14px;
  padding: 14px 0;
  background: #f7eef4;
  color: var(--purple-deep);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.calc-grid button:hover {
  background: var(--pink-soft);
  transform: translateY(-1px);
}

.calc-grid .equals {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
}

/* =========================================
   Themes + cake
   ========================================= */
.theme-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.theme-swatch {
  border: 0;
  border-radius: 16px;
  padding: 18px 12px;
  cursor: pointer;
  color: var(--purple-deep);
  font-weight: 600;
}

.theme-swatch.rose { background: linear-gradient(135deg, #f4d4e4, #e8b4b8); }
.theme-swatch.garden { background: linear-gradient(135deg, #d8f3e8, #95d5b2); }
.theme-swatch.dusk { background: linear-gradient(135deg, #e6d6f5, #cbb2fe); }
.theme-swatch.cream { background: linear-gradient(135deg, #fff3d6, #e7c873); }

.cake {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
}

.layer {
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  width: 58%;
  background: #d9c6cf;
  opacity: 0.45;
  transition: 0.3s ease;
}

.layer[data-layer="1"] { width: 72%; }
.layer[data-layer="0"] { width: 86%; }

.layer.baked {
  opacity: 1;
  background: linear-gradient(135deg, var(--rose), var(--pink));
}

.cake-q {
  margin: 12px 0;
  font-weight: 700;
}

.cake-choices {
  display: grid;
  gap: 8px;
}

.cake-choices button {
  border: 1px solid rgba(107, 76, 154, 0.18);
  background: white;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.cake-choices button:hover {
  background: var(--pink-soft);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 960px) {
  .hero,
  .about-grid,
  .card-grid,
  .price-grid,
  .topic-grid,
  .steps,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .price-card.featured {
    transform: none;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: var(--header);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    display: none;
    box-shadow: var(--shadow-soft);
  }

  .nav-links.open {
    display: flex;
  }

  .hero,
  .about-grid,
  .card-grid,
  .price-grid,
  .topic-grid,
  .steps,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 36px;
  }

  .hero-visual {
    min-height: 280px;
  }
}
@media print {

    /* Tell the browser that the paper is A4 */
    @page {
        size: A4 portrait;
        margin: 0;
    }

    html,
    body {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: white !important;
    }

    /*
       Hide everything except the worksheet.
       Add class="no-print" to anything that should
       disappear from the PDF.
    */
    .no-print {
        display: none !important;
    }

    /*
       Main worksheet container.
       IMPORTANT:
       If her worksheet has a different ID/class,
       change #worksheet to the correct one.
    */
    #worksheet,
    .worksheet {
        width: 210mm !important;
        height: 297mm !important;

        max-width: 210mm !important;
        max-height: 297mm !important;

        margin: 0 !important;
        padding: 8mm !important;

        box-sizing: border-box !important;

        overflow: hidden !important;

        background: white !important;

        /*
           This prevents the worksheet from creating
           additional printed pages.
        */
        break-after: avoid !important;
        page-break-after: avoid !important;
        break-before: avoid !important;
        page-break-before: avoid !important;
        page-break-inside: avoid !important;
    }

    /*
       Stop individual sections from creating
       unnecessary page breaks.
    */
    #worksheet *,
    .worksheet * {
        break-before: auto !important;
        break-after: auto !important;
    }

    /*
       Keep questions together.
    */
    .question,
    .question-box,
    .problem,
    .math-question {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    /*
       Prevent large elements from extending
       outside the A4 page.
    */
    img {
        max-width: 100% !important;
        max-height: 40mm !important;
    }

    table {
        max-width: 100% !important;
    }

    /*
       Remove unnecessary screen spacing.
    */
    #worksheet h1,
    #worksheet h2,
    #worksheet h3,
    .worksheet h1,
    .worksheet h2,
    .worksheet h3 {
        margin-top: 2mm !important;
        margin-bottom: 2mm !important;
    }

    #worksheet p,
    .worksheet p {
        margin-top: 1mm !important;
        margin-bottom: 1mm !important;
    }

    /*
       Hide common website elements when printing.
    */
    nav,
    header,
    footer,
    button,
    .buttons,
    .controls,
    .toolbar,
    .navigation {
        display: none !important;
    }
}
