/* ============================================================
   Receipts — cosmic-scale £ zoom
   Warm monochrome: cream + forest + terracotta + gold accent
   ============================================================ */

:root {
  /* InclusiFund brand palette — teal / white / light blues */
  --cream: #F7FBFD;
  --cream-deep: #E6F4F8;
  --ink: #0A2A35;
  --ink-soft: #355A68;
  --terracotta: #0F8B8D;
  --terracotta-deep: #0B6E6E;
  --forest: #14B8A6;
  --forest-deep: #082F38;
  --gold: #5DD2D4;
  --gold-warm: #B2E8EA;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --type-serif: "Fraunces", "Canela", Georgia, serif;
  --type-sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--cream);
}

body.receipts-body {
  font-family: var(--type-sans);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--ink);
  color: var(--cream);
  padding: 0.75rem 1rem;
  text-decoration: none;
  z-index: 1000;
  border-radius: 4px;
  font-size: 0.9rem;
}
.skip-link:focus { top: 1rem; }

/* ============================================================
   Fixed stage — canvas + overlay text
   ============================================================ */
.r-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

#receipts-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.r-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  text-align: center;
  gap: 0.7rem;
}

.r-label {
  font-family: var(--type-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.6s var(--ease);
}
.r-overlay.is-transit .r-label {
  opacity: 0;
  transform: translateY(6px);
}

.r-kicker {
  font-family: var(--type-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 0.4rem;
  opacity: 0.7;
}

.r-amount {
  font-family: var(--type-serif);
  font-weight: 900;
  font-size: clamp(3rem, 10vw, 7.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0;
  transition: color 0.6s var(--ease), transform 0.5s var(--ease);
  font-variant-numeric: tabular-nums;
  min-height: 1.1em;
}

.r-fact {
  font-family: var(--type-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 48ch;
  margin: 0.2rem auto 0;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.r-context {
  font-family: var(--type-sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.5;
  margin-top: 2rem;
}

/* Accent states driven by JS via body data-stop-accent */
.receipts-body[data-stop-accent="milestone"] .r-amount { color: var(--terracotta); }
.receipts-body[data-stop-accent="shadow"] .r-amount { color: var(--forest-deep); }
.receipts-body[data-stop-accent="final"] .r-amount { color: var(--terracotta-deep); }

.r-overlay.is-transit .r-fact,
.r-overlay.is-transit .r-amount {
  opacity: 0;
  transform: translateY(8px);
}

/* ============================================================
   Rail indicator
   ============================================================ */
.r-rail {
  position: fixed;
  right: clamp(1rem, 3vw, 2.5rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  z-index: 5;
}

.r-rail-dot {
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--ink-soft);
}
.r-rail-dot::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(31, 36, 32, 0.22);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.r-rail-dot:hover::after {
  background: var(--ink-soft);
  transform: scale(1.3);
}
.r-rail-dot.is-active::after {
  background: var(--terracotta);
  transform: scale(1.5);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.18);
}
.r-rail-label {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translate(10px, -50%);
  font-family: var(--type-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(245, 239, 230, 0.92);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.r-rail-dot:hover .r-rail-label,
.r-rail-dot:focus-visible .r-rail-label {
  opacity: 1;
  transform: translate(-4px, -50%);
}

/* ============================================================
   Scroll-driver container
   ============================================================ */
.r-scroll {
  position: relative;
  z-index: 2;
  pointer-events: none;  /* let stage capture nothing — scroll is via body */
}
.r-stop {
  height: 100vh;
  pointer-events: none;
}
.r-stop-final {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 1.5rem;
  pointer-events: auto;
}

.r-final {
  text-align: center;
  max-width: 680px;
  background: rgba(245, 239, 230, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 32, 0.08);
}
.r-final-kicker {
  font-family: var(--type-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--terracotta);
  margin-bottom: 0.5rem;
}
.r-final-title {
  font-family: var(--type-serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.r-final-tagline {
  font-family: var(--type-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--forest-deep);
  margin-bottom: 2.5rem;
}
.r-final-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  font-family: var(--type-sans);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.25s var(--ease);
}
.cta-primary {
  background: var(--ink);
  color: var(--cream);
}
.cta-primary:hover {
  background: var(--terracotta);
  transform: translateY(-2px);
}
.cta-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(31, 36, 32, 0.18);
}
.cta-ghost:hover {
  background: rgba(31, 36, 32, 0.06);
  transform: translateY(-2px);
}

/* ============================================================
   Motion-off fallback
   ============================================================ */
.r-fallback {
  display: none;
  padding: clamp(2rem, 5vw, 4rem);
  max-width: 760px;
  margin: 0 auto;
}
.r-fallback h1 {
  font-family: var(--type-serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1rem;
}
.f-intro {
  font-family: var(--type-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 40ch;
  margin-bottom: 2.5rem;
  line-height: 1.45;
}
.f-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  border-left: 2px solid var(--terracotta);
  padding-left: 1.5rem;
}
.f-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.f-amount {
  font-family: var(--type-serif);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.f-role {
  font-family: var(--type-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-top: 0.15rem;
}
.f-fact {
  font-family: var(--type-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-top: 0.35rem;
}

html.ck-motion-off .r-stage,
html.ck-motion-off .r-rail,
html.ck-motion-off .r-scroll {
  display: none;
}
html.ck-motion-off .r-fallback {
  display: block;
}
html.ck-motion-off body.receipts-body {
  overflow: auto;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .r-rail { right: 0.6rem; gap: 0.55rem; }
  .r-rail-dot { width: 20px; height: 20px; }
  .r-rail-dot::after { width: 7px; height: 7px; }
  .r-overlay { padding: 1.25rem; }
  .r-context { margin-top: 1.2rem; }
}

/* ============================================================
   OS reduced-motion safeguard
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
