/*
 * The Mudda — shared design system.
 *
 * One stylesheet for every page: the landing page, the static pages and the
 * server-rendered pages (api/shared/chrome.js emits the same header, ticker and
 * footer markup). Editorial look: warm paper, Inter Tight headlines, Newsreader
 * body, Mudda red, rounded cards. Light + dark.
 *
 * Pages whose own CSS still hard-codes light colours put data-nodark on <html>;
 * they stay light even when the reader prefers dark, and hide the theme switch.
 *
 * Keep the header/ticker/footer markup in the static pages in step with
 * api/shared/chrome.js.
 */

:root {
  --bg: #f6f4ef; --card: #ffffff; --card-2: #efece4; --ink: #121212; --ink-2: #3d3d3d;
  --muted: #6f6c66; --line: #e3dfd5; --brand: #d3122a; --brand-2: #a80e21; --brand-ink: #ffffff;
  --saffron: #ff7a1a; --green: #138a52; --glass: rgba(246,244,239,.82);
  --shadow: 0 1px 2px rgba(18,18,18,.04), 0 8px 24px rgba(18,18,18,.06);
  --sans: 'Inter Tight', 'Mukta', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', 'Mukta', Georgia, serif;
  --deva: 'Mukta', 'Noto Sans Devanagari', sans-serif;
  --r: 18px;
  --tick-bg: #121212; --tick-ink: #f3f1ec;
  --v-outrage: #e5484d; --v-shame: #b4234a; --v-concern: #d98a00; --v-hope: #138a52;
  --v-pride: #f06a0a; --v-question: #2f6fe4; --v-idea: #7c4ddb; --v-reform: #0d9488;

  /* Aliases for older page CSS (style.css, trust.css, server renderers). */
  --text: var(--ink); --muted-strong: var(--ink-2);
  --border: var(--line); --border-soft: color-mix(in srgb, var(--line) 60%, transparent);
  --bg-alt: var(--card-2); --card-alt: var(--card-2);
  --brand-strong: var(--brand-2); --brand-soft: color-mix(in srgb, var(--brand) 9%, var(--card));
  --display: var(--sans); --serif-deva: var(--deva);
  --radius: 12px; --radius-lg: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-nodark]) {
    --bg: #0d0e11; --card: #16181d; --card-2: #1d2027; --ink: #f3f1ec; --ink-2: #cfccc5;
    --muted: #9a968e; --line: #2a2d35; --glass: rgba(13,14,17,.8); --brand: #ef3349; --brand-2: #ff5a6c;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
    --tick-bg: #1d2027; color-scheme: dark;
  }
}
:root[data-theme="dark"]:not([data-nodark]) {
  --bg: #0d0e11; --card: #16181d; --card-2: #1d2027; --ink: #f3f1ec; --ink-2: #cfccc5;
  --muted: #9a968e; --line: #2a2d35; --glass: rgba(13,14,17,.8); --brand: #ef3349; --brand-2: #ff5a6c;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  --tick-bg: #1d2027; color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
       -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img { max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.m-top { position: sticky; top: 0; z-index: 40; background: var(--glass);
         backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
         border-bottom: 1px solid var(--line); font-family: var(--sans); }
.m-top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.m-top a, .m-foot a { border: 0; }
.m-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; color: var(--ink); min-width: 0; }
.m-logo:hover { color: var(--ink); }
.m-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; flex: none;
          display: grid; place-items: center; font-family: var(--deva); font-weight: 800; font-size: 21px;
          line-height: 1; padding-top: 3px; position: relative; overflow: hidden; }
.m-mark::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
                 background: linear-gradient(90deg, var(--saffron) 0 33%, #fff 33% 66%, var(--green) 66%); }
.m-word { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.m-word b { font-weight: 800; font-size: 20px; letter-spacing: -0.03em; white-space: nowrap; }
.m-word span { font-family: var(--deva); font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 3px; white-space: nowrap; }
.m-nav { display: flex; align-items: center; gap: 4px; }
.m-nav > a, .m-icon { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2);
                      padding: 8px 12px; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
                      font-family: var(--sans); line-height: 1.2; white-space: nowrap; }
.m-nav > a:hover, .m-icon:hover { background: var(--card-2); color: var(--ink); }
.m-nav > a[aria-current="page"] { color: var(--brand); }
.m-nav > a.cta { background: var(--ink); color: var(--bg); }
.m-nav > a.cta:hover { background: var(--brand); color: #fff; }
.m-icon { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; }
.m-icon svg { width: 18px; height: 18px; }
[data-nodark] .m-theme { display: none; }

/* "More" menu: a <details> so it works without JS. */
.m-menu { position: relative; }
.m-menu > summary { list-style: none; }
.m-menu > summary::-webkit-details-marker { display: none; }
.m-menu[open] > summary { background: var(--card-2); color: var(--ink); }
.m-menu-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px));
                background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
                padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; z-index: 50; }
