@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --bg: #F5F1E8;
  --ink: #16212C;
  --muted: #5B6472;
  --primary: #1F6F63;
  --primary-dark: #123F38;
  --primary-light: #4FA593;
  --accent: #E0904A;
  --accent2: #C1573A;
  --rule: #CFC6B3;
  --card: #FFFFFF;
  --max: 720px;

  --shadow-sm: 0 2px 8px rgba(22,33,44,0.07);
  --shadow-md: 0 14px 34px -10px rgba(22,33,44,0.22);
  --shadow-lg: 0 30px 70px -16px rgba(22,33,44,0.30);
  --shadow-primary: 0 16px 36px -10px rgba(31,111,99,0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 27px, var(--rule) 28px);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

h1, h2, h3 { font-family: 'Fraunces', serif; font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; }
a { color: var(--primary); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; position: relative; }
.prose { max-width: var(--max); margin: 0 auto; padding: 0 24px; position: relative; }

/* ---------- Fixed, page-level floating 3D shapes ---------- */
.bg-blobs { position: fixed; inset: 0; pointer-events: none; }
.hero-blob {
  position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none;
  transform: translateZ(0); backface-visibility: hidden;
}
.hero-blob-1 {
  width: 420px; height: 420px; top: -10%; right: -8%;
  background: radial-gradient(circle, rgba(31,111,99,0.36) 0%, rgba(31,111,99,0.18) 45%, rgba(31,111,99,0) 75%);
  animation: float-a 10s ease-in-out infinite;
}
.hero-blob-2 {
  width: 380px; height: 380px; bottom: -12%; left: -8%;
  background: radial-gradient(circle, rgba(224,144,74,0.32) 0%, rgba(224,144,74,0.16) 45%, rgba(224,144,74,0) 75%);
  animation: float-b 13s ease-in-out infinite;
}
.hero-blob-3 {
  width: 260px; height: 260px; top: 42%; left: 4%;
  background: radial-gradient(circle, rgba(193,87,58,0.26) 0%, rgba(193,87,58,0.13) 45%, rgba(193,87,58,0) 75%);
  animation: float-a 8s ease-in-out infinite reverse;
}
@keyframes float-a { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(18px,-26px) scale(1.07); } }
@keyframes float-b { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-20px,22px) scale(1.06); } }

/* ---------- Nav ---------- */
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; max-width: 1080px; margin: 0 auto; flex-wrap: wrap; gap: 12px;
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 241, 232, 0.92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.logo { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.25rem; text-decoration: none; color: var(--ink); }
.logo span { color: var(--primary); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-links a { text-decoration: none; color: var(--ink); font-size: 0.95rem; font-weight: 500; transition: color 0.2s ease; }
.nav-links a:hover { color: var(--primary); }
.nav-cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff !important; padding: 9px 20px; border-radius: 999px; font-weight: 600 !important;
  box-shadow: var(--shadow-primary); transition: transform 0.2s ease, box-shadow 0.2s ease; display: inline-block;
}
.nav-cta:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 20px 40px -8px rgba(31,111,99,0.55); }

/* ---------- Hero ---------- */
.hero { padding: 70px 24px 60px; position: relative; perspective: 1000px; }
.hero-inner { max-width: 760px; margin: 0 auto; text-align: left; position: relative; z-index: 1; }
.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary); display: inline-block; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); max-width: 13ch; }
.hero h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--primary), var(--primary-light) 60%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.squiggle-wrap { display: inline-block; position: relative; }
.squiggle { position: absolute; left: 0; bottom: -6px; width: 100%; height: 16px; pointer-events: none; }
.squiggle-generic { position: absolute; left: 0; bottom: -4px; width: 100%; height: 12px; pointer-events: none; }
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; margin: 14px 0 22px; }

.btn {
  display: inline-block; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; text-decoration: none; padding: 14px 28px; border-radius: 8px;
  font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: transform 0.2s cubic-bezier(.2,.8,.3,1.3), box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 24px 44px -8px rgba(31,111,99,0.55); }
