/* ===========================================================================
   Problem microsite framework v2.

   Benchmarked against /myfoodmymoney/, which is the canonical reference for
   what a SidRatnam problem microsite is. Same devices: a full-bleed cinematic
   hero with Ken Burns and a multi-stop overlay, staggered reveals, real
   photography carrying the argument, an interactive moment, a quantified
   ledger, a before/after, then conversion.

   The framework supplies typography, motion primitives, section types and
   responsive behaviour. Every page composes its own sequence of them and
   brings its own story -- this is deliberately NOT one template with the
   nouns swapped.

   Brand is fixed: Cormorant Garamond, Inter, JetBrains Mono, #D4A017, #0a0a0a.
   =========================================================================== */

.m2 {
  --gold: #D4A017; --gold-soft: rgba(212,160,23,0.09);
  --white: #F5F0E8; --mid: #d4cfc8; --dim: #9c968e;
  --bg: #0a0a0a; --bg1: #101010; --bg2: #161616;
  --line: rgba(245,240,232,0.09); --line2: rgba(245,240,232,0.18);
  --red: #e0614f; --green: #3fb27f;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  background: var(--bg); color: var(--white);
  font-family: 'Inter', system-ui, sans-serif; line-height: 1.65;
}
.m2 ::selection { background: var(--gold); color: #0a0a0a; }
.m2 .wrap { max-width: 1120px; margin: 0 auto; padding: 0 6vw; }
.m2 a:focus-visible, .m2 button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ── motion primitives ──────────────────────────────────────────────────── */
@keyframes m2-up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes m2-kb { from { transform: scale(1) translate(0,0); } to { transform: scale(1.12) translate(-2%,-1%); } }
@keyframes m2-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes m2-pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

.m2 [data-rise] { opacity: 0; transform: translateY(22px); transition: opacity 0.8s ease, transform 0.8s var(--ease); }
.m2 [data-rise].in { opacity: 1; transform: none; }

/* ── hero ───────────────────────────────────────────────────────────────── */
.m2-hero {
  position: relative; height: 100svh; min-height: 600px; max-height: 1100px;
  overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
}
.m2-hero__img { position: absolute; inset: 0; z-index: 0; will-change: transform; animation: m2-kb 24s ease-in-out infinite alternate; }
.m2-hero__img img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.m2-hero__veil {
  position: absolute; inset: 0; z-index: 1;
  /* The mid stops carry the H1. They were light enough that a bright hero
     (a lit kitchen, a laptop screen) dropped the headline to ~2.6:1 -- below
     the 3:1 WCAG AA needs even for large text. Measured across all 20 hero
     images via .qa/measure-hero-contrast.js. */
  background: linear-gradient(to top,
    rgba(10,10,10,0.96) 0%, rgba(10,10,10,0.86) 26%,
    rgba(10,10,10,0.58) 58%, rgba(10,10,10,0.24) 100%);
}
.m2-hero__glow {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 62% 72%, rgba(212,160,23,0.13) 0%, transparent 66%);
}
.m2-hero__content { position: relative; z-index: 3; padding: 0 6vw 9vh; max-width: 940px; }
.m2-hero__eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--white);
  display: flex; align-items: center; gap: 14px; margin-bottom: 1.5rem;
  opacity: 0; animation: m2-up 0.9s 0.35s var(--ease) forwards;
}
.m2-hero__eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--gold); display: block; }
.m2-hero__h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.9rem, 7.4vw, 6.2rem); font-weight: 300; line-height: 1.03;
  color: var(--white); opacity: 0; animation: m2-up 1s 0.6s var(--ease) forwards;
}
.m2-hero__h1 em {
  color: #0a0a0a; font-style: italic; font-weight: 700; background: var(--gold);
  padding: 0.03em 0.18em 0.1em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.m2-hero__sub {
  font-size: clamp(1rem, 1.7vw, 1.14rem); font-weight: 300; line-height: 1.75;
  color: var(--white); max-width: 600px; margin-top: 1.5rem;
  opacity: 0; animation: m2-up 1s 0.85s var(--ease) forwards;
}
.m2-hero__actions {
  display: flex; gap: 18px; flex-wrap: wrap; margin-top: 2.1rem;
  opacity: 0; animation: m2-up 1s 1.05s var(--ease) forwards;
}
.m2-hero__scroll {
  position: absolute; bottom: 30px; right: 6vw; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--white);
  opacity: 0; animation: m2-up 1s 1.4s var(--ease) forwards;
}
.m2-hero__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: m2-bounce 1.7s ease-in-out infinite; }

