/* MARGIN — public teaser stylesheet.
   Brand register (design IS the product): the front door to the analyst's workbench.
   A committed dark-ledger hero drops into the game's own light, cool-paper workbench.
   One accent — ledger green — carries throughout. Display face self-hosted (privacy-clean,
   no third-party CDN → no visitor IP sent to Google, which matters for the GDPR notice).
   Everything is scoped under .mg-teaser so it sits cleanly inside the Divi theme shell. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.mg-teaser {
  /* light workbench (echoes the game's tokens) */
  --bg: #eceef2;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --border: #dcdfe6;
  --border-strong: #c3c8d2;
  --ink: #171a1f;
  --ink-2: #3d434e;
  --muted: #5b626d;

  /* dark ledger (hero + CTA bands) */
  --ledger: #0c1411;
  --ledger-2: #12201a;
  --ledger-line: #1f3329;
  --on-ledger: #eef2f0;
  --on-ledger-muted: #9db0a7;

  /* one accent: ledger green, plus a brighter tint that survives on the dark ledger */
  --accent: #146c43;
  --accent-hover: #115c39;
  --accent-soft: #e5f0ea;
  --accent-ink: #0d4d30;
  --accent-bright: #46cf89;
  --neg: #b3261e;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(20, 24, 33, 0.05), 0 18px 40px -24px rgba(20, 24, 33, 0.28);

  font-family: var(--font-sans);
  color: var(--ink);
  font-size: clamp(16px, 1rem + 0.15vw, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

.mg-teaser * { box-sizing: border-box; }
.mg-teaser h1, .mg-teaser h2, .mg-teaser h3, .mg-teaser p, .mg-teaser ol, .mg-teaser ul { margin: 0; }
/* The theme (Kadence) sets an explicit dark color on headings, which would override our
   inherited on-band color and make hero/CTA headings unreadable on the dark ledger.
   Force every teaser heading to take its band's text color; the accent word opts back out. */
.mg-teaser h1, .mg-teaser h2, .mg-teaser h3 { color: inherit !important; }
.mg-teaser .mg-amp { color: var(--accent-bright) !important; }
.mg-teaser :focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; border-radius: 4px; }

/* full-bleed helper: colored bands span the viewport even inside a contained Divi column */
.mg-band {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding-inline: max(24px, calc(50vw - 600px));
}
.mg-inner { max-width: 1120px; margin-inline: auto; }

/* ---------- HERO (dark ledger) ------------------------------------------- */
.mg-hero {
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(70, 207, 137, 0.12), transparent 55%),
    linear-gradient(180deg, var(--ledger-2), var(--ledger));
  color: var(--on-ledger);
  padding-block: clamp(56px, 9vw, 104px);
  overflow: hidden;
  position: relative;
}
.mg-hero::before {
  /* faint ledger ruling — a whisper of texture, must never fight the headline */
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--ledger-line) 1px, transparent 1px);
  background-size: 100% 40px;
  opacity: 0.09;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%, #000 88%);
          mask-image: linear-gradient(180deg, transparent, #000 45%, #000 88%);
  pointer-events: none;
}
.mg-hero > * { position: relative; }

.mg-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-sans);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--on-ledger-muted);
}
.mg-eyebrow .mg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 0 4px rgba(70, 207, 137, 0.16); }

.mg-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 1.6rem + 5vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
  margin-top: 20px;
}
.mg-hero h1 .mg-amp { color: var(--accent-bright); }
.mg-lede {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.5;
  color: #d6ded9;
  max-width: 46ch;
  margin-top: 22px;
}

.mg-cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 34px; }
.mg-note { font-size: 0.86rem; color: var(--on-ledger-muted); }

