/* Entry 024 — The cancellation page
   Series: The Attention Ledger.
   Scene art direction: the architecture of the automatic — a cold grey-blue server-room
   wall after hours, where charges happen with nobody home. One light source: a cool glow
   from the upper left. One committed temperature: institutional grey-blue, edge to edge,
   the colour of a forgotten direct debit — held against ONE warm amber, used only on the
   true total: the human-warm number on a screen built to stay cold.
   Mini app: one frosted statement panel, three switchable views (the honest page → the
   page you usually get → cancelled). Sharp 6px corners, like a printed statement.
   Display voices: Spectral (the soul — the truth, the per-film line, the cancelled note)
   + Space Mono (the machine — the figures, the chrome, the receipt). Its own recipe. */

:root {
  --cp-deep: #0a1015;        /* darkest — keeps the blue, never black */
  --cp-mid: #2f3b43;         /* cold grey-blue */
  --cp-steel: #5f7282;       /* cold institutional steel */
  --cp-haze: #8ea2af;        /* pale cold light */
  --cp-amber: #e8a24a;       /* the one warm accent — the true total */
  --cp-amber-glow: #f6c47a;
  --cp-amber-deep: #b9802f;
  --cp-on: #e4eaee;          /* never pure white */
  --cp-faint: rgba(196, 212, 222, 0.55);
  --cp-radius: 6px;
  --honest: 0;               /* 0 marketing → 1 honest math, set by JS */
}

.ledger-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 800px;
  padding: 120px 32px;
  border-color: rgba(10, 16, 21, 0.7);
  /* background-first: a real photograph (cold server-room foam) carries the scene; a
     scrim biased to the lower-right keeps the panel legible and the light up-left. */
  background-image:
    linear-gradient(124deg, rgba(8, 13, 18, 0.30) 0%, rgba(8, 13, 18, 0.56) 54%, rgba(6, 10, 14, 0.80) 100%),
    url("../../public/media/backgrounds/night-08-dmitry.jpg");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

/* mid layer — a faint cold hum of light from the upper left (the machine running) */
.hum {
  position: absolute;
  z-index: 0;
  left: 34%;
  top: 34%;
  width: min(760px, 92%);
  height: 460px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(56% 56% at 40% 36%, rgba(142, 172, 188, 0.18), transparent 72%),
    radial-gradient(44% 44% at 66% 70%, rgba(47, 59, 67, 0.26), transparent 78%);
  filter: blur(60px);
  pointer-events: none;
  transition: opacity 800ms ease;
}

/* ------------------------------------------------------------------ */
/* THE MINI APP — one frosted statement panel                          */
/* ------------------------------------------------------------------ */

.statement {
  position: relative;
  z-index: 2;
  width: min(540px, 100%);
  display: grid;
  gap: 22px;
  padding: 30px 34px 34px;
  border-radius: var(--cp-radius);
  font-family: "Space Mono", var(--ui-sans);
  /* cold frosted glass over the photograph */
  background:
    linear-gradient(168deg, rgba(150, 176, 190, 0.12), rgba(12, 22, 30, 0.34));
  border: 1px solid rgba(150, 176, 190, 0.20);
  box-shadow:
    0 1px 0 rgba(208, 224, 232, 0.22) inset,
    0 0 0 1px rgba(7, 12, 17, 0.22),
    0 60px 130px rgba(5, 10, 16, 0.68),
    0 16px 50px rgba(34, 50, 64, 0.30);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  color: var(--cp-on);
}

/* ---- view switch: a quiet segmented control ---- */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 4px;
  background: rgba(12, 22, 30, 0.40);
  border: 1px solid rgba(150, 176, 190, 0.14);
}
.seg-btn {
  flex: 1;
  padding: 9px 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  font-family: "Space Mono", var(--ui-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--cp-faint);
  transition: background 200ms ease, color 200ms ease;
}
.seg-btn:hover { color: var(--cp-on); }
.seg-btn.is-on {
  background: rgba(150, 176, 190, 0.14);
  color: var(--cp-on);
  box-shadow: 0 1px 0 rgba(208, 224, 232, 0.14) inset;
}

