/* ecashcard.org: a purpose page. Paper, ink and one copper accent. The motion is rendered film (the hero and one tile
   per reason, from the ecashcard-film repository); the page itself only lets its sections rise in as they arrive. */
@font-face { font-family: "Figtree"; src: url("/assets/fonts/Figtree-Variable.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
:root {
  --paper: #f6f3ec;
  --ink: #17191c;
  --body: #3d4047;
  --muted: #6b6f78;
  --line: rgba(23, 25, 28, .12);
  --copper: #b8651f;
  --copper-dark: #8f4c13;
  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --out: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font: 400 19px/1.6 var(--sans); background: var(--paper); padding-inline: clamp(16px, 5vw, 56px); overflow-x: clip; }
a { color: var(--ink); text-decoration-color: var(--copper); text-underline-offset: 3px; }
a:hover { color: var(--copper-dark); }
a:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; border-radius: 3px; }
.wrap { max-width: 880px; margin: 0 auto; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 28px; }
.lock { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 25px; letter-spacing: -.02em; }
.lock b { font-weight: 800; color: var(--ink); }
.lock span { font-weight: 400; color: var(--muted); }
/* the mark arrives once: the card pops in, the notes fan up from behind it, the word slides in */
.lock .mark { height: 40px; width: auto; overflow: visible; flex: none; }
.lock .mark .c { transform-box: fill-box; transform-origin: center; animation: markPop .5s cubic-bezier(.3, .7, .4, 1) both; }
.lock .mark .n { animation: markNote .6s cubic-bezier(.2, .8, .3, 1) both; }
.lock .mark .n1 { animation-delay: .35s; }
.lock .mark .n2 { animation-delay: .47s; }
.lock .mark .n3 { animation-delay: .59s; }
.lock span { animation: markWord .55s cubic-bezier(.2, .8, .3, 1) .8s both; }
@keyframes markPop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes markNote { 0% { transform: translateY(20px); opacity: 0; } 15% { opacity: 1; } 70% { transform: translateY(-2px); } 100% { transform: translateY(0); opacity: 1; } }
@keyframes markWord { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
header.top nav { display: flex; gap: 22px; font-size: 16px; }
header.top nav a { color: var(--body); text-decoration: none; }
header.top nav a:hover { color: var(--copper-dark); text-decoration: underline; }

.kicker { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--copper-dark); margin: 0 0 18px; }
section { padding-block: clamp(48px, 9vw, 112px); border-top: 1px solid var(--line); }
section.vision { border-top: 0; padding-top: clamp(32px, 7vw, 80px); padding-bottom: clamp(24px, 5vw, 56px); }
h1 { font-size: clamp(42px, 8vw, 84px); line-height: 1.0; font-weight: 800; letter-spacing: -.025em; margin: 0; text-wrap: balance; max-width: 11em; }
.lede { font-size: clamp(19px, 2.4vw, 24px); line-height: 1.5; color: var(--body); max-width: 30em; margin: 28px 0 0; text-wrap: pretty; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 0 0 28px; text-wrap: balance; max-width: 18em; }
h3 { font-size: 21px; font-weight: 700; margin: 18px 0 8px; letter-spacing: -.01em; }
p { margin: 0; }

/* the purpose lines rise in once; the film follows */
.vision .kicker, .vision h1, .vision .lede, figure.film { animation: arrive 1s var(--out) both; }
.vision h1 { animation-delay: .08s; }
.vision .lede { animation-delay: .2s; }
figure.film { animation-delay: .38s; }
@keyframes arrive { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ── The hero film: a little wider than the text column, its edges fading into the paper ───────────── */
figure.film {
  --w: min(1100px, 100vw);
  width: var(--w); margin: clamp(24px, 5vw, 56px) 0 0 calc(50% - var(--w)/2);
  position: relative; aspect-ratio: 16 / 9;
}
figure.film video, figure.film img {
  display: block; width: 100%; height: 100%; object-fit: cover; background: var(--paper);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 13%, #000 87%, transparent), linear-gradient(to bottom, transparent, #000 12%, #000 84%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 13%, #000 87%, transparent), linear-gradient(to bottom, transparent, #000 12%, #000 84%, transparent);
  mask-composite: intersect;
}

/* ── The reasons, each with its tile ───────────────────────────────────────────────────────────────── */
ol.reasons { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 40px); }
ol.reasons li { min-width: 0; }
ol.reasons p { color: var(--body); font-size: 17px; }
figure.tile { margin: 0 0 6px; aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; background: #ece8df;
  box-shadow: 0 0 0 1px rgba(23, 25, 28, .07), 0 14px 32px -12px rgba(23, 25, 28, .22); }
figure.tile.tile-night { background: #0e1118; }
figure.tile video, figure.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* motion off: the films give way to their stills */
figure.film .still, figure.tile .still { display: none; }
@media (prefers-reduced-motion: reduce) {
  figure.film video, figure.tile video { display: none; }
  figure.film .still, figure.tile .still { display: block; }
}

/* ── Sections rise in as they scroll into view, where the browser can tie an animation to scrolling ── */
@supports (animation-timeline: view()) {
  .reveal > :not(.stagger), .stagger > li { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
  .stagger > li:nth-child(2) { animation-range: entry 10% entry 50%; }
  .stagger > li:nth-child(3) { animation-range: entry 20% entry 60%; }
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

dl.commit { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 22px 36px; }
dl.commit dt { font-weight: 700; }
dl.commit dd { margin: 0; color: var(--body); max-width: 34em; }

section.projects ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
section.projects a { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 22px; padding: 22px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
section.projects li:last-child a { border-bottom: 1px solid var(--line); }
section.projects a span { font-size: 17px; color: var(--body); }
section.projects a b { font-size: 21px; color: var(--ink); }
section.projects a .go { font: 600 14px/1 var(--mono); letter-spacing: .04em; color: var(--copper-dark); white-space: nowrap; transition: transform .25s var(--out); }
section.projects a:hover b { color: var(--copper-dark); }
section.projects a:hover .go { transform: translateX(4px); }
.m-cashu { background: #c8e58c; border-radius: 10px; padding: 5px; }

.doc { max-width: 42em; padding-block: clamp(24px, 5vw, 56px); }
.doc h1 { font-size: clamp(34px, 5vw, 52px); max-width: none; margin: 0 0 8px; }
.doc .meta { color: var(--muted); font-size: 15px; margin: 0 0 32px; }
.doc h2 { font-size: 24px; margin: 36px 0 8px; }
.doc p { margin: 0 0 14px; color: var(--body); }
.doc ul { padding-left: 1.2em; color: var(--body); margin: 0 0 14px; }
.doc li + li { margin-top: 6px; }

footer { border-top: 1px solid var(--line); padding-block: 32px 48px; color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--body); }

@media (max-width: 760px) {
  ol.reasons { grid-template-columns: 1fr; }
  dl.commit { grid-template-columns: 1fr; gap: 6px; }
  dl.commit dd { margin-bottom: 16px; }
  section.projects a { grid-template-columns: 48px minmax(0, 1fr); }
  section.projects a .go { grid-column: 2; }
  header.top nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
