/* Not Forgotten — shared styles for the pitch and budget pages */

/* ---------- Tokens ---------- */
:root {
  --page: #ffffff;
  --page-alt: #f5f5f7;
  --tile: #f5f5f7;
  --tile-on-alt: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --hair: #d2d2d7;
  --link: #0066cc;
  --action: #0071e3;
  --action-hover: #0062cc;
  --bar: #0071e3;
  --track: #e8e8ed;
  --danger: #d70015;
  --chrome: rgba(251,251,253,.8);
  --chrome-ink: #1d1d1f;
  --note-bg: #fff4e0;
  --note-ink: #7a4b00;
  --scrim: rgba(0,0,0,.4);
  --sheet: #ffffff;
  /* Film sections stay dark in both themes */
  --film: #000000;
  --film-ink: #f5f5f7;
  --film-ink-2: #a1a1a6;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: 1rem;
  --ease-spring: cubic-bezier(.16, 1, .3, 1);   /* critically damped feel, no overshoot */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000; --page-alt: #101012; --tile: #1c1c1e; --tile-on-alt: #1c1c1e;
    --ink: #f5f5f7; --ink-2: #d2d2d7; --ink-3: #a1a1a6; --hair: #424245;
    --link: #2997ff; --bar: #2997ff; --track: #2c2c2e; --danger: #ff6961;
    --chrome: rgba(22,22,23,.8); --chrome-ink: #f5f5f7;
    --note-bg: #3d2a06; --note-ink: #ffd38a;
    --scrim: rgba(0,0,0,.6); --sheet: #1c1c1e;
  }
}
@media (min-width: 734px) { :root { --gutter: 2rem; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 3.75rem; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 1.0625rem/1.47 var(--sans); letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, p { margin: 0; }
.wrap { max-width: 61.25rem; margin: 0 auto; padding-inline: var(--gutter); }
.center { text-align: center; }
.measure { max-width: 38rem; margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 50; background: var(--action); color: #fff; padding: .6rem 1rem; border-radius: 999px; }
.skip:focus { top: .5rem; }
.tk {
  display: inline-block; font: 600 .75rem/1 var(--mono); letter-spacing: 0;
  padding: .32em .5em; border-radius: .4em; background: var(--note-bg); color: var(--note-ink);
  vertical-align: .15em; white-space: nowrap;
}

/* Type scale */
.kicker { font-size: clamp(1.0625rem, 2vw, 1.3125rem); font-weight: 600; letter-spacing: .009em; color: var(--ink-3); margin-bottom: .5rem; }
.headline { font-size: clamp(2.5rem, 7.5vw, 4.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; }
.headline-sm { font-size: clamp(2rem, 5.5vw, 3.5rem); font-weight: 700; line-height: 1.07; letter-spacing: -0.03em; }
.subhead { font-size: clamp(1.1875rem, 2.4vw, 1.5rem); line-height: 1.38; font-weight: 500; letter-spacing: -0.012em; color: var(--ink-3); margin-top: 1.25rem; }
.body-lg { font-size: 1.1875rem; line-height: 1.5; color: var(--ink-2); }
.body-lg + .body-lg { margin-top: 1rem; }

.section { padding-block: clamp(5rem, 12vw, 8.75rem); }
.section-sm { padding-block: clamp(3.5rem, 8vw, 5.5rem); }
.alt { background: var(--page-alt); }
.film { background: var(--film); color: var(--film-ink); }
.film .kicker, .film .subhead { color: var(--film-ink-2); }

/* ---------- Local nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; color: var(--chrome-ink);
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--hair) 60%, transparent);
}
.nav .wrap { display: flex; align-items: center; gap: 1.25rem; height: 3.25rem; }
.wordmark { font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.02em; color: inherit; margin-right: auto; }
.wordmark:hover { text-decoration: none; }
.nav-links { display: none; gap: 1.5rem; font-size: .75rem; letter-spacing: -0.01em; }
.nav-links a { color: inherit; opacity: .8; }
.nav-links a:hover, .nav-links a[aria-current] { opacity: 1; text-decoration: none; }
@media (min-width: 834px) { .nav-links { display: flex; } }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 1.75rem; padding: 0 .9rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--action); color: #fff; font: 400 .75rem/1 var(--sans); letter-spacing: -0.01em;
  transition: transform 100ms ease-out, background-color .2s ease;
}
.pill:hover { background: var(--action-hover); text-decoration: none; }
.pill:active { transform: scale(.96); }

/* ---------- Buttons ---------- */
.ctas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem 1.75rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.75rem; padding: 0 1.4rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--action); color: #fff; font: 400 1.0625rem/1 var(--sans); letter-spacing: -0.022em;
  transition: transform 100ms ease-out, background-color .2s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--action-hover); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-quiet { background: var(--tile); color: var(--ink); }
.btn-quiet:hover { background: color-mix(in srgb, var(--tile) 85%, var(--ink)); }
.btn-danger { background: transparent; color: var(--danger); padding-inline: .75rem; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { min-height: 2.25rem; padding-inline: 1rem; font-size: .9375rem; }
.more { font-size: 1.0625rem; color: var(--link); }
.film .more, .film a:not(.btn) { color: #2997ff; }
.more::after { content: " ›"; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(4.5rem, 11vw, 7.5rem); text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: auto 0 0; height: 80%; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 78%, rgba(255,255,255,.10), rgba(255,255,255,0) 70%);
}
.hero .eyebrow { font-size: clamp(1rem, 1.8vw, 1.3125rem); font-weight: 600; color: var(--film-ink-2); letter-spacing: .01em; }
.hero h1 { font-size: clamp(3.5rem, 13vw, 8rem); font-weight: 700; line-height: .95; letter-spacing: -0.045em; margin-top: .75rem; }
.hero .subhead { max-width: 34rem; margin-inline: auto; color: var(--film-ink); }
.hero .narrator { margin-top: 1rem; font-size: clamp(.9375rem, 1.4vw, 1.0625rem); font-weight: 600; letter-spacing: .01em; color: var(--film-ink-2); }
.hero .working { margin-top: 1rem; font-size: .8125rem; color: var(--film-ink-2); }

/* Widescreen still: edges dissolve into the black so it reads as a projected frame. */
.still { position: relative; max-width: 120rem; margin: clamp(2.5rem, 6vw, 4.5rem) auto 0; }
.still img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 86%, transparent 100%);
}
@media (min-width: 734px) { .still img { aspect-ratio: 1920 / 803; } }
.still figcaption {
  position: absolute; right: var(--gutter); bottom: 6%;
  font-size: .75rem; color: rgba(245,245,247,.72); text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.stage { position: relative; perspective: 1000px; padding-block: clamp(3.5rem, 9vw, 6rem) clamp(4.5rem, 11vw, 7.5rem); }
.bracelet {
  --rx: 0deg; --ry: 0deg; --sheen: 30%;
  position: relative; max-width: 50rem; margin: 0 auto;
  padding: clamp(1.15rem, 3.4vw, 2rem) clamp(1rem, 4vw, 2.75rem);
  border-radius: 999px;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  will-change: transform;
  background:
    radial-gradient(120% 220% at var(--sheen) 0%, rgba(255,255,255,.9), rgba(255,255,255,0) 45%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 1px, rgba(0,0,0,.03) 1px 3px),
    linear-gradient(180deg, #f3f3f5 0%, #cfd0d4 44%, #a9abb0 56%, #dedfe2 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95), inset 0 -2px 4px rgba(0,0,0,.25),
    0 40px 80px -30px rgba(255,255,255,.12), 0 30px 60px -20px rgba(0,0,0,.9);
}
.bracelet p {
  font: 600 clamp(.8rem, 3.3vw, 1.625rem)/1 var(--mono); letter-spacing: .16em; color: #3f4145;
  white-space: nowrap; text-shadow: 0 1px 0 rgba(255,255,255,.75), 0 -1px 0 rgba(0,0,0,.28);
}

/* ---------- Intro paragraph (gray with ink emphasis) ---------- */
.intro p {
  max-width: 50rem; margin: 0 auto;
  font-size: clamp(1.5rem, 3.6vw, 2.5rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.025em;
  color: var(--ink-3);
}
.intro strong { color: var(--ink); font-weight: 600; }

/* ---------- Tiles ---------- */
.tiles { display: grid; gap: 1.25rem; margin-top: clamp(2.5rem, 6vw, 4rem); }
@media (min-width: 834px) {
  .tiles-3 { grid-template-columns: repeat(3, 1fr); }
  .tiles-2 { grid-template-columns: repeat(2, 1fr); }
}
/* Documentary photograph: full frame, uncropped, with caption and credit. */
.plate { margin: 1.25rem 0 0; }
.plate img { display: block; width: 100%; height: auto; border-radius: 1.75rem; background: var(--tile); }
.plate figcaption { max-width: 44rem; margin-top: 1rem; font-size: .875rem; line-height: 1.45; color: var(--ink-2); }
.plate .credit { display: block; margin-top: .25rem; font-size: .75rem; color: var(--ink-3); }

.tile { background: var(--tile); border-radius: 1.75rem; padding: 2rem 1.75rem 2.25rem; overflow: hidden; }
.alt .tile { background: var(--tile-on-alt); }
.tile .role { font-size: .875rem; font-weight: 600; color: var(--ink-3); letter-spacing: -0.01em; }
.tile h3 { font-size: clamp(1.5rem, 2.6vw, 1.75rem); font-weight: 700; line-height: 1.14; letter-spacing: -0.025em; margin-top: .4rem; }
.tile p { color: var(--ink-2); margin-top: .75rem; }
.tile .step { font-size: .875rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.photo {
  aspect-ratio: 1 / 1; margin: -2rem -1.75rem 1.75rem; display: grid; place-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 9%, transparent), color-mix(in srgb, var(--ink) 4%, transparent));
  color: var(--ink-3); font: 500 .75rem/1.4 var(--mono); letter-spacing: 0; text-align: center;
}
.photo:has(img) { display: block; overflow: hidden; }
.photo picture, .photo img { display: block; width: 100%; height: 100%; }
.photo img { object-fit: cover; }

/* ---------- Timeline ---------- */
.years { display: grid; gap: 1.25rem; margin: clamp(2.5rem, 6vw, 4rem) 0 0; padding: 0; list-style: none; }
@media (min-width: 734px) { .years { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1068px) { .years { grid-template-columns: repeat(4, 1fr); } }
.year { background: var(--tile-on-alt); border-radius: 1.75rem; padding: 1.75rem; min-height: 15rem; display: flex; flex-direction: column; }
.year .num { font-size: clamp(2.75rem, 5vw, 3.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.year .num .tk { font-size: .875rem; vertical-align: middle; }
.year .date { font-size: .875rem; font-weight: 600; color: var(--ink-3); margin-top: .5rem; min-height: 1.3em; }
.year h3 { font-size: 1.3125rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; margin-top: auto; padding-top: 2rem; }
.year p { color: var(--ink-3); font-size: .9375rem; margin-top: .35rem; }
.year.today { background: var(--ink); color: var(--page); }
.year.today .date, .year.today p { color: color-mix(in srgb, var(--page) 70%, transparent); }

/* ---------- Fact rows (What / Where / Why) ---------- */
.facts { display: grid; gap: 2.5rem; margin-top: clamp(2.5rem, 6vw, 4rem); }
.fact { display: grid; gap: .75rem; padding-top: 1.5rem; border-top: 1px solid var(--hair); }
@media (min-width: 834px) { .fact { grid-template-columns: 14rem 1fr; gap: 2rem; } }
.fact h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.17; }

/* ---------- Notices ---------- */
.notice {
  display: inline-flex; gap: .6rem; align-items: center;
  padding: .65rem 1.1rem; border-radius: 999px; background: var(--note-bg); color: var(--note-ink); font-size: .875rem;
}
.notice[hidden] { display: none; }

/* ---------- Figures & bars ---------- */
.figures { display: grid; gap: 2.5rem 1.5rem; margin: clamp(3rem, 7vw, 4.5rem) 0 0; text-align: center; }
@media (min-width: 734px) { .figures { grid-template-columns: repeat(3, 1fr); } }
.figure { display: flex; flex-direction: column-reverse; }
.figure dd { margin: 0; font-size: clamp(2.75rem, 6vw, 4rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.figure dt { margin-top: .6rem; font-size: 1.0625rem; font-weight: 600; color: var(--ink-3); }
.progress { max-width: 40rem; margin: clamp(3rem, 7vw, 4.5rem) auto 0; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: .9375rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row-head b { color: var(--ink); font-weight: 600; }
.row-head .name { color: var(--ink); font-weight: 600; }
.row-head > span:last-child { white-space: nowrap; text-align: right; }
.track { height: .5rem; border-radius: 999px; background: var(--track); overflow: hidden; margin-top: .6rem; }
.track > i { display: block; height: 100%; width: 100%; background: var(--bar); border-radius: 999px; transform: translateX(-100%); transition: transform 1.1s var(--ease-spring); }
.track > i.over { background: var(--danger); }
.track-lg { height: .75rem; }

/* ---------- Budget page ---------- */
.budget-hero { padding-block: clamp(3.5rem, 9vw, 6rem) clamp(3rem, 7vw, 4.5rem); }
.budget-hero .notice, [data-live-budget] .notice { margin-top: 1.75rem; }
.meter-wrap { max-width: 46rem; margin: clamp(2.5rem, 6vw, 3.5rem) auto 0; text-align: left; }
.meter-wrap .row-head { font-size: 1.0625rem; }
.meter-wrap .row-head b { font-size: 1.75rem; letter-spacing: -0.03em; }

.panel-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.panel-head .headline-sm { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.panel-head p { color: var(--ink-3); margin-top: .35rem; }

.list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.75rem; }
.row-actions { display: none; gap: .25rem; margin-top: .4rem; }
.admin .row-actions { display: flex; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem; font-size: .8125rem; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: .75rem; height: .75rem; border-radius: 3px; background: var(--bar); }
.legend i.track-swatch { background: var(--track); box-shadow: inset 0 0 0 1px var(--hair); }
.sample-tag { font: 600 .75rem/1 var(--sans); letter-spacing: 0; color: var(--note-ink); background: var(--note-bg); border-radius: .35rem; padding: .2rem .35rem; margin-left: .4rem; vertical-align: .1em; white-space: nowrap; }

.totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 2rem 0 0; }
.totals div { background: var(--tile); border-radius: 1.25rem; padding: 1.1rem 1.25rem; }
.alt .totals div { background: var(--tile-on-alt); }
.totals dt { font-size: .8125rem; color: var(--ink-3); font-weight: 600; }
.totals dd { margin: .25rem 0 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* Expense log: table on wide screens, stacked rows on phones */
.log { width: 100%; border-collapse: collapse; margin-top: 2rem; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.log th { text-align: left; font-size: .8125rem; font-weight: 600; color: var(--ink-3); padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--hair); }
.log td { padding: .9rem .75rem .9rem 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.log .num { text-align: right; white-space: nowrap; }
.log td.date { white-space: nowrap; }
.log td.desc { color: var(--ink-2); }
.log .act { display: none; width: 1%; white-space: nowrap; padding-right: 0; }
.admin .log .act { display: table-cell; }
.log tfoot td { font-weight: 700; border-bottom: 0; }
.empty { color: var(--ink-3); padding: 2rem 0; text-align: center; }
@media (max-width: 733px) {
  .log thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .log, .log tbody, .log tfoot { display: block; }
  .log tr { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--hair); }
  .log td { display: block; border: 0; padding: 0; }
  .log td.vendor { font-weight: 600; grid-column: 1; grid-row: 1; }
  .log td.num { grid-column: 2; grid-row: 1; font-weight: 600; }
  .log td.date, .log td.line { color: var(--ink-3); font-size: .875rem; grid-column: 1 / -1; }
  .log td.desc { grid-column: 1 / -1; }
  .admin .log td.act { display: block; grid-column: 1 / -1; }
  .log tfoot tr { border-bottom: 0; }
  .log tfoot td:empty { display: none; }
}

/* ---------- Admin ---------- */
.admin-bar { display: none; background: var(--ink); color: var(--page); font-size: .875rem; }
.admin .admin-bar { display: block; }
.admin-bar .wrap { display: flex; align-items: center; gap: .5rem 1.25rem; min-height: 2.75rem; flex-wrap: wrap; padding-block: .4rem; }
.admin-bar span { margin-right: auto; }
.admin-bar button { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; padding: .4rem 0; min-height: 2.25rem; }
.admin-only { display: none !important; }
.admin .admin-only { display: block !important; }
.admin .admin-only.btn { display: inline-flex !important; }

.add-form { margin-top: 2rem; padding: 1.5rem; border-radius: 1.5rem; background: var(--tile); }
.alt .add-form { background: var(--tile-on-alt); }
.add-form h3 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.02em; }
.fields { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 734px) {
  .fields-expense { grid-template-columns: 10.5rem 9rem 1fr 1fr; }
  .fields-expense .wide { grid-column: 1 / -1; }
  .fields-2 { grid-template-columns: 1fr 1fr; }
  .fields-2 .wide { grid-column: 1 / -1; }
}
.field { display: grid; gap: .35rem; align-content: start; }
.field label { font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  font: 400 1.0625rem/1.3 var(--sans); letter-spacing: -0.022em; color: var(--ink);
  background: var(--page); border: 1px solid var(--hair); border-radius: .75rem; padding: .7rem .8rem; min-height: 2.75rem; width: 100%;
}
.field textarea { min-height: 4.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 30%, transparent); }
.check { display: flex; align-items: center; gap: .6rem; font-size: .9375rem; color: var(--ink-2); min-height: 2.75rem; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--action); }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.25rem; }
.form-error { color: var(--danger); font-size: .9375rem; }
.form-error:empty { display: none; }

/* Sheet dialog: bottom sheet on phones, centered card on wide screens */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 32rem; max-height: 92dvh;
  background: var(--sheet); color: var(--ink); border-radius: 1.5rem 1.5rem 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.25);
}
dialog.sheet::backdrop { background: var(--scrim); }
dialog.sheet[open] { animation: sheet-up .5s var(--ease-spring); }
dialog.sheet[open]::backdrop { animation: fade-in .3s ease; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-pop { from { transform: translateY(1.5rem) scale(.97); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@media (min-width: 734px) {
  dialog.sheet { margin: auto; border-radius: 1.5rem; }
  dialog.sheet[open] { animation-name: sheet-pop; }
}
.sheet form { padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
.sheet .hint { color: var(--ink-3); font-size: .9375rem; margin-top: .4rem; }
.sheet .form-actions { justify-content: flex-end; }
.sheet .form-actions .btn-danger { margin-right: auto; }

/* Toast with undo */
.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 1rem; max-width: calc(100% - 2rem);
  padding: .5rem .6rem .5rem 1.25rem; border-radius: 999px;
  background: var(--ink); color: var(--page); font-size: .9375rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transform: translate(-50%, 0); transition: transform .5s var(--ease-spring), opacity .3s ease;
}
.toast.hide { transform: translate(-50%, 200%); opacity: 0; pointer-events: none; }
.toast button { background: none; border: 0; color: #2997ff; font: 600 .9375rem/1 var(--sans); cursor: pointer; padding: .5rem .75rem; min-height: 2.25rem; border-radius: 999px; }
@media (prefers-color-scheme: dark) { .toast button { color: #0066cc; } }

/* Skeleton while loading */
.loading [data-fig] { color: transparent; background: var(--track); border-radius: .5rem; }

/* ---------- Footer ---------- */
footer { background: var(--page-alt); color: var(--ink-3); font-size: .75rem; line-height: 1.5; padding: 1.5rem 0 3rem; }
footer .rule { border-top: 1px solid var(--hair); margin: 0 0 1rem; }
footer h2 { font-size: .75rem; font-weight: 600; color: var(--ink-2); margin-bottom: .5rem; }
footer ol { margin: 0; padding-left: 1.1rem; }
footer li + li { margin-top: .3rem; }
footer .legal { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
footer .legal button { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
footer .credit { margin-top: 1.5rem; letter-spacing: .01em; }
footer .credit a { color: var(--ink-2); }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(2rem); transition: opacity 1s var(--ease-spring), transform 1s var(--ease-spring); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: .08s; } .js .reveal.d2 { transition-delay: .16s; } .js .reveal.d3 { transition-delay: .24s; }
.js .bracelet-in { opacity: 0; transform: translateY(1.5rem) scale(.96); transition: opacity 1.4s var(--ease-spring), transform 1.4s var(--ease-spring); }
.js .bracelet-in.in { opacity: 1; transform: none; }

/* ---------- Preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .bracelet-in { transform: none !important; transition: opacity .3s linear; }
  .btn:active, .pill:active { transform: none; }
  .track > i { transition: none; }
  dialog.sheet[open], dialog.sheet[open]::backdrop { animation: fade-in .2s ease; }
  .toast { transition: opacity .2s ease; }
  .toast.hide { transform: translate(-50%, 0); }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--page); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --ink-3: var(--ink-2); --hair: var(--ink-3); }
  .nav { background: var(--page); backdrop-filter: none; box-shadow: inset 0 -1px 0 var(--ink); }
  .field input, .field select, .field textarea { border-color: var(--ink); }
}
@media (forced-colors: active) {
  .track { border: 1px solid CanvasText; }
  .track > i { background: Highlight; }
}
