/* ==========================================================================
   cutukids — "craft table" design system
   A warm paper background, a crayon-box palette, and a hero built from
   fanned flashcards — because the product IS printable cards, not an
   abstract idea a gradient blob needs to represent.
   ========================================================================== */

:root {
  /* Color */
  --paper: #fff8ec;
  --paper-alt: #ffefd9;
  --ink: #3d2f63;
  --ink-soft: #6f6390;
  --coral: #ff6f5e;
  --coral-dark: #e85a49;
  --yellow: #ffc93c;
  --teal: #2fb6a8;
  --teal-dark: #24968a;
  --green: #6fbf73;
  --white: #fffdf8;

  /* Type */
  --font-display: "Baloo 2", "Segoe UI Rounded", ui-rounded, sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.75rem;
  --fs-xl: 2.5rem;
  --fs-2xl: 3.25rem;

  /* Shape & shadow */
  --radius-card: 22px;
  --radius-pill: 999px;
  --radius-sm: 14px;
  --shadow-soft: 0 10px 28px rgba(61, 47, 99, 0.14);
  --shadow-lift: 0 16px 36px rgba(61, 47, 99, 0.2);
  --border-ink: 3px solid var(--ink);
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(61, 47, 99, 0.06) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
}
p { margin: 0 0 1em; }
a { color: var(--teal-dark); }
ul { padding-left: 1.25em; }

a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--coral-dark);
  background: var(--white);
  border: 2px solid var(--coral);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  text-decoration: none;
  border-radius: var(--radius-pill);
  padding: 16px 34px;
  border: var(--border-ink);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-soft);
}
.btn:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: var(--shadow-lift); }
.btn-primary { background: var(--coral); color: var(--white); }
.btn-primary:hover { background: var(--coral-dark); }
.btn-block { display: flex; width: 100%; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-md);
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand .brand-dot { color: var(--coral); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 32px 0 64px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero > * {
  /* Grid items default to min-width:auto, which lets a wide-content child
     (the fixed-position card-fan) push this whole grid wider than the
     viewport instead of shrinking — that silently truncates the headline
     on mobile since overflow-x:hidden clips rather than reflows. */
  min-width: 0;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.4;
}
.hero::before { width: 240px; height: 240px; background: var(--yellow); top: -70px; left: -60px; }
.hero::after { width: 200px; height: 200px; background: var(--teal); bottom: -50px; right: 6%; }
.hero h1 {
  font-size: var(--fs-2xl);
  margin-top: 16px;
}
.hero h1 .underline {
  position: relative;
  white-space: nowrap;
}
.hero h1 .underline svg {
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 12px;
}
.hero-sub {
  font-size: var(--fs-md);
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.hero-rating {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.hero-rating .stars { color: var(--yellow); letter-spacing: 2px; }

/* -- flashcard fan (signature element) -- */
.card-fan {
  position: relative;
  width: 100%;
  height: 340px;
}
.flashcard {
  position: absolute;
  width: 168px;
  height: 210px;
  background: var(--white);
  border: var(--border-ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  padding: 12px;
  animation: settle 0.6s ease backwards;
}
.flashcard .icon { font-size: 2.75rem; }
.flashcard:has(img) { padding: 0; overflow: hidden; }
.flashcard img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.flashcard:nth-child(1) { top: 10px; left: 40px; transform: rotate(-9deg); background: var(--yellow); z-index: 1; animation-delay: 0.05s; }
.flashcard:nth-child(2) { top: 0; left: 190px; transform: rotate(6deg); background: var(--green); color: var(--white); z-index: 2; animation-delay: 0.15s; }
.flashcard:nth-child(3) { top: 70px; left: 100px; transform: rotate(-2deg); background: var(--teal); color: var(--white); z-index: 3; animation-delay: 0.25s; }
.flashcard:nth-child(3) .icon { filter: none; }
.flashcard:nth-child(4) { top: 90px; left: 270px; transform: rotate(11deg); background: var(--coral); color: var(--white); z-index: 1; animation-delay: 0.35s; }
.flashcard:hover { transform: rotate(0deg) translateY(-6px) scale(1.04); z-index: 5; }

@keyframes settle {
  from { opacity: 0; transform: translateY(24px) rotate(0deg); }
}

/* ---------- scalloped divider (the one decorative flourish) ---------- */
.scallop {
  display: block;
  width: 100%;
  height: 40px;
  margin-bottom: -1px;
}

/* ---------- section shells ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--paper-alt); }
.section-title {
  text-align: center;
  font-size: var(--fs-xl);
  max-width: 32ch;
  margin: 0 auto 12px;
}
.section-sub {
  text-align: center;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 auto 40px;
}

/* ---------- auto-scrolling "what's inside" strip ---------- */
.marquee {
  overflow: hidden;
  padding: 28px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 4%, black 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 4%, black 96%, transparent);
}
.marquee-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: marquee-scroll 36s linear infinite;
}
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.activity-card {
  flex: none;
  width: 190px;
  background: var(--white);
  border: 2px solid rgba(61, 47, 99, 0.15);
  border-radius: var(--radius-card);
  padding: 22px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.activity-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.activity-card:nth-child(4n+1) { border-color: var(--coral); }
.activity-card:nth-child(4n+2) { border-color: var(--teal); }
.activity-card:nth-child(4n+3) { border-color: var(--yellow); }
.activity-card:nth-child(4n) { border-color: var(--green); }
.activity-card .icon { font-size: 2.5rem; }
.activity-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(61, 47, 99, 0.12);
}
.activity-label { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); }
.activity-desc { font-size: var(--fs-xs); color: var(--ink-soft); }
.highlights-more {
  text-align: center;
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-soft);
}
@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; }
  .marquee-track { animation: none; }
}

