/* Birthday pages (US-100, approved prototype website_dev/prototypes/birthdays-fr-today/):
 * light only, flat, neutral surfaces with the app's purple (lib/core/palette.dart) as the
 * only accent. Used by the migrated families only; the others keep /pages.css. */
:root {
  color-scheme: light;

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --text-xs: 0.875rem;
  --text-sm: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --s16: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --bg: #ffffff;
  --surface: #f5f5f7;
  --text: #1c1c1e;
  --muted: #4a4a50;
  --divider: #e6e6ea;
  --outline: #76767c;
  --primary: #68548e;
  --on-primary: #ffffff;
  --on-primary-soft: #4f3d74;
  --focus: #68548e;
  --badge-bg: #000000;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--text-sm) / 1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-underline-offset: 0.2em; }
a:hover { color: var(--on-primary-soft); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 600px) { .wrap { padding: 0 var(--s6); } }

.top { border-bottom: 1px solid var(--divider); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--s4); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--s3); color: var(--text); text-decoration: none; font-weight: 600; font-size: var(--text-md); }
.brand img { width: 32px; height: 32px; padding: 2px; border-radius: var(--radius-sm); background: #ffffff; }
.top nav a { display: inline-block; color: var(--text); text-decoration: none; font-weight: 500; padding: var(--s3) 0; }
.top nav a:hover { text-decoration: underline; }

.crumbs { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s6) 0 0; padding: 0; list-style: none; font-size: var(--text-xs); color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: var(--s2); }
.crumbs a { color: var(--muted); }

h1 { font-size: var(--text-2xl); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 var(--s3); }
.lead { font-size: var(--text-md); max-width: 60ch; }

/* Top of the page: the answer first. On phones the app strip (.peek) sits
 * right under the intro; on desktop the app panel with the phone opens the
 * right column instead, level with the h1. */
.peek { display: grid; gap: var(--s3); margin-top: var(--s6); }
@media (min-width: 1100px) {
  .peek { display: none; }
  /* Edge case: seven tiles do not fit beside the right column; the last two
   * days stay one click away through the day pages and the month nav. */
  .main-col .days li:nth-child(n+6) { display: none; }
}
.peek-title { font-weight: 600; }
.peek .badges { margin-top: 0; }
.free { font-size: var(--text-xs); color: var(--muted); }

/* Notification preview: the landing's banner (website/assets/landing.css
 * .notif) drawn as a neutral light banner (the landing's is dark glass on its
 * gradient, which this flat page has no backdrop for), with real ARB strings. */