/* ── buttons ────────────────────────────────────────────────────────────── */
.m2-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 0.95rem 1.8rem; border-radius: 100px; font-size: 0.95rem; font-weight: 500;
  transition: transform 0.28s var(--ease), box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}
.m2-btn--gold { background: var(--gold); color: #0a0a0a; font-weight: 600; }
.m2-btn--gold:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(212,160,23,0.3); }
.m2-btn--ghost { border: 1px solid var(--line2); color: var(--white); }
.m2-btn--ghost:hover { border-color: var(--gold); transform: translateY(-2px); }

/* ── section shell ──────────────────────────────────────────────────────── */
.m2-sec { padding: clamp(64px, 9vw, 128px) 0; position: relative; }
.m2-sec--tint { background: var(--bg1); }
.m2-sec--edge { border-top: 1px solid var(--line); }
.m2-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.m2-kicker::before { content: ''; width: 22px; height: 1px; background: var(--gold); }
.m2-h2 {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 300;
  font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.12; color: var(--white);
  max-width: 20ch; margin-bottom: 26px; text-wrap: balance;
}
.m2-h2 em { font-style: italic; color: var(--gold); }
.m2-lede { font-size: clamp(1rem, 1.5vw, 1.1rem); color: var(--mid); max-width: 58ch; font-weight: 300; }
.m2-note { color: var(--dim); font-size: 0.87rem; max-width: 62ch; margin-top: 24px; font-style: italic; }

/* ── split: photograph carries the argument ─────────────────────────────── */
.m2-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.m2-split--flip .m2-split__media { order: 2; }
.m2-split__media { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; }
.m2-split__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m2-split__media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(10,10,10,0.5) 100%); }
.m2-caption {
  position: absolute; left: 18px; bottom: 16px; z-index: 2;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--white);
}

/* ── beats: the story spine ─────────────────────────────────────────────── */
.m2-beats { max-width: 760px; margin-top: 12px; }
.m2-beat { position: relative; padding: 0 0 34px 34px; border-left: 1px solid var(--line2); }
.m2-beat:last-child { border-left-color: transparent; padding-bottom: 0; }
.m2-beat::before {
  content: ''; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--bg); border: 1px solid var(--gold); transition: background 0.5s ease;
}
.m2-beat.in::before { background: var(--gold); }
.m2-beat__n { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.16em; color: var(--dim); display: block; margin-bottom: 6px; }
.m2-beat__t { font-size: 1.1rem; color: var(--white); }
.m2-beat__d { color: var(--dim); font-size: 0.93rem; margin-top: 6px; }
.m2-beat--bad .m2-beat__t { color: var(--red); }
.m2-beat--good .m2-beat__t { color: var(--green); }

/* ── ledger ─────────────────────────────────────────────────────────────── */
.m2-ledger { max-width: 720px; border-top: 1px solid var(--line2); }
.m2-row { display: flex; justify-content: space-between; align-items: baseline; gap: 28px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.m2-row__k { color: var(--mid); }
.m2-row__v { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--white); text-align: right; white-space: nowrap; }
.m2-row--total { border-top: 1px solid var(--line2); border-bottom: none; }
.m2-row--total .m2-row__k { color: var(--white); font-weight: 600; }
.m2-row--total .m2-row__v { color: var(--gold); font-size: 1.25rem; }
.m2-row--bad .m2-row__v { color: var(--red); }

