/* life — quantum life optimization
 * Scoped to .legacy-scrolly[data-legacy="tim-life"] for hub embedding.
 */

.legacy-scrolly[data-legacy="tim-life"] {
  --bg:         #FAF8F4;
  --bg-alt:     #F1ECE2;
  --ink:        #0A0A0A;
  --text:       #1F1F1B;
  --muted:      #5C5A52;
  --rule:       rgba(10,10,10,0.12);
  --teal:       #0F766E;
  --teal-pale:  #CCFBF1;
  --clay:       #B45309;
  --rust:       #9F1239;

  --fg:         var(--text);
  --line:       var(--rule);
  --line-strong:rgba(10,10,10,0.20);
  --teal-soft:  rgba(15,118,110,0.12);
  --panel:      #F4F0E6;
  --panel-light:#FBF8F1;

  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --display:    "Newsreader", Georgia, serif;
  --serif:      "Source Serif 4", "Newsreader", Georgia, serif;
  --body:       "Source Serif 4", Georgia, serif;
  --ui:         "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:       "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga", "onum";
}

.legacy-scrolly[data-legacy="tim-life"] *,
.legacy-scrolly[data-legacy="tim-life"] *::before,
.legacy-scrolly[data-legacy="tim-life"] *::after {
  box-sizing: border-box;
}

.legacy-scrolly[data-legacy="tim-life"] main { max-width: 100%; overflow-x: hidden; }

/* ============================================================
 * 3-COLUMN GRID
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] section {
  display: grid;
  grid-template-columns: 1fr min(1080px, calc(100% - 48px)) 1fr;
  padding: 128px 0;
  opacity: 1;
  transform: none;
  position: relative;
  z-index: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .legacy-scrolly[data-legacy="tim-life"] section:not(.visible):not(.hero) {
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 377ms var(--ease), transform 377ms var(--ease);
  }
}
.legacy-scrolly[data-legacy="tim-life"] section.visible { opacity: 1; transform: scale(1); }

.legacy-scrolly[data-legacy="tim-life"] section > * {
  grid-column: 2;
  justify-self: start;
  width: 100%;
  max-width: 640px;
  min-width: 0;
}

.legacy-scrolly[data-legacy="tim-life"] section > h1,
.legacy-scrolly[data-legacy="tim-life"] section > h2,
.legacy-scrolly[data-legacy="tim-life"] section > .bignum-row,
.legacy-scrolly[data-legacy="tim-life"] section > .chart-wrap,
.legacy-scrolly[data-legacy="tim-life"] section > .breakout {
  max-width: 100%;
}

/* alternating background — full bleed via pseudo */
.legacy-scrolly[data-legacy="tim-life"] section[data-bg="alt"]::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background: var(--bg-alt);
  z-index: -1;
}

