/* Grandma Owl Education — site stylesheet
 * Palette matched to the subtraction-app warm theme (owl-mascot.svg source).
 */

:root {
  /* Palette — warm / earthy, matched to Offline Learning Apps */
  --cream:     #f6f1e7;
  --cream-2:   #efe7d6;
  --white:     #fffaf0;
  --ink:       #2c2418;
  --yellow:    #e8b04a;
  --orange:    #e07856;
  --amber:     #8c6f47;
  --peach:     #e8d6b3;
  --pink:      #e07856;
  --pink-soft: #f0a890;
  --lavender:  #ebe4ff;
  --purple:    #b39ef3;
  --indigo:    #2f8f87;
  --mint:      #def4f0;
  --sky:       #e3ebf9;
  --blue-soft: #d5dfff;
  --muted:     #5a4b35;
  --line:      #d8cdb6;
  --green:     #7a9e63;

  /* Type */
  --font-display: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-6: 24px; --s-8: 32px; --s-12: 48px; --s-16: 64px;
  --s-20: 80px; --s-24: 96px;

  /* Radius / shadows / motion */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 28px;
  --r-pill: 999px;
  --shadow-soft: 0 4px 14px rgba(60, 40, 10, 0.06);
  --shadow-card: 0 12px 30px rgba(60, 40, 10, 0.10);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.375rem; }

p { color: var(--ink); }
.lead { font-size: 1.125rem; line-height: 1.55; color: #2a323a; }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

/* FIX-H: Skip navigation — position:fixed + translateY(-100%) reliably hides above viewport */
.skip-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: 9999;
  background: var(--ink);
  color: var(--cream);
  padding: 14px 28px;
  border-radius: 0 0 var(--r-2) var(--r-2);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 120ms ease;
  white-space: nowrap;
}
.skip-nav:focus {
  transform: translateX(-50%) translateY(0);
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  color: var(--cream);
  text-decoration: none;
}

/* Keyboard focus — visible, branded outline on every interactive element */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 4px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: var(--s-3);
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--s-6);
}

.section {
  padding-block: var(--s-24);
}

.section-tight { padding-block: var(--s-16); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px 26px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 180ms var(--ease-out), background 180ms, box-shadow 180ms;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--ink);
  color: var(--cream);
}
.btn-primary:hover { background: #1a232c; box-shadow: var(--shadow-soft); }

.btn-yellow {
  background: var(--yellow);
  color: var(--ink);
}
.btn-yellow:hover { background: var(--orange); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--cream); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 226, 0.9);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--s-3);
}

/* FIX-D: min-height 44px so brand link meets tap-target standard */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px;
  background: transparent;
  display: inline-grid; place-items: center;
}
.brand-mark svg { width: 38px; height: 38px; }

.nav { display: flex; align-items: center; gap: var(--s-6); }
.nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  /* FIX-D: min-height makes nav links ≥44px tap targets without altering visual spacing */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}
.nav a:hover { color: var(--indigo); text-decoration: none; }
.nav .btn { padding: 10px 18px; font-size: 0.9375rem; }

.menu-toggle { display: none; }

/* Hero */
.hero {
  padding-top: var(--s-20);
  padding-bottom: var(--s-24);
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-12);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  margin-bottom: var(--s-4);
}
/* FIX-A: amber (#9F6000) = 4.77:1 on cream — orange (#fea419) = 1.88:1 (fails WCAG even for large text) */
.hero h1 .accent { color: var(--amber); }
.hero .lead { font-size: 1.25rem; max-width: 36ch; color: #2a323a; margin-bottom: var(--s-8); }
.hero-ctas { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.hero-microcopy { color: var(--muted); font-size: 0.875rem; margin-top: var(--s-4); }

.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}
.hero-art .blob {
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side, #e8d6b3, transparent 70%);
  border-radius: 50%;
}
.hero-art svg { position: relative; width: 100%; height: 100%; }

/* Pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}
.pillar {
  padding: var(--s-8);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  position: relative;
  transition: transform 200ms var(--ease-out), box-shadow 200ms;
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.pillar-1 { background: var(--lavender); }
.pillar-2 { background: var(--mint); }
.pillar-3 { background: var(--peach); }
.pillar-icon {
  width: 56px; height: 56px;
  display: inline-grid; place-items: center;
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  margin-bottom: var(--s-2);
}
.pillar-icon svg { width: 32px; height: 32px; }
.pillar h3 { font-size: 1.5rem; }
.pillar p { color: #2a323a; }
/* FIX-D: padding expands tap target to ≥44px */
.pillar a {
  align-self: flex-start;
  margin-top: auto;
  padding: 12px 0 4px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
}
.pillar a:hover { color: var(--indigo); text-decoration: none; }
.pillar a::after { content: '→'; transition: transform 180ms var(--ease-out); }
.pillar a:hover::after { transform: translateX(4px); }

/* Featured release */
.featured {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-12);
  align-items: center;
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--s-12);
  box-shadow: var(--shadow-soft);
}
.featured-cover {
  aspect-ratio: 2 / 3;
  max-width: 200px;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  padding: var(--s-6);
  box-shadow: var(--shadow-card);
}

