/* Sunhouse website. One stylesheet, no build step.
   Design: Figma 69rXH7ZeXdasRDAls3gwiJ, page "Web · sunhousehomeschool.com" (1303:2):
   Home 1305:2 / 1307:2, Guide 1306:2 / 1307:67, Document template 1306:100.
   Tokens: Figma collection "Web" (light / dark). --ink-faint is darkened in
   light mode from #8a867c to the app's AA value #6b6860 (Tokens.swift
   inkMuteLight, MLD-27): #8a867c is 3.0:1 on the canvas and it carries text. */

@font-face {
  font-family: "Young Serif";
  src: url("/fonts/YoungSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --canvas: #eeeade;
  --sidebar: #f6f3ea;
  --card: #ffffff;
  --ink: #2b2a26;
  --ink-mute: #5c5a52;
  --ink-faint: #6b6860;
  --gold: #e0a64a;
  --on-gold: #2b2a26;
  --rule: #e3ded0;
  --selected: #e7e1d2;
  --focus: #2b2a26;      /* light: ink; gold is 1.8:1 on the canvas */

  --font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;

  /* Type scale (px values from the Figma frames) */
  --t-kicker: 12px;
  --t-small: 13px;
  --t-nav: 15px;
  --t-body: 17px;
  --t-lede: 19px;
  --t-h2: 22px;
  --t-section: 28px;
  --t-h1: 40px;
  --t-hero: 56px;

  --sidebar-w: 260px;
  --aside-w: 300px;
  --read-w: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #1f1e1b;
    --sidebar: #262521;
    --card: #2c2b27;
    --ink: #f1ebdd;
    --ink-mute: #c9c2b2;
    --ink-faint: #9a9488;
    --gold: #e0a64a;
    --on-gold: #2c2b4a;
    --rule: #3a3833;
    --selected: #34322d;
    --focus: #e0a64a;    /* dark: gold, 7.9:1 on #1f1e1b */
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.5;
}

a { color: inherit; }
a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
img { max-width: 100%; }

.skip {
  position: absolute; left: 8px; top: -60px;
  background: var(--ink); color: var(--canvas);
  padding: 8px 14px; border-radius: 999px; z-index: 10;
  text-decoration: none; font-size: var(--t-nav);
}
.skip:focus { top: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Brand row ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-size: 19px; line-height: 1;
}
.brand__mark { width: 20px; height: 20px; flex: none; }

/* ---------- Layout ---------- */
.layout { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--sidebar);
  border-bottom: 1px solid var(--rule);
}
.topbar__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
}

/* Mobile menu: a <details> drawer, no script */
.menu > summary {
  list-style: none; cursor: pointer;
  width: 44px; height: 44px; margin: -10px -10px -10px 0;
  display: grid; place-items: center; color: var(--ink);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu__icon { width: 22px; height: 22px; }
.menu__sheet {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--sidebar); border-bottom: 1px solid var(--rule);
  padding: 8px 12px 20px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* Guide section chips (mobile) */
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 0 20px 12px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; font-size: var(--t-small); text-decoration: none;
  color: var(--ink); background: var(--canvas);
  border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px;
}
.chip[aria-current="true"] { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

.main { padding: 20px 20px 48px; min-width: 0; overflow-wrap: break-word; }
.main a[href^="mailto:"] { overflow-wrap: anywhere; }

/* Nav rows (sidebar and mobile sheet) */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__row {
  display: block; font-size: var(--t-nav); text-decoration: none;
  color: var(--ink); padding: 6px 8px; border-radius: 6px;
}
.nav__row:hover { background: var(--selected); }
.nav__row[aria-current="page"] { background: var(--selected); }
.nav__sections { padding: 6px 0 8px 8px; }
.nav__label {
  margin: 4px 0 4px; font-size: var(--t-kicker); font-weight: 600; color: var(--ink-faint);
}
.nav__section {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--t-small); color: var(--ink-mute); text-decoration: none;
  padding: 3px 0;
}
.nav__section::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--rule); flex: none;
}
.nav__section[aria-current="true"] { color: var(--ink); }
.nav__section[aria-current="true"]::before { background: var(--gold); }

/* Pills */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 11px 22px; border-radius: 999px;
  font-size: var(--t-nav); font-weight: 500; line-height: 1.2;
  text-decoration: none; border: 1px solid var(--ink);
}
.pill--filled { background: var(--ink); color: var(--canvas); }
.pill--outline { background: transparent; color: var(--ink); }
.pill--store { background: var(--ink); color: var(--canvas); }
.pills { display: flex; flex-direction: column; gap: 12px; margin: 24px 0 8px; }
.pills .pill { padding: 13px 22px; font-size: 16px; }

