/* Ocamba Display — client-facing capability showcase
   Self-contained (no external fonts/CDN). Light/dark aware. Responsive. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --bg-card: #ffffff;
  --fg: #0d1117;
  --fg-muted: #566072;
  --border: #e6e9ef;
  --border-strong: #d4d9e2;
  --accent: #4f7cff;
  --accent-2: #9b5cff;
  --accent-ink: #ffffff;
  --code-bg: #0d1117;
  --code-fg: #cfe3ff;
  --shadow: 0 1px 2px rgba(16,22,30,.04), 0 8px 30px rgba(16,22,30,.06);
  --shadow-lift: 0 6px 16px rgba(16,22,30,.08), 0 24px 60px rgba(16,22,30,.12);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1160px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d12;
    --bg-soft: #10141b;
    --bg-card: #12171f;
    --fg: #e7edf5;
    --fg-muted: #93a1b3;
    --border: #212a35;
    --border-strong: #2c3743;
    --accent: #6b93ff;
    --accent-2: #b07bff;
    --code-bg: #070a0e;
    --code-fg: #cfe3ff;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 30px rgba(0,0,0,.35);
    --shadow-lift: 0 6px 16px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 17px; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent); }
.nav nav { margin-left: auto; display: flex; gap: 22px; font-size: 14px; }
.nav nav a { color: var(--fg-muted); }
.nav nav a:hover { color: var(--fg); text-decoration: none; }
@media (max-width: 720px) { .nav nav { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg-card); color: var(--fg); transition: .15s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn.primary { border: 0; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 70px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto 0; height: 620px; z-index: -1;
  background:
    radial-gradient(60% 60% at 20% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(50% 50% at 90% 0%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 70%);
  filter: blur(6px);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; } }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 5px 11px; border-radius: 20px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 16px; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(115deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--fg-muted); margin: 0 0 26px; max-width: 32em; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 30px; margin-top: 34px; }
.hero-stats .s b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.hero-stats .s span { font-size: 13px; color: var(--fg-muted); }

/* ---------- section frame ---------- */
section { padding: 64px 0; }
.section-head { max-width: 40em; margin-bottom: 34px; }
.section-head .eyebrow { margin-bottom: 12px; }
.section-head h2 { font-size: clamp(26px, 3.5vw, 36px); letter-spacing: -.025em; margin: 0 0 10px; font-weight: 800; }
.section-head p { font-size: 17px; color: var(--fg-muted); margin: 0; }
.alt { background: var(--bg-soft); border-block: 1px solid var(--border); }

/* ---------- feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .features { grid-template-columns: 1fr; } }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: .18s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.card .ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; margin-bottom: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.card h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.01em; }
.card p { margin: 0; font-size: 14.5px; color: var(--fg-muted); }

/* ---------- player showcase ---------- */
.showcase { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: start; }
@media (max-width: 900px) { .showcase { grid-template-columns: 1fr; } }
.player-frame { background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lift); aspect-ratio: 16/9; }
.player-frame > div { width: 100%; height: 100%; }
.controls-panel h3 { margin: 0 0 4px; font-size: 18px; }
.controls-panel p { margin: 0 0 16px; color: var(--fg-muted); font-size: 14.5px; }
.ctl-group { margin-bottom: 14px; }
.ctl-group label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-muted); margin-bottom: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--fg); }
.chip[aria-pressed="true"] { border-color: transparent; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.evlog { margin-top: 8px; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--code-bg); color: #8fdc9c; border-radius: var(--radius-sm); padding: 10px 12px; height: 96px; overflow: auto; white-space: pre-wrap; }

/* ---------- formats gallery ---------- */
.formats-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.fmt {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: .16s;
}
.fmt:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.fmt .stage {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-soft); border: 1px dashed var(--border-strong);
  display: grid; place-items: center; min-height: 90px;
}
.fmt .stage .ins-holder { max-width: 100%; overflow: hidden; }
/* placeholder creative */
.creative {
  display: grid; place-items: center; text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 6px;
  font-weight: 700; letter-spacing: .01em; padding: 6px; line-height: 1.2; max-width: 100%;
}
.creative small { display: block; font-weight: 600; opacity: .85; font-size: 11px; margin-top: 2px; }
.fmt .meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fmt .meta b { font-size: 14px; letter-spacing: -.01em; }
.fmt .meta .dim { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--fg-muted); }
.fmt .name { font-size: 12.5px; color: var(--fg-muted); margin-top: -4px; }
.fmt .fmt-actions { margin-top: auto; }

