/* ==========================================================
   Itaim Bibi News — mobile-first editorial
   ========================================================== */

:root {
  --paper: #F3EFE7;
  --paper-2: #E9E3D7;
  --card: #FBF9F4;
  --ink: #16140F;
  --ink-2: #3B372F;
  --muted: #7A7366;
  --line: rgba(22, 20, 15, .12);
  --accent: #1E3B2F;
  --accent-ink: #F3EFE7;
  --gold: #A9803F;
  --on-media: #FFFFFF;

  --serif: 'Instrument Serif', 'Iowan Old Style', 'Times New Roman', serif;
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r: 20px;
  --r-sm: 14px;
  --g: 16px;
  --top-h: 96px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E0D0B;
    --paper-2: #1A1813;
    --card: #15130F;
    --ink: #F1ECE2;
    --ink-2: #D2CBBD;
    --muted: #918A7C;
    --line: rgba(241, 236, 226, .12);
    --accent: #23463A;
    --accent-ink: #F1ECE2;
    --gold: #D1AA6B;
  }
}
:root[data-theme="dark"] {
  --paper: #0E0D0B;
  --paper-2: #1A1813;
  --card: #15130F;
  --ink: #F1ECE2;
  --ink-2: #D2CBBD;
  --muted: #918A7C;
  --line: rgba(241, 236, 226, .12);
  --accent: #23463A;
  --accent-ink: #F1ECE2;
  --gold: #D1AA6B;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.serif { font-family: var(--serif); font-weight: 400; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold);
}
.kicker time { color: var(--muted); font-weight: 500; letter-spacing: .08em; }
.on-media .kicker time { color: rgba(255,255,255,.75); }
.kicker .dotsep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

/* ---------- media (fade-in) ---------- */
.media { position: relative; overflow: hidden; background: var(--paper-2); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--ease), transform 1.2s var(--ease); }
.media img.is-in, .media video { opacity: 1; }
.media.is-broken::before {
  content: "IB"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 40px; color: var(--muted);
}

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  padding-top: var(--safe-t);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.is-scrolled { border-color: var(--line); }
.top__row {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: 8px calc(var(--g) - 6px) 0;
}
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.icon-btn:active { background: var(--paper-2); }
.brand {
  justify-self: center;
  font-family: var(--serif); font-size: 31px; line-height: 1; letter-spacing: -.015em;
  white-space: nowrap;
  transform-origin: center; transition: transform .35s var(--ease);
}
.brand em { color: var(--gold); }
.top.is-scrolled .brand { transform: scale(.82); }
.top__meta {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  height: 30px; overflow: hidden; white-space: nowrap;
  transition: height .35s var(--ease), opacity .25s;
}
.top.is-scrolled .top__meta { height: 8px; opacity: 0; }
.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); display: inline-block; }

/* ---------- demo notice ---------- */
.demo-note {
  margin: 12px var(--g) 0; padding: 10px 14px;
  border: 1px dashed var(--line); border-radius: 12px;
  font-size: 12.5px; color: var(--muted); line-height: 1.4;
}
.demo-note b { color: var(--ink); font-weight: 600; }