.notifs { position: relative; padding-bottom: var(--s2); }
/* The edge of an iOS notification stack under the banner. */
.notifs::before { content: ""; position: absolute; left: var(--s3); right: var(--s3); bottom: 0; height: var(--s8); border: 1px solid var(--divider); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--bg); }
.notif { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border: 1px solid var(--divider); border-radius: var(--radius-lg); background: var(--bg); }
.notif .n-icon { width: 36px; height: 36px; padding: 2px; border: 1px solid var(--divider); border-radius: var(--radius-sm); background: #ffffff; }
.notif .n-txt { display: grid; font-size: var(--text-xs); line-height: 1.33; }
.notif .n-title { font-weight: 600; padding-right: var(--s12); }
.notif .n-body { color: var(--muted); }
.notif .n-when { position: absolute; top: var(--s3); right: var(--s4); font-size: var(--text-xs); line-height: 1.33; color: var(--muted); }

/* Day strip: the one place the brand colour fills a surface. */
.days { margin: var(--s6) calc(-1 * var(--s4)) 0; overflow-x: auto; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days ol { display: flex; gap: var(--s2); margin: 0; padding: var(--s1) var(--s4); list-style: none; width: max-content; }
@media (min-width: 600px) { .days { margin: var(--s6) calc(-1 * var(--s6)) 0; } .days ol { padding: var(--s1) var(--s6); } }
@media (min-width: 1100px) { .days { margin: var(--s6) 0 0; overflow: visible; } .days ol { padding: var(--s1) 0; width: auto; } .days li { flex: 1; } }
.days a, .days span.tile { white-space: nowrap; display: grid; gap: 0; min-width: 6.5rem; padding: var(--s2) var(--s3); border: 1px solid var(--divider); border-radius: var(--radius-md); color: var(--text); text-decoration: none; line-height: 1.33; }
.days a:hover { border-color: var(--outline); color: var(--text); }
.days .d-when { font-size: var(--text-xs); color: var(--muted); }
.days .d-date { font-weight: 600; }
.days .d-count { font-size: var(--text-xs); color: var(--muted); }
.days span.tile[aria-current] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.days span.tile[aria-current] .d-when, .days span.tile[aria-current] .d-count { color: var(--on-primary); }

.layout { display: grid; gap: var(--s12); margin-top: var(--s3); }
.main-col { min-width: 0; }
.today { margin-top: var(--s8); }
@media (min-width: 1100px) { .layout { grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--s12); align-items: start; } }

.section-title { font-size: var(--text-lg); line-height: 1.27; font-weight: 600; padding-bottom: var(--s3); border-bottom: 2px solid var(--text); }

/* Person: photo left, facts right, the message under both. */
.person { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--s3) var(--s4); padding: var(--s6) 0; border-bottom: 1px solid var(--divider); }
@media (min-width: 600px) { .person { grid-template-columns: 152px minmax(0, 1fr); column-gap: var(--s6); } }
.face { margin: 0; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
/* Commons thumbnails keep their own shape; the crop keeps the upper part, where the face usually is. */
.face img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.face.initials { display: grid; place-items: center; background: var(--surface); color: var(--on-primary-soft); font-size: var(--text-xl); font-weight: 600; letter-spacing: 0.02em; }
.info { display: grid; gap: var(--s1); align-content: start; }
.info h3 { font-size: var(--text-lg); line-height: 1.27; font-weight: 600; }
.age, .role { color: var(--muted); }
.age strong { color: var(--on-primary-soft); font-weight: 600; }
.why { margin-top: var(--s2); max-width: 62ch; }
@media (max-width: 599px) { .why { grid-column: 1 / -1; } .info { display: contents; } .info > h3, .info > .age, .info > .role { grid-column: 2; } .person { row-gap: var(--s1); } .face { grid-row: 1 / span 3; } .why { margin-top: var(--s3); } .wish { margin-top: var(--s3); } }

.wish { grid-column: 1 / -1; display: grid; gap: var(--s3); padding: var(--s4); border-radius: var(--radius-md); background: var(--surface); }
@media (min-width: 600px) { .wish { grid-column: 2; } .face { grid-row: 1 / span 3; } .info { align-self: start; } }
@media (min-width: 1100px) { .wish { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s4); } }
.wish p { font-style: italic; }
.wish button { justify-self: start; min-height: 44px; padding: var(--s2) var(--s4); border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--bg); color: var(--primary); font: 600 var(--text-sm) / 1.25 var(--font); cursor: pointer; white-space: nowrap; }
.wish button:hover { background: var(--surface); color: var(--on-primary-soft); }
.wish button:active { background: var(--primary); color: var(--on-primary); }

.meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 var(--s4); font-size: var(--text-xs); color: var(--muted); }
@media (min-width: 600px) { .meta { grid-column: 2; } }
.meta > a, .meta .credit a { display: inline-block; padding: var(--s1) 0; }
.meta .credit, .meta .credit a { color: var(--muted); }

.sources { margin-top: var(--s4); font-size: var(--text-xs); color: var(--muted); max-width: 70ch; }

