/* Finger Painters — marketing site */
/* Hero panel: toddler (left) | copy+CTA (middle) | rotated phone (right). */

:root {
  /* Warm paper field + ink — paint accents live on the hero strokes */
  --color-bg: #f7f1e4;
  --color-surface: #ffffff;
  --color-ink: #1f2430;
  --color-ink-soft: #5a6170;
  /* Adjacent to cream ~4.6:1 for text; ~3.1:1 for non-text UI chrome */
  --color-accent: #e07a2f;
  --color-accent-soft: #ffe8d2;
  --color-border: #d9ceb8;
  --color-link: #1d4ed8;

  --paint-coral: #ff6b6b;
  --paint-teal: #2ec4b6;
  --paint-sun: #ffd166;
  --paint-lime: #8ac926;
  --paint-violet: #9b5de5;
  --paint-sky: #4cc9f0;

  --font-main: "Nunito", system-ui, sans-serif;
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;

  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --radius: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.06);

  --max-width: 960px;
  --hero-max: 42rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(247 241 228 / 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-ink);
}

.brand--compact .brand__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.brand__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-ink);
}

.nav {
  display: none;
  gap: var(--space-2);
  align-items: center;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-ink-soft);
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--color-ink);
  background: rgb(255 255 255 / 0.55);
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  /* Border on cream ≈ 3:1 for control outline (WCAG 1.4.11) */
  background: rgb(255 255 255 / 0.75);
  border-radius: 10px;
  cursor: pointer;
  color: var(--color-ink);
}

/* ---------- Hero (desired panel: photo | copy | phone) ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Same horizontal inset as .section so the panel lines up with the page column */
  padding: 0 var(--space-4);
  /* Cream field matching the desired banner */
  background: #f7efe3;
}

/*
  Mobile stacks photo → copy → phone.
  The panel uses the same column as .section__inner (--max-width), not the viewport.
*/
.hero__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  text-align: center;
  padding: 0;
  background: #f7efe3;
  border-radius: 0;
  animation: hero-rise 0.7s ease-out both;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__visual {
  margin: 0;
  flex-shrink: 0;
  animation: portrait-pop 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.hero__visual--toddler {
  width: 100%;
  border-radius: 0;
  overflow: hidden;
}

.hero__visual--toddler img {
  width: 100%;
  height: min(70vw, 22rem);
  object-fit: cover;
  object-position: center 30%;
}

.hero__visual--phone {
  width: min(70vw, 16rem);
  margin: 0 auto var(--space-6);
}

.hero__visual img {
  width: 100%;
  height: auto;
  display: block;
}

/* Hero phone carousel: fade between toddler + preschool screens */
.hero-carousel {
  width: 100%;
}

.hero-carousel__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 396 / 790;
}

.hero-carousel__slide {
  margin: 0;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}

.hero-carousel__slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.hero-carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: var(--space-3);
}

.hero-carousel__dot {
  width: 0.65rem;
  height: 0.65rem;
  padding: 0;
  border: 2px solid #6b6258; /* ≥3:1 on cream (WCAG 1.4.11) */
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.hero-carousel__dot.is-active {
  background: #6b6258;
}

@keyframes portrait-pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-6);
  max-width: 36rem;
  margin: 0 auto;
  order: 0;
}

/* #c2410c on #f7efe3 ≈ 4.5:1 — rule + offer line (WCAG 1.4.3 / 1.4.11) */
.hero__rule {
  width: 3.25rem;
  height: 3px;
  margin: 0;
  border: 0;
  background: #c2410c;
}

.hero__offer {
  margin: var(--space-2) 0 0;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: 0.03em;
  line-height: 1.15;
  color: #c2410c;
}

.hero h1 {
  font-family: var(--font-main);
  font-size: clamp(2rem, 4.2vw, 3.15rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--color-ink);
  margin: 0;
  letter-spacing: -0.03em;
  max-width: 12ch;
}

.lead {
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  font-weight: 600;
  color: var(--color-ink-soft);
  max-width: 38ch;
  margin: 0;
  line-height: 1.5;
}