/* ---- sub meta line: the machine, recessive ---- */
.sub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--cp-faint);
}
.sub-meta .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cp-haze);
  box-shadow: 0 0 9px rgba(142, 172, 188, 0.7);
}
.sub-meta .plan { color: rgba(220, 232, 238, 0.86); }
.sub-meta .sep { opacity: 0.4; }

.view { display: grid; gap: 22px; }
[hidden] { display: none !important; }

/* ---- the truth: a plain ledger of what you got for what you paid ---- */
.truth { margin: 0; display: grid; gap: 0; }
.truth-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(150, 176, 190, 0.12);
}
.truth-row:first-child { padding-top: 2px; }
.truth dt {
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-size: clamp(14px, 1.7vw, 16px);
  color: rgba(214, 228, 236, 0.80);
}
.truth dd { margin: 0; }
.truth .num {
  font-family: "Space Mono", var(--ui-sans);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--cp-on);
  white-space: nowrap;
}

/* the focal point: the total — warms from cold steel to amber as honesty rises */
.truth-row.is-total {
  margin-top: 4px;
  padding-top: 16px;
  border-bottom: 0;
  border-top: 1px solid rgba(150, 176, 190, 0.22);
}
.truth-row.is-total dt {
  font-size: clamp(15px, 1.9vw, 18px);
  color: var(--cp-on);
}
.truth .total {
  font-size: clamp(26px, 4.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: color-mix(in oklab, var(--cp-steel) calc((1 - var(--honest)) * 100%), var(--cp-amber) calc(var(--honest) * 100%));
  text-shadow: 0 0 calc(var(--honest) * 30px) rgba(246, 196, 122, calc(var(--honest) * 0.45));
  transition: color 200ms linear, text-shadow 200ms linear;
}

/* ---- marketing ↔ ledger morph ---- */
.morph { position: relative; min-height: 108px; }
.morph-marketing {
  opacity: calc(1 - var(--honest));
  transition: opacity 240ms ease;
}
.mk-head {
  margin: 0 0 12px;
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(206, 222, 232, 0.78);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.tile {
  height: 48px;
  border-radius: 4px;
  background:
    linear-gradient(150deg, rgba(120, 150, 170, 0.30), rgba(60, 80, 96, 0.20));
  border: 1px solid rgba(150, 176, 190, 0.18);
}
.morph-ledger {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  align-content: center;
  opacity: var(--honest);
  transition: opacity 240ms ease;
  pointer-events: none;
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-size: clamp(16px, 2.1vw, 20px);
  line-height: 1.5;
  color: rgba(222, 234, 240, 0.92);
  text-wrap: balance;
}
.morph-ledger .hl {
  color: var(--cp-amber);
  font-weight: 500;
  white-space: nowrap;
}
.morph-ledger { pointer-events: none; }
.statement[data-honest="on"] .morph-ledger { pointer-events: auto; }

/* ---- the honest-math slider ---- */
.honest-slider {
  display: grid;
  gap: 10px;
  cursor: pointer;
}
.slider-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cp-faint);
}
#mathRange {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--cp-amber) calc(var(--honest) * 100%),
    rgba(150, 176, 190, 0.22) calc(var(--honest) * 100%)
  );
  cursor: pointer;
}
#mathRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cp-amber-glow);
  border: 1px solid var(--cp-amber-deep);
  box-shadow: 0 4px 14px rgba(184, 128, 47, 0.45);
  transition: transform 140ms ease;
}
#mathRange::-webkit-slider-thumb:hover { transform: scale(1.12); }
#mathRange::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cp-amber-glow);
  border: 1px solid var(--cp-amber-deep);
}

/* ---- cancel: the calmest, clearest thing on the honest page ---- */
.btn {
  font-family: "Space Mono", var(--ui-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--cp-radius);
  padding: 15px 26px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 180ms ease, background 220ms ease, border-color 220ms ease, color 220ms ease, box-shadow 220ms ease;
}
.btn-cancel {
  justify-self: stretch;
  background: rgba(228, 234, 238, 0.92);
  color: #14202a;
  border-color: rgba(228, 234, 238, 0.5);
  box-shadow: 0 10px 30px rgba(8, 16, 24, 0.4);
}
.btn-cancel:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(8, 16, 24, 0.5); }
.cancel-hint {
  margin: -6px 0 0;
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 13.5px;
  color: rgba(196, 212, 222, 0.62);
}