/* ---------- ticker ---------- */
.ticker {
  display: flex; align-items: center;
  background: var(--ink); color: var(--paper);
  height: 36px; overflow: hidden; font-size: 13px;
}
.ticker__label {
  flex: none; display: flex; align-items: center; gap: 7px;
  padding: 0 12px 0 var(--g); height: 100%;
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  background: var(--ink); position: relative; z-index: 1;
  box-shadow: 10px 0 14px var(--ink);
}
.live { width: 7px; height: 7px; border-radius: 50%; background: #E0503C; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224,80,60,.6);} 70% { box-shadow: 0 0 0 7px rgba(224,80,60,0);} 100% { box-shadow: 0 0 0 0 rgba(224,80,60,0);} }
.ticker__viewport { overflow: hidden; flex: 1; }
.ticker__track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.ticker__track a { padding: 0 22px; white-space: nowrap; opacity: .92; position: relative; }
.ticker__track a::after { content: "✦"; position: absolute; right: -6px; color: var(--gold); font-size: 9px; top: 3px; }
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- editorias (stories) ---------- */
.cats {
  display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none;
  padding: 16px var(--g) 6px; scroll-padding: 0 var(--g);
}
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 68px; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.cat__ring {
  display: block;
  width: 66px; height: 66px; border-radius: 50%; padding: 2.5px;
  background: var(--line);
  transition: transform .2s var(--ease);
}
.cat.is-fresh .cat__ring { background: conic-gradient(from 210deg, var(--gold), #E8C98F, var(--accent), var(--gold)); }
.cat__in { display: block; width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid var(--paper); overflow: hidden; background: var(--paper-2); }
.cat__in img { width: 100%; height: 100%; object-fit: cover; }
.cat__mono { width: 100%; height: 100%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-family: var(--serif); font-style: italic; font-size: 24px; }
.cat__label { font-size: 11.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.cat.is-active .cat__ring { background: var(--ink); }
.cat.is-active .cat__label { color: var(--ink); font-weight: 700; }
.cat:active .cat__ring { transform: scale(.94); }

/* ---------- skeleton ---------- */
.sk { background: linear-gradient(100deg, var(--paper-2) 30%, color-mix(in srgb, var(--paper-2) 50%, var(--paper)) 50%, var(--paper-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r); }
.sk-hero { margin: 14px var(--g); aspect-ratio: 4/5; }
.sk-line { margin: 0 var(--g) 10px; height: 18px; border-radius: 8px; }
.sk-line.short { width: 55%; }
@keyframes shimmer { to { background-position: -100% 0; } }

/* ---------- hero (capa) ---------- */
.hero { display: block; margin: 12px var(--g) 0; }
.hero__frame { position: relative; border-radius: var(--r); overflow: hidden; aspect-ratio: 4/5; color: var(--on-media); isolation: isolate; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 18px 40px -18px rgba(30,25,15,.35); }
.hero .media { position: absolute; inset: 0; }
.hero:active .media img { transform: scale(1.03); }
.hero__frame::after { content: ""; position: absolute; inset: 0 0 auto; height: 22%; background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,0)); z-index: 1; pointer-events: none; }
.hero__badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(255,255,255,.16); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.25);
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.hero__count { left: auto; right: 14px; letter-spacing: .04em; }
.hero__body { padding: 18px 2px 0; }
.hero h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 8.6vw, 56px); line-height: 1.02; letter-spacing: -.012em; margin: 8px 0 16px; text-wrap: balance; }
.hero .hero__cta { background: var(--ink); color: var(--paper); }
.hero__cta { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; padding: 10px 16px; border-radius: 999px; background: var(--on-media); color: #16140F; }
.hero__cta svg { width: 16px; height: 16px; }

/* ---------- sections ---------- */
.sec { margin-top: 44px; }
.sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 var(--g); margin-bottom: 16px; }
.sec__title { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: .95; letter-spacing: -.01em; }
.sec__title em { color: var(--gold); }
.sec__sub { font-size: 12px; color: var(--muted); letter-spacing: .02em; padding-bottom: 3px; white-space: nowrap; }
.rule { height: 1px; background: var(--line); margin: 0 var(--g); }

/* ---------- rails ---------- */
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--g) 6px; scroll-padding: 0 var(--g); scrollbar-width: none; overscroll-behavior-x: contain; }
.rail::-webkit-scrollbar { display: none; }
.rcard { flex: 0 0 76%; scroll-snap-align: start; }
.rcard .media { aspect-ratio: 4/5; border-radius: var(--r); }
.rcard__num { position: absolute; left: 12px; top: 6px; font-family: var(--serif); font-style: italic; font-size: 58px; line-height: 1; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.45); z-index: 1; }
.rcard .media::after { content: ""; position: absolute; inset: 0 0 auto; height: 30%; background: linear-gradient(rgba(0,0,0,.35), transparent); }
.rcard h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.1; margin: 12px 2px 6px; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .kicker { margin: 0 2px; }