/* ---------- stats bar ---------- */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 48px;
  text-align: center;
  padding: 12px 0 8px;
}
.stat .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-xl);
  color: var(--teal-dark);
  display: block;
}
.stat .label { color: var(--ink-soft); font-size: var(--fs-sm); }

/* ---------- pricing / product grid ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  align-items: stretch;
}
.pricing-card {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border: var(--border-ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
  padding: 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease;
}
.pricing-card:hover { transform: translateY(-4px); }
.sale-ribbon {
  position: absolute;
  top: 20px;
  right: -38px;
  width: 150px;
  transform: rotate(45deg);
  background: var(--coral);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-xs);
  text-align: center;
  padding: 5px 0;
  box-shadow: 0 3px 8px rgba(61, 47, 99, 0.25);
  z-index: 2;
}
.product-image {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  background: var(--paper-alt);
}
.pricing-card h3 { font-size: var(--fs-md); }
.pricing-card > p { font-size: var(--fs-sm); color: var(--ink-soft); flex-grow: 1; }
.product-link { display: block; text-decoration: none; color: inherit; }
.product-link:hover h3 { color: var(--coral-dark); }
.product-link:hover .product-image { filter: brightness(1.04); }
.preview-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 6px 0 4px;
}
.preview-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(61, 47, 99, 0.15);
}
.pricing-card .price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 4px;
}
.pricing-card .price-now {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  color: var(--coral-dark);
}
.pricing-card .price-was {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-color: var(--coral);
}
.pricing-card .price-caption { color: var(--ink-soft); font-size: var(--fs-xs); margin-bottom: 16px; }
.features {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.features li { display: flex; gap: 10px; align-items: flex-start; }
.features li::before {
  content: "✓";
  color: var(--white);
  background: var(--teal);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.features-shared {
  max-width: 420px;
  margin: 36px auto 0;
}

/* ---------- countdown ---------- */
.countdown-strip {
  background: var(--yellow);
  border-top: var(--border-ink);
  border-bottom: var(--border-ink);
  padding: 20px 0;
  text-align: center;
}
.countdown-strip .label {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 10px;
}
.countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.countdown .unit {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  min-width: 62px;
  padding: 10px 6px;
}
.countdown .unit .n { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); display: block; }
.countdown .unit .u { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--yellow); }