/* ---------- the price-vs-value chart (hero imagery) ---------------------- */
.mg-chart {
  margin-top: clamp(40px, 6vw, 66px);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ledger-line);
  border-radius: var(--radius);
  padding: 22px clamp(18px, 3vw, 30px) 18px;
}
.mg-chart-head {
  display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline;
  justify-content: space-between; margin-bottom: 12px;
}
.mg-chart-head .mg-chart-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.mg-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.82rem; color: var(--on-ledger-muted); }
.mg-legend span { display: inline-flex; align-items: center; gap: 7px; }
.mg-legend i { width: 16px; height: 0; border-top: 2px solid currentColor; display: inline-block; }
.mg-legend .mg-k-value { color: var(--accent-bright); }
.mg-legend .mg-k-price { color: #cbd5cf; }
.mg-legend .mg-k-mos i { width: 14px; height: 11px; border: none; background: rgba(70, 207, 137, 0.22); border-radius: 2px; }
.mg-chart svg { display: block; width: 100%; height: auto; }

/* chart draw-in */
.mg-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mg-line-value { stroke: var(--accent-bright); stroke-width: 2.5; }
.mg-line-price { stroke: #cbd5cf; stroke-width: 2; }
.mg-mos-band { fill: rgba(70, 207, 137, 0.16); }
.mg-mos-label { fill: var(--accent-bright); font-family: var(--font-sans); font-size: 12px; font-weight: 600; }
.mg-axis { stroke: var(--ledger-line); stroke-width: 1; }

@media (prefers-reduced-motion: no-preference) {
  .mg-line-value, .mg-line-price {
    stroke-dasharray: var(--len, 2000);
    stroke-dashoffset: var(--len, 2000);
    animation: mg-draw 1.9s var(--ease) 0.25s forwards;
  }
  .mg-line-price { animation-delay: 0.55s; animation-duration: 2.1s; }
  .mg-mos-band { opacity: 0; animation: mg-fade 1s ease 1.9s forwards; }
  .mg-mos-label { opacity: 0; animation: mg-fade 0.8s ease 2.2s forwards; }
  @keyframes mg-draw { to { stroke-dashoffset: 0; } }
  @keyframes mg-fade { to { opacity: 1; } }

  .mg-hero h1, .mg-hero .mg-eyebrow, .mg-hero .mg-lede, .mg-hero .mg-cta-row {
    opacity: 0; transform: translateY(14px);
    animation: mg-rise 0.9s var(--ease) forwards;
  }
  .mg-hero .mg-eyebrow { animation-delay: 0.05s; }
  .mg-hero h1 { animation-delay: 0.14s; }
  .mg-hero .mg-lede { animation-delay: 0.26s; }
  .mg-hero .mg-cta-row { animation-delay: 0.38s; }
  @keyframes mg-rise { to { opacity: 1; transform: none; } }
}

/* ---------- buttons ------------------------------------------------------ */
.mg-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-size: 0.98rem; font-weight: 650; letter-spacing: 0.01em;
  padding: 14px 26px; border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.08s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.mg-btn svg { width: 1.05em; height: 1.05em; }
.mg-btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent-hover);
  box-shadow: 0 10px 26px -12px rgba(20, 108, 67, 0.85);
}
.mg-btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(20, 108, 67, 0.9); }
.mg-btn-primary:active { transform: translateY(0); }
.mg-btn-ghost { background: transparent; color: var(--on-ledger); border-color: rgba(255, 255, 255, 0.22); }
.mg-btn-ghost:hover { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.04); }
/* on light bands, the ghost turns dark-outlined */
.mg-light .mg-btn-ghost { color: var(--ink); border-color: var(--border-strong); }
.mg-light .mg-btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* ---------- light sections ----------------------------------------------- */
.mg-light { background: var(--bg); color: var(--ink); }
.mg-section { padding-block: clamp(56px, 8vw, 96px); }
.mg-kicker {
  font-family: var(--font-sans); font-size: 0.82rem; font-weight: 650;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink);
}
.mg-h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.9rem);
  letter-spacing: -0.025em; line-height: 1.05; text-wrap: balance;
  margin-top: 12px;
}
.mg-section-lede {
  font-family: var(--font-serif); font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  line-height: 1.55; color: var(--ink-2); max-width: 60ch; margin-top: 18px;
}