/* ================================================================== */
/* RETENTION (dark-pattern) VIEW — the page they actually ship         */
/* ================================================================== */

.view-usual { gap: 18px; place-items: stretch; text-align: center; }
.winback-eyebrow {
  margin: 0;
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-size: clamp(17px, 2.4vw, 22px);
  color: var(--cp-on);
}
/* the inflating offer — loud, the cold irony focal point of this view */
.balloon {
  justify-self: center;
  display: grid;
  place-items: center;
  gap: 2px;
  width: 168px; height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, var(--cp-amber-glow), var(--cp-amber) 58%, var(--cp-amber-deep));
  box-shadow: 0 18px 50px rgba(184, 128, 47, 0.45), 0 0 0 8px rgba(232, 162, 74, 0.12);
  transform: scale(0.4);
  opacity: 0;
}
.statement[data-view="usual"] .balloon {
  animation: inflate 620ms cubic-bezier(0.18, 1.3, 0.4, 1) 120ms both;
}
.balloon-big {
  font-family: "Space Mono", var(--ui-sans);
  font-size: 34px; font-weight: 700;
  color: #2a1a06;
  letter-spacing: -0.01em;
}
.balloon-small {
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: #3a260a;
}
.tiles-loud { grid-template-columns: repeat(6, 1fr); gap: 7px; opacity: 0.9; }
.tiles-loud .tile {
  height: 34px;
  background: linear-gradient(150deg, rgba(150, 180, 200, 0.45), rgba(90, 116, 136, 0.30));
}
.winback-fine {
  margin: 0;
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(214, 228, 236, 0.78);
}
.btn-stay {
  justify-self: center;
  min-width: 240px;
  background: linear-gradient(180deg, var(--cp-amber-glow), var(--cp-amber));
  color: #2a1a06;
  border-color: var(--cp-amber-deep);
  box-shadow: 0 12px 34px rgba(184, 128, 47, 0.42);
}
.btn-stay:hover { transform: translateY(-2px); }
/* cancel demoted to a grey link buried under the offer */
.cancel-link {
  justify-self: center;
  font-family: "Space Mono", var(--ui-sans);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: rgba(150, 170, 182, 0.42);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cancel-link:hover { color: rgba(180, 198, 208, 0.7); }

/* ================================================================== */
/* CANCELLED (terminal) VIEW                                            */
/* ================================================================== */

.view-done { gap: 14px; place-items: center; text-align: center; padding: 18px 0 8px; }
.done-mark {
  margin: 0;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 24px;
  color: var(--cp-amber);
  border: 1px solid rgba(232, 162, 74, 0.5);
  background: rgba(232, 162, 74, 0.08);
}
.done-head {
  margin: 0;
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 500;
  color: var(--cp-on);
}
.done-line {
  margin: 0;
  max-width: 38ch;
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.5;
  color: rgba(218, 230, 238, 0.86);
}
.done-fig {
  font-family: "Space Mono", var(--ui-sans);
  font-weight: 700;
  color: var(--cp-amber);
  font-variant-numeric: tabular-nums;
}
.done-quiet {
  margin: 0;
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: rgba(196, 212, 222, 0.62);
}

/* photo attribution */
.scene-credit {
  position: absolute;
  right: 16px;
  bottom: 13px;
  z-index: 3;
  font-family: "Space Mono", var(--ui-sans);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(216, 228, 236, 0.30);
  pointer-events: none;
}

/* the hum dims when the dark-pattern view is showing — colder, busier */
.ledger-scene:has(.statement[data-view="usual"]) .hum { opacity: 0.6; }
.ledger-scene:has(.statement[data-view="done"]) .hum { opacity: 0.4; }

@keyframes inflate {
  from { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  to   { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .statement[data-view="usual"] .balloon { animation: none; transform: scale(1); opacity: 1; }
  .total, .morph-marketing, .morph-ledger { transition: none; }
}

/* ---- small screens ---- */
@media (max-width: 720px) {
  .ledger-scene { padding: 72px 16px; min-height: 0; }
  .statement { padding: 24px 22px 28px; gap: 18px; }
  .truth .total { font-size: 28px; }
  .balloon { width: 140px; height: 140px; }
  .balloon-big { font-size: 28px; }
  .tiles-loud { grid-template-columns: repeat(4, 1fr); }
}
