/* Eva and Tilly — the site is Eva's diary: ruled notebook paper, grape marker, taped-in photos. */

@font-face { font-family: "Gaegu"; src: url("../fonts/gaegu-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gaegu"; src: url("../fonts/gaegu-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #fbfdff;        /* notebook page */
  --rule: #d5e5f6;         /* blue ruled lines */
  --margin: #f2a3a0;       /* red margin line */
  --ink: #2d2457;          /* body text: dark grape-navy */
  --grape: #6b3fa0;        /* Eva's grape marker */
  --eva: #6fb7f2;          /* Eva's blue tee */
  --tilly-red: #d9392f;    /* Tilly's stripes */
  --book: #ffd447;         /* Tilly's yellow board book */
  --sticky: #fff1a6;
  --tape: rgba(255, 212, 71, .72);
  --tape-blue: rgba(111, 183, 242, .6);
  --line: 32px;
  --hand: "Gaegu", "Comic Sans MS", "Chalkboard SE", cursive;
  --text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --mx: max(10px, calc(50% - min(580px, 50% - var(--gutter)) - 20px)); /* margin line sits just left of the content */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--text);
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent calc(var(--mx) - 1px), var(--margin) calc(var(--mx) - 1px), var(--margin) calc(var(--mx) + 1px), transparent calc(var(--mx) + 1px)),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  background-attachment: local;
}
@media (max-width: 640px) { body { background-image: repeating-linear-gradient(180deg, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line)); } }

img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--grape); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--tilly-red); }
:focus-visible { outline: 3px dashed var(--tilly-red); outline-offset: 4px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--book); color: var(--ink); padding: 8px 14px; z-index: 10; border-radius: 8px; }
.skip:focus { left: 8px; }

/* Type */
h1, h2, h3, .hand { font-family: var(--hand); font-weight: 700; color: var(--grape); line-height: 1.02; letter-spacing: -.035em; word-spacing: .06em; }
h1 { font-size: clamp(3.6rem, 10vw, 7.5rem); margin: 0; line-height: .88; }
h2 { font-size: clamp(2.4rem, 5.4vw, 3.8rem); margin: 0 0 .35em; }
h3 { font-size: clamp(1.7rem, 3vw, 2.1rem); margin: 0 0 .25em; }
p { margin: 0 0 1em; max-width: 64ch; }
.lead { font-size: clamp(1.2rem, 2vw, 1.4rem); }
.day { font-family: var(--hand); font-size: 1.6rem; color: var(--tilly-red); margin: 0 0 .2em; transform: rotate(-2deg); display: inline-block; }

/* Scribble underline drawn like a marker stroke */
.scribble { display: block; width: min(420px, 80%); height: 22px; margin-top: 4px; color: var(--book); }

/* Header */
.site-head { padding: 18px 0 8px; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.logo { font-family: var(--hand); font-weight: 700; font-size: 2rem; color: var(--grape); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.logo svg { width: 44px; height: 44px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--hand); font-size: 1.35rem; }
.nav a { text-decoration: none; color: var(--ink); padding: 2px 4px; border-radius: 6px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--grape); background: linear-gradient(transparent 55%, var(--sticky) 55%); }

