/* ============================================================
   Family App Studio — design tokens
   Concept: the family chore chart, elevated. Warm apricot paper,
   ink-plum type, three accent roles (assign / track / reward).
   ============================================================ */

:root {
  --ink: #2a1e27;
  --ink-soft: #5b4a56;
  --paper: #fbe9d9;
  --paper-card: #fff7ee;
  --paper-raised: #ffffff;
  --line: rgba(42, 30, 39, 0.12);

  --coral: #ea6146;
  --coral-strong: #d24d34;
  --sage: #45805f;
  --sage-strong: #366b4c;
  --gold: #dd9c31;

  --shadow-sm: 0 1px 2px rgba(42, 30, 39, 0.08);
  --shadow-md: 0 12px 28px -14px rgba(42, 30, 39, 0.35);
  --shadow-lg: 0 24px 48px -20px rgba(42, 30, 39, 0.4);

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --nav-h: 76px;
  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5e8dd;
    --ink-soft: #cbb6c2;
    --paper: #1f1720;
    --paper-card: #2a1f2a;
    --paper-raised: #322533;
    --line: rgba(245, 232, 221, 0.14);

    --coral: #ff8666;
    --coral-strong: #ff9d80;
    --sage: #6fbb90;
    --sage-strong: #86cca4;
    --gold: #f0b94e;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 28px -14px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 24px 55px -20px rgba(0, 0, 0, 0.65);
  }
}

:root[data-theme="dark"] {
  --ink: #f5e8dd;
  --ink-soft: #cbb6c2;
  --paper: #1f1720;
  --paper-card: #2a1f2a;
  --paper-raised: #322533;
  --line: rgba(245, 232, 221, 0.14);
  --coral: #ff8666;
  --coral-strong: #ff9d80;
  --sage: #6fbb90;
  --sage-strong: #86cca4;
  --gold: #f0b94e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 28px -14px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 55px -20px rgba(0, 0, 0, 0.65);
}

:root[data-theme="light"] {
  --ink: #2a1e27;
  --ink-soft: #5b4a56;
  --paper: #fbe9d9;
  --paper-card: #fff7ee;
  --paper-raised: #ffffff;
  --line: rgba(42, 30, 39, 0.12);
  --coral: #ea6146;
  --coral-strong: #d24d34;
  --sage: #45805f;
  --sage-strong: #366b4c;
  --gold: #dd9c31;
  --shadow-sm: 0 1px 2px rgba(42, 30, 39, 0.08);
  --shadow-md: 0 12px 28px -14px rgba(42, 30, 39, 0.35);
  --shadow-lg: 0 24px 48px -20px rgba(42, 30, 39, 0.4);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.8rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2.5px solid var(--coral);
  outline-offset: 3px;
}

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

/* ---------- shared layout ---------- */
.section__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section__inner--narrow { max-width: 720px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-strong);
  margin: 0 0 1rem;
}
.eyebrow--center { text-align: center; }

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 1.55rem + 2vw, 3.1rem);
  line-height: 1.12;
  text-wrap: balance;
  max-width: 18ch;
}
.choreward .section__title { max-width: 22ch; margin-inline: auto; text-align: center; }
.section__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--sage-strong);
}

.section__lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-top: 1.25rem;
}
.choreward .section__lede { margin-inline: auto; text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn--primary {
  background: var(--coral);
  color: #fff8f2;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--coral-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost {
  border: 1.5px solid var(--line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--coral); color: var(--coral-strong); }

/* ---------- reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.9rem 1.25rem 0;
}
.nav {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.7rem 0.6rem 1.1rem;
  background: color-mix(in srgb, var(--paper-raised) 78%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav__links a {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav__links a:hover { background: var(--paper-card); }
.nav__links a.is-active { color: var(--coral-strong); background: var(--paper-card); }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 0 auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
}
.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4.4rem);
  line-height: 1.06;
  text-wrap: balance;
  max-width: 15ch;
}
.hero__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--coral-strong);
}
.hero__lede {
  margin-top: 1.4rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 44ch;
}
.hero__actions {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ---------- Board mockup ---------- */
.hero__board { position: relative; }
.board {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: var(--shadow-lg);
}
.board__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 0.3rem 1rem;
}
.board__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}
.board__hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.board__kids {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.kid-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.kid-card:nth-child(1) { transform: rotate(-1deg); }
.kid-card:nth-child(2) { transform: rotate(1deg); }
.kid-card__top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.kid-card__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--kid-accent);
  color: #fff8f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  flex-shrink: 0;
}
.kid-card__name {
  font-weight: 600;
  font-size: 0.95rem;
}
.kid-card__label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kid-card__balance {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 2.1rem;
  font-variant-numeric: tabular-nums;
  color: var(--kid-accent);
  margin: 0.5rem 0 0.7rem;
}
.kid-card__chores { display: flex; flex-direction: column; gap: 0.5rem; }

.chore {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.86rem;
  padding: 0.3rem 0.2rem;
  border-radius: 8px;
}
.chore input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chore__box {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.6px solid var(--line);
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chore__box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: no-repeat center / 62% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 12 9 17 20 6'/%3E%3C/svg%3E");
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.chore input:checked + .chore__box {
  background: var(--kid-accent);
  border-color: var(--kid-accent);
}
.chore input:checked + .chore__box::after { opacity: 1; transform: scale(1); }
.chore input:focus-visible + .chore__box { outline: 2.5px solid var(--coral); outline-offset: 2px; }
.chore__text { flex: 1; transition: color 0.15s ease, opacity 0.15s ease; }
.chore input:checked ~ .chore__text { text-decoration: line-through; opacity: 0.55; }
.chore__pts {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.board__footer {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
  text-align: center;
}
.board__reward {
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.board__reward strong { color: var(--gold); font-family: var(--font-mono); }

.balance-pop {
  animation: pop 0.4s ease;
}
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ============================================================
   ChoreWard section
   ============================================================ */
.choreward {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: var(--paper-card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.choreward__icon {
  margin: 0 auto 1.5rem;
  width: clamp(72px, 6vw + 40px, 96px);
  height: clamp(72px, 6vw + 40px, 96px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.feature-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}
.feature-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.8rem 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card-accent) 16%, transparent);
  color: var(--card-accent);
  margin-bottom: 1.1rem;
}
.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.choreward__pullquote {
  margin: 3.5rem auto 0;
  max-width: 52ch;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 1vw + 1rem, 1.5rem);
  color: var(--sage-strong);
  text-wrap: balance;
}

/* ============================================================
   About
   ============================================================ */
.about {
  padding: clamp(4.5rem, 9vw, 8rem) 0;
}
.note {
  position: relative;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 2.6rem clamp(1.6rem, 5vw, 3rem);
  box-shadow: var(--shadow-md);
  transform: rotate(-0.6deg);
}
.note__pin {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: var(--shadow-sm);
}
.note__text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 1vw + 1.1rem, 1.7rem);
  line-height: 1.5;
  text-wrap: balance;
}
.note__text strong { font-weight: 600; font-style: normal; color: var(--coral-strong); }
.note__sign {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.site-footer__inner > span:first-child {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}
.site-footer nav { display: flex; gap: 1.2rem; }
.site-footer nav a:hover { color: var(--coral-strong); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__board { max-width: 480px; }
}

@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav__links a { text-align: center; }

  .board__kids { grid-template-columns: 1fr; }
  .kid-card:nth-child(1), .kid-card:nth-child(2) { transform: none; }
}

@media (max-width: 480px) {
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
}
