/* =====================================================================
   My HW — Brand System
   Friendly homework organiser for students, parents, teachers, tutors.
   Warm, energetic, organised, calm.
   ===================================================================== */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito+Sans:ital,opsz,wght@0,6..12,400;0,6..12,500;0,6..12,600;0,6..12,700;0,6..12,800&family=Fredoka:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

/* =====================================================================
   TOKENS
   ===================================================================== */
:root {
  /* Type families (swappable via data-font) */
  --font-display: 'Quicksand', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;

  /* Warm neutrals — never pure black/white */
  --ink:       oklch(0.29 0.015 60);
  --ink-soft:  oklch(0.44 0.013 60);
  --muted:     oklch(0.60 0.011 65);
  --faint:     oklch(0.72 0.008 70);
  --line:      oklch(0.92 0.008 75);
  --line-soft: oklch(0.955 0.006 80);
  --surface:   oklch(0.995 0.003 85);
  --bg:        oklch(0.984 0.006 80);

  /* Soft illustration palette — shared chroma/lightness, varied hue */
  --c-sun:   oklch(0.88 0.085 85);
  --c-mint:  oklch(0.86 0.075 165);
  --c-sky:   oklch(0.86 0.075 235);
  --c-lilac: oklch(0.85 0.075 300);
  --c-coral: oklch(0.85 0.085 30);
  --c-sun-ink:   oklch(0.55 0.12 75);
  --c-mint-ink:  oklch(0.55 0.10 165);
  --c-sky-ink:   oklch(0.55 0.11 240);
  --c-lilac-ink: oklch(0.52 0.11 300);
  --c-coral-ink: oklch(0.58 0.15 32);

  /* Radius scale (swappable via data-radius) */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Density spacing (swappable via data-density) */
  --section-y: 112px;
  --gap: 24px;

  /* Shadows — soft, no harsh edges */
  --shadow-sm: 0 2px 8px oklch(0.5 0.02 60 / 0.06), 0 1px 2px oklch(0.5 0.02 60 / 0.05);
  --shadow-md: 0 10px 30px oklch(0.45 0.03 50 / 0.08), 0 2px 8px oklch(0.45 0.03 50 / 0.05);
  --shadow-lg: 0 24px 60px oklch(0.45 0.04 45 / 0.12), 0 6px 18px oklch(0.45 0.03 50 / 0.07);

  --maxw: 1140px;
}

/* ---- Color directions ---- */
:root,
:root[data-theme="coral"] {
  --primary:        oklch(0.67 0.155 33);
  --primary-strong: oklch(0.60 0.175 33);
  --primary-ink:    oklch(0.45 0.16 33);
  --primary-soft:   oklch(0.94 0.045 40);
  --primary-softer: oklch(0.965 0.025 45);
  --on-primary:     oklch(0.99 0.01 40);
}
:root[data-theme="sky"] {
  --primary:        oklch(0.66 0.135 240);
  --primary-strong: oklch(0.58 0.145 245);
  --primary-ink:    oklch(0.46 0.14 245);
  --primary-soft:   oklch(0.945 0.04 235);
  --primary-softer: oklch(0.97 0.022 235);
  --on-primary:     oklch(0.99 0.01 235);
}
:root[data-theme="amber"] {
  --primary:        oklch(0.76 0.145 72);
  --primary-strong: oklch(0.68 0.155 65);
  --primary-ink:    oklch(0.50 0.12 62);
  --primary-soft:   oklch(0.95 0.05 82);
  --primary-softer: oklch(0.975 0.028 85);
  --on-primary:     oklch(0.27 0.04 70);
}

/* ---- Font directions ---- */
:root[data-font="quicksand"] { --font-display: 'Quicksand', system-ui, sans-serif; }
:root[data-font="fredoka"]   { --font-display: 'Fredoka', system-ui, sans-serif; }
:root[data-font="poppins"]   { --font-display: 'Poppins', system-ui, sans-serif; }
:root[data-font="nunito"]    { --font-display: 'Nunito', system-ui, sans-serif; }

/* ---- Radius directions ---- */
:root[data-radius="soft"] { --r-sm: 8px;  --r-md: 12px; --r-lg: 18px; --r-xl: 24px; }
:root[data-radius="round"]{ --r-sm: 12px; --r-md: 18px; --r-lg: 26px; --r-xl: 36px; }
:root[data-radius="extra"]{ --r-sm: 16px; --r-md: 24px; --r-lg: 34px; --r-xl: 46px; }

/* ---- Density directions ---- */
:root[data-density="compact"] { --section-y: 80px;  --gap: 18px; }
:root[data-density="regular"] { --section-y: 112px; --gap: 24px; }
:root[data-density="comfy"]   { --section-y: 144px; --gap: 32px; }

/* =====================================================================
   BASE
   ===================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* =====================================================================
   LAYOUT HELPERS
   ===================================================================== */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section-y) 0; }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px; border-radius: 2px;
  background: var(--primary);
}
.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-head .eyebrow::before { display: none; }
.section-head .eyebrow { padding: 6px 14px; background: var(--primary-soft); border-radius: var(--r-pill); }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.9rem); margin: 18px 0 0; }
.section-head p { margin-top: 16px; font-size: 1.12rem; color: var(--ink-soft); }
.lead { font-size: 1.18rem; color: var(--ink-soft); }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  padding: 15px 26px; border-radius: var(--r-pill);
  border: none; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 22px oklch(0.6 0.16 33 / 0.28); }
:root[data-theme="sky"]  .btn-primary { box-shadow: 0 8px 22px oklch(0.6 0.14 240 / 0.28); }
:root[data-theme="amber"].btn-primary { box-shadow: 0 8px 22px oklch(0.7 0.15 70 / 0.30); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--faint); }

/* App Store badge button */
.appstore {
  display: inline-flex; align-items: center; gap: 13px;
  background: var(--ink); color: oklch(0.99 0.005 80);
  padding: 12px 22px 12px 20px; border-radius: var(--r-md);
  transition: transform .15s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-md);
}
.appstore:hover { transform: translateY(-2px); }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore .sm { font-size: 0.72rem; line-height: 1; opacity: 0.8; font-family: var(--font-body); font-weight: 500; }
.appstore .lg { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; line-height: 1.15; }

/* =====================================================================
   CARDS
   ===================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* =====================================================================
   ILLUSTRATION PRIMITIVES
   ===================================================================== */
.illu { display: block; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  color: var(--ink);
}

/* Screenshot placeholder slot (for user's real Xcode screenshots) */
.shot-slot {
  position: relative;
  background:
    repeating-linear-gradient(135deg, var(--line-soft) 0 12px, var(--surface) 12px 24px);
  border: 1.5px dashed var(--faint);
  border-radius: var(--r-lg);
  display: grid; place-items: center;
  color: var(--muted);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.78rem; letter-spacing: 0.02em; text-align: center;
  padding: 16px;
}

/* =====================================================================
   FORMS
   ===================================================================== */
.field {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.input {
  flex: 1 1 240px; min-width: 0;
  font-family: var(--font-body); font-size: 1rem;
  padding: 15px 20px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input::placeholder { color: var(--faint); }

/* =====================================================================
   FOOTER
   ===================================================================== */
.footer { background: var(--surface); border-top: 1px solid var(--line); }

/* =====================================================================
   UTIL
   ===================================================================== */
.center { text-align: center; }
.muted { color: var(--muted); }
.soft { color: var(--ink-soft); }
@media (max-width: 720px) {
  body { font-size: 17px; }
  :root { --section-y: 72px; }
}
