/* Family Companion — styles */

@font-face {
  font-family: 'TheSeasons';
  src: url('assets/TheSeasons-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #0e1a7a;
  --navy-deep: #0a1356;
  --gold: #d6a758;
  --gold-soft: #f5e8cc;
  --cream: #faf8f4;
  --ink: #1b1d2e;
  --ink-soft: #4a4d60;
  --ink-muted: #8a8d9f;
  --rule: #E8E2D5;
  --serif: 'TheSeasons', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, 'SF Pro', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; padding: 0; font-family: var(--sans); background: #efeadf; }

.app-root {
  width: 100%; height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  overflow: hidden;
  position: relative;
}

/* subtle warm grain */
.grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.2  0 0 0 0 0.1  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.035; mix-blend-mode: multiply; z-index: 1;
}

.scroll { height: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; position: relative; z-index: 2; }
.scroll::-webkit-scrollbar { display: none; }

/* Header — brand */
.brand-head {
  padding: 68px 22px 8px;
  display: flex; align-items: center; gap: 10px;
}
.brand-mark {
  width: 22px; height: 22px;
}
.brand-text { line-height: 1; }
.brand-name {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 3px;
}

/* Greeting */
.greeting {
  padding: 8px 22px 20px;
}
.greeting-serif {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.08;
  color: var(--navy);
  letter-spacing: -0.01em;
  font-weight: 400;
  text-wrap: pretty;
}
.greeting-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 10px;
  line-height: 1.5;
  max-width: 28ch;
}

