/* MiniDraw — marketing site styles
   Colors and assets pulled directly from the KidsDraw iPad app.

   Brand system (from DrawingEditorView.swift + HomeView.swift + ProjectCardView.swift):
   - appBackground          rgb(137, 90, 255)   #895AFF   (Color.appBackground)
   - brand deep purple      rgb(110,  0, 210)   #6E00D2   (markers stroke)
   - brand light purple     rgb(200,170, 255)   #C8AAFF   (markers bg)
   - card lavender          rgb(245,241,255)    #F5F1FF   (ProjectCard bg)
   - card border lilac      rgb(206,207,234)    #CECFEA   (ProjectCard shadow)
   - deep shadow            rgb( 28,  0, 98)    #1C0062   (shadow color)
   - color A (orange)       rgb(255,118, 67)    #FF7643
   - color B (blue)         rgb(125,179,253)    #7DB3FD

   Palette colors (from DrawingEditorView palette array):
   --pal-purple   #8C59F2   --pal-pink   #FF59B3
   --pal-red      #F23B3B   --pal-orange #FF8C00
   --pal-yellow   #FFD91A   --pal-lime   #99E633
   --pal-green    #33BF59   --pal-teal   #1ACCB3
   --pal-skyblue  #8CCCFF   --pal-blue   #33A6FF
*/

:root {
  /* Brand */
  --brand: #895AFF;
  --brand-deep: #6E00D2;
  --brand-light: #C8AAFF;
  --lavender: #F5F1FF;
  --lilac-border: #CECFEA;
  --deep-shadow: rgba(28, 0, 98, 0.16);
  --deep-shadow-soft: rgba(28, 0, 98, 0.08);
  --ink: #1C0062;
  --ink-soft: #5A4F7A;

  /* Palette (from app) */
  --pal-purple:  #8C59F2;
  --pal-pink:    #FF59B3;
  --pal-red:     #F23B3B;
  --pal-orange:  #FF8C00;
  --pal-yellow:  #FFD91A;
  --pal-lime:    #99E633;
  --pal-green:   #33BF59;
  --pal-teal:    #1ACCB3;
  --pal-skyblue: #8CCCFF;
  --pal-blue:    #33A6FF;
  --accent-a:    #FF7643;  /* color A */
  --accent-b:    #7DB3FD;  /* color B */

  /* Shape */
  --radius-sm: 16px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;

  /* Shadows — mirror the iPad app card shadows */
  --shadow-card-1: 0 14px 28px var(--deep-shadow);        /* ProjectCard outer */
  --shadow-card-2: 0 6px 14px var(--deep-shadow-soft);    /* ProjectCard inner */
  --shadow-sm: 0 4px 14px rgba(28, 0, 98, 0.06);
  --shadow-md: 0 12px 30px rgba(28, 0, 98, 0.10);
  --shadow-lg: 0 24px 60px rgba(28, 0, 98, 0.22);

  /* Type — Nunito as SF Pro Rounded alternative (matches .system rounded in app) */
  --font-display: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --max-w: 1120px;
}

/* Reset */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white, #fff);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  font-size: 17px;
  font-weight: 500;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 22px;
}
section { padding-block: 96px; }
@media (max-width: 720px) { section { padding-block: 64px; } }

/* Type — matches the app's "rounded, heavy" headings */
h1,h2,h3,h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); font-weight: 900; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); font-weight: 900; }
h3 { font-size: 1.2rem; font-weight: 800; }
p  { margin: 0 0 1em; color: var(--ink-soft); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }

.eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-deep);
  background: var(--lavender);
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
  border: 1px solid var(--lilac-border);
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--lilac-border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.22rem;
  color: var(--ink);
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--brand);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: .98rem;
  transition: color .15s ease;
}
.nav-links a:hover { color: var(--brand-deep); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* Buttons — rounded like the app's .continuous corner style */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-radius: 20px;                /* matches RoundedRectangle(cornerRadius: 20) */
  font-weight: 800;
  font-size: 1rem;
  border: none;
  transition: transform .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 10px 24px rgba(137, 90, 255, 0.45);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(137, 90, 255, 0.55); }
.btn-secondary {
  background: white;
  color: var(--brand-deep);
  border: 2px solid var(--brand-light);
}
.btn-secondary:hover { border-color: var(--brand); transform: translateY(-2px); }
.btn svg { width: 22px; height: 22px; }

/* Official Apple "Download on the App Store" badge.
   Per Apple Identity Guidelines: minimum height 40px, surrounded by clear space
   equal to 1/10th of the badge height. Do not recolor or modify. */