/* reels rail */
.reel-card { flex: 0 0 44%; scroll-snap-align: start; position: relative; border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 9/16; color: #fff; }
.reel-card .media { position: absolute; inset: 0; }
.reel-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.8)); }
.reel-card__play { position: absolute; top: 10px; right: 10px; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.reel-card__play svg { width: 13px; height: 13px; }
.reel-card h3 { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1; font-size: 14px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- feed ---------- */
.feed { padding: 0 var(--g); display: flex; flex-direction: column; gap: 30px; }
.wide .media { aspect-ratio: 16/11; border-radius: var(--r); }
.wide h3 { font-family: var(--serif); font-weight: 400; font-size: 29px; line-height: 1.04; letter-spacing: -.008em; margin: 14px 0 8px; text-wrap: balance; }
.wide p { color: var(--muted); font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wide .kicker { margin-top: 14px; }
.wide .kicker + h3 { margin-top: 6px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pcard .media { aspect-ratio: 1; border-radius: var(--r-sm); }
.pcard .kicker { margin-top: 10px; font-size: 10px; }
.pcard h3 { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.1; margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1fr 92px; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.row h3 { font-size: 16px; font-weight: 600; line-height: 1.28; letter-spacing: -.005em; margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row .kicker { font-size: 10px; }
.row .media { width: 92px; height: 92px; border-radius: 12px; }

.rcard, .pcard, .wide { display: block; }
.card-link:active { opacity: .75; }

/* video marker */
.vmark { position: absolute; z-index: 1; bottom: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.4); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.vmark svg { width: 12px; height: 12px; }
.amark { position: absolute; z-index: 1; top: 10px; right: 10px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.4); color: #fff; font-size: 11px; font-weight: 600; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* quote */
.quote { display: block; position: relative; background: var(--paper-2); border-radius: var(--r); padding: 30px 22px 24px; overflow: hidden; }
.quote::before { content: "“"; position: absolute; top: -34px; right: 10px; font-family: var(--serif); font-size: 200px; line-height: 1; color: var(--gold); opacity: .25; }
.quote blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: 28px; line-height: 1.12; letter-spacing: -.01em; text-wrap: balance; position: relative; }
.quote figcaption { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.quote figcaption b { color: var(--ink); font-weight: 600; }
.quote .kicker { margin-bottom: 14px; }

/* cta */
.cta { background: var(--accent); color: var(--accent-ink); border-radius: var(--r); padding: 28px 22px; position: relative; overflow: hidden; }
.cta::after { content: "IB"; position: absolute; right: -14px; bottom: -40px; font-family: var(--serif); font-style: italic; font-size: 180px; line-height: 1; opacity: .08; }
.cta h3 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1; margin: 10px 0 10px; }
.cta p { opacity: .8; font-size: 14.5px; max-width: 30ch; }
.cta .kicker { color: #E8C98F; }
.cta__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.btn svg { width: 18px; height: 18px; }
.btn--light { background: var(--accent-ink); color: var(--accent); }
.btn--ghost { border: 1px solid color-mix(in srgb, var(--accent-ink) 35%, transparent); }
.btn--ink { background: var(--ink); color: var(--paper); width: 100%; height: 52px; }
.btn--line { border: 1px solid var(--line); width: 100%; height: 52px; }

/* partners (pronto para ativar) */
.partners { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 var(--g); }
.partner { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.partner img { height: 34px; width: auto; object-fit: contain; object-position: left; }
.partner b { font-size: 14px; }
.partner span { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

/* page header (saved / filtered) */
.phead { padding: 22px var(--g) 18px; }
.phead h1 { font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: .95; letter-spacing: -.015em; }
.phead h1 em { color: var(--gold); }
.phead p { color: var(--muted); margin-top: 10px; font-size: 14.5px; }
.empty { text-align: center; padding: 60px 30px; color: var(--muted); }
.empty .serif { font-size: 30px; color: var(--ink); line-height: 1.05; margin-bottom: 10px; display: block; }

/* ---------- footer ---------- */
.foot { margin-top: 64px; padding: 40px var(--g) calc(120px + var(--safe-b)); border-top: 1px solid var(--line); text-align: center; }
.foot__brand { font-family: var(--serif); font-size: 44px; line-height: 1; letter-spacing: -.015em; }
.foot__brand em { color: var(--gold); }
.foot__tag { color: var(--muted); margin-top: 8px; font-size: 14px; }
.foot__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.foot__links a { font-size: 13px; font-weight: 600; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; }
.foot__copy { font-size: 11.5px; color: var(--muted); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); z-index: 40;
  transform: translateX(-50%);
  display: flex; gap: 2px; padding: 5px;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.12);
  transition: transform .4s var(--ease), opacity .3s;
}
.tabbar.is-hidden { transform: translate(-50%, calc(100% + 30px)); opacity: 0; }
.tab { display: flex; align-items: center; gap: 7px; height: 46px; padding: 0 15px; border-radius: 999px; color: color-mix(in srgb, var(--paper) 62%, transparent); font-size: 13px; font-weight: 600; transition: background .3s var(--ease), color .3s, padding .3s var(--ease); }
.tab svg { width: 21px; height: 21px; }
.tab span { display: none; }
.tab.is-active { background: var(--paper); color: var(--ink); padding: 0 17px 0 14px; }
.tab.is-active span { display: inline; }

/* ---------- reels view ---------- */
.reels { position: fixed; left: 0; right: 0; top: var(--top-h); bottom: 0; overflow-y: auto; scroll-snap-type: y mandatory; background: #000; scrollbar-width: none; z-index: 5; }
.reels::-webkit-scrollbar { display: none; }
.reel { position: relative; height: calc(100svh - var(--top-h)); scroll-snap-align: start; scroll-snap-stop: always; color: #fff; overflow: hidden; }
.reel .media { position: absolute; inset: 0; background: #111; }
.reel .media img, .reel .media video { object-fit: cover; }
.reel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 50%, rgba(0,0,0,.85)); pointer-events: none; }
.reel__body { position: absolute; left: 0; right: 0; bottom: calc(86px + var(--safe-b)); z-index: 1; padding: 0 20px; }
.reel__body .kicker { color: #E8C98F; }
.reel__body h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.02; margin: 8px 0 14px; text-wrap: balance; }
.reel__mute { position: absolute; z-index: 2; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.reel__mute svg { width: 18px; height: 18px; }
.view-reels .ticker, .view-reels .cats, .view-reels .foot { display: none; }

/* ---------- reader ---------- */
.reader {
  position: fixed; inset: 0; z-index: 60;
  background: var(--paper);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  transform: translateY(100%); visibility: hidden;
  transition: transform .5s var(--ease), visibility 0s linear .5s;
}
.reader.is-open { transform: none; visibility: visible; transition: transform .5s var(--ease), visibility 0s; }
.reader__bar {
  position: sticky; top: 0; z-index: 3; height: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0 12px;
}
.reader__bar > * { margin-top: calc(var(--safe-t) + 12px); position: relative; }
.reader__bar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--safe-t) + 66px);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity .3s;
}
.reader.is-past-media .reader__bar::before { opacity: 1; }
.reader__actions { display: flex; gap: 8px; }
.glass-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(20,18,14,.38); color: #fff;
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.18);
  transition: transform .2s var(--ease), background .3s;
}
.glass-btn:active { transform: scale(.92); }
.glass-btn svg { width: 20px; height: 20px; }
.glass-btn.is-on svg { fill: currentColor; }
.reader.is-past-media .glass-btn { background: color-mix(in srgb, var(--paper) 80%, transparent); color: var(--ink); border-color: var(--line); }
.reader__progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--gold); z-index: 4; }

.rmedia-wrap { position: relative; }
.rmedia { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--paper-2); }
.rmedia::-webkit-scrollbar { display: none; }
.rmedia .media { flex: 0 0 100%; aspect-ratio: 4/5; max-height: 78svh; scroll-snap-align: center; }
.rmedia .media.is-video { aspect-ratio: 9/14; background: #000; }
.rmedia .media video { object-fit: contain; }
.rdots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 5px; }
.rdots i { width: 6px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.55); transition: width .3s var(--ease), background .3s; }
.rdots i.is-on { width: 18px; background: #fff; }
.rcount { position: absolute; right: 12px; bottom: 10px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.4); padding: 3px 8px; border-radius: 99px; }