/* Search — the prominent surface */
.search-surface {
  margin: 4px 18px 22px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 16px 18px 14px;
  box-shadow: 0 8px 24px rgba(14, 26, 122, 0.06);
  cursor: text;
  position: relative;
}
.search-surface:active { transform: translateY(1px); }
.search-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  font-weight: 600;
}
.search-prompt {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.2;
  color: var(--navy);
  letter-spacing: -0.005em;
}
.search-prompt .cursor {
  display: inline-block; width: 2px; height: 22px;
  background: var(--gold); vertical-align: -3px; margin-left: 2px;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Age chip row */
.age-row {
  display: flex; gap: 8px; padding: 0 18px 22px; overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.age-row::-webkit-scrollbar { display: none; }
.age-chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  scroll-snap-align: start;
  white-space: nowrap;
}
.age-chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.age-chip-range {
  font-size: 11px;
  color: var(--ink-muted);
  margin-left: 6px;
  font-weight: 400;
}
.age-chip.active .age-chip-range { color: rgba(255,255,255,0.7); }

/* Section label */
.section-label {
  padding: 0 22px 14px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.section-eyebrow {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.section-count {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-style: italic;
}

/* Entry point cards */
.ep-stack {
  padding: 0 18px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.ep-card {
  background: var(--tint, #EADFC7);
  border-radius: 20px;
  padding: 22px 22px 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid rgba(0,0,0,0.04);
}
.ep-card:active { transform: scale(0.985); }
.ep-card-mark {
  position: absolute;
  top: 20px; right: 20px;
  opacity: 0.95;
}
.ep-card-mark .bead-bar {
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}
.ep-card-kicker {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent, #7A5A1E);
  opacity: 0.75;
  font-weight: 600;
  margin-bottom: 10px;
}
.ep-card-title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.18;
  color: var(--accent, #7A5A1E);
  letter-spacing: -0.008em;
  max-width: 18ch;
  text-wrap: balance;
}
.ep-card-blurb {
  font-size: 13px;
  color: var(--accent, #7A5A1E);
  opacity: 0.72;
  margin-top: 10px;
  line-height: 1.5;
  max-width: 32ch;
}
.ep-card-arrow {
  margin-top: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--accent, #7A5A1E);
  font-weight: 600;
  text-transform: uppercase;
}

/* Extras section */
.extras {
  padding: 0 18px 28px;
  display: flex; flex-direction: column; gap: 8px;
}
.extra-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
}
.extra-title {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--navy);
  line-height: 1.2;
}
.extra-blurb {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.5;
}

/* Footer mark */
.foot-mark {
  padding: 28px 22px 100px;
  text-align: center;
}
.foot-mark-line {
  width: 32px; height: 1px; background: var(--rule);
  margin: 0 auto 14px;
}
.foot-mark-serif {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-muted);
  text-wrap: pretty;
  max-width: 28ch;
  margin: 0 auto;
  line-height: 1.5;
}

/* ============ ENTRY POINT SCREEN ============ */
.ep-hero {
  padding: 20px 24px 28px;
  background: var(--tint);
  position: relative;
  overflow: hidden;
}
.ep-hero-kicker {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
  font-weight: 600;
  margin-bottom: 16px;
}
.ep-hero-title {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.08;
  color: var(--accent);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.ep-hero-blurb {
  font-size: 14px;
  color: var(--accent);
  opacity: 0.75;
  margin-top: 12px;
  line-height: 1.5;
  max-width: 34ch;
}
.ep-hero-age {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--accent);
  opacity: 0.85;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(0,0,0,0.06);
}
.ep-hero-age-change {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 500;
}

.topics-list {
  padding: 22px 18px 100px;
  display: flex; flex-direction: column; gap: 10px;
}
.topic-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.topic-card:active { transform: scale(0.99); }
.topic-headline {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.25;
  color: var(--navy);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.topic-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.topic-meta .dot { width: 3px; height: 3px; border-radius: 999px; background: currentColor; }
.topic-card.stub {
  opacity: 0.55; background: transparent; border-style: dashed;
}
.topic-card.stub .topic-headline {
  font-style: italic; color: var(--ink-muted); font-size: 15px;
}

/* ============ ARTICLE SCREEN ============ */
.article-scroll {
  padding: 0;
}
.article-kicker-band {
  padding: 22px 24px 18px;
  background: var(--tint);
}
.article-kicker {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.8;
  font-weight: 600;
  margin-bottom: 10px;
}
.article-kicker-age {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.6;
  font-weight: 500;
  margin-bottom: 0;
}
.article-kicker-row {
  display: flex; gap: 10px; align-items: center; margin-bottom: 10px;
}
.article-kicker-sep { width: 12px; height: 1px; background: currentColor; opacity: 0.5; }

.article-headline {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.12;
  color: var(--navy);
  letter-spacing: -0.01em;
  padding: 0 24px;
  margin-top: 26px;
  text-wrap: balance;
}
.article-body {
  padding: 0 24px;
  margin-top: 22px;
}
.article-body p {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 18px;
  text-wrap: pretty;
  letter-spacing: -0.003em;
}
.article-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 46px;
  line-height: 0.9;
  float: left;
  padding: 6px 10px 0 0;
  color: var(--gold);
  font-weight: 400;
}

.article-block {
  margin: 28px 18px 0;
  padding: 22px 22px 24px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--rule);
}
.article-block.gold {
  background: var(--gold-soft);
  border-color: rgba(214, 167, 88, 0.35);
}
.article-block.navy {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.article-block-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
}
.article-block.navy .article-block-label { color: var(--gold); }
.article-block-title {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 14px;
  line-height: 1.2;
}
.article-block.navy .article-block-title { color: #fff; }

.try-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.try-list li {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  font-family: var(--sans);
}
.try-list li .mark {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 12px;
  margin-top: 2px;
}

.ask-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.ask-list li {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.4;
  color: rgba(255,255,255,0.95);
  padding-left: 22px;
  position: relative;
  text-wrap: pretty;
}
.ask-list li::before {
  content: '"';
  position: absolute;
  left: 0; top: -6px;
  font-size: 28px;
  color: var(--gold);
  font-family: var(--serif);
}

.hear-more {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0 2px;
}
.hear-play {
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.hear-meta-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  line-height: 1.3;
}
.hear-meta-sub {
  font-size: 12px; color: var(--ink-muted);
  margin-top: 3px;
}

.related-list {
  padding: 0; margin: 0; list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.related-row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  cursor: pointer;
}
.related-row:first-child { border-top: 0; padding-top: 0; }
.related-swatch {
  width: 36px; height: 36px; border-radius: 8px;
  flex: 0 0 auto;
}
.related-meta-k {
  font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 2px;
}
.related-meta-t {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--navy);
  line-height: 1.25;
  text-wrap: balance;
}

.article-foot {
  height: 120px;
}

/* ============ NAV / BACK BUTTON ============ */
.topnav {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 58px 16px 0;
  pointer-events: none;
}
.topnav > * { pointer-events: auto; }
.nav-pill {
  height: 38px; min-width: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 0.5px solid rgba(0,0,0,0.06);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  color: var(--navy);
}
.nav-pill-dark {
  background: rgba(14,26,122,0.3);
  color: #fff;
}

/* ============ SEARCH OVERLAY ============ */
.search-overlay {
  position: absolute; inset: 0;
  background: var(--cream);
  z-index: 40;
  display: flex; flex-direction: column;
  animation: slideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.search-overlay-head {
  padding: 54px 20px 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.search-overlay-close {
  font-size: 14px; color: var(--navy); font-weight: 500;
  cursor: pointer; padding: 4px 2px;
}
.search-overlay-body { flex: 1; overflow-y: auto; padding: 8px 22px 20px; }
.search-overlay-prompt {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.12;
  color: var(--navy);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.search-input {
  width: 100%;
  border: 0; outline: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--navy);
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.2;
}
.search-input::placeholder { color: var(--ink-muted); font-style: italic; }

.search-examples {
  margin-top: 18px;
}
.search-examples-label {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 10px;
}
.search-example {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1.4;
  display: flex; gap: 10px; align-items: flex-start;
}
.search-example-mark {
  color: var(--gold);
  flex: 0 0 auto;
  font-size: 12px;
  margin-top: 4px;
}

/* AI response */
.ai-response {
  margin-top: 24px;
  padding: 22px 22px 24px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 18px;
}
.ai-response-label {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 12px;
  display: flex; gap: 8px; align-items: center;
}
.ai-response-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
}
.ai-response-body p { margin: 0 0 12px; }
.ai-suggest-label {
  margin-top: 20px;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 600; margin-bottom: 8px;
}
.ai-suggest-row {
  display: flex; flex-direction: column; gap: 8px;
}
.ai-suggest-chip {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex; gap: 10px; align-items: center;
}
.ai-suggest-swatch {
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto;
}
.ai-suggest-text {
  font-size: 13px; color: var(--navy);
  font-family: var(--serif);
  line-height: 1.3;
}

.ai-thinking {
  display: flex; gap: 6px; padding: 12px 0;
}
.ai-thinking span {
  width: 7px; height: 7px; border-radius: 999px; background: var(--gold);
  animation: bounce 1s infinite ease-in-out;
}
.ai-thinking span:nth-child(2) { animation-delay: 0.15s; }
.ai-thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* ============ TWEAKS PANEL ============ */
.tweaks-panel {
  position: fixed;
  right: 16px; bottom: 16px;
  width: 280px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--rule);
  box-shadow: 0 20px 50px rgba(14, 26, 122, 0.15);
  z-index: 1000;
  padding: 14px 16px 16px;
  font-family: var(--sans);
}
.tweaks-panel h4 {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--navy);
  margin: 0 0 10px;
  font-weight: 400;
}
.tweak-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink);
}
.tweak-row:first-of-type { border-top: 0; }
.tweak-row select, .tweak-row input[type="checkbox"] {
  font-size: 12px; font-family: inherit;
}

/* root device wrapper */
.device-wrap {
  width: 100%; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 800px at 50% 30%, #ece3d2 0%, #d8cdb7 100%);
  padding: 20px;
  overflow: auto;
}
@media (max-width: 500px) {
  .device-wrap { padding: 0; background: var(--cream); }
}