.appstore-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.appstore-badge img {
  height: 52px;
  width: auto;
  display: block;
}
.appstore-badge:hover { transform: translateY(-2px); }
.appstore-badge:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
.appstore-badge--header img { height: 40px; }

/* ============================================================
   HERO — uses the actual StarPattern.png background on purple,
   echoing HomeView's purple background with tiled stars
   ============================================================ */
.hero {
  position: relative;
  padding-top: 110px;
  padding-bottom: 140px;
  background-color: var(--brand);
  background-image: url("assets/star-pattern.png");
  background-repeat: repeat;
  background-size: 180px auto;
  color: white;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(137,90,255,0.0) 0%, rgba(137,90,255,0.35) 100%);
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero { padding-top: 64px; padding-bottom: 88px; }
}

.hero h1 { color: white; }
.hero h1 span { color: #FFD91A; }            /* app palette yellow */
.hero .eyebrow {
  background: rgba(255,255,255,0.18);
  color: white;
  border-color: rgba(255,255,255,0.25);
}
.hero p.tagline {
  font-size: 1.3rem;
  color: white;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero p.sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  max-width: 52ch;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; align-items: center; }
.hero-cta .btn { padding-block: 14px; }
.hero .btn-primary {
  background: white;
  color: var(--brand-deep);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.hero .btn-secondary {
  background: rgba(255,255,255,0.14);
  color: white;
  border-color: rgba(255,255,255,0.3);
}
.hero .btn-secondary:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   HERO SHOT — real iPad screenshot
   ============================================================ */
.hero-shot {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 4px solid #ffffff;
  transform: rotate(-1.2deg);
  transition: transform .3s ease;
}
.hero-shot:hover { transform: rotate(0deg) scale(1.01); }
.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

/* Legacy mockup styles (kept for reference, not used on home) */
.mockup {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  background: var(--lavender);
  box-shadow: var(--shadow-card-1), var(--shadow-card-2);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--lilac-border);
}
.mockup-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mockup-top h3 {
  color: var(--brand-deep);
  margin: 0;
  font-size: 1.25rem;
}
.mockup-top .tools {
  display: flex;
  gap: 8px;
}
.mockup-top .tools img {
  width: 32px; height: 32px;
  padding: 6px;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--lilac-border);
}
.mockup-canvas {
  flex: 1;
  background: white;
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow: inset 0 0 0 1px var(--lilac-border);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 18px;
}
.mockup-canvas .sticker {
  position: absolute;
  width: 34%;
}
.mockup-canvas .sticker-1 { top: 10%; left: 8%; transform: rotate(-8deg); }
.mockup-canvas .sticker-2 { bottom: 12%; right: 10%; transform: rotate(6deg); width: 30%; }
.mockup-canvas .sticker-3 { top: 45%; left: 52%; transform: rotate(-3deg); width: 26%; }

.mockup-palette {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 10px;
  background: white;
  border-radius: 18px;
  border: 1px solid var(--lilac-border);
}
.mockup-palette i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 2px 4px rgba(28, 0, 98, 0.12);
}

/* ============================================================
   FEATURES — white cards on lavender (ProjectCard style)
   ============================================================ */
.features { background: var(--lavender); }
.features-head { text-align: center; margin-bottom: 56px; }
.features-head p { max-width: 56ch; margin-inline: auto; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px;
  border: 1px solid var(--lilac-border);
  box-shadow: 0 10px 24px var(--deep-shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-1), var(--shadow-card-2);
}
.feature-icon {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin-bottom: 16px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--brand-deep);
}
.feature-card h3 { margin-bottom: 8px; color: var(--ink); }
.feature-card p { margin: 0; font-size: .98rem; }

/* ============================================================
   WHAT'S INCLUDED — stat cards tinted with palette colors
   ============================================================ */
.included-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-top: 48px;
}
@media (max-width: 900px) { .included-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: white;
  border: 1px solid var(--lilac-border);
  border-radius: var(--radius-lg);
  padding: 32px 18px 26px;
  text-align: center;
  box-shadow: 0 8px 20px var(--deep-shadow-soft);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--tint, var(--brand));
}
.stat-card:nth-child(1) { --tint: var(--pal-purple); }
.stat-card:nth-child(2) { --tint: var(--pal-pink); }
.stat-card:nth-child(3) { --tint: var(--pal-orange); }
.stat-card:nth-child(4) { --tint: var(--pal-green); }
.stat-card:nth-child(5) { --tint: var(--pal-blue); }

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.6rem;
  color: var(--brand-deep);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label { font-size: .95rem; font-weight: 800; color: var(--ink-soft); }

/* Palette strip — shows the REAL 10 app palette colors */
.palette-strip {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}
.palette-strip i {
  width: 38px; height: 38px; border-radius: 50%;
  box-shadow: 0 4px 10px var(--deep-shadow-soft);
  border: 3px solid white;
}

