/* Entry 021 — The child's ledger
   Series: Glass Houses (new).
   Scene art direction: blue hour. A lone snow peak under a soft cloud in a cool
   twilight sky — something small and watched-over, exposed under a wide sky. The
   machine's dossier on a child floats as a dark frosted panel; almost all of it
   is cool slate certainty. ONE warm rose note — the human line, the way out — is
   the only warmth, pulled from the faint blush already in the cloud.
   One accent: soft rose. Display voices distinct to this entry: Lora (the soul,
   the human) + Plus Jakarta Sans (the machine). Pillowy radii, tender.
   Don't reuse the previous entry's recipe (020 was cool water / copper-coral /
   DM Serif + Sora / soft radii). This is blue-hour sky / rose / Lora + Jakarta. */

.ledger-scene {
  --accent: #e0789a;          /* soft rose — the human note, the faint blush in the cloud */
  --accent-glow: #f2a9c0;
  --accent-deep: #c45c80;
  --machine: #c7d6ea;         /* cool slate — the machine's voice */
  --machine-faint: rgba(180, 198, 222, 0.56);
  --on-dark: #eef3fa;
  --glass-line: rgba(176, 200, 230, 0.24);

  position: relative;
  display: grid;
  place-items: center;
  min-height: 820px;
  padding: 120px 32px;
  border-color: rgba(8, 16, 30, 0.7);
  /* background-first: a real photograph (blue-hour peak, faint warm cloud) carries
     the scene; a cool scrim, darker toward the panel, keeps the dark glass legible. */
  background-image:
    linear-gradient(178deg, rgba(6, 14, 30, 0.52) 0%, rgba(7, 16, 33, 0.30) 38%, rgba(5, 11, 24, 0.74) 100%),
    url("../../public/media/backgrounds/cool-15-marek.jpg");
  background-size: cover, cover;
  background-position: center, center 38%;
  background-repeat: no-repeat, no-repeat;
  font-family: "Plus Jakarta Sans", var(--ui-sans);
}

/* mid layer — a soft dark pool of shade behind the panel, so the glass reads */
.shade {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 56%;
  width: min(820px, 92%);
  height: 560px;
  transform: translate(-50%, -50%);
  background: radial-gradient(58% 56% at 50% 50%, rgba(5, 11, 24, 0.66), transparent 74%);
  filter: blur(36px);
  pointer-events: none;
}

/* mid layer — the rose blush of the cloud, spilled faintly */
.blush {
  position: absolute;
  z-index: 0;
  left: 52%;
  top: 30%;
  width: min(560px, 70%);
  height: 260px;
  transform: translate(-50%, -50%);
  background: radial-gradient(56% 56% at 50% 50%, rgba(224, 120, 154, 0.14), transparent 72%);
  filter: blur(56px);
  pointer-events: none;
  transition: opacity 900ms ease;
}

/* ------------------------------------------------------------------ */
/* THE COMPONENT — one frosted-glass dossier panel                     */
/* ------------------------------------------------------------------ */

.ledger-panel {
  position: relative;
  z-index: 2;
  width: min(640px, 100%);
  display: grid;
  gap: 22px;
  padding: 34px 34px 30px;
  border-radius: 30px;
  background:
    linear-gradient(164deg, rgba(150, 180, 216, 0.13), rgba(10, 20, 38, 0.34));
  border: 1px solid var(--glass-line);
  box-shadow:
    0 1px 0 rgba(212, 228, 248, 0.26) inset,
    0 0 0 1px rgba(6, 12, 24, 0.22),
    0 60px 130px rgba(4, 9, 20, 0.68),
    0 16px 50px rgba(20, 44, 90, 0.30);
  backdrop-filter: blur(32px) saturate(1.2);
  -webkit-backdrop-filter: blur(32px) saturate(1.2);
  color: var(--on-dark);
}

/* header: the child, named */
.lp-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.lp-id { margin: 0; display: grid; gap: 3px; }
.lp-name {
  font-family: "Lora", "Newsreader", Georgia, serif;
  font-size: clamp(24px, 3.4vw, 31px);
  font-weight: 500;
  letter-spacing: 0.004em;
  color: #f4eef1;
}
.lp-name b { font-weight: 500; color: var(--machine-faint); font-size: 0.7em; }
.lp-meta {
  font-family: "Plus Jakarta Sans", var(--ui-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(180, 198, 222, 0.56);
}
.lp-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(224, 120, 154, 0.8);
  margin-right: 6px;
  vertical-align: middle;
}