/* ── compare ────────────────────────────────────────────────────────────── */
.m2-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.m2-col { border: 1px solid var(--line); border-radius: 14px; padding: 30px; background: var(--bg2); }
.m2-col--good { border-color: rgba(63,178,127,0.3); background: rgba(63,178,127,0.04); }
.m2-col__h { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 18px; }
.m2-col--good .m2-col__h { color: var(--green); }
.m2-col ul { list-style: none; }
.m2-col li { position: relative; padding-left: 22px; margin-bottom: 12px; color: var(--mid); font-size: 0.95rem; }
.m2-col li::before { content: '✕'; position: absolute; left: 0; color: var(--red); font-size: 0.8rem; }
.m2-col--good li::before { content: '✓'; color: var(--green); }

/* ── honesty pill ───────────────────────────────────────────────────────── */
.m2-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; padding: 7px 14px;
  border-radius: 100px; border: 1px solid;
}
.m2-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.m2-pill--live { color: var(--green); border-color: rgba(63,178,127,0.4); background: rgba(63,178,127,0.08); }
.m2-pill--live::before { animation: m2-pulse 2s ease-in-out infinite; }
.m2-pill--ready { color: var(--gold); border-color: rgba(212,160,23,0.4); background: var(--gold-soft); }
.m2-pill--build { color: var(--mid); border-color: var(--line2); background: rgba(245,240,232,0.04); }

/* ── live call ──────────────────────────────────────────────────────────── */
.m2-live { border: 1px solid rgba(63,178,127,0.25); border-radius: 18px; padding: clamp(36px,5vw,64px); text-align: center;
  background: linear-gradient(180deg, rgba(63,178,127,0.07), transparent 70%), var(--bg1); }
.m2-live__h { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 300; font-size: clamp(1.8rem,3.4vw,2.6rem); margin: 18px 0; }
.m2-live__p { color: var(--mid); max-width: 52ch; margin: 0 auto 30px; }
.m2-live__num {
  display: inline-flex; align-items: center; gap: 12px; background: var(--gold); color: #0a0a0a;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: clamp(1.1rem,2.4vw,1.5rem);
  font-weight: 600; padding: 1rem 2rem; border-radius: 100px; min-height: 56px;
  transition: transform 0.28s var(--ease), box-shadow 0.28s ease;
}
.m2-live__num:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(212,160,23,0.32); }
.m2-live__fine { color: var(--dim); font-size: 0.84rem; max-width: 50ch; margin: 22px auto 0; }

/* ── evidence ───────────────────────────────────────────────────────────── */
.m2-ev { border-left: 2px solid var(--line2); padding-left: 26px; margin-bottom: 34px; max-width: 66ch; }
.m2-ev__c { color: var(--white); margin-bottom: 10px; }
.m2-ev__m { font-size: 0.82rem; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: baseline; }
.m2-ev__m a { color: var(--mid); text-decoration: underline; text-underline-offset: 3px; }
.m2-ev__m a:hover { color: var(--gold); }
.m2-ev__k { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line2); flex: 0 0 auto; }
.m2-ev__k--projected { color: var(--gold); border-color: rgba(212,160,23,0.3); }

/* ── related + cta ──────────────────────────────────────────────────────── */
.m2-rel { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.m2-rel__c { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2);
  transition: border-color 0.25s ease, transform 0.25s var(--ease); }
.m2-rel__c:hover { border-color: rgba(212,160,23,0.4); transform: translateY(-3px); }
.m2-rel__q { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.15rem; line-height: 1.3; color: var(--white); }

.m2-cta { padding: clamp(80px,10vw,150px) 0; text-align: center; position: relative; overflow: hidden;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, var(--gold-soft), transparent 70%), var(--bg1); }
.m2-cta__h { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 300;
  font-size: clamp(2.1rem,5vw,3.6rem); line-height: 1.1; margin-bottom: 20px; text-wrap: balance; }