.sidebar__platforms { margin: 8px 0 0; font-size: var(--t-kicker); color: var(--ink-faint); }

/* Footer (mobile) */
.footer {
  padding: 20px 20px 32px; border-top: 1px solid var(--rule);
}
.footer__links { margin: 0 0 6px; font-size: var(--t-small); color: var(--ink-mute); }
.footer__links a { color: var(--ink-mute); text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }
.footer__copy { margin: 0; font-size: var(--t-kicker); color: var(--ink-faint); }

/* ---------- Sun arc ---------- */
.arc { display: block; width: 100%; height: auto; margin: 28px 0 8px; color: var(--rule); }

/* ---------- Screenshot frames ---------- */
.shots { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 16px; margin: 20px 0 0; }
.shot {
  margin: 0; background: var(--card); border: 1px solid var(--rule);
  overflow: hidden; flex: none; max-width: 100%;
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot--iphone { width: 212px; aspect-ratio: 230 / 500; border-radius: 30px; }
.shot--ipad   { width: 560px; aspect-ratio: 560 / 420; border-radius: 18px; }
.shot--mac    { width: 560px; aspect-ratio: 560 / 350; border-radius: 12px; }
.shot--watch  { width: 148px; aspect-ratio: 160 / 195; border-radius: 34px; }

/* ---------- Home ---------- */
.kicker { margin: 0 0 8px; font-size: var(--t-kicker); font-weight: 600; color: var(--ink-faint); }
.hero__title {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: 36px; line-height: 40px; max-width: 720px;
}
.hero__lede { margin: 14px 0 0; font-size: 16px; line-height: 24px; color: var(--ink-mute); max-width: 640px; }
.hero__note { margin: 10px 0 0; font-size: var(--t-small); line-height: 19px; color: var(--ink-faint); max-width: 640px; }
.hero__shots { display: flex; justify-content: center; align-items: flex-end; gap: 24px; }
.hero__shots .shot--mac { display: none; width: 560px; }
.hero__shots .shot--iphone { width: 161px; border-radius: 26px; }

.label { margin: 40px 0 4px; font-size: var(--t-kicker); font-weight: 600; color: var(--ink-faint); }
.features { list-style: none; margin: 0; padding: 0; }
.feature {
  display: grid; grid-template-columns: 22px 1fr; gap: 0 16px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.feature__dot { width: 22px; height: 22px; border-radius: 50%; border: 1.4px solid var(--ink-faint); }
.feature__title { margin: 0; font-size: 15px; font-weight: 500; line-height: 20px; }
.feature__sub { margin: 2px 0 0; font-size: var(--t-small); line-height: 18px; color: var(--ink-mute); }
.feature__thumb { display: none; }
.price { margin: 28px 0 0; font-size: 15px; line-height: 22px; color: var(--ink-mute); max-width: 640px; }
.price strong { color: var(--ink); font-weight: 500; }

/* "Families ask" aside */
.ask { padding: 32px 20px; border-top: 1px solid var(--rule); background: var(--sidebar); }
.ask__title {
  margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 20px;
  display: inline-flex; align-items: flex-start; gap: 4px;
}
.ask__title::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-top: 2px; }
.ask__item { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.ask__q { margin: 0; font-size: 15px; font-weight: 500; }
.ask__a { margin: 4px 0 0; font-size: var(--t-small); line-height: 18px; color: var(--ink-mute); }
.ask__more { display: inline-block; margin-top: 16px; font-size: var(--t-small); font-weight: 500; text-decoration: none; }
.ask__more:hover { text-decoration: underline; }

/* ---------- Guide ---------- */
.page-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.15; overflow-wrap: break-word; }
.page-sub { margin: 6px 0 0; font-size: 15px; color: var(--ink-faint); }
.gsection { padding: 32px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 120px; }
.gsection__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; }
.gsection__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.2; }
.platforms { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.platform {
  font-size: var(--t-kicker); color: var(--ink-mute);
  border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px;
}
.gsection p { margin: 0 0 8px; font-size: 16px; line-height: 24px; color: var(--ink-mute); max-width: 680px; }

/* ---------- Document template (FAQ, Support, Privacy, Terms, Help) ---------- */
.doc { max-width: var(--read-w); }
.doc .page-title { margin-bottom: 0; }
.group-label { margin: 28px 0 6px; font-size: var(--t-kicker); font-weight: 600; color: var(--ink-faint); }
.card {
  background: var(--sidebar); border: 1px solid var(--rule); border-radius: 12px;
  padding: 0 20px;
}
.card > * + * { border-top: 1px solid var(--rule); }
.card__row { padding: 12px 0; }
.card__row p { margin: 4px 0 0; font-size: 15px; line-height: 22px; color: var(--ink-mute); }
.card__row h3 { margin: 0; font-size: 15px; font-weight: 500; }
.card ul { margin: 0; padding: 12px 0 12px 18px; }
.card li { font-size: var(--t-body); line-height: 26px; color: var(--ink); }

.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; font-size: 15px; font-weight: 500; min-height: 44px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "\203A"; transform: rotate(90deg); color: var(--ink-faint); flex: none; transition: transform .15s; }
.faq[open] summary::after { transform: rotate(-90deg); }
.faq__a { margin: 0 0 14px; font-size: 15px; line-height: 22px; color: var(--ink-mute); }
.faq__a p { margin: 0 0 8px; }