.rbody { max-width: 680px; margin: 0 auto; padding: 24px var(--g) calc(60px + var(--safe-b)); }
.rbody h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 9vw, 54px); line-height: 1.0; letter-spacing: -.014em; margin: 12px 0 16px; text-wrap: balance; }
.rmeta { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.rmeta__logo { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--serif); font-style: italic; font-size: 16px; flex: none; }
.rmeta b { color: var(--ink); font-weight: 600; display: block; font-size: 13.5px; }
.prose { margin-top: 24px; }
.prose p { font-size: 18px; line-height: 1.66; color: var(--ink-2); margin-bottom: 1.05em; overflow-wrap: anywhere; }
.prose > p:first-child::first-letter { font-family: var(--serif); float: left; font-size: 74px; line-height: .8; padding: 8px 10px 0 0; color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .prose > p:first-child::first-letter { color: var(--gold); } }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 28px; }
.tags a { font-size: 12.5px; font-weight: 500; color: var(--ink-2); padding: 7px 12px; border-radius: 999px; background: var(--paper-2); }
.ractions { display: grid; gap: 10px; }
.related { margin-top: 44px; }
.related h4 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0 0 6px; }
.related h4 em { color: var(--gold); }

/* ---------- search ---------- */
.search {
  position: fixed; inset: 0; z-index: 55; background: var(--paper);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s, transform .4s var(--ease), visibility 0s linear .4s;
}
.search.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .4s var(--ease), visibility 0s; }
.search__bar { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 12px) var(--g) 12px; border-bottom: 1px solid var(--line); }
.search__field { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.search__field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); }
.search__field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__cancel { font-size: 14px; font-weight: 600; padding: 8px 2px; }
.search__body { flex: 1; overflow-y: auto; padding: 8px var(--g) calc(40px + var(--safe-b)); }
.search__label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 18px 0 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; aspect-ratio: 4/3; border-radius: var(--r-sm); overflow: hidden; color: #fff; }
.tile .media { position: absolute; inset: 0; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.65)); }
.tile b { position: absolute; left: 12px; bottom: 10px; z-index: 1; font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1; }
.tile small { position: absolute; right: 10px; top: 10px; z-index: 1; font-size: 11px; font-weight: 600; background: rgba(0,0,0,.35); padding: 2px 8px; border-radius: 99px; }
mark { background: color-mix(in srgb, var(--gold) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; transition: all .35s var(--ease); white-space: nowrap; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- entrance ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================
   Tablet / desktop
   ========================================================== */
@media (min-width: 760px) {
  :root { --g: 28px; }
  .brand { font-size: 40px; }
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; }
  .hero__body { padding: 0; }
  .rcard { flex-basis: 40%; }
  .reel-card { flex-basis: 22%; }
  .feed { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 28px; }
  .feed > .wide, .feed > .quote, .feed > .cta, .feed > .sec-inline { grid-column: 1 / -1; }
  .pair, .rows { grid-column: span 1; }
  .rows { border-top: 0; }
  .partners { grid-template-columns: repeat(4, 1fr); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  main, .cats, .demo-note-wrap { max-width: 1240px; margin-left: auto; margin-right: auto; }
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; }
  .hero__frame { max-height: 78vh; }
  .hero h2 { font-size: 60px; }
  .rcard { flex-basis: 23%; }
  .reel-card { flex-basis: 15%; }
  .wide { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: center; }
  .wide .kicker { margin-top: 0; }
  .wide h3 { font-size: 40px; }
  .rmedia .media { max-height: 82vh; }
}