/* ============================================================
 * TYPOGRAPHY — body
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] p {
  margin: 0 0 24px 0;
  max-width: 640px;
  color: var(--text);
  text-wrap: pretty;
  hanging-punctuation: first;
}

.legacy-scrolly[data-legacy="tim-life"] a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(15,118,110,0.3);
  transition: text-decoration-color 144ms var(--ease);
}
.legacy-scrolly[data-legacy="tim-life"] a:hover { text-decoration-color: var(--teal); }

.legacy-scrolly[data-legacy="tim-life"] strong { color: var(--ink); }

/* ============================================================
 * TYPOGRAPHY — headings
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 32px 0;
  text-wrap: balance;
  max-width: 100%;
}

.legacy-scrolly[data-legacy="tim-life"] h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 5.2vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 40px 0;
  text-wrap: balance;
}

.legacy-scrolly[data-legacy="tim-life"] h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  margin: 32px 0 16px 0;
  text-wrap: balance;
}

/* ============================================================
 * KICKER
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] .kicker {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 24px 0;
  display: block;
  hyphens: none;
  word-break: keep-all;
  text-wrap: balance;
}

/* ============================================================
 * DEK
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] .dek {
  font-family: var(--display);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 400;
  line-height: 1.45;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 56px 0;
  max-width: 560px;
  text-wrap: balance;
}

/* ============================================================
 * DROP CAPS
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] p.dropcap::first-letter {
  font-family: var(--display);
  font-weight: 500;
  font-size: 88px;
  line-height: 0.85;
  float: left;
  color: var(--ink);
  padding: 8px 14px 0 0;
  margin-top: 4px;
}

/* ============================================================
 * BIGNUM ROW — hero stats
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] .bignum-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 48px 0 40px;
  max-width: 100%;
  align-items: start;
}

.legacy-scrolly[data-legacy="tim-life"] .bignum { text-align: left; }

.legacy-scrolly[data-legacy="tim-life"] .bignum .n {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  color: var(--teal);
  display: block;
  font-feature-settings: "tnum" 1;
  margin-bottom: 8px;
  white-space: nowrap;
}
.legacy-scrolly[data-legacy="tim-life"] .bignum .n .x { font-size: 0.85em; }
.legacy-scrolly[data-legacy="tim-life"] .bignum .n .sup {
  font-size: 0.6em;
  vertical-align: super;
  line-height: 0;
}

.legacy-scrolly[data-legacy="tim-life"] .bignum .lbl {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  line-height: 1.4;
}

/* ============================================================
 * CHARTS
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] canvas {
  display: block;
  max-width: 100%;
  height: 380px;
}

.legacy-scrolly[data-legacy="tim-life"] section > .chart-wrap {
  width: 100%;
  max-width: 1080px;
  justify-self: center;
}

.legacy-scrolly[data-legacy="tim-life"] .chart-wrap {
  margin: 40px 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 28px 28px 22px;
  position: relative;
}
.legacy-scrolly[data-legacy="tim-life"] section[data-bg="alt"] .chart-wrap { background: var(--bg-alt); }

.legacy-scrolly[data-legacy="tim-life"] .chart-wrap canvas { width: 100%; display: block; }

.legacy-scrolly[data-legacy="tim-life"] .source-credit {
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 8px;
  text-align: right;
  display: block;
}

/* ============================================================
 * NUMBERS + CODE
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] code,
.legacy-scrolly[data-legacy="tim-life"] .mono { font-family: var(--mono); font-size: 0.92em; }

.legacy-scrolly[data-legacy="tim-life"] pre {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 15px;
  overflow-x: auto;
  line-height: 1.6;
}

.legacy-scrolly[data-legacy="tim-life"] pre.big-eq {
  font-family: var(--mono);
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 400;
  color: var(--teal);
  background: rgba(15,118,110,0.06);
  border: 0;
  border-left: 3px solid var(--teal);
  padding: 16px 24px;
  border-radius: 6px;
  margin: 28px 0;
  text-align: left;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
}
.legacy-scrolly[data-legacy="tim-life"] pre.big-eq sup { font-size: 0.6em; vertical-align: super; line-height: 0; }

/* ============================================================
 * SLIDERS
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] .slider-row { margin: 12px 0; }
.legacy-scrolly[data-legacy="tim-life"] .slider-row label {
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 12px;
}
.legacy-scrolly[data-legacy="tim-life"] .slider-row .val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  background: var(--teal-pale);
  color: var(--teal);
  padding: 2px 8px;
  border-radius: 3px;
  min-width: 28px;
  text-align: center;
}

.legacy-scrolly[data-legacy="tim-life"] input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  cursor: pointer;
  margin: 0;
  accent-color: var(--teal);
}

.legacy-scrolly[data-legacy="tim-life"] input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(26,26,26,0.14);
  border-radius: 2px;
  border: none;
}

.legacy-scrolly[data-legacy="tim-life"] input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(13,148,136,0.4);
  margin-top: -8px;
  cursor: pointer;
}

/* ============================================================
 * LIVE COUNTER
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] .live-counter {
  background: rgba(15,118,110,0.04);
  border: 1px solid rgba(15,118,110,0.15);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 32px 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.legacy-scrolly[data-legacy="tim-life"] .counter-label {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.legacy-scrolly[data-legacy="tim-life"] .counter-value {
  font-family: var(--mono);
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 500;
  color: var(--teal);
  line-height: 1.2;
  font-feature-settings: "tnum" 1;
}

/* ============================================================
 * LISTS
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] ul,
.legacy-scrolly[data-legacy="tim-life"] ol {
  max-width: 640px;
  padding-left: 24px;
}
.legacy-scrolly[data-legacy="tim-life"] li {
  margin-bottom: 12px;
  line-height: 1.65;
}

/* ============================================================
 * RECEIPT BLOCKS — collapsible proof details
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] .receipt-block {
  margin: 20px 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.legacy-scrolly[data-legacy="tim-life"] .receipt-block summary {
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  background: rgba(15,118,110,0.03);
  transition: background 144ms var(--ease);
}
.legacy-scrolly[data-legacy="tim-life"] .receipt-block summary:hover { background: rgba(15,118,110,0.06); }
.legacy-scrolly[data-legacy="tim-life"] .receipt-block summary::-webkit-details-marker { display: none; }
.legacy-scrolly[data-legacy="tim-life"] .receipt-block summary::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 10px;
  font-size: 11px;
  color: var(--teal);
  transition: transform 144ms var(--ease);
}
.legacy-scrolly[data-legacy="tim-life"] .receipt-block[open] summary::before { transform: rotate(90deg); }

.legacy-scrolly[data-legacy="tim-life"] .receipt-body {
  padding: 20px;
  border-top: 1px solid var(--rule);
}

.legacy-scrolly[data-legacy="tim-life"] .lean-sig {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--ink);
  color: #E8E6DF;
  padding: 16px 20px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0 0 16px;
  border: none;
}
.legacy-scrolly[data-legacy="tim-life"] .lean-sig code { background: none; padding: 0; color: inherit; font-size: inherit; }

.legacy-scrolly[data-legacy="tim-life"] .axiom-list {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  background: rgba(15,118,110,0.04);
  padding: 12px 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0 0 12px;
  color: var(--muted);
  border: none;
}
.legacy-scrolly[data-legacy="tim-life"] .axiom-list code { background: none; padding: 0; color: inherit; font-size: inherit; }

.legacy-scrolly[data-legacy="tim-life"] .receipt-note {
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--teal);
  margin: 8px 0 0;
}

/* ============================================================
 * CODA
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] section.coda {
  text-align: center;
  padding: 96px 0;
}
.legacy-scrolly[data-legacy="tim-life"] section.coda > .coda-text {
  max-width: 640px;
  margin: 0 auto;
  justify-self: center;
}
.legacy-scrolly[data-legacy="tim-life"] .coda-text {
  font-family: var(--display);
  font-size: clamp(18px, 2.5vw, 26px);
  line-height: 1.55;
  font-style: italic;
  color: var(--muted);
}

/* ============================================================
 * FOOTER
 * ============================================================ */