.btn:active { transform: translateY(0px) scale(0.98); }
.text-link {
  display: block; width: fit-content; margin: 14px 0 0; color: var(--muted); text-decoration: underline;
  text-decoration-color: var(--rule); text-underline-offset: 4px; font-size: 0.92rem; transition: color 0.2s ease;
}
.text-link:hover { color: var(--primary); }
.btn-outline {
  display: inline-block; background: rgba(255,255,255,0.6); color: var(--ink); text-decoration: none;
  padding: 13px 26px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; border: 1px solid var(--rule);
  margin-left: 12px; backdrop-filter: blur(6px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-outline:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ---------- Age tabs (own compact section) ---------- */
.age-section { padding: 24px 24px 40px; }
.age-tabs {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.age-tab {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; border: 1px solid var(--rule);
  background: rgba(255,255,255,0.5); border-radius: 999px; padding: 8px 16px; color: var(--muted);
  cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.age-tab:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.age-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.age-panel { margin-top: 14px; max-width: 46ch; min-height: 48px; }
.age-panel p { color: var(--muted); font-size: 0.95rem; margin: 0; animation: panel-in 0.35s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Sections ---------- */
section { padding: 70px 0; position: relative; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .eyebrow { margin-bottom: 10px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-head p { color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }

/* ---------- 3D tilt cards (frosted glass) ---------- */
.card {
  background: linear-gradient(155deg, rgba(255,255,255,0.68), rgba(251,249,244,0.68));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(207,198,179,0.7); border-radius: 12px;
  padding: 28px; text-decoration: none; color: var(--ink); display: block;
  box-shadow: var(--shadow-sm);
  transition: transform 0.5s cubic-bezier(.16,.84,.44,1), box-shadow 0.35s ease, border-color 0.35s ease;
  transform-style: preserve-3d; position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: 12px; opacity: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.55), transparent 60%);
  transition: opacity 0.3s ease; pointer-events: none;
}
.card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.card:hover::before { opacity: 1; }
.card .tag { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.card h3 { font-size: 1.15rem; margin: 10px 0 8px; }
.card p { color: var(--muted); font-size: 0.95rem; margin: 0; }

.divider { border: none; border-top: 1px solid var(--rule); margin: 0; }

/* ---------- Blog list ---------- */
.post-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 22px 20px; border-radius: 10px; text-decoration: none;
  color: var(--ink); gap: 24px; transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.post-row:hover { background: #fff; transform: translateX(4px); box-shadow: var(--shadow-sm); }
.post-row:hover .post-title { color: var(--primary); }
.post-title { font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.15rem; transition: color 0.2s ease; }
.post-meta { font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

/* ---------- Article ---------- */
.article-head { padding-top: 60px; padding-bottom: 20px; }
.article-head .eyebrow { margin-bottom: 16px; }
.article-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); max-width: 18ch; }
.article-meta { color: var(--muted); font-size: 0.9rem; margin-top: 14px; font-family: 'IBM Plex Mono', monospace; }
article.body { padding: 20px 0 60px; }
article.body p { margin: 0 0 22px; }
article.body h2 { font-size: 1.5rem; margin-top: 44px; }
article.body ul, article.body ol { margin: 0 0 22px; padding-left: 22px; }
article.body li { margin-bottom: 8px; }

/* ---------- Sticky-note callout ---------- */
.callout {
  background: #F7E9C6; border: none; padding: 20px 24px; border-radius: 4px; margin: 34px 12px; font-size: 0.98rem;
  box-shadow: 0 8px 18px -6px rgba(22,33,44,0.25), 0 2px 4px rgba(22,33,44,0.1);
  transform: rotate(-1.2deg); position: relative;
}
.callout::before {
  content: ""; position: absolute; top: -9px; left: 28px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent2); box-shadow: 0 3px 4px rgba(0,0,0,0.25);
}

/* ---------- About / trust box (frosted glass) ---------- */
.trust-box {
  background: linear-gradient(155deg, rgba(255,255,255,0.68), rgba(251,249,244,0.68));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(207,198,179,0.7); border-radius: 14px;
  padding: 32px; display: flex; gap: 24px; align-items: flex-start;
  box-shadow: var(--shadow-md); transition: transform 0.5s cubic-bezier(.16,.84,.44,1); transform-style: preserve-3d;
}
.trust-box .mark { font-family: 'Fraunces', serif; font-size: 2.2rem; color: var(--primary); font-style: italic; }

/* ---------- Footer ---------- */
footer { padding: 40px 24px; margin-top: 40px; }
.footer-inner { max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
footer p { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* ---------- Scroll-reveal (toggles both ways) ---------- */
.reveal { opacity: 0; transform: translateY(28px) rotateX(4deg); transition: opacity 0.8s cubic-bezier(.16,.84,.44,1), transform 0.8s cubic-bezier(.16,.84,.44,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0) rotateX(0); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-links { gap: 14px; font-size: 0.85rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .trust-box { flex-direction: column; }
  .btn-outline { margin-left: 0; margin-top: 10px; display: inline-block; }
  .hero-blob { filter: blur(36px); }
  .hero { padding: 50px 20px 36px; }
  .hero h1 { font-size: 28px; max-width: none; }
  .hero p.lede { margin: 10px 0 18px; font-size: 1.02rem; }
  .age-section { padding: 16px 20px 28px; }
  .age-tabs { gap: 8px; }
  .age-tab { flex: 1 1 calc(50% - 8px); text-align: center; padding: 9px 10px; font-size: 0.72rem; }
}

/* ---------- Universal search (home page only) ---------- */
.search-trigger {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--rule); background: #fff; cursor: pointer; color: var(--ink); flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.search-trigger:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px) rotate(-6deg); box-shadow: var(--shadow-sm); }
.search-overlay {
  position: fixed; inset: 0; background: rgba(22, 33, 44, 0.5); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; padding: 8vh 20px; z-index: 100;
}
.search-overlay.open { display: flex; }
.search-modal {
  background: var(--bg); border-radius: 14px; max-width: 620px; width: 100%; max-height: 78vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg);
}
.search-modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--rule); background: #fff; }
.search-modal-head input { flex: 1; border: none; background: transparent; font-family: 'Inter', sans-serif; font-size: 1.05rem; outline: none; color: var(--ink); }
.search-close-btn { border: none; background: transparent; font-size: 1.3rem; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px; }
.search-modal-body { overflow-y: auto; padding: 8px 0 20px; }
.search-result-row { display: flex; flex-direction: column; gap: 3px; padding: 14px 20px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); transition: background 0.2s ease; }
.search-result-row:hover { background: #fff; }
.search-result-tag { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.search-result-title { font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.02rem; }
.search-result-desc { color: var(--muted); font-size: 0.88rem; }
.search-empty { color: var(--muted); padding: 14px 20px; font-size: 0.92rem; margin: 0; }
.dict-card { padding: 14px 20px; border-top: 2px solid var(--rule); margin-top: 6px; }
.dict-word { font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 600; margin-top: 6px; }
.dict-pos { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.dict-def { margin: 8px 0 4px; font-size: 0.95rem; }
.dict-example { color: var(--muted); font-size: 0.88rem; font-style: italic; margin: 0; }
@media (max-width: 760px) { .search-overlay { padding: 4vh 12px; } }

/* ---------- Dictionary "hear pronunciation" button ---------- */
.hear-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; border: 1px solid var(--rule); background: #fff;
  border-radius: 999px; padding: 6px 14px; color: var(--ink); cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  vertical-align: middle; margin-left: 6px;
}
.hear-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.hear-btn.is-playing { border-color: var(--accent); box-shadow: 0 0 0 0 rgba(224,144,74,0.5); animation: hear-btn-pulse 0.9s ease-out infinite; }
@keyframes hear-btn-pulse { 0% { box-shadow: 0 0 0 0 rgba(224,144,74,0.5); } 100% { box-shadow: 0 0 0 14px rgba(224,144,74,0); } }

/* ---------- Printable download block (bottom of blog posts) ---------- */
.print-block {
  margin: 40px 0 10px; padding: 22px 24px; border: 1px solid rgba(207,198,179,0.7);
  border-radius: 12px; background: linear-gradient(155deg, rgba(255,255,255,0.68), rgba(251,249,244,0.68));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.print-block p { margin: 0 0 14px; color: var(--muted); font-size: 0.92rem; }
.print-links { display: flex; gap: 12px; flex-wrap: wrap; }
.print-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem;
  border: 1px solid var(--rule); background: #fff; border-radius: 8px;
  padding: 10px 16px; color: var(--ink); text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.print-link:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

/* ---------- Notebook status pill (age-tabs card) ---------- */
.notebook-pill {
  display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem;
  color: var(--primary); background: rgba(31,111,99,0.1); border: 1px solid rgba(31,111,99,0.25);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 14px; letter-spacing: 0.02em;
}

.why-split { padding-top: 100px; }
.why-badge-col { margin-bottom: 24px; }

@media (min-width: 900px) {
  .hero-split {
    display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: start;
    max-width: 1080px; margin: 0 auto; padding: 0 24px;
  }
  .hero-split .hero, .hero-split .age-section {
    padding-left: 0; padding-right: 0; max-width: none; margin: 0;
  }
  .hero-split .hero { padding-top: 70px; }
  .hero-split .age-section {
    margin-top: 70px; padding: 28px 28px 32px; background: #FFFFFF;
    border: 1px solid #E2E8F0; border-radius: 20px;
    box-shadow: var(--shadow-md);
  }
  .hero-split .age-tab:not(.is-active) { background: #F8FAFC; }
  .hero-split .age-panel { margin-top: 18px; max-width: none; }

  .why-split {
    display: grid; grid-template-columns: 0.8fr 1.5fr; gap: 48px; align-items: center;
  }
  .why-badge-col { display: flex; margin-bottom: 0; }
  .why-badge {
    font-family: 'Fraunces', serif; font-style: italic; font-size: 1.15rem; color: var(--primary-dark);
    background: linear-gradient(155deg, rgba(255,255,255,0.75), rgba(251,249,244,0.75));
    border: 1px solid rgba(207,198,179,0.7); border-radius: 16px; padding: 28px 24px;
    box-shadow: var(--shadow-sm); line-height: 1.5;
  }
  .why-content-col .section-head { max-width: none; }
}

/* ---------- Contact page form (moved off inline styles for strict CSP) ---------- */
.contact-lede { color: var(--muted); max-width: 46ch; margin-top: 14px; }
.section-pad-bottom { padding-bottom: 70px; }
.card-static { cursor: default; }
.card-flex-col { cursor: default; display: flex; flex-direction: column; }
.field-group { margin-bottom: 14px; }
.field-group-last { margin-bottom: 18px; }
.field-label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.field-input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--rule); border-radius: 3px;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; background: #fff;
}
.field-input-resize { resize: vertical; }
.mb-20 { margin-bottom: 20px; }
.btn-full { width: 100%; }
.email-code-box {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.95rem; background: #fff;
  border: 1px solid var(--rule); border-radius: 3px; padding: 12px 14px;
  margin-bottom: 20px; word-break: break-all;
}
.btn-outline-centered { text-align: center; margin-left: 0; margin-top: auto; }

/* ---------- Remaining inline-style replacements ---------- */
.article-body-tight { padding-top: 32px; }
.thanks-section { padding: 80px 24px; }
.thanks-lede { color: var(--muted); margin: 16px 0 30px; }
.nav-right-group { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.search-icon-muted { color: var(--muted); flex-shrink: 0; }
.section-head-tight { margin-bottom: 20px; }

/* ---------- Blog listing / resources inline-style replacements ---------- */
.pb-60 { padding-bottom: 60px; }
.opacity-muted-row { opacity: 0.55; }
.pt-0-pb-70 { padding-top: 0; padding-bottom: 70px; }
.mb-16 { margin-bottom: 16px; }

/* ---------- Reading level quiz ---------- */
.quiz-card {
  background: linear-gradient(155deg, rgba(255,255,255,0.75), rgba(251,249,244,0.75));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(207,198,179,0.7); border-radius: 16px;
  padding: 32px; box-shadow: var(--shadow-md); max-width: 640px;
  outline: none;
}
.quiz-progress-track {
  width: 100%; height: 6px; background: rgba(207,198,179,0.5); border-radius: 999px;
  overflow: hidden; margin-bottom: 18px;
}
.quiz-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px; transition: width 0.35s ease;
}
.quiz-step-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--primary); margin: 0 0 8px;
}
.quiz-question { font-size: 1.3rem; margin: 0 0 18px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  text-align: left; font-family: 'Inter', sans-serif; font-size: 0.98rem; color: var(--ink);
  background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 14px 18px;
  cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.quiz-option:hover { border-color: var(--primary); transform: translateX(3px); background: rgba(31,111,99,0.05); }
.quiz-result-tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); display: block; margin-bottom: 8px;
}
.quiz-result-desc { color: var(--muted); margin: 0 0 14px; line-height: 1.6; }
.quiz-result-rec { margin: 0 0 22px; line-height: 1.6; }
.quiz-result-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.quiz-retake {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
@media (max-width: 760px) {
  .quiz-card { padding: 24px 20px; }
  .quiz-question { font-size: 1.15rem; }
}

/* ---------- Listen to Article player ---------- */
.listen-player {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(155deg, rgba(255,255,255,0.7), rgba(251,249,244,0.7));
  border: 1px solid rgba(207,198,179,0.7); border-radius: 12px;
  padding: 14px 18px; margin: 20px 0 8px;
}
.listen-play-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.listen-play-btn:hover { transform: scale(1.06); }
.listen-play-btn:disabled { opacity: 0.6; cursor: wait; }
.listen-track { flex: 1 1 200px; min-width: 160px; }
.listen-seek {
  width: 100%; accent-color: var(--primary); cursor: pointer; height: 4px;
}
.listen-time {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--muted); margin-top: 4px;
}
.listen-speed {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; color: var(--ink);
  background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 8px;
  cursor: pointer; flex-shrink: 0;
}
.listen-status {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--muted);
  flex-basis: 100%; min-height: 14px;
}
@media (max-width: 500px) {
  .listen-player { padding: 12px 14px; }
}

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
  position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 200;
  max-width: 560px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 20px 22px;
  display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-banner p { margin: 0 0 14px; font-size: 0.92rem; color: var(--ink); line-height: 1.55; }
.cookie-banner a { text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-btn-accept {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  border: none; border-radius: 8px; padding: 10px 20px; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; font-family: 'Inter', sans-serif;
}
.cookie-btn-decline {
  background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: 8px;
  padding: 10px 20px; font-size: 0.9rem; cursor: pointer; font-family: 'Inter', sans-serif;
}
.cookie-btn-decline:hover { border-color: var(--primary); }
@media (max-width: 500px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; padding: 16px 18px; }
}

/* ---------- Footer (brand + newsletter + links, grid) ---------- */
footer { padding: 44px 24px 32px; margin-top: 40px; }
.footer-grid {
  display: grid; grid-template-columns: 1fr; gap: 32px; padding-bottom: 24px;
  border-bottom: 1px solid var(--rule); margin-bottom: 18px;
}
.footer-brand p { margin: 8px 0 0; }
.footer-newsletter-label { font-weight: 600; margin: 0 0 10px; font-size: 0.95rem; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-links a, .footer-link-btn {
  color: var(--muted); font-size: 0.85rem; text-decoration: underline;
  background: none; border: none; cursor: pointer; font-family: 'Inter', sans-serif; padding: 0;
}
.footer-links a:hover, .footer-link-btn:hover { color: var(--primary); }
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
}

/* ---------- Newsletter form (homepage) ---------- */
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; max-width: 420px; }
.newsletter-form input[type="email"] {
  flex: 1 1 220px;
  height: 48px; padding: 0 18px; line-height: 46px;
  border: 1px solid var(--rule); border-radius: 999px;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; background: #fff; color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(22,33,44,0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.newsletter-form input[type="email"]:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,111,99,0.15);
}
.newsletter-form input[type="email"]:invalid:not(:placeholder-shown) { border-color: var(--accent2); }
.newsletter-form button { flex-shrink: 0; height: 48px; }
.newsletter-form button:disabled { opacity: 0.6; cursor: wait; }
.newsletter-status { font-size: 0.82rem; margin: 8px 0 0; min-height: 18px; }
.newsletter-status.is-success { color: var(--primary); }
.newsletter-status.is-error { color: var(--accent2); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Homepage newsletter section ---------- */
.newsletter-section-card {
  background: linear-gradient(155deg, rgba(255,255,255,0.75), rgba(251,249,244,0.75));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(207,198,179,0.7); border-radius: 16px;
  padding: 36px; box-shadow: var(--shadow-md); max-width: 640px;
  margin-top: 30px;
}
.newsletter-section-card h2 { margin-bottom: 8px; }
.newsletter-section-card p.newsletter-sub { color: var(--muted); margin: 0 0 22px; }
.newsletter-section-card .newsletter-form { max-width: 460px; }

/* Below 500px: drop flex entirely for the form (block layout instead),
   so there's no flex-basis value left that could ever be misread as a
   height. This is the fix for the oval/blob input bug — the previous
   flex-based stacking approach kept leaving a numeric flex-basis in
   play that occasionally got applied along the wrong axis. */
@media (max-width: 500px) {
  .newsletter-section-card { padding: 26px 22px; }
  .newsletter-section-card .newsletter-form { display: block; max-width: none; }
  .newsletter-section-card .newsletter-form input[type="email"] {
    display: block; width: 100%; height: 50px; line-height: 48px; box-sizing: border-box;
  }
  .newsletter-section-card .newsletter-form button {
    display: block; width: 100%; height: 50px; margin-top: 10px;
  }
}
.pt-0 { padding-top: 0; }