/* Buttons look like stickers */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 1.35rem/1 var(--hand); text-decoration: none; cursor: pointer;
  color: #fff; background: var(--tilly-red);
  border: 3px solid var(--ink); border-radius: 16px; padding: 12px 22px 14px;
  box-shadow: 4px 5px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.btn:hover { color: #fff; transform: translate(-1px, -2px); box-shadow: 5px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn.quiet { background: #fff; color: var(--ink); }
.btn.quiet:hover { color: var(--grape); }
.btn[aria-disabled="true"] { background: #fff; color: var(--ink); cursor: default; border-style: dashed; box-shadow: none; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin-top: 22px; }

/* Taped-in photos */
.photo { background: #fff; padding: 10px 10px 12px; box-shadow: 0 1px 1px rgba(45,36,87,.12), 0 8px 22px -8px rgba(45,36,87,.35); position: relative; margin: 0; }
.photo img { width: 100%; aspect-ratio: var(--ar, 16 / 9); object-fit: cover; }
.photo figcaption { font-family: var(--hand); font-size: 1.35rem; line-height: 1.15; padding: 8px 4px 0; color: var(--ink); }
.photo::before { content: ""; position: absolute; top: -12px; left: 50%; width: 92px; height: 26px; translate: -50% 0; rotate: -3deg; background: var(--tape); }
.photo.blue-tape::before { background: var(--tape-blue); rotate: 4deg; }
.tilt-l { rotate: -2.2deg; } .tilt-r { rotate: 1.8deg; } .tilt-rr { rotate: 3.4deg; }

/* Sticky note */
.sticky { background: var(--sticky); padding: 16px 20px 18px; font-family: var(--hand); font-size: 1.45rem; line-height: 1.2; box-shadow: 0 10px 18px -10px rgba(45,36,87,.45); rotate: 2deg; max-width: 280px; }
.sticky strong { color: var(--tilly-red); }

/* Sections */
section { padding: clamp(44px, 6.5vw, 84px) 0; }
.section-intro { margin-bottom: 36px; }

/* Hero */
.hero { padding-top: clamp(24px, 5vw, 56px); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-photos { position: relative; padding: 18px 0 48px; }
.hero-photos .main { --ar: 4 / 3; }
.hero-photos .main figcaption { max-width: 52%; }
.hero-photos .small { position: absolute; width: 42%; right: -14px; bottom: -34px; --ar: 1 / 1; }
@media (max-width: 860px) { .hero-photos .small { right: 0; } }
.hero-photos .sticky { position: absolute; left: -24px; top: -6px; rotate: -5deg; z-index: 2; font-size: 1.3rem; }
.diary-entry { font-family: var(--hand); font-size: clamp(1.55rem, 2.5vw, 1.9rem); line-height: var(--line); color: var(--ink); margin: 18px 0 0; max-width: 30ch; }
.diary-entry::before { content: "Tuesday."; display: block; color: var(--tilly-red); }
.tagline { font-size: 1.2rem; margin-top: 14px; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-photos { max-width: 560px; margin: 8px auto 0; }
  .hero-photos .sticky { left: auto; right: 8px; top: -18px; }
}

/* Episode card on the home page */
.episode .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.ep-num { font-family: var(--hand); font-size: 1.5rem; color: var(--tilly-red); margin: 0; }
.photo-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.photo-strip .photo { padding: 6px 6px 8px; }
.photo-strip .photo::before { width: 54px; height: 18px; top: -9px; }
.photo-strip figcaption { font-size: 1.1rem; }
@media (max-width: 860px) { .episode .wrap { grid-template-columns: 1fr; } }

/* Family */
.family-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 32px; }
.family-grid .photo { --ar: 1 / 1; }
.family-grid .photo:nth-child(3n+1) { rotate: -1.6deg; }
.family-grid .photo:nth-child(3n+2) { rotate: 1.2deg; }
.family-grid .photo:nth-child(3n) { rotate: -.6deg; }
.family-grid figcaption b { display: block; font-size: 1.9rem; color: var(--grape); }
.family-grid figcaption span { display: block; font-size: 1.25rem; }
@media (max-width: 860px) { .family-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .family-grid { grid-template-columns: 1fr; max-width: 360px; margin-inline: auto; } }

/* Eva's dictionary */
.dictionary { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: clamp(22px, 4vw, 44px); box-shadow: 8px 10px 0 var(--eva); max-width: 900px; }
.dictionary dl { margin: 0; display: grid; gap: 22px; }
.dictionary dt { font-family: var(--hand); font-weight: 700; font-size: 2rem; color: var(--grape); line-height: 1; }
.dictionary dt small { font-family: var(--text); font-weight: 400; font-style: italic; font-size: 1rem; color: var(--ink); margin-left: 8px; }
.dictionary dd { margin: 4px 0 0; font-size: 1.15rem; }
.dictionary dd::before { content: "Eva says: "; font-weight: 700; }
.dictionary .add { font-family: var(--hand); font-size: 1.4rem; margin-top: 26px; color: var(--tilly-red); }

/* The Eva Dollar toy */
.dollar-zone .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.bill-btn { background: none; border: 0; padding: 0; cursor: pointer; width: 100%; max-width: 520px; display: block; margin: 0 auto; filter: drop-shadow(0 12px 16px rgba(45,36,87,.25)); }
.bill-btn svg { width: 100%; height: auto; display: block; rotate: -2deg; transition: rotate .2s; }
.bill-btn:hover svg { rotate: 1deg; }
.bill-btn.chomp svg { animation: chomp .35s ease-out; }
@keyframes chomp { 30% { transform: scale(.96) rotate(-3deg); } 60% { transform: scale(1.02) rotate(2deg); } }
.bill-status { font-family: var(--hand); font-size: 1.5rem; min-height: 2.4em; text-align: center; margin-top: 14px; }
.bill-count { font-size: 1rem; text-align: center; color: var(--ink); opacity: .8; }
@media (max-width: 860px) { .dollar-zone .wrap { grid-template-columns: 1fr; } }

/* Printables teaser */
.printables-teaser .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.print-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.print-list li { display: flex; gap: 14px; align-items: flex-start; }
.print-list svg { width: 44px; height: 44px; flex: none; color: var(--grape); }
.print-list b { font-family: var(--hand); font-size: 1.6rem; color: var(--grape); display: block; line-height: 1.1; }
@media (max-width: 860px) { .printables-teaser .wrap { grid-template-columns: 1fr; } }

/* For grown-ups: a calmer page, still on paper */
.grownups { background: rgba(111, 183, 242, .14); }
.grownups .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grownups h3 { font-size: 1.8rem; }
@media (max-width: 860px) { .grownups .cols { grid-template-columns: 1fr; } }

/* Coming up: Eva's to-do list */
.todo { list-style: none; padding: 0; margin: 0; font-family: var(--hand); font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: var(--line); max-width: 640px; }
.todo li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 6px 0; }
.todo .box { width: 26px; height: 26px; border: 3px solid var(--ink); border-radius: 5px; margin-top: 4px; position: relative; background: #fff; }
.todo .done .box::after { content: ""; position: absolute; left: 5px; top: -8px; width: 10px; height: 22px; border: solid var(--tilly-red); border-width: 0 4px 4px 0; rotate: 40deg; }
.todo .done .title { text-decoration: line-through wavy var(--tilly-red); text-decoration-thickness: 2px; }
.todo small { display: block; font-family: var(--text); font-size: 1rem; line-height: 1.4; }

/* Footer */
.site-foot { padding: 48px 0 64px; border-top: 3px dashed var(--rule); font-size: 1rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; align-items: flex-end; }
.site-foot .logo { font-size: 1.6rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Episode page */
.ep-hero { padding-top: 24px; }
.player { position: relative; border: 4px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: 8px 10px 0 var(--book); background: var(--ink); aspect-ratio: 16 / 9; }
.player img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.player .soon { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #fff; padding: 20px; }
.player .soon b { font-family: var(--hand); font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1; display: block; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ep-facts { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 18px 0 0; padding: 0; list-style: none; }
.ep-facts li { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 4px 14px; font-size: 1rem; }

.story { display: grid; gap: clamp(48px, 8vw, 96px); }
.story-day { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.story-day:nth-child(even) .photo { order: -1; }
.story-day p { font-size: 1.2rem; }
@media (max-width: 860px) { .story-day { grid-template-columns: 1fr; } .story-day:nth-child(even) .photo { order: 0; } }

.song { background: var(--grape); color: #fff; border-radius: 26px; padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.song h2 { color: var(--book); }
.song p { color: #fff; }
.lyric { font-family: var(--hand); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; margin: 0; }
@media (max-width: 860px) { .song { grid-template-columns: 1fr; } }

.talk { counter-reset: q; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; max-width: 760px; }
.talk li { counter-increment: q; display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; font-size: 1.15rem; }
.talk li::before { content: counter(q); font-family: var(--hand); font-weight: 700; font-size: 1.8rem; width: 44px; height: 44px; display: grid; place-content: center; border-radius: 50%; background: var(--book); color: var(--ink); }

/* Printables page */
.sheet { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: clamp(18px, 3vw, 32px); }
.sheet + .sheet { margin-top: 40px; }
.bills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.bills svg { width: 100%; height: auto; border: 2px dashed #9aa; }
.tracker { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.tracker th, .tracker td { border: 2px solid var(--ink); padding: 10px 12px; text-align: left; height: 48px; }
.tracker th { font-family: var(--hand); font-size: 1.4rem; color: var(--grape); background: var(--sticky); }
@media (max-width: 640px) { .bills { grid-template-columns: 1fr; } .tracker { font-size: .95rem; } }

/* 404 */
.lost { text-align: center; padding: 80px 0 120px; }
.lost .photo { max-width: 520px; margin: 32px auto; }
.lost p { margin-inline: auto; }

/* Printing: only the sheets */
@media print {
  body { background: #fff; font-size: 12pt; }
  .site-head, .site-foot, .no-print, .skip { display: none !important; }
  section { padding: 0; }
  .sheet { border: 0; padding: 0; break-after: page; }
  .bills svg { border-color: #999; }
}