.featured-ctas { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-6); }

/* Books grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s-8);
}

.book {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.book-cover {
  display: block;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--lavender);
  aspect-ratio: 2 / 3;
  max-width: 200px;
  transition: transform 200ms var(--ease-out);
}
.book-cover:hover { transform: translateY(-4px); }
.book-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.book-meta { display: flex; flex-direction: column; gap: var(--s-3); }
.book-meta h3 { font-size: 1.25rem; line-height: 1.25; }
.book-meta p { color: #2a323a; font-size: 0.95rem; line-height: 1.55; }
.book-ctas { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-2); }
.book-ctas .btn { padding: 10px 20px; font-size: 0.9375rem; }

.age-pill {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--peach);
  padding: 4px 12px;
  border-radius: var(--r-pill);
}

/* Featured book on homepage uses real cover image now */
.featured-cover {
  overflow: hidden;
  padding: 0;
  background: var(--lavender);
}
.featured-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Printables */
.printable-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}
.printable {
  background: var(--white);
  border-radius: var(--r-md);
  padding: var(--s-6);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: transform 200ms var(--ease-out), box-shadow 200ms;
}
.printable:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.printable-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--indigo);
  background: var(--lavender);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
/* FIX-B: display:block + padding raises tap target from 27px to ≥44px */
.printable h3 { font-size: 1.125rem; }
.printable a {
  margin-top: auto;
  font-weight: 600;
  color: var(--ink);
  display: block;
  padding: 12px 0 4px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.printable a:hover { color: var(--indigo); text-decoration: none; }

/* Trust row */
.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}
.trust {
  background: var(--white);
  padding: var(--s-8);
  border-radius: var(--r-md);
  border-left: 4px solid var(--orange);
}
.trust p {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: var(--s-4);
}
.trust cite {
  font-style: normal;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

/* Newsletter band */
.cta-band {
  background: var(--ink);
  color: var(--cream);
  padding-block: var(--s-16);
  border-radius: 0;
}
.cta-band .container { text-align: center; }
.cta-band .eyebrow { color: var(--yellow); }
.cta-band h2 { color: var(--cream); margin-bottom: var(--s-3); }
.cta-band p { color: rgba(255, 248, 226, 0.85); max-width: 56ch; margin-inline: auto; margin-bottom: var(--s-6); }
.cta-band .microcopy { font-size: 0.8125rem; color: rgba(255, 248, 226, 0.65); margin-top: var(--s-3); }

/* Footer */
.site-footer {
  background: var(--cream);
  border-top: 1px solid var(--line);
  padding-block: var(--s-12) var(--s-6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-8);
  margin-bottom: var(--s-8);
}
/* FIX-E: h4 → h2.footer-col-heading to avoid heading level skip; styled identically */
.footer-grid h4,
.footer-col-heading {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: var(--s-3);
}
/* FIX-C: footer links need ≥44px tap target; display:block + padding achieves this */
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 0; }
.footer-grid a {
  color: var(--ink);
  font-size: 0.95rem;
  display: block;
  padding: 8px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.footer-grid a:hover { color: var(--indigo); text-decoration: none; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.social { display: flex; gap: var(--s-3); }
.social a {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  background: var(--white);
  border-radius: 50%;
  color: var(--ink);
}
.social a:hover { background: var(--yellow); text-decoration: none; }
.social svg { width: 18px; height: 18px; }

/* Responsive */
@media (max-width: 900px) {
  .hero { padding-top: var(--s-12); padding-bottom: var(--s-16); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-8); }
  .hero-art { order: -1; max-width: 320px; }
  .pillars { grid-template-columns: 1fr; }
  .featured { grid-template-columns: 1fr; padding: var(--s-8); gap: var(--s-6); }
  .featured-cover { max-width: 280px; margin-inline: auto; }
  .printable-grid { grid-template-columns: 1fr; }
  .trust-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding-block: var(--s-16); }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    flex-direction: column;
    padding: var(--s-4);
    border-bottom: 1px solid var(--line);
    gap: var(--s-3);
  }
  .menu-toggle {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ink);
  }
  .nav.open a:not(.btn) {
    padding: 12px 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