.m-menu-panel a { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 10px 12px; border-radius: 10px; }
.m-menu-panel a:hover { background: var(--card-2); color: var(--ink); }
.m-menu-panel a[aria-current="page"] { color: var(--brand); }
.m-menu-panel .m-menu-sep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 4px 6px; }

/* ---------- ticker (news chyron of the latest Mudda articles) ---------- */
.m-tick { display: flex; align-items: stretch; height: 42px; background: var(--tick-bg); color: var(--tick-ink);
          font-family: var(--sans); position: relative; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,.06); }
.m-tick[hidden] { display: none; }
.m-tick-label { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 0 22px 0 16px;
                background: var(--brand); color: #fff; text-decoration: none; font-size: 12px; font-weight: 800;
                letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; position: relative; z-index: 2;
                clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
.m-tick-label:hover { color: #fff; background: var(--brand-2); }
.m-tick-label .dev { font-family: var(--deva); letter-spacing: 0; text-transform: none; font-size: 14px; }
.m-tick-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: m-tick-pulse 1.4s ease-out infinite; }
@keyframes m-tick-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 70%, 100% { box-shadow: 0 0 0 7px rgba(255,255,255,0); } }
.m-tick-view { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center;
               -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%);
                       mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent 100%); }
.m-tick-track { display: flex; flex: none; white-space: nowrap; will-change: transform;
                animation: m-tick-scroll var(--tick-dur, 120s) linear infinite; }
.m-tick-set { display: flex; flex: none; }
.m-tick:hover .m-tick-track, .m-tick:focus-within .m-tick-track, .m-tick.is-paused .m-tick-track { animation-play-state: paused; }
@keyframes m-tick-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.m-tick-item { display: inline-flex; align-items: center; gap: 9px; padding: 0 26px 0 0; margin-left: 26px; color: var(--tick-ink);
               text-decoration: none; font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; line-height: 42px;
               border-right: 1px solid rgba(255,255,255,.12); }
.m-tick-item:hover, .m-tick-item:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.m-tick-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--saffron)); flex: none; }
.m-tick-item time { font-size: 11.5px; font-weight: 700; color: #ffb27a; letter-spacing: .03em; text-transform: uppercase; }
.m-tick-item .t[lang="hi"] { font-family: var(--deva); font-weight: 600; }
.m-tick-pause { flex: none; width: 42px; border: 0; background: transparent; color: rgba(255,255,255,.7); cursor: pointer;
                display: grid; place-items: center; border-left: 1px solid rgba(255,255,255,.1); padding: 0; }
.m-tick-pause:hover { color: #fff; background: rgba(255,255,255,.06); }
.m-tick-pause svg { width: 14px; height: 14px; }
.m-tick-pause .ic-play, .m-tick.is-paused .m-tick-pause .ic-pause { display: none; }
.m-tick.is-paused .m-tick-pause .ic-play { display: block; }
@media (prefers-reduced-motion: reduce) {
  .m-tick-track { animation: none; }
  .m-tick-set[aria-hidden="true"], .m-tick-pause { display: none; }
  .m-tick-view { overflow-x: auto; -webkit-mask-image: none; mask-image: none; scrollbar-width: thin; scroll-snap-type: x proximity; }
  .m-tick-item { scroll-snap-align: start; }
  .m-tick-dot { animation: none; }
}

/* ---------- shared bits ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 999px;
       font-weight: 700; font-size: 15px; text-decoration: none; border: 1px solid var(--line); color: var(--ink);
       background: var(--card); cursor: pointer; transition: transform .15s, background .15s; font-family: var(--sans); }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; }
.pill { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
        color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
        padding: 4px 10px 4px 8px; border-radius: 999px; letter-spacing: .01em; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
[data-v="outrage"] { --c: var(--v-outrage); } [data-v="shame"] { --c: var(--v-shame); }
[data-v="concern"] { --c: var(--v-concern); } [data-v="hope"] { --c: var(--v-hope); }
[data-v="pride"] { --c: var(--v-pride); } [data-v="question"] { --c: var(--v-question); }
[data-v="idea"] { --c: var(--v-idea); } [data-v="reform"] { --c: var(--v-reform); }
.m-kicker { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); margin: 0 0 8px; font-family: var(--sans); }

/* ---------- inner pages: header block, breadcrumb, story cards, prose ---------- */
.m-page { max-width: 1180px; margin: 0 auto; padding: 36px 24px 64px; }
.m-page.narrow { max-width: 780px; }
.m-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; font-weight: 600;
           color: var(--muted); margin: 0 0 22px; font-family: var(--sans); text-transform: none; letter-spacing: 0; }
.m-crumb a { color: var(--muted); text-decoration: none; border: 0; }
.m-crumb a:hover { color: var(--brand); }
.m-crumb .sep { opacity: .5; }
.m-crumb .lang { margin-left: auto; display: inline-flex; gap: 2px; background: var(--card); border: 1px solid var(--line);
                 border-radius: 999px; padding: 3px; }
.m-crumb .lang a, .m-crumb .lang b { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; }
.m-crumb .lang b { background: var(--ink); color: var(--bg); }
.m-h1 { font-family: var(--sans); font-size: clamp(34px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 800; margin: 0 0 14px; color: var(--ink); }
.m-dek { font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--ink-2); max-width: 40em; margin: 0 0 30px; }

.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.m-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
          overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.m-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.m-card .thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--card-2); border: 0; }