/* premise: a single confident annual-report paragraph */
.mg-premise .mg-inner { max-width: 820px; }
.mg-premise p + p { margin-top: 18px; }
.mg-premise strong { color: var(--ink); font-weight: 650; }

/* how-it-works: a real 4-step sequence (numbers earned — it IS an ordered process) */
.mg-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 42px; }
.mg-step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 22px 26px; box-shadow: var(--shadow); position: relative;
}
.mg-step-n {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft);
}
.mg-step-ico { color: var(--accent); margin: 16px 0 12px; }
.mg-step-ico svg { width: 30px; height: 30px; display: block; }
.mg-step h3 { font-family: var(--font-display); font-weight: 650; font-size: 1.12rem; letter-spacing: -0.015em; }
.mg-step p { color: var(--ink-2); font-size: 0.96rem; margin-top: 8px; }

/* honest-by-design: the differentiator, two columns */
.mg-honest { background: var(--surface); }
.mg-honest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 40px; }
.mg-feat { padding: 22px 4px; }
.mg-feat .mg-feat-ico { color: var(--accent); }
.mg-feat .mg-feat-ico svg { width: 26px; height: 26px; }
.mg-feat h3 { font-family: var(--font-display); font-weight: 650; font-size: 1.08rem; letter-spacing: -0.01em; margin-top: 14px; }
.mg-feat p { color: var(--ink-2); font-size: 0.95rem; margin-top: 8px; }

/* curriculum chapters */
.mg-chapters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; margin-top: 40px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mg-chapter { background: var(--surface); padding: 22px 22px 24px; }
.mg-chapter .mg-ch-tag { font-family: var(--font-sans); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.mg-chapter h3 { font-family: var(--font-display); font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; margin-top: 6px; }
.mg-chapter p { color: var(--ink-2); font-size: 0.92rem; margin-top: 8px; }

/* ---------- closing CTA band (dark ledger) ------------------------------- */
.mg-cta-band {
  background:
    radial-gradient(90% 120% at 15% 120%, rgba(70, 207, 137, 0.14), transparent 55%),
    linear-gradient(180deg, var(--ledger), var(--ledger-2));
  color: var(--on-ledger);
  padding-block: clamp(60px, 9vw, 108px);
  text-align: center;
}
.mg-cta-band h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.02;
  text-wrap: balance;
}
.mg-cta-band p { color: var(--on-ledger-muted); max-width: 52ch; margin: 16px auto 0; font-family: var(--font-serif); font-size: 1.15rem; }
.mg-cta-band .mg-cta-row { justify-content: center; }

/* ---------- footer / disclaimer ------------------------------------------ */
.mg-fineprint {
  background: var(--ledger); color: var(--on-ledger-muted);
  padding-block: 30px; font-size: 0.82rem; line-height: 1.55;
  border-top: 1px solid var(--ledger-line);
}
.mg-fineprint .mg-inner { display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center; justify-content: space-between; }
.mg-fineprint a { color: #cbd5cf; text-decoration: underline; text-underline-offset: 3px; }
.mg-fineprint a:hover { color: var(--accent-bright); }
.mg-fineprint .mg-disclaimer { max-width: 62ch; }

@media (max-width: 640px) {
  .mg-cta-row { gap: 10px; }
  .mg-btn { width: 100%; justify-content: center; }
  .mg-cta-band .mg-btn, .mg-hero .mg-btn { width: auto; }
}

/* ---------- Kadence theme integration (teaser pages only) ----------------
   On /juego/ (75) and /play-margin/ (76) the theme's own page-title band is
   redundant with our hero, and the boxed content wrapper adds a white card +
   padding around a design meant to run edge-to-edge. Neutralize both so the
   dark hero sits flush under the nav. Privacy pages (84/85) keep the title. */
body.page-id-75 .entry-hero.page-hero-section,
body.page-id-76 .entry-hero.page-hero-section { display: none; }

body.page-id-75 .content-container .entry-content-wrap,
body.page-id-76 .content-container .entry-content-wrap {
  padding: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}
body.page-id-75 .content-container,
body.page-id-76 .content-container { padding-top: 0 !important; }