/* ---------- code + integration ---------- */
.code-wrap { position: relative; }
pre.code {
  background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius-sm);
  padding: 16px 16px; margin: 0; overflow-x: auto;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
pre.code .tok-tag { color: #7ee0b0; } pre.code .tok-attr { color: #9bb8ff; } pre.code .tok-str { color: #ffd479; } pre.code .tok-com { color: #6b7684; } pre.code .tok-kw { color: #ff9ecb; }
.copy-btn { position: absolute; top: 10px; right: 10px; font-size: 12px; padding: 5px 10px; border-radius: 7px; border: 1px solid #2a3542; background: #12161c; color: #9fb2c7; cursor: pointer; }
.copy-btn:hover { color: #fff; border-color: #3a4a5c; }
.integrate { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 820px) { .integrate { grid-template-columns: 1fr; } }
.integrate h3 { font-size: 16px; margin: 0 0 10px; }

/* ---------- modal (get the code) ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(6,9,14,.55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-back.open { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); max-width: 620px; width: 100%; box-shadow: var(--shadow-lift); overflow: hidden; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal header h4 { margin: 0; font-size: 16px; }
.modal header button { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--fg-muted); line-height: 1; }
.modal .body { padding: 18px; }
.modal .body p { margin: 0 0 14px; color: var(--fg-muted); font-size: 14px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--fg-muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- misc ---------- */
.muted-brand { color: var(--fg-muted); font-weight: 600; }
.muted-note { color: var(--fg-muted); font-size: 13px; }
.hero-mid { max-width: 44rem; }
.cta-nav { margin-left: 16px; }
.btn.block { width: 100%; justify-content: center; margin-top: 6px; }
code { font: .92em ui-monospace, Menlo, Consolas, monospace; background: color-mix(in srgb, var(--fg) 8%, transparent); padding: 1px 5px; border-radius: 5px; }

/* ---------- in-context publisher page ---------- */
.pubpage { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.masthead { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); font-weight: 800; letter-spacing: -.01em; }
.masthead .logo-dot { width: 16px; height: 16px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.masthead .mh-nav { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--fg-muted); }
@media (max-width: 620px) { .masthead .mh-nav { display: none; } }
.pub-grid { display: grid; grid-template-columns: 1fr 300px; gap: 26px; padding: 24px; }
@media (max-width: 820px) { .pub-grid { grid-template-columns: 1fr; } .rail { display: none; } }
.article h3 { font-size: 22px; letter-spacing: -.02em; margin: 18px 0 4px; }
.article .byline { color: var(--fg-muted); font-size: 13px; margin: 0 0 14px; }
.article p { color: var(--fg); margin: 0 0 14px; max-width: 62ch; }
.adcap { font-size: 10.5px !important; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-muted) !important; margin: 0 0 6px !important; }
.ad-holder { background: var(--bg-soft); border-radius: 8px; overflow: hidden; }
.ad-inner { width: 100%; height: 100%; }
.inarticle { float: right; margin: 4px 0 14px 20px; }
@media (max-width: 520px) { .inarticle { float: none; margin: 0 0 14px; } }
.rail .sticky { position: sticky; top: 76px; }

/* ---------- playground ---------- */
.pg-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) {
  .pg-grid { grid-template-columns: 1fr; display: flex; flex-direction: column; }
  .pg-sidebar, .pg-main { display: contents; }
  .pg-eyebrow { order: 1; }
  .pg-main-head { order: 2; }
  .pg-controls { order: 3; }
  .pg-preview { order: 4; }
}
.pg-sidebar { min-width: 0; }
.pg-eyebrow { margin-bottom: 12px; }
/* Stick the whole right column while the taller settings column scrolls */
.pg-main {
  position: sticky;
  top: 60px;
  align-self: start;
  min-width: 0;
  max-height: calc(100vh - 72px);
  overflow: auto;
}
.pg-main-head { margin-bottom: 18px; }
.pg-main-head h2 { font-size: clamp(26px, 3.5vw, 36px); letter-spacing: -.025em; margin: 0 0 10px; font-weight: 800; }
.pg-lede { font-size: 17px; color: var(--fg-muted); margin: 0; }
.pg-controls { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.select { width: 100%; font: inherit; font-size: 14px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--fg); }
.select.sm { width: auto; padding: 5px 9px; font-size: 13px; }
.range { width: 100%; accent-color: var(--accent); }
.switches { display: flex; flex-direction: column; gap: 7px; }
.sw { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); cursor: pointer; }
.sw input { accent-color: var(--accent); width: 16px; height: 16px; }
.ctl-inline { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; color: var(--fg-muted); }
.pg-preview { min-width: 0; }
.pg-stage-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 8px; min-height: 34px;
}
.pg-stage-bar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pg-fit-btn { border-color: var(--border-strong); color: var(--fg-muted); background: var(--bg-card); }
.pg-fit-btn[aria-pressed="true"] {
  border-color: transparent; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.pg-stage {
  position: relative; min-height: 380px; border-radius: var(--radius);
  border: 1px dashed var(--border-strong); background:
    var(--bg-soft) ;
  background-image: radial-gradient(color-mix(in srgb, var(--fg) 8%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
  display: grid; place-items: center; overflow: auto; padding: 24px;
}
/* Stage is a preview viewport. With fit on it is a fixed frame and the ad is
   scaled (transform) to fit; with fit off the true-size ad can overflow/scroll. */
.pg-stage.is-fit { height: 380px; overflow: hidden; }
.pg-empty { color: var(--fg-muted); font-size: 14px; text-align: center; }
/* margin:auto centers when it fits and collapses to 0 on overflow (scrollable) */
.pg-scale-host { margin: auto; }
/* the ad in its exact bounds — one clear frame. Mounts scaled but hidden, then
   fades in (see .ready) so a format switch never flashes an empty box. */
.pg-ad {
  position: relative;
  transform-origin: top left;
  overflow: hidden; border-radius: 8px;
  background: var(--bg-card); box-shadow: var(--shadow-lift);
  opacity: 0; transition: opacity .18s ease;
}
.pg-ad.ready { opacity: 1; }
/* fallback creative brings its own rounded corners — let them define the shape
   so no white crescent/shadow shows around them */
.pg-ad.has-fallback { background: transparent; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .pg-ad { transition: none; } }
/* feed error / no-fill: a colorful house creative at the slot's exact size.
   Absolute overlay so it survives the SDK blanking the slot content. */
.pg-fallback { position: absolute; inset: 0; z-index: 2; }
.pg-fallback img { display: block; width: 100%; height: 100%; }
/* replay the selected entrance/exit animation so the fallback still feels live */
.pg-fallback[class*="anim-"],
.pg-fallback[class*="animout-"] {
  animation-duration: var(--pg-anim-ms, 400ms);
  animation-timing-function: cubic-bezier(.22, .61, .36, 1);
  animation-fill-mode: both;
}
.pg-fallback.anim-fade { animation-name: pgfb-fade; }
.pg-fallback.anim-slide { animation-name: pgfb-slide-up; }
.pg-fallback.anim-slide-down { animation-name: pgfb-slide-down; }
.pg-fallback.anim-slide-left { animation-name: pgfb-slide-left; }
.pg-fallback.anim-slide-right { animation-name: pgfb-slide-right; }
.pg-fallback.anim-zoom { animation-name: pgfb-zoom; }
.pg-fallback.anim-pop { animation-name: pgfb-pop; }
.pg-fallback.anim-flip { animation-name: pgfb-flip; }
.pg-fallback.animout-fade { animation-name: pgfb-out-fade; }
.pg-fallback.animout-slide { animation-name: pgfb-out-slide-down; }
.pg-fallback.animout-slide-down { animation-name: pgfb-out-slide-up; }
.pg-fallback.animout-slide-left { animation-name: pgfb-out-slide-left; }
.pg-fallback.animout-slide-right { animation-name: pgfb-out-slide-right; }
.pg-fallback.animout-zoom { animation-name: pgfb-out-zoom; }
.pg-fallback.animout-pop { animation-name: pgfb-out-pop; }
.pg-fallback.animout-flip { animation-name: pgfb-out-flip; }
@keyframes pgfb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pgfb-slide-up { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }
@keyframes pgfb-slide-down { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: none; } }
@keyframes pgfb-slide-left { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: none; } }
@keyframes pgfb-slide-right { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: none; } }
@keyframes pgfb-zoom { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes pgfb-pop { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.04); } 100% { transform: none; } }
@keyframes pgfb-flip { from { opacity: 0; transform: perspective(600px) rotateY(90deg); } to { opacity: 1; transform: none; } }
@keyframes pgfb-out-fade { from { opacity: 1; } to { opacity: 0; } }
@keyframes pgfb-out-slide-up { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-100%); } }
@keyframes pgfb-out-slide-down { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(100%); } }
@keyframes pgfb-out-slide-left { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-100%); } }
@keyframes pgfb-out-slide-right { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(100%); } }
@keyframes pgfb-out-zoom { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.85); } }
@keyframes pgfb-out-pop { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.6); } }
@keyframes pgfb-out-flip { from { opacity: 1; transform: none; } to { opacity: 0; transform: perspective(600px) rotateY(90deg); } }
@media (prefers-reduced-motion: reduce) { .pg-fallback { animation: none !important; } }
.pg-under { display: grid; grid-template-columns: 1fr 260px; gap: 14px; margin-top: 14px; }
@media (max-width: 700px) { .pg-under { grid-template-columns: 1fr; } }
.code-wrap.grow { min-width: 0; }
.pg-under .evlog { height: auto; min-height: 90px; }