/* the segmented control */
.lp-seg {
  display: inline-flex;
  align-self: start;
  padding: 4px;
  border-radius: 999px;
  background: rgba(10, 20, 38, 0.5);
  border: 1px solid rgba(176, 200, 230, 0.18);
}
.lp-seg button {
  font-family: "Plus Jakarta Sans", var(--ui-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 9px 15px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(196, 212, 230, 0.66);
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease;
}
.lp-seg button[aria-pressed="true"] {
  background: rgba(199, 214, 234, 0.16);
  color: #f1f6fc;
}
.lp-seg button.owed[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #2a0f1a;
  box-shadow: 0 8px 22px rgba(224, 120, 154, 0.32);
}

/* ---- the views ---- */
.lp-view { display: none; }
.ledger-panel[data-view="see"] .v-see { display: grid; gap: 14px; }
.ledger-panel[data-view="they"] .v-they { display: grid; gap: 6px; }
.ledger-panel[data-view="owed"] .v-owed { display: grid; gap: 18px; }

/* the screen-time view — all a parent is shown today */
.st-card {
  display: grid;
  gap: 12px;
  padding: 22px 22px 24px;
  border-radius: 20px;
  background: rgba(14, 26, 46, 0.4);
  border: 1px solid rgba(176, 200, 230, 0.16);
}
.st-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.st-label {
  font-family: "Plus Jakarta Sans", var(--ui-sans);
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(180, 198, 222, 0.62);
}
.st-value {
  font-family: "Lora", Georgia, serif;
  font-size: 30px; font-weight: 500; color: #eef3fa;
  font-variant-numeric: tabular-nums;
}
.st-bar { height: 7px; border-radius: 999px; background: rgba(176, 200, 230, 0.16); overflow: hidden; }
.st-bar i { display: block; height: 100%; width: 58%; border-radius: 999px;
  background: linear-gradient(90deg, rgba(199, 214, 234, 0.7), rgba(146, 179, 219, 0.85)); }
.st-foot {
  margin: 4px 0 0;
  font-family: "Lora", Georgia, serif; font-style: italic;
  font-size: 15px; color: rgba(196, 212, 230, 0.7);
}

/* the dossier — what the machines see */
.dos-lead {
  margin: 0 0 8px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(224, 120, 154, 0.3);
  background: rgba(224, 120, 154, 0.08);
  font-family: "Lora", Georgia, serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--accent-glow);
}
.dos-lead span {
  display: block;
  font-family: "Plus Jakarta Sans", var(--ui-sans);
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(224, 120, 154, 0.72);
  margin-bottom: 4px;
}
.dos-rows { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.dos-row {
  display: grid;
  gap: 2px;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(176, 200, 230, 0.1);
  cursor: pointer;
  transition: background 200ms ease, opacity 360ms ease;
}
.dos-row:last-child { border-bottom: none; }
.dos-row:hover { background: rgba(176, 200, 230, 0.05); }
.dos-find {
  font-family: "Plus Jakarta Sans", var(--ui-sans);
  font-size: 15px; font-weight: 500; color: var(--machine);
}
.dos-find b { font-weight: 700; color: #e9f1fb; }
.dos-src {
  font-family: "Plus Jakarta Sans", var(--ui-sans);
  font-size: 11px; letter-spacing: 0.06em;
  color: rgba(170, 190, 216, 0.5);
}
.dos-caveat {
  max-height: 0; overflow: hidden; opacity: 0;
  margin: 0; padding-left: 0;
  font-family: "Lora", Georgia, serif; font-style: italic;
  font-size: 14px; color: var(--accent-glow);
  border-left: 2px solid var(--accent);
  transition: max-height 360ms ease, opacity 300ms ease, padding-left 300ms ease, margin-top 300ms ease;
}
.dos-row.is-open .dos-caveat {
  max-height: 60px; opacity: 1; padding-left: 12px; margin-top: 8px;
}

/* the owed view — what a child gets to keep */
.owed-line {
  margin: 0;
  font-family: "Lora", "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: clamp(22px, 3.2vw, 29px);
  line-height: 1.24;
  color: #f6eef1;
  text-wrap: balance;
}
.owed-line em { font-style: italic; color: var(--accent-glow); }
.owed-sub {
  margin: -6px 0 0;
  font-family: "Plus Jakarta Sans", var(--ui-sans);
  font-size: 14px; line-height: 1.5; color: rgba(196, 212, 230, 0.7);
  max-width: 46ch;
}
.owed-close {
  justify-self: start;
  font-family: "Plus Jakarta Sans", var(--ui-sans);
  font-size: 14px; font-weight: 600;
  border-radius: 999px;
  padding: 13px 24px;
  border: 1px solid rgba(224, 120, 154, 0.45);
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #2a0f1a;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(224, 120, 154, 0.3);
  transition: transform 170ms ease, box-shadow 200ms ease;
}
.owed-close:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(224, 120, 154, 0.42); }
.ledger-panel.is-closed .owed-close { display: none; }
.ledger-panel.is-closed .owed-line { color: var(--accent-glow); }

/* footer note line */
.lp-note {
  margin: 0;
  font-family: "Plus Jakarta Sans", var(--ui-sans);
  font-size: 12px; line-height: 1.5;
  color: rgba(180, 198, 222, 0.56);
  border-top: 1px solid rgba(176, 200, 230, 0.14);
  padding-top: 16px;
}

/* unobtrusive photo attribution */
.scene-credit {
  position: absolute;
  right: 16px; bottom: 13px; z-index: 3;
  font-family: var(--ui-sans);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(220, 230, 246, 0.34);
  pointer-events: none;
}

.ledger-scene:has(.ledger-panel[data-view="they"]) .blush { opacity: 1; }
.ledger-scene:has(.ledger-panel[data-view="see"]) .blush { opacity: 0.5; }

@media (prefers-reduced-motion: reduce) {
  .dos-caveat, .blush { transition: none; }
}

@media (max-width: 720px) {
  .ledger-scene { padding: 72px 14px; min-height: 0; }
  .ledger-panel { padding: 26px 22px 24px; border-radius: 24px; gap: 18px; }
  .lp-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .lp-seg { flex-wrap: wrap; }
}
