/* Shelby's Fund. Shared styles for every page. */
:root {
  --ink: #27231f;
  --muted: #5d554d;
  --paper: #f3f4f1;
  --paper-2: #e8e9e4;
  --coat: #8e5420;
  --dusk: #222b40;
  --dusk-ink: #e6e8ee;
  --sun: #f0a63a;
  --measure: 34rem;
  --wide: 72rem;
  --serif: "Alegreya", Georgia, serif;
  --sans: "Alegreya Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.1875rem/1.65 var(--serif); }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--coat); text-underline-offset: .18em; }
a:focus-visible, .button:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1.1em; }
h1, h2, h3 { text-wrap: balance; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }

.button {
  display: inline-block; padding: .8rem 1.4rem; background: var(--sun); color: var(--ink);
  font: 700 1.125rem/1.2 var(--sans); text-decoration: none; border: 0; border-radius: 999px; cursor: pointer;
}
.button:hover { background: #f5b65a; }
.button.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.button.ghost:hover { background: rgba(255,255,255,.12); }
.text-link {
  font: 700 1.0625rem/1.2 var(--sans); background: none; border: 0; padding: .5rem 0;
  color: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer;
}

/* Site header */
.site-head { background: var(--paper); border-bottom: 1px solid rgba(39,35,31,.1); position: relative; z-index: 3; }
.site-head .in {
  max-width: var(--wide); margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: .5rem 1.5rem; flex-wrap: wrap;
}
.wordmark { font: italic 800 1.65rem/1 var(--serif); color: var(--ink); text-decoration: none; margin-right: auto; }
.site-nav { display: flex; gap: .25rem 1.25rem; font: 700 1.0625rem/1.2 var(--sans); order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
.site-nav a { color: var(--ink); text-decoration: none; white-space: nowrap; padding: .35rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--coat); text-decoration: underline; text-underline-offset: .3em; }
.site-head .button { padding: .55rem 1.1rem; font-size: 1.0625rem; }
@media (min-width: 52rem) {
  .site-nav { order: 0; width: auto; }
}

/* Full-bleed photo hero (home and Shelby's story) */
.hero { position: relative; min-height: calc(100svh - 4rem); display: grid; align-items: end; overflow: hidden; background: var(--dusk); color: #fff; }
.hero picture, .hero > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 68% 50%; animation: settle 2.6s cubic-bezier(.2,.7,.2,1) both; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,22,30,.9) 0%, rgba(20,22,30,.6) 42%, rgba(20,22,30,.18) 70%, rgba(20,22,30,0) 82%); }
.hero-text { position: relative; z-index: 1; padding: 0 1.25rem 2.75rem; max-width: var(--wide); width: 100%; margin: 0 auto; }
.hero-home .name { font-size: clamp(3.6rem, 12.5vw, 8.75rem); }
.hero .name { margin: 0; font: italic 800 clamp(4.5rem, 19vw, 11.5rem)/.85 var(--serif); letter-spacing: -.02em; text-shadow: 0 2px 30px rgba(0,0,0,.35); animation: rise 1.8s .4s cubic-bezier(.2,.7,.2,1) both; }
.hero .dates { margin: .9rem 0 0; font: 500 clamp(1rem, 2.6vw, 1.2rem)/1.3 var(--sans); color: rgba(255,255,255,.85); animation: rise 1.8s .6s cubic-bezier(.2,.7,.2,1) both; }
.hero .tagline { margin: 1rem 0 1.5rem; max-width: 30rem; font-size: clamp(1.25rem, 3.4vw, 1.55rem); line-height: 1.38; animation: rise 1.8s .8s cubic-bezier(.2,.7,.2,1) both; }
.hero .birthday { margin: 0 0 1.4rem; max-width: 30rem; font: 700 clamp(1.125rem, 2.8vw, 1.3rem)/1.35 var(--sans); color: var(--sun); animation: rise 1.8s 1s cubic-bezier(.2,.7,.2,1) both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; animation: rise 1.8s 1.15s cubic-bezier(.2,.7,.2,1) both; }
.hero-actions .text-link { color: #fff; }
.hero .hint { margin: .9rem 0 0; font: 500 .9375rem/1.4 var(--sans); color: rgba(255,255,255,.78); animation: rise 1.8s 1.25s cubic-bezier(.2,.7,.2,1) both; }
/* Story hero: Shelby sits on the left of the photo, so her name goes on the right */
.hero-right img { object-position: 22% 50%; }
.hero-right::after { background: linear-gradient(to top, rgba(20,22,30,.88) 0%, rgba(20,22,30,.45) 38%, rgba(20,22,30,0) 65%), linear-gradient(to left, rgba(20,22,30,.55) 0%, rgba(20,22,30,0) 55%); }
@media (min-width: 52rem) {
  .hero-right .hero-text { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
  .hero-right .hero-actions { justify-content: flex-end; }
}
@keyframes settle { from { transform: scale(1.07); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Generic page sections */
.section { padding: 4.5rem 1.25rem; }
.section > .in { max-width: var(--measure); margin: 0 auto; }
.section > .in.full { max-width: var(--wide); }
.section h2, .chapter h2, .page-head h1 { margin: 0 0 1rem; font: italic 400 clamp(2rem, 6vw, 2.6rem)/1.1 var(--serif); color: var(--coat); }
.section h3 { margin: 2.25rem 0 .6rem; font: 700 1.25rem/1.3 var(--sans); }
.lede { font-size: 1.375rem; line-height: 1.5; }
.dusk { background: var(--dusk); color: var(--dusk-ink); }
.dusk h2, .dusk h3 { color: #fff; }
.dusk a { color: var(--sun); }
.tint { background: var(--paper-2); }
.page-head { padding: 3.5rem 1.25rem 0; }
.page-head > .in { max-width: var(--measure); margin: 0 auto; }
.page-head h1 { font: italic 800 clamp(2.75rem, 9vw, 4.5rem)/.95 var(--serif); color: var(--ink); letter-spacing: -.015em; margin-bottom: 1.1rem; }

/* Progress toward the goal */
.progress { padding: 2.25rem 1.25rem; border-bottom: 1px solid rgba(39,35,31,.1); }
.progress .in { max-width: var(--wide); margin: 0 auto; display: grid; gap: 1.25rem 3rem; }
.raised { margin: 0; font: 400 1.1rem/1.3 var(--sans); color: var(--muted); }
.raised strong { display: block; font: italic 800 clamp(2.25rem, 7vw, 3.25rem)/1 var(--serif); color: var(--ink); }
/* The track: a line to the goal, with a tennis ball sitting where the total is */
.track { position: relative; height: 4px; margin: 1.6rem 1rem 1.3rem 0; background: repeating-linear-gradient(90deg, rgba(39,35,31,.22) 0 10px, transparent 10px 18px); border-radius: 2px; }
.track .fill { position: absolute; inset: 0 auto 0 0; width: var(--pct); background: var(--coat); border-radius: 2px; }
.track .ball { position: absolute; top: 50%; left: var(--pct); width: 2.1rem; height: 2.1rem; transform: translate(-50%, -50%); filter: drop-shadow(0 3px 3px rgba(39,35,31,.25)); }
@media (prefers-reduced-motion: no-preference) {
  .track:not(.go) .fill { width: 0; }
  .track:not(.go) .ball { left: 0; transform: translate(-50%, -50%) rotate(-540deg); }
  .track .fill { transition: width 1.6s cubic-bezier(.2,.7,.2,1) .15s; }
  .track .ball { transition: left 1.6s cubic-bezier(.2,.7,.2,1) .15s, transform 1.6s cubic-bezier(.2,.7,.2,1) .15s; }
}
.match { margin: 0; padding: 1rem 1.15rem; border-left: 4px solid var(--sun); background: rgba(240,166,58,.12); font: 500 1.0625rem/1.45 var(--sans); }
.match strong { font-weight: 700; }
.asof { font: 500 .9375rem/1.4 var(--sans); color: var(--muted); margin: 0; }
@media (min-width: 52rem) { .progress .in { grid-template-columns: 1.2fr 1fr; align-items: center; } }

/* Signs */
.signs { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.signs li { padding: .55rem 0 .55rem 1.6rem; border-bottom: 1px solid rgba(230,232,238,.18); position: relative; }
.signs li::before { content: ""; position: absolute; left: .1rem; top: 1.05em; width: .55rem; height: .55rem; border-radius: 50%; background: var(--sun); }
.section:not(.dusk) .signs li { border-bottom-color: rgba(39,35,31,.12); }
.urgent { margin: 1.5rem 0 0; padding: 1rem 1.15rem; border-left: 4px solid var(--sun); background: rgba(240,166,58,.1); }
.dusk .urgent { color: #fff; }
.split { display: grid; gap: 1rem 4rem; }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }

/* Less than 48 hours */
.timeline { list-style: none; margin: 1.75rem 0 2rem .4rem; padding: 0; border-left: 2px solid rgba(240,166,58,.45); }
.timeline li { position: relative; padding: 0 0 1.5rem 1.7rem; font-size: 1.3rem; line-height: 1.4; color: #fff; }
.timeline li:last-child { padding-bottom: .2rem; }
.timeline li::before { content: ""; position: absolute; left: -.5rem; top: .3rem; width: .85rem; height: .85rem; border-radius: 50%; background: var(--sun); }
.timeline li:last-child::before { background: var(--dusk); box-shadow: inset 0 0 0 2px var(--sun); }
.timeline b { display: block; font: 700 .9375rem/1.3 var(--sans); color: var(--sun); margin-bottom: .1rem; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .timeline li { animation: beat linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
  }
}
@keyframes beat { from { opacity: 0; transform: translateY(1.1rem); } to { opacity: 1; transform: none; } }
.goal { max-width: 42rem; margin: 2rem 0 1.25rem; padding: 1.15rem 1.3rem; border-left: 4px solid var(--coat); background: #fff; border-radius: 0 4px 4px 0; }
.goal b { display: block; font: 700 1.1875rem/1.35 var(--sans); margin-bottom: .25rem; }

/* Studies list */
.studies { list-style: none; margin: 1.5rem 0; padding: 0; display: grid; gap: 1.25rem; }
.studies li { padding-top: 1rem; border-top: 2px solid var(--coat); }
.studies li { font-size: 1.0625rem; line-height: 1.5; }
.studies b { display: block; font: italic 400 1.6rem/1.15 var(--serif); color: var(--coat); margin-bottom: .35rem; }
.studies span { display: block; color: var(--muted); font: 500 .9375rem/1.4 var(--sans); margin-top: .15rem; }
@media (min-width: 52rem) { .studies { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

/* Media + text rows (fetch teaser, story teaser) */
.feature { display: grid; gap: 2rem 4rem; align-items: center; }
.feature .media img, .feature .media video { width: 100%; border-radius: 3px; }
@media (min-width: 52rem) { .feature { grid-template-columns: 1fr 1fr; } .feature.flip .media { order: 2; } }
.loop { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 3px; background: #cfd3c8; }
.portrait-wrap img { max-height: 42rem; width: 100%; object-fit: cover; border-radius: 3px; }

/* Doors to other pages */
.doors { display: grid; gap: 1rem; margin-top: 1.5rem; }
.door { display: block; padding: 1.4rem 1.4rem 1.3rem; background: #fff; border-radius: 4px; color: var(--ink); text-decoration: none; border: 1px solid rgba(39,35,31,.1); }
.door b { display: block; font: italic 400 1.6rem/1.15 var(--serif); color: var(--coat); margin-bottom: .35rem; }
.door span { font: 500 1.0625rem/1.45 var(--sans); color: var(--muted); }
.door:hover b { text-decoration: underline; text-underline-offset: .2em; }
@media (min-width: 40rem) { .doors { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .doors.four { grid-template-columns: repeat(4, 1fr); } }

/* Steps (a real sequence) */
.steps { list-style: none; counter-reset: step; margin: 2rem 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.75rem 3.75rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -.2rem;
  font: italic 800 2.6rem/1 var(--serif); color: var(--coat);
}
.steps b { display: block; font: 700 1.1875rem/1.35 var(--sans); margin-bottom: .2rem; }

/* Copy-ready text */
.copybox { margin: 1.25rem 0 2rem; background: #fff; border: 1px solid rgba(39,35,31,.12); border-radius: 4px; }
.copybox p { margin: 0; padding: 1.1rem 1.2rem; white-space: pre-line; font-size: 1.0625rem; }
.copybox .bar-row { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.2rem; border-top: 1px solid rgba(39,35,31,.1); }
.copybox button { font: 700 1rem/1.2 var(--sans); background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: .5rem 1rem; cursor: pointer; }
.copybox .status { font: 500 .9375rem/1.3 var(--sans); color: var(--muted); }

/* Ways to give */
.ways { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.ways > li { padding: 1.6rem 0; border-top: 1px solid rgba(39,35,31,.14); }
.ways h3 { margin: 0 0 .5rem; }

/* Guide pages */
.toc { margin: 1.5rem 0 0; padding: 1rem 1.2rem; background: #fff; border-radius: 4px; border: 1px solid rgba(39,35,31,.1); font: 500 1.0625rem/1.5 var(--sans); }
.toc ol { margin: .4rem 0 0; padding-left: 1.3rem; }
.guide h2 { margin-top: 3.5rem; }
.guide h2:first-child { margin-top: 0; }
.guide ul:not(.signs), .guide ol:not(.steps) { padding-left: 1.3rem; }
.guide li { margin-bottom: .45rem; }
.note { font: 500 1rem/1.5 var(--sans); color: var(--muted); padding: 1rem 1.15rem; background: var(--paper-2); border-radius: 4px; }
.resources { list-style: none; padding: 0 !important; }
.resources li { padding: .8rem 0; border-bottom: 1px solid rgba(39,35,31,.12); margin: 0 !important; }
.resources b { display: block; font: 700 1.0625rem/1.35 var(--sans); }
.resources span { display: block; font: 500 1rem/1.45 var(--sans); color: var(--muted); }
.sources { font: 500 .9375rem/1.5 var(--sans); color: var(--muted); padding-left: 1.3rem; }
.sources li { margin-bottom: .4rem; }
sup a { text-decoration: none; font: 700 .75em var(--sans); padding: 0 .1em; }

/* Shelby's story */
.story { padding: 4.5rem 1.25rem 2rem; }
.chapter { max-width: var(--measure); margin: 0 auto 4.5rem; }
figure { margin: 2.25rem 0 0; }
figcaption { margin-top: .6rem; font: 500 .95rem/1.4 var(--sans); color: var(--muted); }
.wide { margin-left: -1.25rem; margin-right: -1.25rem; }
.wide figcaption { padding: 0 1.25rem; }
@media (min-width: 46rem) { .wide { margin-left: -6rem; margin-right: -6rem; } .wide figcaption { padding: 0; } }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-items: start; }
.pair img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.inset { max-width: 18rem; }
.clip { display: block; width: 100%; height: auto; background: #111; border-radius: 3px; }
.last { font-size: 1.375rem; line-height: 1.5; font-style: italic; }
.give-actions { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; margin: 1.75rem 0; }
.copied { font: 500 1rem var(--sans); color: var(--muted); min-height: 1.4em; margin: 0; }
.album { display: block; margin-top: 2.75rem; color: var(--ink); text-decoration: none; }
.album-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.album-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }
.album-text { display: inline-block; margin-top: .8rem; font: 700 1.125rem/1.3 var(--sans); color: var(--coat); text-decoration: underline; text-underline-offset: .2em; }
.album:hover .album-text { color: var(--ink); }

/* Photo album */
.album-intro { max-width: 76rem; margin: 0 auto; padding: 3rem 1.25rem 1.5rem; }
.album-intro h1 { margin: 0; font: italic 800 clamp(3rem, 11vw, 6.5rem)/.9 var(--serif); letter-spacing: -.02em; }
.album-intro p { margin: 1rem 0 0; max-width: 32rem; color: var(--muted); font-size: 1.25rem; }
.years {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: .25rem 1.1rem; overflow-x: auto; scrollbar-width: thin;
  padding: .7rem max(1.25rem, calc((100% - 73.5rem) / 2));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(39,35,31,.1);
  font: 700 1.0625rem/1.2 var(--sans);
}
.years a { color: var(--ink); text-decoration: none; white-space: nowrap; padding: .2rem 0; }
.years a:hover { color: var(--coat); text-decoration: underline; }
.album-main { max-width: 76rem; margin: 0 auto; padding: 0 1.25rem 3rem; }
.year { padding-top: 3rem; }
.year h2 { margin: 0 0 1.25rem; font: italic 800 clamp(3.25rem, 10vw, 6rem)/.9 var(--serif); color: var(--coat); letter-spacing: -.02em; }
/* Justified rows: each tile grows by its aspect ratio (--r), so photos stay uncropped, rows line up, and dates read left to right */
.grid { display: flex; flex-wrap: wrap; gap: 1.25rem .75rem; }
.grid::after { content: ""; flex-grow: 999; }
.tile { flex: var(--r) 1 calc(var(--r) * 9rem); margin: 0; min-width: 0; }
@media (min-width: 46rem) { .tile { flex-basis: calc(var(--r) * 15rem); } }
.tile a { position: relative; display: block; background: #e2e3de; border-radius: 3px; overflow: hidden; }
.tile img { width: 100%; transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.tile a:hover img { transform: scale(1.03); }
.tile figcaption { margin-top: .45rem; font: 500 .9375rem/1.35 var(--sans); color: var(--ink); }
.dur {
  position: absolute; left: .5rem; bottom: .5rem; display: flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem .2rem .45rem; border-radius: 999px; background: rgba(20,22,30,.72); color: #fff; font: 700 .875rem/1.2 var(--sans);
}
.dur::before { content: ""; border-style: solid; border-width: .32rem 0 .32rem .55rem; border-color: transparent transparent transparent #fff; }
.when { display: block; color: var(--muted); font-weight: 500; font-size: .8125rem; }
dialog { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(17,19,26,.97); color: #fff; }
dialog::backdrop { background: rgba(17,19,26,.9); }
body:has(dialog[open]) { overflow: hidden; }
dialog[open] { display: grid; grid-template-rows: 1fr auto; }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: 3.5rem .75rem .5rem; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100svh - 9.5rem); width: auto; height: auto; object-fit: contain; }
.lb-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; max-width: 60rem; width: 100%; margin: 0 auto; padding: .75rem 1rem 1.25rem; }
.lb-cap { margin: 0; text-align: center; font: 500 1.125rem/1.35 var(--sans); }
.lb-cap span { display: block; color: rgba(255,255,255,.65); font-size: .9375rem; }
.lb-btn { width: 3rem; height: 3rem; border: 0; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,.12); color: #fff; font: 400 1.75rem/1 var(--sans); }
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-close { position: absolute; top: .75rem; right: .75rem; }

/* #FetchForShelby gallery: reuse the album's justified rows, two rows that both fill the width */
.p-fetch .grid::after { display: none; }
@media (min-width: 46rem) { .p-fetch .tile { flex-basis: calc(var(--r) * 33%); } }

/* Footer */
.site-foot { padding: 3rem 1.25rem 3.5rem; text-align: center; font: 500 1rem/1.5 var(--sans); color: var(--muted); border-top: 1px solid rgba(39,35,31,.1); }
.site-foot .sig { font: italic 400 1.5rem/1.3 var(--serif); color: var(--ink); margin-bottom: .25rem; }
.site-foot .fine { max-width: 40rem; margin: 1.25rem auto 0; font-size: .9375rem; }

@media (min-width: 46rem) {
  body { font-size: 1.25rem; }
  .hero-text { padding: 0 2.5rem 4rem; }
  .site-head .in { padding: .8rem 2.5rem; }
  .section { padding: 5.5rem 2.5rem; }
  .album-intro { padding: 4rem 2.5rem 2rem; }
  .album-main { padding: 0 2.5rem 3rem; }
}
/* Smooth cross-page fades in browsers that support them; the header stays put */
@view-transition { navigation: auto; }
.site-head { view-transition-name: site-head; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
