/* KidSched website — colors and components mirror KidSched/Support/Theme.swift and Shared/Swatch.swift */

:root {
  color-scheme: light;

  --background: #FBF7F0;
  --surface: #FFFFFF;
  --ink: #1F2D27;
  --muted: #5C6B63;
  --border: #EDE6DA;
  --border-strong: #DDD5C8;
  --sage: #3E6A54;
  --sage-dark: #2C5040;
  --sage-tint: #E4EEE7;
  --alert: #C8612E;

  /* Swatch pairs: tint (background) + ink (foreground) */
  --sage-t: #E4EEE7;     --sage-i: #2C5040;
  --peach-t: #F9E6D8;    --peach-i: #7E3A15;
  --sky-t: #DDEAF5;      --sky-i: #234C70;
  --butter-t: #F6EBC6;   --butter-i: #634808;
  --lavender-t: #E9E3F3; --lavender-i: #4A3A75;
  --stone-t: #F0EBE2;    --stone-i: #4A564F;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-card: 20px;
  --radius-btn: 16px;
  --radius-chip: 8px;
  --max: 1120px;
  --gutter: 20px;
  --shadow: 0 1px 2px rgba(31, 45, 39, .04), 0 12px 32px rgba(31, 45, 39, .07);
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--sage); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--sage-dark); }

:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.5vw + .5rem, 3.9rem); }
h2 { font-size: clamp(1.8rem, 3vw + .6rem, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px;
}
.skip-link:focus { top: 12px; color: #fff; }

/* Section label, like SectionHeader */
.eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}

.lead { font-size: clamp(1.05rem, .6vw + .95rem, 1.25rem); color: var(--muted); max-width: 38em; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 247, 240, .88);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.3rem; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand:hover { color: var(--ink); }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -8px;
  background: none; border: 0; border-radius: 12px; color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav-links {
  display: none;
  position: absolute; left: 0; right: 0; top: 64px;
  flex-direction: column; gap: 4px;
  margin: 0; padding: 8px var(--gutter) 20px; list-style: none;
  background: var(--background); border-bottom: 1px solid var(--border);
  box-shadow: 0 16px 24px rgba(31, 45, 39, .06);
}
.nav-links.open { display: flex; }
.nav-links a:not(.btn) { display: block; padding: 12px 4px; color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-links a[aria-current="page"] { color: var(--sage); }
.nav-links .btn { margin-top: 8px; }

@media (min-width: 720px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex; position: static; flex-direction: row; align-items: center; gap: 28px;
    padding: 0; background: none; border: 0; box-shadow: none;
  }
  .nav-links a:not(.btn) { padding: 6px 0; font-size: 15px; }
  .nav-links a:not(.btn):hover { color: var(--sage); }
  .nav-links .btn { margin-top: 0; }
}

/* ---------- Buttons (PrimaryButtonStyle / SecondaryButtonStyle) ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 24px;
  border-radius: var(--radius-btn);
  font: 700 17px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s, transform .15s;
}
.btn-primary { background: var(--sage); color: #fff; border: 1px solid var(--sage); }
.btn-primary:hover { background: var(--sage-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); font-weight: 600; }
.btn-secondary:hover { background: #fff; color: var(--ink); border-color: var(--muted); }
.btn-small { min-height: 42px; padding: 0 18px; font-size: 15px; border-radius: 12px; }
.nav-links .btn-small { color: #fff; }

/* "Coming soon to the App Store" badge */
.store-badge { display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 22px 8px 18px; border-radius: var(--radius-btn); background: var(--ink); color: #fff; text-decoration: none; }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge small { display: block; font-size: 12px; font-weight: 500; opacity: .8; line-height: 1.2; }
.store-badge strong { display: block; font-size: 19px; line-height: 1.2; font-weight: 600; }
.store-badge:hover { color: #fff; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

@media (max-width: 479px) {
  .cta-row > * { width: 100%; justify-content: center; }
}

/* ---------- Cards, chips, tiles ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; line-height: 1.3;
  padding: 4px 8px; border-radius: var(--radius-chip);
  background: var(--sw-t, var(--sage-t)); color: var(--sw-i, var(--sage-i));
  white-space: nowrap;
}

.tile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--sw-t, var(--sage-t)); color: var(--sw-i, var(--sage-i));
}
.tile svg { width: 24px; height: 24px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 13px; font-weight: 700;
  background: var(--sw-t, var(--sage-t)); color: var(--sw-i, var(--sage-i));
}

.sw-sage     { --sw-t: var(--sage-t);     --sw-i: var(--sage-i); }
.sw-peach    { --sw-t: var(--peach-t);    --sw-i: var(--peach-i); }
.sw-sky      { --sw-t: var(--sky-t);      --sw-i: var(--sky-i); }
.sw-butter   { --sw-t: var(--butter-t);   --sw-i: var(--butter-i); }
.sw-lavender { --sw-t: var(--lavender-t); --sw-i: var(--lavender-i); }
.sw-stone    { --sw-t: var(--stone-t);    --sw-i: var(--stone-i); }

/* ---------- Hero ---------- */

.hero { padding: 40px 0 64px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: italic; color: var(--sage); }
.hero .lead { margin-bottom: 28px; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--muted); }

@media (min-width: 960px) {
  .hero { padding: 72px 0 96px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 56px; }
}

/* ---------- Phone mockup (Today screen) ---------- */

.phone-wrap { position: relative; display: flex; justify-content: center; }
.phone-wrap::before {
  content: ""; position: absolute; inset: 8% 4% 4%; z-index: 0;
  border-radius: 48px;
  background: radial-gradient(60% 50% at 70% 20%, var(--peach-t), transparent 70%),
              radial-gradient(60% 60% at 20% 80%, var(--sage-tint), transparent 70%);
}

.phone {
  position: relative; z-index: 1;
  width: 100%; max-width: 340px;
  padding: 12px;
  background: #1F2D27;
  border-radius: 52px;
  box-shadow: 0 30px 60px rgba(31, 45, 39, .22), inset 0 0 0 2px #3a4a43;
}
.phone-screen {
  position: relative; overflow: hidden;
  background: var(--background);
  border-radius: 40px;
  padding: 14px 16px 22px;
  font-size: 13px; line-height: 1.4;
}
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 2px 10px 12px; font-size: 13px; font-weight: 600; }
.phone-status .island { width: 88px; height: 26px; background: #1F2D27; border-radius: 20px; }
.phone-status .bars { display: flex; gap: 4px; align-items: center; }
.phone-status .bars i { display: block; width: 4px; background: var(--ink); border-radius: 1px; }

.app-title { font-family: var(--serif); font-size: 28px; font-weight: 600; margin: 4px 0 2px; }
.app-sub { color: var(--muted); font-size: 12px; margin-bottom: 12px; }

.m-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.m-row { display: flex; gap: 10px; align-items: flex-start; }
.m-row .tile { width: 32px; height: 32px; border-radius: 10px; }
.m-row .tile svg { width: 16px; height: 16px; }
.m-title { font-weight: 700; font-size: 13px; }
.m-meta { color: var(--muted); font-size: 12px; }
.m-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 2px 8px; }

.m-next { background: var(--sage); color: #fff; border: 0; }
.m-next .m-meta { color: rgba(255, 255, 255, .8); }
.m-next .leave { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.m-next .leave strong { font-family: var(--serif); font-size: 26px; font-weight: 600; }

.m-heads { border-color: #F0D5C4; background: #FDF5EF; }
.m-heads .m-title { color: var(--peach-i); }

.timeline { display: grid; gap: 0; }
.t-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.t-item:first-child { border-top: 0; padding-top: 0; }
.t-time { color: var(--muted); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Day header: "Today  THU, SEP 24 ————" */
.day-header { display: flex; align-items: baseline; gap: 10px; }
.day-header .dh-title { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.day-header .dh-date { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.day-header::after { content: ""; flex: 1; height: 1px; background: var(--border); transform: translateY(-4px); }

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .lead { margin-left: auto; margin-right: auto; }
@media (min-width: 960px) { .section { padding: 104px 0; } }
main > .section:last-child { padding-bottom: 0; }

.band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---------- Feature grid ---------- */

.features { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1024px) { .features { grid-template-columns: repeat(3, 1fr); } }

.feature { display: flex; flex-direction: column; gap: 14px; transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature h3 { margin: 0; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; }
.feature .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }

/* ---------- Spotlights ---------- */

.spotlight { display: grid; gap: 36px; align-items: center; }
.spotlight + .spotlight { margin-top: 80px; }
.spotlight ul.checks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.spotlight ul.checks li { display: flex; gap: 12px; align-items: flex-start; }
.spotlight ul.checks svg { width: 22px; height: 22px; flex: none; color: var(--sage); margin-top: 2px; }

@media (min-width: 900px) {
  .spotlight { grid-template-columns: 1fr 1fr; gap: 64px; }
  .spotlight.flip .spotlight-visual { order: -1; }
}

.demo { background: var(--background); border: 1px solid var(--border); border-radius: 28px; padding: clamp(16px, 4vw, 32px); }
.demo .card { padding: 18px; box-shadow: var(--shadow); }

.qa-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--surface); font-size: 16px; font-weight: 500;
}
.qa-input .caret { width: 2px; height: 20px; background: var(--sage); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.qa-parsed { margin-top: 14px; display: grid; gap: 10px; }
.qa-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.qa-line b { color: var(--ink); min-width: 64px; font-weight: 600; }

.cal-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.cal-row:first-of-type { border-top: 0; }
.cal-date { width: 46px; flex: none; text-align: center; border-radius: 10px; background: var(--stone-t); padding: 4px 0; }
.cal-date small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.cal-date span { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.1; }
.cal-body { flex: 1; min-width: 0; }
.cal-body .m-title { font-size: 15px; }
.toggle { width: 42px; height: 26px; flex: none; border-radius: 13px; background: var(--sage); position: relative; }
.toggle::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.toggle.off { background: var(--border-strong); }
.toggle.off::after { right: auto; left: 3px; }

.url-field { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--stone-t); border-radius: 12px; font-size: 13px; color: var(--muted); margin-bottom: 8px; overflow: hidden; }
.url-field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-field svg { width: 16px; height: 16px; flex: none; }

/* ---------- Privacy band ---------- */

.privacy-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .privacy-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.privacy-grid .card { background: var(--background); }
.privacy-grid h3 { font-size: 1.15rem; margin: 14px 0 6px; }
.privacy-grid p { color: var(--muted); font-size: 16px; margin: 0; }

/* ---------- Final CTA ---------- */

.cta-card {
  position: relative; overflow: hidden;
  background: var(--sage); color: #fff;
  border-radius: 32px; padding: clamp(36px, 6vw, 72px) clamp(24px, 5vw, 64px);
  text-align: center;
}
.cta-card::before, .cta-card::after { content: ""; position: absolute; border-radius: 50%; }
.cta-card::before { width: 280px; height: 280px; right: -80px; top: -110px; background: rgba(255, 255, 255, .08); }
.cta-card::after { width: 64px; height: 64px; right: 90px; top: 40px; background: var(--peach-t); opacity: .9; }
.cta-card > * { position: relative; z-index: 1; }
@media (max-width: 719px) { .cta-card::after { display: none; } }
.cta-card h2 { color: #fff; }
.cta-card p { color: rgba(255, 255, 255, .85); max-width: 32em; margin: 0 auto 28px; font-size: 1.1rem; }
.cta-card .cta-row { justify-content: center; }
.cta-card .store-badge { background: #fff; color: var(--ink); }
.cta-card .btn-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.cta-card .btn-secondary:hover { border-color: #fff; }

/* ---------- Footer ---------- */

.site-footer { padding: 48px 0 40px; border-top: 1px solid var(--border); margin-top: 72px; font-size: 15px; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--sage); }
.site-footer .brand { font-size: 1.1rem; }
.site-footer .brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer-note { width: 100%; margin: 8px 0 0; font-size: 13px; }

/* ---------- Content pages (privacy / support) ---------- */

.page-hero { padding: 48px 0 24px; }
.page-hero .lead { margin-bottom: 0; }
.page-updated { margin-top: 16px; font-size: 14px; color: var(--muted); }

.prose { max-width: 720px; }
.prose h2 { font-size: clamp(1.5rem, 1.5vw + 1rem, 1.9rem); margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: .5em; }
.prose .card { margin: 24px 0; }

.summary-card { display: grid; gap: 14px; }
.summary-card .item { display: flex; gap: 14px; align-items: flex-start; }
.summary-card .tile { width: 40px; height: 40px; border-radius: 12px; }
.summary-card .tile svg { width: 20px; height: 20px; }
.summary-card p { margin: 0; }

.support-grid { display: grid; gap: 32px; }
@media (min-width: 960px) { .support-grid { grid-template-columns: 320px 1fr; gap: 56px; align-items: start; } .support-grid aside { position: sticky; top: 96px; } }

.contact-card h2 { font-size: 1.4rem; margin-top: 16px; }
.contact-card p { color: var(--muted); font-size: 16px; }
.contact-card .btn { width: 100%; }

.faq { display: grid; gap: 12px; }
.faq-group + .faq-group { margin-top: 40px; }
.faq-group > h2 { font-size: 1.5rem; margin-bottom: 16px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 20px; cursor: pointer; list-style: none; font-weight: 600; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-2px, 0); }
.faq .answer { padding: 0 20px 18px; color: var(--muted); font-size: 16px; }
.faq .answer p:last-child, .faq .answer ul:last-child { margin-bottom: 0; }
.faq .answer ul { padding-left: 1.2em; }

/* ---------- Motion ---------- */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Real app screenshots */
.phone-screen.shot { padding: 0; aspect-ratio: 598 / 1300; }
.phone-screen.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.phone-pair { align-items: flex-start; }
.phone-pair .phone { max-width: 300px; }
.phone-pair .phone-back { display: none; }
@media (min-width: 560px) {
  .phone-pair { padding-right: 90px; }
  .phone-pair .phone-back { display: block; position: absolute; top: 40px; left: calc(50% - 60px); transform: rotate(5deg); opacity: .96; z-index: 0; }
  .phone-pair .phone-front { transform: translateX(-40px) rotate(-2deg); }
}
.shots-stack { display: grid; gap: 16px; }
.shots-stack img { display: block; width: 100%; height: auto; border-radius: 20px; box-shadow: var(--shadow); }