/* ---------- size cloud ---------- */
.size-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.size-chip { cursor: pointer; font: inherit; text-align: left; border: 1px solid var(--border); background: var(--bg-card); border-radius: 11px; padding: 9px 13px; box-shadow: var(--shadow); transition: .15s; }
.size-chip:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.size-chip b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.size-chip span { font-size: 11.5px; color: var(--fg-muted); }

/* ============================================================ v2 additions */

/* ---- hero browser mock (living-site miniature) ---- */
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 44px; align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 30px; } }
.hero-visual .browser { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lift); background: var(--bg-card); position: relative; max-width: 100%; text-decoration: none; }
.hero-visual .browser:hover .bopen { opacity: 1; transform: translate(-50%, 0); }
.bbar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.bbar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.burl { margin-left: 8px; font: 11px ui-monospace, Menlo, monospace; color: var(--fg-muted); }
.bview { display: block; position: relative; height: 430px; overflow: hidden; }
.bview iframe { position: absolute; top: 0; left: 0; width: 1180px; height: 1560px; border: 0; transform: scale(.463); transform-origin: top left; pointer-events: none; background: var(--bg); }
.bopen { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 6px); opacity: .95; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 10px; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent); transition: .18s; }

/* ---- entry cards ---- */
#explore { padding: 40px 0 20px; }
.entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .entry-grid { grid-template-columns: 1fr; } }
.entry { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); transition: .18s; }
.entry:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); transform: translateY(-3px); text-decoration: none; }
.entry-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.entry-ico { font-size: 26px; line-height: 1; }
.entry h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.entry p { margin: 0 0 16px; color: var(--fg-muted); font-size: 14.5px; }
.entry-cta { font-weight: 700; color: var(--accent); font-size: 14px; margin-top: auto; }