.m-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.m-card .kicker { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); }
.m-card h2 { font-family: var(--sans); font-size: 20px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; margin: 0; color: var(--ink); }
.m-card h2 a { color: inherit; text-decoration: none; border: 0; }
.m-card h2 a:hover { color: var(--brand); }
.m-card .why { font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: var(--ink-2); margin: 0; }
.m-card .why b { font-family: var(--sans); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-right: 6px; }
.m-card .meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 500; }
.m-card .meta strong { color: var(--ink); font-weight: 700; }

.m-prose { font-family: var(--serif); font-size: 18.5px; line-height: 1.65; color: var(--ink); }
.m-prose h2 { font-family: var(--sans); font-size: 26px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; margin: 42px 0 12px; }
.m-prose h3 { font-family: var(--sans); font-size: 19px; letter-spacing: -0.015em; font-weight: 700; margin: 28px 0 8px; }
.m-prose a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; border: 0; }
.m-prose ul, .m-prose ol { padding-left: 1.2em; }
.m-prose li { margin: 0 0 10px; }
.m-prose strong { font-weight: 600; }

/* ---------- footer ---------- */
.m-foot { margin-top: 56px; padding: 40px 0 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line);
          font-family: var(--sans); text-align: left; text-transform: none; letter-spacing: 0; font-weight: 400;
          background: transparent; max-width: none; display: block; }
.m-foot .wrap { display: grid; gap: 22px; }
.m-foot-top { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.m-foot-top .m-logo { margin-right: 0; }
.m-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.m-foot a { color: var(--muted); text-decoration: none; margin: 0; }
.m-foot a:hover { color: var(--ink); }
.m-own { margin: 0; max-width: 62em; font-size: 13.5px; line-height: 1.6; padding: 14px 16px; border-radius: 12px;
         background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.m-own b { color: var(--ink); }
.m-foot-note { margin: 0; font-size: 13px; line-height: 1.6; max-width: 62em; }
.m-foot-bottom { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 13px; }
.m-foot .motto { font-family: var(--deva); font-weight: 600; }

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .m-top .wrap { height: 58px; gap: 6px; }
  .m-nav .hide-sm { display: none; }
  .m-nav > a.cta { padding: 8px 14px; }
  .m-word b { font-size: 18px; }
  .m-tick { height: 40px; }
  .m-tick-label { padding: 0 18px 0 12px; font-size: 11px; letter-spacing: .1em; }
  .m-tick-item { font-size: 14px; line-height: 40px; margin-left: 20px; padding-right: 20px; }
  .m-tick-pause { width: 38px; }
  .m-page { padding: 24px 16px 48px; }
  .m-dek { font-size: 18px; }
  .m-grid { grid-template-columns: 1fr; gap: 14px; }
  .m-prose { font-size: 17.5px; }
  .m-foot { padding: 32px 0 40px; margin-top: 40px; }
}
@media (max-width: 380px) { .m-word span { display: none; } }
@media (prefers-reduced-motion: reduce) { .m-card, .btn { transition: none; } .m-card:hover, .btn:hover { transform: none; } }
@media print { .m-top, .m-tick, .m-foot { display: none !important; } }
.m-foot .m-logo, .m-foot .m-logo:hover { color: var(--ink); }