.legacy-scrolly[data-legacy="tim-life"] footer {
  padding: 60px 0 100px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: lowercase;
  color: var(--fg);
  border-top: 1px solid var(--rule);
}

/* ============================================================
 * MOBILE
 * ============================================================ */
@media (max-width: 768px) {
  .legacy-scrolly[data-legacy="tim-life"] {
    font-size: 18px;
  }
  .legacy-scrolly[data-legacy="tim-life"] section {
    grid-template-columns: 1fr calc(100% - 32px) 1fr;
    padding: 80px 0;
  }
  .legacy-scrolly[data-legacy="tim-life"] section > * { max-width: 100%; }
  .legacy-scrolly[data-legacy="tim-life"] h1 { font-size: clamp(32px, 8vw, 48px); }
  .legacy-scrolly[data-legacy="tim-life"] h2 { font-size: clamp(24px, 6vw, 40px); }
  .legacy-scrolly[data-legacy="tim-life"] .dek { margin-bottom: 40px; }
  .legacy-scrolly[data-legacy="tim-life"] .bignum-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 32px 0 24px;
  }
  .legacy-scrolly[data-legacy="tim-life"] .chart-wrap { padding: 20px 16px 16px; }
  .legacy-scrolly[data-legacy="tim-life"] canvas { height: 300px; }
  .legacy-scrolly[data-legacy="tim-life"] .kicker { margin-bottom: 16px; }
  .legacy-scrolly[data-legacy="tim-life"] p.dropcap::first-letter { font-size: 64px; padding: 4px 10px 0 0; }
  .legacy-scrolly[data-legacy="tim-life"] pre.big-eq { font-size: 16px; }
}

@media (max-width: 560px) {
  .legacy-scrolly[data-legacy="tim-life"] .bignum-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .legacy-scrolly[data-legacy="tim-life"] canvas { height: 260px; }
}