/* ---- colorful formats gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 16px; }
.gcard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); transition: .16s; }
.gcard:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); transform: translateY(-2px); text-decoration: none; }
.gstage { height: 152px; display: grid; place-items: center; background: var(--bg-soft); border-radius: var(--radius-sm); overflow: hidden; padding: 10px; }
.gstage img { border-radius: 7px; box-shadow: 0 4px 14px rgba(16,22,30,.18); display: block; max-width: 100%; }
.gmeta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gmeta b { font-size: 14px; letter-spacing: -.01em; }
.gmeta span { font: 12px ui-monospace, Menlo, monospace; color: var(--fg-muted); }
.gdev { display: flex; align-items: center; gap: 6px; }
.gdev-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); margin-right: 2px; }
.gdev-ico { display: inline-flex; }
.gdev-ico.on { color: var(--accent); }
.gdev-ico.off { color: var(--border-strong); opacity: .7; }
.gtry { font-size: 12.5px; color: var(--accent); font-weight: 600; margin-top: auto; }

/* ---- player studio extras ---- */
.sw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; }
input.color { width: 40px; height: 28px; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-card); cursor: pointer; }

/* ---- playground page ---- */
.pg-page { padding: 40px 0 70px; }
.center-note { text-align: center; margin: 10px 0 0; }