/* About */
.about { background: white; }
.about-card {
  background: var(--lavender);
  border-radius: var(--radius-xl);
  padding: 64px 56px;
  border: 1px solid var(--lilac-border);
  box-shadow: var(--shadow-card-1), var(--shadow-card-2);
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.about-card::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("assets/star-pattern.png");
  background-size: 260px auto;
  opacity: 0.08;
  pointer-events: none;
}
.about-card > * { position: relative; z-index: 1; }
@media (max-width: 600px) { .about-card { padding: 40px 26px; } }
.about-card p { font-size: 1.08rem; color: var(--ink); }

/* Contact — full-bleed purple card with star pattern */
.contact-card {
  background-color: var(--brand);
  background-image: url("assets/star-pattern.png");
  background-size: 180px auto;
  color: white;
  border-radius: var(--radius-xl);
  padding: 64px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.contact-card h2 { color: white; }
.contact-card p { color: rgba(255,255,255,0.92); margin-bottom: 28px; }
.contact-card .btn {
  background: white;
  color: var(--brand-deep);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

/* Footer */
.site-footer {
  background: #120545;
  color: rgba(255,255,255,0.75);
  padding: 64px 0 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  color: white;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 14px;
}
.site-footer .brand { color: white; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: rgba(255,255,255,0.75); transition: color .15s; }
.site-footer a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .9rem;
}

/* Legal pages */
.legal { padding-block: 80px; background: var(--lavender); }
.legal-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: 60px;
  max-width: 840px;
  margin-inline: auto;
  border: 1px solid var(--lilac-border);
  box-shadow: var(--shadow-card-1), var(--shadow-card-2);
}
@media (max-width: 600px) { .legal-content { padding: 36px 24px; } }
.legal-content h1 { margin-bottom: 8px; }
.legal-content .updated { color: var(--ink-soft); font-size: .92rem; margin-bottom: 32px; }
.legal-content h2 { font-size: 1.4rem; margin-top: 36px; color: var(--brand-deep); }
.legal-content h3 { margin-top: 24px; }
.legal-content p, .legal-content li { color: var(--ink); }
.legal-content ul { padding-left: 22px; }
.legal-content li { margin-bottom: 8px; }
.legal-content a { color: var(--brand-deep); font-weight: 700; text-decoration: underline; }
.legal-content a.btn { text-decoration: none; }
.legal-content a.btn-primary { color: white; }

/* ============================================================
   PRODIGY studio brand mark + studio hero + apps grid
   ============================================================ */
.brand-mark--studio {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: white;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1;
}

.studio-hero {
  text-align: center;
  max-width: 760px;
}
.studio-hero .eyebrow {
  background: rgba(255,255,255,0.18);
  color: white;
  border-color: rgba(255,255,255,0.25);
}
.studio-hero h1 { color: white; }
.studio-hero h1 span { color: #FFD91A; }
.studio-hero p.tagline {
  font-size: 1.3rem;
  color: white;
  font-weight: 700;
  margin-bottom: 8px;
}
.studio-hero p.sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  max-width: 56ch;
  margin-inline: auto;
}
.hero .studio-hero + * { /* spacing safety */ }

/* Apps grid — large cards, one per studio app */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
@media (max-width: 760px) { .apps-grid { grid-template-columns: 1fr; } }

.app-card {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  background: white;
  border-radius: var(--radius-xl);
  padding: 28px;
  border: 1px solid var(--lilac-border);
  box-shadow: 0 10px 24px var(--deep-shadow-soft);
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}
.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-1), var(--shadow-card-2);
}
.app-card-icon {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--brand);
}
.app-card-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-card-icon--ghost {
  display: grid;
  place-items: center;
  background: var(--lavender);
  border: 2px dashed var(--brand-light);
  font-size: 2rem;
  color: var(--brand-deep);
  box-shadow: none;
}
.app-card-body { flex: 1; min-width: 0; }
.app-card-body h3 {
  font-size: 1.4rem;
  margin-bottom: 4px;
  color: var(--ink);
}
.app-card-tagline {
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--brand-deep);
  font-size: .95rem;
}
.app-card-body p { margin: 0 0 14px; font-size: .98rem; }
.app-card-link {
  display: inline-block;
  font-weight: 800;
  color: var(--brand-deep);
  font-size: .95rem;
}
.app-card--placeholder {
  background: var(--lavender);
  border-style: dashed;
  cursor: default;
}
.app-card--placeholder:hover { transform: none; box-shadow: 0 10px 24px var(--deep-shadow-soft); }

/* Focus */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}