.side { display: grid; gap: var(--s12); }
.next { list-style: none; margin: 0; padding: 0; }
.next li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--divider); }
.next .n-name { font-weight: 600; }
.next .n-role { grid-row: 2; color: var(--muted); font-size: var(--text-xs); }
.next .n-age { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.more { display: inline-block; margin-top: var(--s3); padding: var(--s2) 0; font-weight: 500; }

.app { display: grid; gap: var(--s3); padding: var(--s6); border-radius: var(--radius-md); background: var(--surface); }
.app h2 { font-size: var(--text-lg); line-height: 1.27; font-weight: 600; }
.app > p:not(.free) { color: var(--muted); }
@media (max-width: 1099px) { .side .app { order: 2; } }
@media (min-width: 600px) and (max-width: 1099px) {
  .app { grid-template-columns: minmax(0, 1fr) 20rem; column-gap: var(--s8); align-content: center; }
  .app > * { grid-column: 1; }
  .app .device { grid-column: 2; grid-row: 1 / span 5; }
}

/* The real timeline screenshot in the landing's phone frame, with the real
 * notification banner laid over it (it floats, so it gets the one shadow). */
.device { position: relative; margin-bottom: var(--s3); }
.device .notif { position: absolute; top: var(--s8); left: 0; right: 0; background: var(--bg); box-shadow: 0 8px 24px rgba(29, 27, 32, 0.16); }

/* Device frame from website/pages.css .phone, shadow softened for a light page. */
.phone { position: relative; width: 180px; margin: 0 auto; aspect-ratio: 1320 / 2868; border-radius: 33px; padding: 2px; background: linear-gradient(135deg, #bfb8b0 0%, #8e8880 35%, #d6d0c8 62%, #7c766f 100%); box-shadow: 0 8px 24px rgba(29, 27, 32, 0.18); }
.phone::before, .phone::after { content: ""; position: absolute; width: 4px; border-radius: 2px; background: linear-gradient(#7c766f, #bfb8b0); }
.phone::before { left: -2px; top: 19.6%; height: 4.3%; }
.phone::after { right: -2px; top: 20.6%; height: 6.2%; }
.phone .bezel { height: 100%; border-radius: 31px; background: #07070a; padding: 4px; }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; border-radius: 27px; }
.badges { display: flex; flex-wrap: nowrap; justify-content: center; gap: var(--s2); margin-top: var(--s2); }
.badges .badge { flex: 0 1 auto; min-width: 0; }
.badge { display: flex; align-items: center; gap: var(--s2); min-height: 48px; padding: var(--s2) var(--s3) var(--s2) var(--s3); white-space: nowrap; border-radius: var(--radius-sm); background: var(--badge-bg); color: #fff; text-decoration: none; }
.badge:hover { background: #2c292f; color: #fff; }
.badge svg { display: block; }
.badge .apple-mark { width: 20px; height: 26px; fill: #fff; }
.badge .play-mark { width: 24px; height: 24px; }
.badge .bsmall { display: block; font-size: 10px; letter-spacing: 0.05em; line-height: 1.2; }
.badge .bbig { display: block; font-size: 15px; font-weight: 600; line-height: 1.15; }

.months { margin-top: var(--s12); padding-top: var(--s4); border-top: 1px solid var(--divider); display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); }
.months h2 { font-size: var(--text-sm); font-weight: 600; }
.months ul { display: flex; flex-wrap: wrap; gap: 0 var(--s4); margin: 0; padding: 0; list-style: none; }
.months a { display: inline-block; padding: var(--s2) 0; color: var(--text); }
.months a:hover, .months [aria-current] { color: var(--primary); }
.months [aria-current] { font-weight: 600; }
.months span[aria-current] { display: inline-block; padding: var(--s2) 0; }

footer { margin-top: var(--s8); padding: var(--s6) 0 var(--s12); border-top: 1px solid var(--divider); }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); font-size: var(--text-xs); }
footer li > * { display: inline-block; padding: var(--s1) 0; }
footer a { color: var(--muted); }
footer [aria-current] { color: var(--text); font-weight: 500; }

/* Closing app band above the footer: every page ends on the app. */
.cta-band { margin-top: var(--s12); border-top: 1px solid var(--divider); background: var(--surface); }
.cta-band .wrap { display: grid; justify-items: center; gap: var(--s4); padding-top: var(--s12); padding-bottom: var(--s12); text-align: center; }
.cta-band h2 { font-size: var(--text-xl); line-height: 1.27; font-weight: 600; max-width: 28rem; }
.cta-band p { color: var(--muted); max-width: 34rem; }
.cta-band .notif { width: min(100%, 24rem); text-align: left; }
.cta-band .badges { margin-top: var(--s2); }

/* Edge case: on the narrowest phones both badges still share one row. */
@media (max-width: 400px) {
  .app { padding: var(--s4); }
  .badge { gap: 6px; padding: 6px 10px; min-height: 44px; }
  .badge .bbig { font-size: 13px; }
  .badge .bsmall { font-size: 8px; }
  .badge .apple-mark { width: 16px; height: 21px; }
  .badge .play-mark { width: 19px; height: 19px; }
}

.days span.tile:not([aria-current]) { color: var(--muted); border-style: dashed; }

.note { color: var(--muted); }
.why cite { font-style: italic; }
/* Japanese has no italic; a slanted CJK face is a synthetic oblique, so wishes and titles stay upright. */
:lang(ja) .wish p, :lang(ja) .why cite { font-style: normal; }
.people-empty { padding: var(--s6) 0; color: var(--muted); }
.live-error { margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--radius-md); background: var(--surface); }

.facts { list-style: none; margin: var(--s8) 0 0; padding: 0; display: grid; gap: var(--s2) var(--s6); grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.facts li { display: grid; padding: var(--s3) 0; border-top: 1px solid var(--divider); }
.facts small { font-size: var(--text-xs); color: var(--muted); }
.facts span { font-weight: 600; }

.fete-link { margin-top: var(--s8); }

.faq { margin-top: var(--s12); }
.faq > h2 { font-size: var(--text-lg); line-height: 1.27; font-weight: 600; padding-bottom: var(--s3); border-bottom: 2px solid var(--text); }
.faq-item { padding: var(--s4) 0; border-bottom: 1px solid var(--divider); max-width: 70ch; }
.faq-item h3 { font-size: var(--text-md); font-weight: 600; margin-bottom: var(--s1); }
.faq-item p { color: var(--muted); }

.picker { margin-top: var(--s8); padding: var(--s6); border-radius: var(--radius-md); background: var(--surface); }
.picker h2 { font-size: var(--text-lg); line-height: 1.27; font-weight: 600; margin-bottom: var(--s4); }
.picker form { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s3) var(--s4); }
.picker label { display: grid; gap: var(--s1); font-size: var(--text-xs); font-weight: 600; color: var(--text); }
.picker select { min-height: 44px; min-width: 8rem; padding: var(--s2) var(--s3); border: 1px solid var(--outline); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: 400 var(--text-sm) / 1.25 var(--font); }
.picker button { min-height: 44px; padding: var(--s2) var(--s6); border: 0; border-radius: var(--radius-sm); background: var(--primary); color: var(--on-primary); font: 600 var(--text-sm) / 1.25 var(--font); cursor: pointer; }
.picker button:hover { background: var(--on-primary-soft); }
.picker .note { flex-basis: 100%; }

.shortcuts { list-style: none; margin: var(--s8) 0 0; padding: 0; display: grid; gap: var(--s2); }
.shortcuts a { display: inline-block; padding: var(--s2) 0; font-weight: 600; }

.month-day { margin-top: var(--s8); }
.month-day h2 { font-size: var(--text-lg); line-height: 1.27; font-weight: 600; padding-bottom: var(--s2); border-bottom: 2px solid var(--text); }
.month-day h2 a { color: var(--text); text-decoration: none; }
.month-day h2 a:hover { color: var(--primary); text-decoration: underline; }
.month-day .more { margin-top: var(--s1); }
.next .n-age.year { font-size: var(--text-xs); }

.band-link { font-size: var(--text-xs); }
