/* Spent. — shared "Ledger" system for spent.eddychong.com
   Olive accent · IBM Plex Sans body · Fraunces serif accents · IBM Plex Mono data.
   Static, dependency-free (Cloudflare Pages ready). */

:root {
  --paper: #f6f4ee;
  --paper-edge: #efece3;
  --ink: #23271d;
  --ink-soft: #5c6152;
  --ink-mute: #8a8d7f;
  --rule: #d9d7cb;
  --rule-soft: #e7e4da;
  --olive: #5a6b47;
  --olive-deep: #445335;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --measure: 40rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- shared atoms ---- */
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .dot { color: var(--olive); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive);
  margin: 0 0 0.5rem;
}

.rule-total {
  border: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  height: 3px;
  margin: 0;
}

a { color: var(--olive-deep); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--olive); }
a:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 2px; }

/* ---- App Store badge (official Apple artwork) ---- */
.appstore-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 9px;
  text-decoration: none;
  transition: transform 0.4s var(--ease);
}
.appstore-badge:hover { transform: translateY(-2px); }
.appstore-badge img { display: block; width: 180px; height: auto; }
.appstore-badge:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }

/* ---- phone storyboard reel (shared engine) ---- */
.reel {
  position: relative;
  width: 270px;
  aspect-ratio: 390 / 844;
  flex: none;
}
.reel-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 38px;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.9s var(--ease), transform 1.4s var(--ease);
  box-shadow: 0 1px 0 rgba(35,39,29,0.04);
}
.reel-screen.is-active { opacity: 1; transform: scale(1); z-index: 2; }
.reel-bezel {
  position: absolute;
  inset: -10px;
  border-radius: 50px;
  border: 1px solid var(--rule);
  pointer-events: none;
  z-index: 3;
}

.reel-caption {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  min-height: 3.6em;
}
.reel-caption .rc-item { display: none; }
.reel-caption .rc-item.is-active { display: block; animation: capIn 0.7s var(--ease) both; }
@keyframes capIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* progress ticks */
.reel-ticks { display: flex; gap: 6px; }
.reel-ticks button {
  appearance: none; border: 0; padding: 0; cursor: pointer;
  width: 26px; height: 3px; background: var(--rule); position: relative; overflow: hidden;
}
.reel-ticks button .fill {
  position: absolute; inset: 0; width: 0; background: var(--olive); transform-origin: left;
}
.reel-ticks button.is-active .fill { width: 100%; transition: width var(--reel-dur, 3.6s) linear; }
.reel-ticks button.is-done .fill { width: 100%; }

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--ink);
  padding: 1.5rem;
}
.footer-inner {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}
.footer-links { display: flex; gap: 1.5rem; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; }
.footer-meta { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); letter-spacing: 0.03em; }

/* ---- reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reel-screen, .reveal, .reel-caption .rc-item { transition: none !important; animation: none !important; }
  .reel-screen { opacity: 1; }
  .reel-screen:not(.is-active) { opacity: 0; }
  .reveal { opacity: 1; transform: none; }
}