.m2-cta__h em { font-style: italic; color: var(--gold); }
.m2-cta__p { color: var(--mid); max-width: 50ch; margin: 0 auto 40px; }
.m2-cta__row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .m2-split, .m2-compare { grid-template-columns: 1fr; }
  .m2-split--flip .m2-split__media { order: 0; }
  .m2-rel { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .m2-row { flex-direction: column; gap: 3px; }
  .m2-row__v { text-align: left; }
  .m2-cta__row { flex-direction: column; align-items: stretch; }
  .m2-btn { justify-content: center; }
  .m2-hero__content { padding-bottom: 12vh; }
}
@media (prefers-reduced-motion: reduce) {
  .m2 [data-rise] { opacity: 1 !important; transform: none !important; }
  .m2-beat::before { background: var(--gold) !important; }
  .m2-hero__img { animation: none !important; }
  .m2-hero__eyebrow, .m2-hero__h1, .m2-hero__sub, .m2-hero__actions, .m2-hero__scroll { opacity: 1 !important; animation: none !important; }
  .m2-hero__dot, .m2-pill--live::before { animation: none !important; }
}

/* Guard: any label/detail pair inside a page-specific widget stacks rather
   than running together on one line. Two separate pages hit this same bug. */
.m2 [class$="__txt"], .m2 [class$="__sub"], .m2 [class$="__name"], .m2 [class$="__meta"] { display: block; }

/* ── the direct answer ──────────────────────────────────────────────────────
   Sits immediately after the hero. An answer engine performing extractive
   summarisation lifts a short self-contained passage; this makes sure the
   passage it finds is an accurate, complete answer to the page's question
   rather than a fragment of narrative from halfway down.
   -------------------------------------------------------------------------- */
.m2-answer { padding:clamp(56px,7vw,88px) 0 0; }
.m2-answer__box {
  max-width:820px; border-left:2px solid var(--gold); padding:4px 0 4px 28px;
}
.m2-answer__lead {
  font-family:'Cormorant Garamond',Georgia,serif; font-weight:300;
  font-size:clamp(1.35rem,2.6vw,1.95rem); line-height:1.34; color:var(--white);
  margin-bottom:16px; text-wrap:pretty;
}
.m2-answer__lead strong { color:var(--gold); font-weight:600; }
.m2-answer__detail { color:var(--mid); font-size:1.02rem; max-width:64ch; }
.m2-answer__facts { list-style:none; margin:20px 0 0; padding:0; }
.m2-answer__facts li {
  position:relative; padding-left:20px; margin-bottom:9px;
  color:var(--mid); font-size:.96rem;
}
.m2-answer__facts li::before {
  content:''; position:absolute; left:0; top:.6em; width:6px; height:6px;
  border-radius:50%; background:var(--gold); opacity:.8;
}
@media (max-width:560px){ .m2-answer__box { padding-left:18px; } }

/* ── entity statement ───────────────────────────────────────────────────────
   Answer engines model "what is this company, what is it for". A page that
   only describes a problem gives them nothing to attribute. This states the
   relationship plainly, in sentences that stay true if quoted alone.
   -------------------------------------------------------------------------- */
.m2-entity { max-width:70ch; }
.m2-entity__stmt { font-size:1.1rem; color:var(--white); line-height:1.7; margin-bottom:18px; }
.m2-entity__sub { color:var(--mid); font-size:.98rem; margin-bottom:10px; }
.m2-entity__sub strong { color:var(--white); font-weight:600; }

/* Citation detail sits on its own line beneath the source link. Keeping it
   inline orphaned a leading comma whenever a long source name wrapped. */
.m2-ev__d{
  margin:6px 0 0; font-size:.82rem; line-height:1.6;
  color:rgba(255,255,255,.44); letter-spacing:.01em;
}

/* Caveat attached to an individual evidence record -- e.g. a survey question
   that was reworded mid-series, so the numbers either side of it are not a
   trend. Reads as an aside, but it is the part that earns the citation. */
.m2-ev__n{
  margin:10px 0 0; padding-left:14px;
  border-left:2px solid rgba(212,160,23,.32);
  font-size:.86rem; line-height:1.62; color:rgba(255,255,255,.56);
}

/* Link back up to the outcome layer from a problem page. */
.m2-upto{
  margin:26px 0 0; font-size:.92rem; color:rgba(255,255,255,.52);
}
.m2-upto a{ color:var(--gold,#D4A017); text-decoration:none; border-bottom:1px solid rgba(212,160,23,.35); }
.m2-upto a:hover{ border-bottom-color:var(--gold,#D4A017); }