.legal h2 { margin: 36px 0 8px; font-family: var(--font-display); font-weight: 400; font-size: var(--t-h2); line-height: 1.25; }
.legal h2.group-label {
  margin: 28px 0 6px; font-family: var(--font-body); font-size: var(--t-kicker);
  font-weight: 600; line-height: 1.5; color: var(--ink-faint);
}
.legal h3 { margin: 20px 0 6px; font-size: var(--t-body); font-weight: 600; }
.legal p, .legal li { font-size: var(--t-body); line-height: 26px; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal .updated { margin: 6px 0 0; font-size: 15px; color: var(--ink-faint); }
.legal .note { font-size: 15px; color: var(--ink-faint); }

.table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 15px; line-height: 22px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
.table th { font-size: var(--t-small); font-weight: 600; color: var(--ink-faint); }
.table td:last-child { color: var(--ink-mute); }
.table td { overflow-wrap: anywhere; }
code { font-size: 0.9em; overflow-wrap: anywhere; }

.prose p { margin: 0 0 12px; font-size: var(--t-body); line-height: 26px; }
.prose h2 { margin: 32px 0 8px; font-family: var(--font-display); font-weight: 400; font-size: var(--t-h2); }
.prose ol, .prose ul { margin: 0 0 12px; padding-left: 22px; }
.prose li { font-size: var(--t-body); line-height: 26px; }
.prose a, .legal a, .faq__a a, .card a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 2px; }

.related { margin: 32px 0 0; font-size: 15px; color: var(--ink-mute); }

/* Open-in-app and 404 pages */
.center { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.center p { color: var(--ink-mute); }

/* ---------- Desktop (like the Mac app) ---------- */
@media (min-width: 1024px) {
  .topbar, .footer, .chips { display: none; }
  .layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; grid-row: span 2; align-self: start;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--sidebar); border-right: 1px solid var(--rule);
    padding: 28px 12px;
  }
  .sidebar .brand { padding: 0 8px 20px; }
  .sidebar__foot { margin-top: auto; padding: 24px 8px 0; }
  .main { padding: 64px 48px 96px; }

  .hero__title { font-size: 56px; line-height: 62px; }
  .hero__lede { font-size: var(--t-lede); line-height: 28px; }
  .pills { flex-direction: row; gap: 10px; }
  .pills .pill { padding: 11px 22px; font-size: var(--t-nav); }
  .hero__shots { justify-content: flex-start; }
  .hero__shots .shot--mac { display: block; flex: 0 1 560px; }
  .feature { grid-template-columns: 22px 1fr 120px; gap: 0 18px; padding: 18px 0; }
  .feature__title { font-size: var(--t-body); }
  .feature__sub { font-size: 15px; line-height: 21px; }
  .feature__thumb {
    display: block; width: 120px; height: 76px; border-radius: 8px;
    background: var(--card); border: 1px solid var(--rule); overflow: hidden;
  }
  .feature__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

  .ask { grid-column: 2; border-top: 0; background: transparent; padding: 0 48px 64px; }
  .page-title { font-size: var(--t-h1); }
  .gsection { padding: 40px 0; scroll-margin-top: 24px; }
  .gsection__title { font-size: var(--t-section); }
  .gsection p { font-size: var(--t-body); line-height: 25px; }
  .shots { justify-content: flex-start; }
  .shot--iphone { width: 230px; border-radius: 32px; }
  .shot--watch { width: 160px; border-radius: 36px; }
}

@media (min-width: 1280px) {
  .main { padding: 64px 80px 96px; }
  .page--home .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--aside-w); }
  .page--home .ask {
    grid-column: 3; grid-row: 1;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--sidebar); border-left: 1px solid var(--rule);
    padding: 64px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .faq summary::after { transition: none; }
}