.hero__cta {
  display: flex;
  justify-content: center;
  margin-top: var(--space-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  border-radius: 12px;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  min-height: 48px;
  touch-action: manipulation;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.btn:active {
  transform: scale(0.97);
}

.btn--store {
  background: var(--color-ink);
  color: #fff;
  box-shadow: var(--shadow-md);
  border-radius: 980px;
  padding-inline: var(--space-6);
  gap: var(--space-3);
  white-space: nowrap;
}

.btn--store:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn__apple {
  flex-shrink: 0;
}

.btn--primary {
  background: var(--color-ink);
  color: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  box-shadow: var(--shadow-lg);
}

.btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border: 2px solid var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--color-ink);
  background: rgb(45 51 63 / 0.05);
}

/* ---------- Sections ---------- */

.section {
  padding: var(--space-12) var(--space-4);
}

.section--alt {
  background: rgb(255 255 255 / 0.45);
}

.section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__head {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto var(--space-10);
}

.section__head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-ink);
  margin: 0 0 var(--space-3) 0;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--color-ink-soft);
  margin: 0;
}

.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 var(--space-3) 0;
}

.card p {
  color: var(--color-ink-soft);
  margin: 0;
  font-size: 0.95rem;
}

.step-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-surface);
  font-weight: 800;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}

/* ---------- Pricing ---------- */

.price-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .price-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.price-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow-sm);
}

.price-card--featured {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  position: relative;
}

.price-card--featured::before {
  content: "Popular";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-accent);
  background: var(--color-surface);
  padding: 0 var(--space-3);
  border-radius: 999px;
  border: 1px solid var(--color-accent);
}

.price-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 var(--space-2) 0;
}

.price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: var(--space-2) 0;
}

.price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-ink-soft);
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: var(--space-6) 0 0 0;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
}

.price-card li {
  padding: var(--space-2) 0;
  border-top: 1px solid rgb(229 220 200 / 0.4);
}

.price-card li:first-child {
  border-top: none;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: var(--space-12) var(--space-4) var(--space-8);
  margin-top: var(--space-12);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .site-footer__inner {
    grid-template-columns: 2fr 1fr;
  }
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--color-ink);
}

.footer-copy {
  color: var(--color-ink-soft);
  font-size: 0.85rem;
  margin-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }

  .menu-btn {
    display: none;
  }
}

/* Desktop: photo | copy | phone, still inside the page column */
@media (min-width: 900px) {
  .hero__panel {
    display: grid;
    /* Middle track sized so the store CTA fits at --max-width (960px) */
    grid-template-columns: minmax(14rem, 1fr) minmax(16rem, 1.2fr) minmax(12rem, 0.95fr);
    column-gap: var(--space-4);
    align-items: stretch;
    min-height: min(78vh, 40rem);
    text-align: left;
  }

  .hero__visual--toddler {
    height: 100%;
    min-height: 28rem;
    min-width: 0;
  }

  .hero__visual--toddler img {
    height: 100%;
    min-height: 28rem;
    object-fit: cover;
    object-position: 55% 20%;
  }

  .hero__copy {
    align-items: flex-start;
    justify-content: center;
    margin: 0;
    max-width: none;
    min-width: 0;
    padding: var(--space-10) var(--space-4);
  }

  .hero__cta {
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
  }

  /* Keep the pill inside the middle track; do not paint over phone dots */
  .hero__cta .btn--store {
    max-width: 100%;
    box-sizing: border-box;
    padding-inline: var(--space-4);
  }

  .hero__visual--phone {
    width: auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-4) var(--space-6) 0;
  }

  .hero-carousel {
    width: min(100%, 20rem);
  }

  /* Keep dots centered under the phone frame (not flush left) */
  .hero-carousel__dots {
    justify-content: center;
    padding-left: 0;
  }
}

.mobile-menu {
  display: none;
  gap: var(--space-3);
  margin: 0 var(--space-4) var(--space-4);
  padding: var(--space-4);
  background: rgb(255 255 255 / 0.92);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.mobile-menu a {
  display: block;
  padding: var(--space-3);
  color: var(--color-ink);
  font-weight: 700;
  border-radius: 8px;
}

.mobile-menu a:hover {
  background: var(--color-accent-soft);
}

.mobile-menu.open {
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .section,
  .hero {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__panel,
  .hero__visual {
    animation: none;
  }

  .hero-carousel__slide {
    transition: none;
  }
}
