/* esoteria.ai v2: /marketing only (B3), on B0's shell (base.css, chapter.css, js/chapter.js). Fable 5.2 spec: one large scene
   per page marked data-scene; nothing under 12 px; the orb only on M1 and the Close. Only transform and opacity animate. */

/* ---- shared pieces */
.mk-label { font-size: 12px; line-height: 1.4; color: var(--t3); }   /* R44: small text at least ink-3 */
.mk-cap { font-size: 12px; line-height: 1.4; color: var(--t3); }
.mk-receipt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: rgba(237, 235, 240, .04); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; opacity: 0; transform: translateY(8px); transition: opacity .42s var(--ease), transform .42s var(--ease); }
.mk-receipt b { display: block; font-weight: 500; color: var(--t1); }
.mk-receipt small { display: block; font-size: 13px; color: var(--t3); }
.mk-receipt time { font-size: 13px; color: var(--t3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-keys { display: flex; justify-content: flex-end; gap: 8px; }
.k.quiet { box-shadow: inset 0 0 0 1px var(--line-2); }
.copy.mk { left: calc(88px * var(--k)); top: 11%; width: calc(640px * var(--k)); }
.phone .copy.mk { left: 20px; right: 20px; width: auto; top: 84px; }
[data-scene] { position: absolute; }
.snap .layer * { transition: none !important; }

/* ================= M1 hero (B default; A at ?hero=a) */
.copy.mk-hero { left: calc(88px * var(--k)); top: 30%; width: calc(500px * var(--k)); }
.mk-hero-scene { left: 42%; right: 0; top: 24%; height: 56%; }
.mk-hero-scene .mk-stage { position: absolute; left: calc(50% - 300px * var(--k)); top: calc(160px * var(--k)); width: calc(600px * var(--k)); }
.mk-orb { position: absolute; pointer-events: none; opacity: .02; transition: opacity .6s var(--ease); }   /* RG3: from .02, not 0, so the orb is painted (and counted) on the hero's first frame; it still fades in */
.layer.on .mk-orb { opacity: 1; }
.mk-hero-scene .mk-orb { width: calc(420px * var(--k)); left: calc(-135px * var(--k)); top: calc(-345px * var(--k)); }
.mk-orb .plum { position: absolute; inset: 24%; border-radius: 50%; opacity: 0; transition: opacity .5s var(--ease);
  background-image: radial-gradient(circle, rgba(169, 112, 182, .9) 0.8px, transparent 1.1px); background-size: 7px 7px;
  -webkit-mask-image: radial-gradient(closest-side, transparent 70%, #000 82%, transparent 100%); mask-image: radial-gradient(closest-side, transparent 70%, #000 82%, transparent 100%); }
.working .mk-orb .plum { opacity: 1; }
.brief { position: relative; background: var(--sheet); border-radius: 16px; padding: 24px; box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -30px rgba(0, 0, 0, .9); display: flex; flex-direction: column; gap: 14px; }
.brief-meta { font-size: 13px; color: var(--t3); }
.brief-h { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; color: var(--t1); margin-top: -2px; }
.brief ol { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.5; color: var(--t2); }
.brief li { display: flex; gap: 14px; opacity: 0; transition: opacity .3s var(--ease); }
.brief li .n { width: 12px; flex: none; color: var(--t3); font-variant-numeric: tabular-nums; }
.brief .mk-keys { opacity: 0; transition: opacity .42s var(--ease); }
.brief-frame { opacity: 0; transform: translateY(24px); transition: opacity .42s var(--ease), transform .42s var(--ease); }
.b-card .brief-frame { opacity: 1; transform: none; }
.b-l1 .brief li:nth-child(1), .b-l2 .brief li:nth-child(2), .b-l3 .brief-close { opacity: 1; }
/* X10 (D14): the third line is a plain closing line under the two numbered ones */
.brief-close { font-size: 16px; line-height: 1.5; color: var(--t2); opacity: 0; transition: opacity .3s var(--ease); }
.phone .brief-close { font-size: 14px; }
.brief-frame { position: relative; }
.brief.raise { position: relative; }
.mk-under { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; opacity: 0; transition: opacity .42s var(--ease); }
.b-keys .brief .mk-keys, .b-keys .mk-under { opacity: 1; }
/* B: the week's numbers fold into the brief */
.hero-a .board { display: none; }
.board { position: absolute; left: 0; right: 0; top: 0; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 16px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; opacity: 0; transform: translateY(24px); transition: opacity .42s var(--ease), transform .42s var(--ease); }
.b-board .board { opacity: 1; transform: none; }
.b-fold .board { background: transparent; box-shadow: none; }
.col { padding: 20px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.col + .col { box-shadow: inset 1px 0 0 var(--line); }
.b-fold .col { box-shadow: none; }
.col h4 { font-size: 12px; font-weight: 500; color: var(--t3); transition: opacity .3s var(--ease); }
.cell { display: flex; flex-direction: column; gap: 2px; opacity: .38; transition: opacity .3s var(--ease); }
.cell b { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; color: var(--t1); font-variant-numeric: tabular-nums; transform-origin: 0 0; display: inline-block; width: max-content; }
.cell span { font-size: 12px; line-height: 1.35; color: var(--t3); transition: opacity .3s var(--ease); }
.readbar { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--plum); opacity: 0; }
.b-read .readbar { opacity: 1; transform: translateX(var(--bw, 600px)); transition: transform 1.6s linear, opacity .2s; }
.b-readend .readbar { opacity: 0; transform: translateX(var(--bw, 600px)); transition: opacity .2s; }
.b-read .col:nth-child(1) .cell { opacity: 1; transition-delay: .1s; }
.b-read .col:nth-child(2) .cell { opacity: 1; transition-delay: .5s; }
.b-read .col:nth-child(3) .cell { opacity: 1; transition-delay: .9s; }
.b-read .col:nth-child(4) .cell { opacity: 1; transition-delay: 1.3s; }
.b-fold .col h4, .b-fold .cell:not(.pick), .b-fold .cell.pick span { opacity: 0 !important; transition-delay: 0s !important; }
.b-fly .cell.pick b { transition: transform .6s var(--paper); }
.b-land .board { opacity: 0; transition: opacity .2s; }
.phone .copy.mk-hero { left: 20px; right: 20px; width: auto; top: 84px; }
.phone .copy.mk-hero .ctas { margin-top: 18px; gap: 8px; }
.phone .copy.mk-hero .btn { height: 44px; font-size: 14.5px; padding: 0 16px; }
.phone .mk-hero-scene { left: 16px; right: 16px; top: 352px; height: auto; }
.phone .mk-hero-scene .mk-stage { position: relative; left: 0; top: 0; width: auto; }
.phone .mk-hero-scene .mk-orb { display: none; } /* R10: no orb on phone */
.phone .brief { padding: 16px; gap: 10px; }
.phone .brief-h { font-size: 20px; }
.phone .brief ol { font-size: 14px; gap: 6px; }
.phone .board { grid-template-columns: repeat(2, 1fr); }
.phone .col { padding: 12px 14px; gap: 8px; }
.phone .col:nth-child(3) { box-shadow: inset 0 1px 0 var(--line); }
.phone .col:nth-child(4) { box-shadow: inset 1px 0 0 var(--line), inset 0 1px 0 var(--line); }
.phone .b-fold .col { box-shadow: none; }
.phone .cell b { font-size: 26px; }
.phone .cell:nth-of-type(3) { display: none; }
.phone .mk-under { margin-top: 10px; }

/* ================= M2 spend: the chart and its card, one scene */
.mk-spend-scene { left: calc(50% - 552px * var(--k)); width: calc(1104px * var(--k)); top: 29%; height: 52%; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.mk-spend-row { display: flex; align-items: center; gap: calc(64px * var(--k)); }
.chart { position: relative; width: calc(600px * var(--k)); flex: none; }
.bars { height: calc(296px * var(--k)); display: flex; align-items: flex-end; gap: calc(12px * var(--k)); border-bottom: 1px solid var(--line); }
.bar { position: relative; flex: 1; height: var(--h); transform-origin: 50% 100%; transform: scaleY(0); transition: transform .42s var(--paper); }
.bar i, .bar u { position: absolute; inset: 0; border-radius: 3px 3px 0 0; }
.bar i { background: var(--t4); opacity: .55; }
.bar u { background: var(--ox); opacity: 0; transition: opacity .3s var(--ease); }
.days { display: flex; gap: calc(12px * var(--k)); margin-top: 8px; }
.days span { flex: 1; text-align: center; font-size: 12px; color: var(--t3); }   /* X9: ink-3, readable */
/* X9: the save light sits behind the bars only; its box ends above the day letters */
.bars { position: relative; isolation: isolate; }
.bars > .glow { inset: -22% -22% 0 -22%; }
.bar-lab { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); font-size: 14px; color: var(--t1); white-space: nowrap; opacity: 0; transition: opacity .3s var(--ease); display: flex; align-items: center; gap: 7px; }
.bar-lab .bd { position: static; border-radius: 50%; opacity: 1; }
.b-bars .bar { transform: scaleY(1); }
.b-ox .bar.thu u, .b-ox .bar-lab { opacity: 1; }
/* R21: the Thursday bars stay oxblood after the pause; the receipt never erases the proof */
.mk-side { width: calc(440px * var(--k)); flex: none; display: flex; flex-direction: column; gap: 12px; }
.mk-cw { opacity: 0; transform: translateY(24px); transition: opacity .42s var(--ease), transform .42s var(--ease); }
.mk-side .card { width: 100%; padding: 22px 24px 18px; gap: 12px; }
/* CP4 M2: the figure is the card's largest text, as on the home's Price cards (the chip goes) */
.mk-fig { font-size: 32px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--t1); }
.phone .mk-fig { font-size: 28px; }
.mk-side .card-h { font-size: 20px; line-height: 1.3; }
.b-save .mk-cw { opacity: 1; transform: none; }
.b-receipt .mk-receipt { opacity: 1; transform: none; }
.phone .mk-spend-scene { left: 16px; right: 16px; width: auto; top: calc(var(--hb, 150px) + 24px + 24px); height: auto; display: block; }   /* X7: 24 px under the headline to the bars' label (which sits 24 px above the bars) */
.phone .mk-spend-row { flex-direction: column; align-items: stretch; gap: 18px; }
.phone .chart { width: 100%; }
.phone .bars { height: 150px; gap: 8px; }
.phone .days { gap: 8px; }
.phone .bar:nth-child(-n+2), .phone .days span:nth-child(-n+2) { display: none; }
.phone .mk-side { width: 100%; }
.phone .mk-side .card { padding: 16px 18px 14px; }
.phone .mk-side .card-h { font-size: 18px; }
.phone .mk-spend-scene .mk-label { margin-top: 14px; }

/* ================= M3 posts: the week strip, one scene */
.mk-posts-scene { left: calc(50% - 580px * var(--k)); width: calc(1160px * var(--k)); top: 29%; height: 50%; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.strip { display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr 1fr; gap: calc(16px * var(--k)); opacity: 0; transition: opacity .42s var(--ease); }
.b-strip .strip { opacity: 1; }
.slot { display: flex; flex-direction: column; gap: 12px; }
.slot > .day { font-size: 13px; font-weight: 500; color: var(--t3); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.post { background: var(--sheet); border-radius: 14px; padding: 16px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 8px; opacity: 0; transform: translateY(12px); transition: opacity .42s var(--ease), transform .42s var(--ease); }
.post .pk { font-size: 12px; font-weight: 500; color: var(--t3); }
.post .pt { font-size: 15px; font-weight: 500; line-height: 1.3; color: var(--t1); text-wrap: balance; }   /* CP3 M-3: no orphan on Thursday */
.post:not(.p4) .pb { display: none; }   /* CP3 M-4: Mon, Tue, Wed, Fri show kind, title, time; Thursday keeps its body and keys */
/* CP4 M3: the four title-only cards share one height and set their titles at 17 px, so the strip fills its row */
html:not(.phone) .post:not(.p4) { min-height: calc(120px * var(--k)); }   /* X8: js sets the four to the tallest */
html:not(.phone) .post:not(.p4) .pt { font-size: 17px; }
.post time { margin-top: auto; }
.post .pb { font-size: 14px; line-height: 1.45; color: var(--t3); }
.post time { font-size: 13px; color: var(--t3); }
.post .mk-keys { opacity: 0; transition: opacity .3s var(--ease); margin-top: 4px; justify-content: flex-start; gap: 6px; }
.b-p1 .post.p1, .b-p2 .post.p2, .b-p3 .post.p3, .b-p4 .post.p4, .b-p5 .post.p5 { opacity: 1; transform: none; }
.b-lift .post.p4 .mk-keys { opacity: 1; }
.mk-posts-foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.mk-posts-foot .mk-receipt { width: calc(440px * var(--k)); }
.phone .mk-posts-scene { left: 16px; right: 16px; width: auto; top: 190px; height: auto; display: block; }
.phone .strip { grid-template-columns: 1fr; gap: 10px; }
.phone .slot { flex-direction: row; gap: 12px; }
.phone .slot > .day { width: 36px; flex: none; border: 0; padding: 14px 0 0; }
.phone .slot > :not(.day) { flex: 1; }
.phone .slot.m2, .phone .slot.m3 { display: none; }
.phone .post { padding: 12px 14px; gap: 6px; }
.phone .post .pb { display: none; }
.phone .mk-posts-foot { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 14px; }
.phone .mk-posts-foot .mk-label { order: 2; }   /* CP3 M-2: the label is last, 12 px under the receipt */
.phone .mk-posts-foot .mk-receipt { width: auto; }

/* finished state at once */
.reduced .layer * { transition: none !important; animation: none !important; }

/* ================= short phones (the 360x640 floor; any phone layout under 700 px tall). FX-B, N4: subtract, never cram.
   Type sizes stay; secondary rows step out so every page ends 16 px above the cue. Product strings and labels unchanged. */
@media (max-height: 700px) {
  /* M1: the two buttons side by side, the brief under them; the brief keeps its heading and the two lines the figures fly into */
  .phone .copy.mk-hero .ctas { margin-top: 16px; flex-wrap: nowrap; }
  .phone .copy.mk-hero .btn { padding: 0 14px; }
  .phone .mk-hero-scene { top: 380px; }
  .phone .brief-meta, .phone .brief-close, .phone .brief .mk-keys { display: none; }
  .phone .board .cell:nth-of-type(n+2) { display: none; }
  .phone .mk-under { margin-top: 8px; }
  /* M2: the chart is shorter and loses its day letters; the line steps out (the card's chip carries $1,240/month) */
  .phone [data-layer="spend"] .copy .sub { display: none; }
  .phone .bars { height: 64px; }   /* X7: 24 px under the headline; M8-1: 16 px or more over the cue box (20 measured) */
  .phone .mk-side .card { padding: 12px 16px 10px; }
  .phone .mk-spend-row { gap: 10px; }
  .phone .days { display: none; }
  .phone .mk-spend-scene .mk-label { margin-top: 8px; }
  /* M3: Monday and Thursday; Friday steps out */
  .phone .slot.m5 { display: none; }
}

/* ================= R49 short desktop heights (html.short; html.shortz zooms the 720 design). Drop order: repeated scene lines first */
/* M1: the caption names the four sources the board has just shown as its column heads */
html.short:not(.phone) .mk-under .mk-cap { display: none; }
/* R56 (C7-1): in the zoomed tier only, where 12 px renders at 10 px and ink-3's thin glyphs under-read the 4.0 peak floor,
   these runs take ink-2: the Spend day letters, the hero's demo label and the Spend receipt's time */
html.shortz:not(.phone) .days span, html.shortz:not(.phone) [data-layer="hero"] .mk-label, html.shortz:not(.phone) [data-layer="spend"] .mk-receipt time { color: var(--t2); }