/* ============================================================ living site */
body.site { background: var(--bg-soft); }
.site-top { background: #0d1117; color: #cdd6e2; font-size: 13px; }
.site-topbar { display: flex; align-items: center; gap: 14px; height: 44px; }
.site-topbar .demo-flag { color: #9fb0c4; }
.site-topbar .demo-flag code { background: rgba(255,255,255,.08); color: #dbe6f2; }
.back-pill { color: #cdd6e2; text-decoration: none; font-weight: 600; padding: 4px 10px; border: 1px solid #2a3542; border-radius: 20px; }
.back-pill:hover { border-color: #3a4a5c; text-decoration: none; }
.site-topbar .btn { margin-left: auto; }
.masthead { position: sticky; top: 0; z-index: 40; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.masthead-in { display: flex; align-items: center; gap: 20px; height: 62px; }
.mh-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.mh-brand .logo-dot { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.mh-links { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.mh-links a { color: var(--fg-muted); cursor: pointer; }
.mh-links a:hover { color: var(--fg); }
@media (max-width: 640px) { .mh-links { display: none; } }
.site-main { padding: 22px 24px 60px; }

.adband { text-align: center; margin: 22px 0; }
.adband.inset { margin: 26px 0; }
.ad-center { display: inline-block; max-width: 100%; }
.adcap { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--fg-muted); margin-bottom: 6px; }
.adcap.mt { margin-top: 22px; }

.lead-grid { display: grid; grid-template-columns: 1fr 320px; gap: 30px; margin: 8px 0 4px; }
@media (max-width: 880px) { .lead-grid { grid-template-columns: 1fr; } }
.lead-story .thumb.big { height: 300px; }
.thumb { border-radius: 12px; height: 160px; margin-bottom: 12px; background: linear-gradient(135deg, #5170ff, #b357ff); }
.thumb.t1 { background: linear-gradient(135deg,#5170ff,#b357ff); }
.thumb.t2 { background: linear-gradient(135deg,#0ea5a5,#10b981); }
.thumb.t3 { background: linear-gradient(135deg,#ff7a59,#ff4f9b); }
.thumb.t4 { background: linear-gradient(135deg,#06b6d4,#3b82f6); }
.thumb.t5 { background: linear-gradient(135deg,#f59e0b,#f97316); }
.thumb.t6 { background: linear-gradient(135deg,#7c3aed,#db2777); }
.cat { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; }
.lead-story h1 { font-size: 32px; line-height: 1.1; letter-spacing: -.025em; margin: 4px 0 10px; }
.lead-story .dek { font-size: 17px; color: var(--fg-muted); margin: 0 0 10px; }
.byline { font-size: 13px; color: var(--fg-muted); }
.lead-rail { }
.mostread { list-style: none; margin: 20px 0 0; padding: 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.mostread li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.mostread li:first-child { border-top: 0; }
.mostread b { color: var(--accent); }

.feed-grid { display: grid; grid-template-columns: 1fr 300px; gap: 34px; margin-top: 6px; }
@media (max-width: 880px) { .feed-grid { grid-template-columns: 1fr; } .rail { display: none; } }
.sec-title { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 6px; margin: 0 0 16px; }
.story { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.story .thumb { height: 100px; margin: 0; }
.story h3 { margin: 4px 0 4px; font-size: 18px; letter-spacing: -.01em; }
.story p { margin: 0; color: var(--fg-muted); font-size: 14px; }
.adcard { text-align: center; margin: 18px 0; padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.adcard [data-ad] { display: inline-block; }
.rail .rail-sticky { position: sticky; top: 78px; }
.site-foot { border-top: 1px solid var(--border); background: var(--bg-card); padding: 26px 0; color: var(--fg-muted); font-size: 13px; }
@media (min-width: 641px) { .mobileonly { display: none; } }

/* ---- gallery device filter ---- */
.gfilter { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.gfilter .chip { font-size: 13.5px; }
.gfilter-count { font-size: 13px; color: var(--fg-muted); margin-left: 4px; }

/* ---- video ad unit (living site) ---- */
body.site .evchip { display: none; } /* event chips are a showcase affordance, not editorial */
.videoad { position: relative; overflow: hidden; border-radius: 8px; background: #000; }
.videoad-tag { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 5px; }

/* ============================================================ demo cards
   (renderers.htm / behaviors.htm generic [data-demo] units) */
.rsec { font-size: 22px; letter-spacing: -.02em; margin: 44px 0 6px; }
.rsec-note { max-width: 46em; color: var(--fg-muted); font-size: 15px; margin: 0 0 16px; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; margin: 14px 0 8px; }
.demo-card { display: flex; flex-direction: column; gap: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.demo-card.wide { grid-column: span 2; }
@media (max-width: 720px) { .demo-card.wide { grid-column: span 1; } }
.demo-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.demo-card h4 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.demo-card h4 code, .rsec code { font-size: .85em; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.names { margin: 0; font-size: 12.5px; color: var(--fg-muted); }
.good { margin: 0; font-size: 14px; color: var(--fg-muted); }
.good b { color: var(--fg); }
.evchip { flex-shrink: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px ui-monospace, Menlo, monospace; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 20px; padding: 3px 10px; }
.demo-unit { position: relative; margin: 4px auto; max-width: 100%; }
.demo-card .demo-unit { overflow-x: auto; }
.fit-resizer { resize: horizontal; overflow: hidden; width: 300px; min-width: 160px; max-width: 100%; padding: 0 10px 10px 0; border-right: 3px solid var(--border-strong); border-bottom: 3px solid var(--border-strong); border-radius: 4px; }
.fit-resizer .demo-unit { width: 100%; }

/* ============================================================ behaviors page
   skin contract: body transparent, content column opaque */
body.bh-body { background: transparent; }
.bh-article { padding: 30px 0 80px; }
.bh-col { max-width: 860px; margin: 0 auto; padding: 34px clamp(20px, 4vw, 48px) 60px; background: var(--bg); border-radius: var(--radius); }
.bh-col h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; margin: 8px 0 14px; }
.bh-col h2 { font-size: 23px; letter-spacing: -.02em; margin: 48px 0 6px; }
.bh-col .lede { font-size: 17.5px; color: var(--fg-muted); }
.bh-col section { margin: 0 0 8px; }
.bh-col p { color: var(--fg-muted); }
.bh-col p b, .bh-col p code { color: var(--fg); }
.bh-col code { font-size: .88em; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.tsub { font-size: 13px; font-weight: 600; color: var(--fg-muted); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; vertical-align: 3px; }
.filler { border-left: 3px solid var(--border); padding-left: 16px; font-style: italic; margin: 40px 0; }
.bh-chips { margin: 10px 0; }
.bh-note { font-size: 14px; margin-top: 18px; }
.bh-range { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fg-muted); margin: 8px 0; }
.bh-range .range { flex: 1; max-width: 260px; }
.bh-col .demo-unit { margin: 14px auto; }
.bh-col .code-wrap { margin: 12px 0 4px; }

/* ---- playground v3: guide line, scroll runway, skin contract ---- */
.pg-guide { margin: 12px 2px 0; font-size: 14px; color: var(--fg-muted); border-left: 3px solid var(--accent); padding-left: 12px; min-height: 1.4em; }
.pg-guide b { color: var(--fg); }
.pg-runway { height: 70vh; display: grid; place-items: center; color: var(--fg-muted); font-size: 13px; letter-spacing: .04em; border: 1px dashed var(--border); border-radius: var(--radius); margin: 14px 0; }
body.skin-run { background: transparent; }
body.skin-run .pg-controls, body.skin-run .pg-preview .pg-stage, body.skin-run .pg-main-head { background: var(--bg); border-radius: var(--radius); }

/* ============================================================ coverage map */
.cov-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cov-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-muted); padding: 8px 10px; border-bottom: 2px solid var(--border-strong); }
.cov-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cov-table td:first-child { white-space: nowrap; font-weight: 600; }
.cov-table code { font-size: .85em; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
.cov-group td { padding-top: 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-muted); border-bottom: 2px solid var(--border-strong); font-weight: 700; }
.cov-note { color: var(--fg-muted); }