/* ---------- testimonials ---------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 26px 22px 22px;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.tape {
  position: absolute;
  top: -10px;
  left: 24px;
  width: 64px;
  height: 22px;
  background: repeating-linear-gradient(45deg, var(--teal), var(--teal) 6px, var(--teal-dark) 6px, var(--teal-dark) 12px);
  opacity: 0.85;
  transform: rotate(-3deg);
  border-radius: 3px;
}
.testimonial-card:nth-child(3n+2) .tape { background: repeating-linear-gradient(45deg, var(--coral), var(--coral) 6px, var(--coral-dark) 6px, var(--coral-dark) 12px); }
.testimonial-card:nth-child(3n) .tape { background: repeating-linear-gradient(45deg, var(--yellow), var(--yellow) 6px, #e0aa1f 6px, #e0aa1f 12px); }
.testimonial-quote { font-size: var(--fs-sm); color: var(--ink); margin-bottom: 16px; }
.testimonial-who { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.testimonial-name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); }
.testimonial-role { font-size: var(--fs-xs); color: var(--ink-soft); }

/* ---------- why-us trio ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.why-card { text-align: center; padding: 8px 12px; }
.why-card .icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  box-shadow: var(--shadow-soft);
}
.why-card:nth-child(3n+1) .icon { background: var(--coral); }
.why-card:nth-child(3n+2) .icon { background: var(--teal); }
.why-card:nth-child(3n) .icon { background: var(--yellow); }
.why-card h3 { font-size: var(--fs-md); }
.why-card p { color: var(--ink-soft); font-size: var(--fs-sm); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.faq-item {
  background: var(--white);
  border: 2px solid rgba(61, 47, 99, 0.15);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--coral);
  transition: transform 0.15s ease;
  flex: none;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 22px 20px; color: var(--ink-soft); }

/* ---------- final CTA ---------- */
.final-cta {
  text-align: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-card);
  padding: 56px 32px;
}
.final-cta h2 { color: var(--paper); }
.final-cta p { color: rgba(255, 248, 236, 0.75); max-width: 48ch; margin-left: auto; margin-right: auto; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255, 248, 236, 0.7);
  padding: 40px 0 28px;
  font-size: var(--fs-sm);
}
.site-footer a { color: var(--paper); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 18px;
}
.footer-disclaimer {
  border-top: 1px solid rgba(255, 248, 236, 0.15);
  margin-top: 18px;
  padding-top: 18px;
  font-size: var(--fs-xs);
  opacity: 0.7;
}

/* ---------- simple policy pages ---------- */
.policy-page { padding: 56px 0 80px; max-width: 720px; margin: 0 auto; }
.policy-page h1 { font-size: var(--fs-xl); }
.policy-body { white-space: pre-line; color: var(--ink-soft); }
.contact-card {
  background: var(--white);
  border: var(--border-ink);
  border-radius: var(--radius-card);
  padding: 28px;
  margin-top: 24px;
  text-align: center;
}

/* ---------- product detail page ---------- */
.product-detail { padding: 32px 0 80px; }
.back-link {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  margin-bottom: 24px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: start;
}
.detail-cover {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: var(--radius-card);
  background: var(--paper-alt);
  margin-bottom: 20px;
}
.detail-main h1 { font-size: var(--fs-xl); }
.detail-description { color: var(--ink-soft); white-space: pre-line; }
.detail-subheading { font-size: var(--fs-md); margin-top: 32px; }
.detail-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.detail-preview-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(61, 47, 99, 0.15);
}
.detail-buybox {
  position: sticky;
  top: 24px;
  max-width: none;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .card-fan { height: 300px; max-width: 380px; margin: 0 auto; }
  .flashcard { width: 130px; height: 168px; }
  .flashcard:nth-child(1) { top: 10px; left: 10px; }
  .flashcard:nth-child(2) { top: 0; left: 130px; }
  .flashcard:nth-child(3) { top: 90px; left: 70px; }
  .flashcard:nth-child(4) { top: 100px; left: 190px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-buybox {
    /* Not `static`: .sale-ribbon inside is `position:absolute` and needs
       this card as its containing block, or (with no positioned ancestor
       between it and the page root) it detaches to the document root and
       renders near the top of the whole page instead of on this card —
       escaping the card's `overflow:hidden` clip and causing real
       horizontal page overflow on mobile. `relative` cancels the desktop
       `sticky` positioning the same way `static` would, but still anchors
       the ribbon correctly. */
    position: relative;
  }
  :root { --fs-2xl: 2.5rem; --fs-xl: 2rem; }
}
@media (max-width: 560px) {
  .countdown .unit { min-width: 52px; }
  .hero-cta-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
  /* Extra-compact fan for the smallest real phones (iPhone SE-class,
     ~320-375px) — the 900px breakpoint's fan is sized for tablets/large
     phones and its rightmost card can crowd a very narrow viewport. */
  .card-fan { height: 240px; max-width: 260px; }
  .flashcard { width: 100px; height: 128px; padding: 8px; gap: 6px; }
  .flashcard .icon { font-size: 2rem; }
  .flashcard:nth-child(1) { top: 0; left: 0; }
  .flashcard:nth-child(2) { top: 0; left: 80px; }
  .flashcard:nth-child(3) { top: 60px; left: 40px; }
  .flashcard:nth-child(4) { top: 70px; left: 140px; }
}

