/* ============ MISSION CONTROL · live portfolio ============
     A night-shift civic grid control room. Every figure is a real
     production number read live from Firestore (stats/latest). */
    :root {
      color-scheme: dark;
      --ink: #0B0E14;
      --ink-2: #0E121A;
      --panel: #12161B;
      --panel-2: #161B22;
      --line: #232A33;
      --line-2: #2C3542;
      --txt: #E7ECF3;
      --txt-mid: #9AA6B6;
      /* was #5D6879 — only ~3.3:1 on --ink, which fails WCAG AA for small
         text and made the dense Tamil glyphs genuinely hard to read.
         Matched to --txt-mid; hierarchy now comes from size and case,
         not from dimming. */
            --accent: #FFB020;
      /* signal saffron */
      --accent-dim: #7a5410;
      --teal: #38D6C4;
      /* data / telemetry lines */
      --nominal: #3FD07A;
      --warning: #F5A623;
      --critical: #F0556A;
      --glow: 0 0 0 1px var(--line), 0 18px 40px -24px rgba(0, 0, 0, .9);
      --font-sans: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", "Roboto Mono", Consolas, monospace;
      --maxw: 1180px;
    }

    /* committed dark: keep tokens stable even if viewer forces light */
    :root[data-theme="light"] {
      color-scheme: dark;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      margin: 0;
    }

    body {
      background:
        radial-gradient(1200px 600px at 80% -10%, rgba(255, 176, 32, .06), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(56, 214, 196, .05), transparent 55%),
        var(--ink);
      color: var(--txt);
      font-family: var(--font-sans);
      -webkit-font-smoothing: antialiased;
      line-height: 1.5;
    }

    .wrap {
      max-width: var(--maxw);
      margin: 0 auto;
      padding: 0 24px;
    }

    /* faint scanning grid overlay */
    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      background-image: linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
      background-size: 56px 56px;
      opacity: .15;
      mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 75%);
    }

    .stage {
      position: relative;
      z-index: 1;
    }

    /* CRT texture: faint scanlines + corner vignette. One fixed layer, GPU-cheap. */
    body::after {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 2;
      background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 3px),
        radial-gradient(140% 120% at 50% 40%, transparent 60%, rgba(0, 0, 0, .28) 100%);
    }

    /* ---------- ignition sequence (first paint) ----------
       A signal line sweeps the viewport once, hero rises in a fast stagger,
       panels flicker on like monitors. h1 animates transform-only so the
       LCP element is painted from frame one. */
    .boot-sweep {
      position: fixed;
      left: 0;
      right: 0;
      top: -4%;
      height: 2px;
      z-index: 60;
      pointer-events: none;
      opacity: 0;
      background: linear-gradient(90deg, transparent 5%, var(--teal) 35%, var(--accent) 65%, transparent 95%);
      box-shadow: 0 0 22px 2px rgba(56, 214, 196, .45);
      animation: sweep 1.05s ease-in-out .12s 1 forwards;
    }

    @keyframes sweep {
      0% { top: -4%; opacity: 0; }
      12% { opacity: .95; }
      85% { opacity: .75; }
      100% { top: 104%; opacity: 0; }
    }

    @keyframes rise {
      from { opacity: 0; transform: translateY(14px); }
      to { opacity: 1; transform: none; }
    }

    @keyframes fade {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    /* transform-only: element stays painted, LCP unaffected */
    @keyframes slide {
      from { transform: translateY(16px); }
      to { transform: none; }
    }

    @keyframes flickerOn {
      0% { opacity: 0; }
      52% { opacity: 0; }
      58% { opacity: .75; }
      66% { opacity: .25; }
      74% { opacity: .9; }
      82% { opacity: .55; }
      100% { opacity: 1; }
    }

    .topbar { animation: fade .4s ease-out both; }
    .eyebrow { animation: rise .5s ease-out .14s both; }
    h1 { animation: slide .6s cubic-bezier(.2, .7, .2, 1) .08s both; }
    .thesis { animation: rise .5s ease-out .28s both; }
    .live-note { animation: rise .5s ease-out .4s both; }
    .hero-links { animation: rise .5s ease-out .38s both; }
    .readout .rd:nth-child(1) { animation: rise .5s ease-out .46s both; }
    .readout .rd:nth-child(2) { animation: rise .5s ease-out .54s both; }
    .readout .rd:nth-child(3) { animation: rise .5s ease-out .62s both; }
    .readout .rd:nth-child(4) { animation: rise .5s ease-out .7s both; }
    .grid .panel { animation: flickerOn .72s both; }
    .grid .panel:nth-child(1) { animation-delay: .45s; }
    .grid .panel:nth-child(2) { animation-delay: .58s; }
    .grid .panel:nth-child(3) { animation-delay: .68s; }
    .grid .panel:nth-child(4) { animation-delay: .76s; }
    .grid .panel:nth-child(5) { animation-delay: .84s; }
    .grid .panel:nth-child(6) { animation-delay: .92s; }
    .grid .panel:nth-child(7) { animation-delay: 1s; }

    /* prose articles reveal as they scroll into view (progressive enhancement) */
    @supports (animation-timeline: view()) {
      .detail article {
        animation: rise linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 45%;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .boot-sweep { animation: none; display: none; }
      .topbar, .eyebrow, h1, .thesis, .live-note,
      .readout .rd, .hero-links, .grid .panel, .detail article {
        animation: none;
      }
    }

    /* ---------- top ops bar ---------- */
    .topbar {
      position: sticky;
      top: 0;
      z-index: 20;
      backdrop-filter: blur(8px);
      background: linear-gradient(var(--ink-2), rgba(11, 14, 20, .7));
      border-bottom: 1px solid var(--line);
    }

    .topbar .row {
      display: flex;
      align-items: center;
      gap: 18px;
      height: 52px;
    }

    .brand {
      font-family: var(--font-mono);
      font-weight: 700;
      letter-spacing: .06em;
      font-size: .9rem;
    }

    .brand b {
      color: var(--accent);
    }

    .topbar .spacer {
      flex: 1;
    }

    .stat-inline {
      font-family: var(--font-mono);
      font-size: .72rem;
      color: var(--txt-mid);
      display: flex;
      align-items: center;
      gap: 7px;
      letter-spacing: .04em;
    }

    .stat-inline .num {
      color: var(--txt);
      font-variant-numeric: tabular-nums;
    }

    .dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      display: inline-block;
      background: var(--nominal);
      box-shadow: 0 0 0 0 rgba(63, 208, 122, .7);
    }

    .dot.pulse {
      animation: pulse 2s infinite;
    }

    .dot.offline {
      background: var(--txt-mid);
      box-shadow: none;
      animation: none;
    }

    /* telemetry older than the stale threshold: amber, no pulse —
       the page stops asserting liveness it can't back up */
    .dot.stale {
      background: var(--warning);
      box-shadow: none;
      animation: none;
    }

    #ago.stale {
      color: var(--warning);
    }

    @keyframes pulse {
      0% {
        box-shadow: 0 0 0 0 rgba(63, 208, 122, .55);
      }

      70% {
        box-shadow: 0 0 0 7px rgba(63, 208, 122, 0);
      }

      100% {
        box-shadow: 0 0 0 0 rgba(63, 208, 122, 0);
      }
    }

    .lang {
      display: flex;
      border: 1px solid var(--line-2);
      border-radius: 6px;
      overflow: hidden;
      font-family: var(--font-mono);
    }

    .lang button {
      background: transparent;
      color: var(--txt-mid);
      border: 0;
      padding: 5px 10px;
      font-size: .72rem;
      cursor: pointer;
      font-family: inherit;
    }

    .lang button[aria-pressed="true"] {
      background: var(--accent);
      color: #1a1200;
      font-weight: 700;
    }

    @media (max-width:720px) {
      .hide-sm {
        display: none;
      }
    }

    /* ---------- hero ---------- */
    .hero {
      /* vertical only — a `padding` shorthand here would clobber .wrap's
         horizontal padding on the shared <div class="wrap hero"> element */
      padding-top: 56px;
      padding-bottom: 34px;
      display: grid;
      grid-template-columns: 1.5fr 1fr;
      gap: 40px;
      align-items: end;
    }

    @media (max-width:860px) {
      .hero {
        grid-template-columns: 1fr;
        gap: 28px;
      }
    }

    .eyebrow {
      font-family: var(--font-mono);
      font-size: .72rem;
      letter-spacing: .18em;
      text-transform: uppercase;
      color: var(--accent);
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 18px;
    }

    .eyebrow .rec {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--critical);
      animation: pulse-red 1.6s infinite;
    }

    @keyframes pulse-red {

      0%,
      100% {
        opacity: 1;
      }

      50% {
        opacity: .25;
      }
    }

    h1 {
      font-size: clamp(2.4rem, 6vw, 4.3rem);
      line-height: .98;
      letter-spacing: -.03em;
      margin: 0;
      font-weight: 800;
      text-wrap: balance;
      /* cinematic: white-hot top edge falling to steel.
         background-clip:text paints glyphs only inside the background box,
         so give the box headroom for deep descenders (Tamil மு etc.) —
         the negative margin cancels the layout impact. */
      background: linear-gradient(180deg, #fff 30%, #b9c4d4 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      -webkit-text-fill-color: transparent;
      padding-bottom: .18em;
      margin-bottom: -.18em;
    }

    /* Tamil script needs more vertical room than Latin at this size */
    h1:lang(ta) {
      line-height: 1.12;
      letter-spacing: 0;
    }

    h1 .sub {
      display: block;
      color: var(--txt-mid);
      -webkit-text-fill-color: var(--txt-mid);
      font-size: clamp(1rem, 2.2vw, 1.4rem);
      font-weight: 500;
      letter-spacing: -.01em;
      margin-top: 14px;
    }

    .thesis {
      margin-top: 22px;
      max-width: 52ch;
      color: var(--txt-mid);
      font-size: 1.02rem;
    }

    .thesis b {
      color: var(--txt);
    }

    .live-note {
      margin-top: 16px;
      font-family: var(--font-mono);
      font-size: .74rem;
      color: var(--txt-mid);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* aggregate readout strip */
    .readout {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: linear-gradient(var(--panel), var(--ink-2));
      box-shadow: var(--glow);
      padding: 6px;
    }

    .readout .grid2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }

    .rd {
      padding: 16px 16px;
      position: relative;
    }

    .rd:nth-child(odd) {
      border-right: 1px solid var(--line);
    }

    .rd:nth-child(-n+2) {
      border-bottom: 1px solid var(--line);
    }

    .rd .k {
      font-family: var(--font-mono);
      font-size: .66rem;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: var(--txt-mid);
    }

    .rd .v {
      font-family: var(--font-mono);
      font-size: 2.1rem;
      font-weight: 700;
      margin-top: 6px;
      font-variant-numeric: tabular-nums;
      letter-spacing: -.02em;
    }

    .rd .v .plus {
      color: var(--accent);
    }

    /* ---------- systems grid ---------- */
    .section-head {
      display: flex;
      align-items: baseline;
      gap: 14px;
      margin: 40px 0 18px;
    }

    .section-head h2 {
      font-size: .82rem;
      font-family: var(--font-mono);
      letter-spacing: .16em;
      text-transform: uppercase;
      color: var(--txt-mid);
      margin: 0;
      font-weight: 600;
    }

    .section-head .rule {
      flex: 1;
      height: 1px;
      position: relative;
      overflow: hidden;
      background: var(--line);
    }

    /* ambient: a teal signal trace runs the divider every few seconds.
       hardware accelerated translateX avoids paint storms. */
    .section-head .rule::after {
      content: "";
      position: absolute;
      top: 0; left: -90px; right: 0; bottom: 0;
      background: linear-gradient(90deg, transparent, rgba(56, 214, 196, .8), transparent) no-repeat 0 0 / 90px 1px;
      animation: trace 6s linear infinite;
    }

    @keyframes trace {
      0% { transform: translateX(0); }
      55%, 100% { transform: translateX(100%); }
    }

    .section-head .count {
      font-family: var(--font-mono);
      font-size: .72rem;
      color: var(--txt-mid);
    }

    /* Asymmetric editorial grid on a 6-col base:
       flagship 4 + 2  /  2 + 2 + 2  /  3 + 3  */
    .grid {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 16px;
    }

    .grid .panel {
      grid-column: span 2;
    }

    .grid .panel.flagship {
      grid-column: span 4;
    }

    .grid .panel.s3 {
      grid-column: span 3;
    }

    @media (max-width:980px) {
      .grid {
        grid-template-columns: repeat(2, 1fr);
      }

      .grid .panel,
      .grid .panel.s3 {
        grid-column: span 1;
      }

      .grid .panel.flagship {
        grid-column: span 2;
      }
    }

    @media (max-width:640px) {
      .grid {
        grid-template-columns: 1fr;
      }

      .grid .panel,
      .grid .panel.s3,
      .grid .panel.flagship {
        grid-column: auto;
      }
    }

    /* The flagship is wide enough to fit all four chips on one line, which
       runs them together as a single long string. Lay them out 2x2 so the
       "now" pair and the cumulative pair read as separate rows. */
    .flagship .chips {
      display: grid;
      grid-template-columns: repeat(2, max-content);
      justify-content: start;
      gap: 10px 30px;
    }

    @media (max-width:640px) {
      .flagship .chips {
        grid-template-columns: 1fr;
        gap: 8px;
      }
    }

    /* flagship: the most-live system gets scale and a warm signal tint */
    .panel.flagship {
      border-color: rgba(255, 176, 32, .26);
      background:
        radial-gradient(640px 240px at 88% -25%, rgba(255, 176, 32, .09), transparent 62%),
        linear-gradient(180deg, var(--panel-2), var(--panel));
    }

    a.panel.flagship:hover {
      border-color: var(--accent);
    }

    /* ambient: a scan light travels the flagship's top edge */
    .panel.flagship .scan-trace {
      position: absolute;
      top: -1px;
      left: 12px;
      right: 12px;
      height: 1px;
      pointer-events: none;
      overflow: hidden;
    }

    .panel.flagship .scan-trace::after {
      content: "";
      position: absolute;
      top: 0; left: -140px; right: 0; bottom: 0;
      background:
        linear-gradient(90deg, transparent, rgba(255, 176, 32, .85), transparent) no-repeat 0 0 / 140px 1px;
      animation: trace-wide 7.5s ease-in-out infinite;
    }

    @keyframes trace-wide {
      0% { transform: translateX(0); }
      60%, 100% { transform: translateX(100%); }
    }

    @media (min-width:981px) {
      .flagship .metric .v {
        font-size: 3.1rem;
      }

      .flagship .p-name {
        font-size: 1.18rem;
      }

      .flagship .viz .benches {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        align-items: end;
      }

      .flagship .viz .benches .gauge-sub {
        grid-column: 1 / -1;
        margin-top: 0;
      }
    }

    .panel {
      position: relative;
      background: linear-gradient(180deg, var(--panel-2), var(--panel));
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 18px 18px 16px;
      min-height: 230px;
      display: flex;
      flex-direction: column;
      box-shadow: var(--glow);
      transition: border-color .2s, transform .2s;
      color: inherit;
      text-decoration: none;
    }

    .panel:hover {
      transform: translateY(-3px);
      box-shadow: 0 0 0 1px var(--line-2), 0 24px 48px -20px rgba(0, 0, 0, .95);
    }

    .panel:hover .tick {
      border-color: var(--accent-dim);
    }

    a.panel {
      cursor: pointer;
    }

    a.panel:hover {
      border-color: var(--accent-dim);
    }

    a.panel:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    a.panel .p-name::after {
      content: "↗";
      font-size: .72em;
      color: var(--txt-mid);
      margin-left: 6px;
      transition: color .2s;
      vertical-align: middle;
    }

    a.panel:hover .p-name::after {
      color: var(--accent);
    }

    /* corner registration ticks */
    .panel .tick {
      position: absolute;
      width: 8px;
      height: 8px;
      border-color: var(--line-2);
    }

    .panel .tick.tl {
      top: 8px;
      left: 8px;
      border-left: 1px solid;
      border-top: 1px solid;
    }

    .panel .tick.tr {
      top: 8px;
      right: 8px;
      border-right: 1px solid;
      border-top: 1px solid;
    }

    .panel .tick.bl {
      bottom: 8px;
      left: 8px;
      border-left: 1px solid;
      border-bottom: 1px solid;
    }

    .panel .tick.br {
      bottom: 8px;
      right: 8px;
      border-right: 1px solid;
      border-bottom: 1px solid;
    }

    .p-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
    }

    .p-name {
      font-weight: 700;
      font-size: 1.02rem;
      letter-spacing: -.01em;
    }

    .p-endpoint {
      font-family: var(--font-mono);
      font-size: .68rem;
      color: var(--txt-mid);
      margin-top: 3px;
    }

    .p-endpoint-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 4px;
    }

    .p-endpoint-row .p-endpoint {
      margin-top: 0;
    }

    .plat-badge {
      font-family: var(--font-mono);
      font-size: .60rem;
      letter-spacing: .03em;
      color: var(--txt-mid);
      background: var(--ink-2);
      border: 1px solid var(--line-2);
      padding: 1.5px 6px;
      border-radius: 4px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      text-decoration: none;
      cursor: pointer;
      transition: border-color .15s, color .15s, background .15s, transform .15s;
    }

    .plat-badge:hover {
      color: #fff;
      border-color: var(--accent);
      background: rgba(255, 176, 32, .12);
      transform: translateY(-1px);
    }

    .plat-badge.play:hover {
      border-color: #34d399;
      background: rgba(52, 211, 153, .12);
      color: #6ee7b7;
    }

    .plat-badge.web:hover {
      border-color: #38bdf8;
      background: rgba(56, 189, 248, .12);
      color: #7dd3fc;
    }

    .plat-badge.wear {
      border-color: rgba(251, 191, 36, .3);
      color: #fcd34d;
    }

    .plat-badge.wear:hover {
      border-color: #fbbf24;
      background: rgba(251, 191, 36, .14);
      color: #fef08a;
    }

    .plat-badge.mcp {
      border-color: rgba(168, 85, 247, .35);
      color: #c084fc;
    }

    .plat-badge.mcp:hover {
      border-color: #c084fc;
      background: rgba(168, 85, 247, .18);
      color: #f3e8ff;
      box-shadow: 0 0 10px rgba(168, 85, 247, .25);
    }

    .plat-badge.api {
      border-color: rgba(56, 189, 248, .3);
      color: #38bdf8;
    }

    .plat-badge.api:hover {
      border-color: #38bdf8;
      background: rgba(56, 189, 248, .14);
      color: #7dd3fc;
    }

    .plat-ic {
      width: 10px;
      height: 10px;
      display: inline-block;
      flex-shrink: 0;
    }

    .status {
      font-family: var(--font-mono);
      font-size: .62rem;
      letter-spacing: .08em;
      text-transform: uppercase;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 8px;
      border-radius: 20px;
      white-space: nowrap;
      border: 1px solid var(--line-2);
    }

    .status.ok {
      color: var(--nominal);
    }

    .status.ok .dot {
      background: var(--nominal);
    }

    .status.warn {
      color: var(--warning);
    }

    .status.warn .dot {
      background: var(--warning);
    }

    .status.crit {
      color: var(--critical);
    }

    .status.crit .dot {
      background: var(--critical);
    }

    .metric {
      margin-top: 16px;
    }

    .metric .k {
      font-family: var(--font-mono);
      font-size: .64rem;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: var(--txt-mid);
    }

    .metric .v {
      font-family: var(--font-mono);
      font-size: 2rem;
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      letter-spacing: -.02em;
      line-height: 1.1;
      margin-top: 2px;
    }

    .metric .v .u {
      font-size: .9rem;
      color: var(--accent);
    }

    /* live sub-badge (real-time count within a panel) */
    .livebadge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-family: var(--font-mono);
      font-size: .62rem;
      letter-spacing: .06em;
      color: var(--teal);
      margin-left: 10px;
      vertical-align: middle;
      text-transform: uppercase;
    }

    .livebadge .dot {
      background: var(--teal);
      box-shadow: 0 0 0 0 rgba(56, 214, 196, .7);
    }

    /* explicit display beats the UA [hidden] rule, so restate it */
    .livebadge[hidden] {
      display: none;
    }

    /* supporting stat chips under a panel metric */
    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 14px;
      margin-top: 12px;
      font-family: var(--font-mono);
      font-size: .68rem;
    }

    .chips .c {
      color: var(--txt-mid);
    }

    .chips .c b {
      color: var(--txt-mid);
      font-weight: 600;
    }

    /* provenance tags — every figure declares its time basis so live and lifetime
     numbers can never be read as the same kind of thing.
       .now = live right now   .win = rolling window (28d GA4 / 16mo Search Console)
       .all = cumulative all-time      (untagged = current state, e.g. subscribers, rating) */
    .tag {
      font-family: var(--font-mono);
      font-size: .58rem;
      letter-spacing: .07em;
      text-transform: uppercase;
      color: var(--txt-mid);
      white-space: nowrap;
    }

    /* no opacity knock-down: these sit at the same brightness as
       everything else and read as small-caps labels instead */
    .tag.win,
    .tag.all {
      opacity: 1;
    }

    .tag.now {
      color: var(--teal);
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .tag.now::before {
      content: "";
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--teal);
      box-shadow: 0 0 0 0 rgba(56, 214, 196, .7);
      animation: pulse-teal 2s infinite;
    }

    @keyframes pulse-teal {
      0% {
        box-shadow: 0 0 0 0 rgba(56, 214, 196, .5);
      }

      70% {
        box-shadow: 0 0 0 6px rgba(56, 214, 196, 0);
      }

      100% {
        box-shadow: 0 0 0 0 rgba(56, 214, 196, 0);
      }
    }

    .metric .v .tag {
      margin-left: 10px;
      vertical-align: middle;
    }

    .viz {
      margin-top: auto;
      padding-top: 14px;
    }

    /* honest gauges — every fill encodes a real figure from stats/latest */
    .gauge-track {
      height: 8px;
      border-radius: 5px;
      background: var(--line);
      margin-top: 8px;
      overflow: hidden;
    }

    .gauge-fill {
      display: block;
      height: 100%;
      width: 0;
      border-radius: 5px;
      background: var(--accent);
      transition: width .9s cubic-bezier(.4, 0, .2, 1);
      position: relative;
      overflow: hidden;
    }

    /* ambient: a soft sheen crosses each filled gauge */
    .gauge-fill::after {
      content: "";
      position: absolute;
      top: 0; left: -48px; right: 0; bottom: 0;
      background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent) no-repeat 0 0 / 48px 100%;
      animation: sheen 4.5s ease-in-out infinite;
    }

    @keyframes sheen {
      0%, 35% { transform: translateX(0); }
      75%, 100% { transform: translateX(100%); }
    }

    .gauge-fill.crit {
      background: var(--critical);
    }

    .gauge-fill.ok {
      background: var(--nominal);
    }

    .gauge-fill.teal {
      background: var(--teal);
    }

    .gauge-fill.accent {
      background: var(--accent);
    }

    .gauge-scale {
      display: flex;
      justify-content: space-between;
      margin-top: 5px;
      font-family: var(--font-mono);
      font-size: .58rem;
      color: var(--txt-mid);
      font-variant-numeric: tabular-nums;
    }

    .gauge-sub {
      font-family: var(--font-mono);
      font-size: .62rem;
      color: var(--txt-mid);
      margin-top: 9px;
      line-height: 1.35;
    }

    @media (prefers-reduced-motion: reduce) {
      .gauge-fill {
        transition: none;
      }
    }

    /* per-bench breakdown (Court Pulse) */
    .benches {
      display: flex;
      flex-direction: column;
      gap: 11px;
    }

    .bench-top {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 6px;
    }

    .bench-name {
      font-family: var(--font-mono);
      font-size: .64rem;
      letter-spacing: .07em;
      text-transform: uppercase;
      color: var(--txt-mid);
    }

    .bench-fig {
      font-family: var(--font-mono);
      font-size: .66rem;
      color: var(--txt-mid);
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .bench-fig b {
      color: var(--txt);
      font-weight: 700;
    }

    /* a figure the card is deliberately disclosing about itself */
    .bench-fig.flag b {
      color: var(--accent);
    }

    /* stacked variant: label+tag on one line, figures beneath — for rows whose figures
     are too long to sit opposite the label without overflowing the card. */
    .bench-fig.row {
      display: block;
      white-space: normal;
      margin-top: 1px;
      line-height: 1.45;
    }

    /* ---------- quick-links ---------- */
    .quick-links {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }

    /* Each contact reads as a field chip in the same language as the
       status pills and panels, rather than an underlined hyperlink. */
    .quick-links .end {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      font-family: var(--font-mono);
      font-size: .76rem;
      color: var(--txt-mid);
      padding: 7px 13px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: linear-gradient(180deg, var(--panel-2), var(--panel));
      transition: border-color .2s, transform .2s, box-shadow .2s;
    }

    .quick-links .end a {
      color: var(--txt);
      text-decoration: none;
    }

    /* only the chips that actually go somewhere get an affordance —
       the location chip is a plain readout */
    .quick-links .end:has(a):hover {
      border-color: var(--accent);
      transform: translateY(-1px);
      box-shadow: 0 8px 20px -14px rgba(255, 176, 32, .8);
    }

    .quick-links .end:has(a):hover a,
    .quick-links .end:has(a):hover .k {
      color: var(--accent);
    }

    @media (prefers-reduced-motion: reduce) {
      .quick-links .end:has(a):hover {
        transform: none;
      }
    }

    .quick-links .end .k {
      color: var(--txt-mid);
      display: inline-flex;
      align-items: center;
    }

    .quick-links .end .ic {
      width: 15px;
      height: 15px;
      display: block;
    }

    /* Visually hidden but still in the DOM and the accessibility tree:
       screen readers announce "Email hello@…", crawlers still read the
       label. Not aria-label — that would REPLACE the link's accessible
       name with "Email" and hide the address from assistive tech. */
    .vh {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      padding: 0;
      overflow: hidden;
      clip: rect(0 0 0 0);
      clip-path: inset(50%);
      white-space: nowrap;
      border: 0;
    }

    .quick-links .spacer {
      flex: 1;
    }

    footer.quick-links {
      margin-top: 52px;
      border-top: 1px solid var(--line);
      padding: 28px 0 60px;
    }

    /* sits inside the identity column now, under the thesis */
    .hero-links {
      margin-top: 26px;
    }

    .readout-col {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .readout-col .live-note {
      margin-top: 0;
    }

    .disclaimer {
      width: 100%;
      font-family: var(--font-mono);
      font-size: .68rem;
      color: var(--txt-mid);
      background: var(--ink-2);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 12px;
    }

    a.focusable:focus-visible,
    button:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    @media (prefers-reduced-motion: reduce) {

      .dot.pulse,
      .eyebrow .rec,
      .tag.now::before,
      .section-head .rule::after,
      .panel.flagship .scan-trace::after,
      .gauge-fill::after {
        animation: none;
      }
    }

    /* ---------- mobile pass ---------- */
    @media (max-width:640px) {
      .wrap {
        /* keep real breathing room at the edges — 16px read as flush on narrow screens */
        padding: 0 22px;
      }

      /* the row must hold brand + clock + both language buttons at 375px.
         Tamil's labels are wider than the English ones, so the brand is
         the element that gives — everything else stays intact. */
      .topbar .row {
        gap: 10px;
        height: 48px;
      }

      .brand {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .76rem;
        letter-spacing: .03em;
      }

      .topbar .stat-inline,
      .lang {
        flex: 0 0 auto;
      }

      /* tighten tracking so the eyebrow fits one line instead of
         breaking "CIVIC-TECH" across two */
      .eyebrow {
        letter-spacing: .1em;
        font-size: .68rem;
        align-items: center;
      }

      .eyebrow .rec {
        flex: 0 0 auto;
      }

      /* chips stack full-width so the long email address never has to
         share a row and truncate */
      .quick-links {
        gap: 8px;
      }

      .quick-links .end {
        width: 100%;
      }

      .quick-links .spacer {
        display: none;
      }



      .stat-inline {
        font-size: .66rem;
      }

      .lang button {
        padding: 5px 8px;
      }

      .hero {
        padding-top: 40px;
        padding-bottom: 26px;
      }

      .metric .v {
        font-size: 1.7rem;
      }

      .rd .v {
        font-size: 1.7rem;
      }

      .rd {
        padding: 13px 14px;
      }

      .panel {
        min-height: 0;
        padding: 16px 15px 14px;
      }

      footer.quick-links {
        margin-top: 36px;
        padding: 24px 0 44px;
      }
    }
    /* ===== SYSTEMS IN DETAIL — crawlable prose ===== */
    .detail {
      margin: 56px 0 8px;
    }

    .detail .dl {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 22px 34px;
      margin-top: 22px;
    }

    .detail article h3 {
      font: 600 14px/1.3 var(--font-sans);
      letter-spacing: .02em;
      margin: 0 0 6px;
      color: var(--txt);
    }

    .detail article h3 a {
      color: inherit;
      text-decoration: none;
      border-bottom: 1px solid var(--line-2);
    }

    .detail article h3 a:hover {
      color: var(--accent);
      border-bottom-color: var(--accent);
    }

    .detail article p {
      margin: 0;
      font-size: 13.5px;
      line-height: 1.65;
      color: var(--txt-mid);
    }

    .detail article p b {
      color: var(--txt);
      font-variant-numeric: tabular-nums;
      font-weight: 600;
    }
.stale-metric { opacity: 0.5; filter: grayscale(1); transition: opacity 0.3s; }
.stale-metric::after { content: "\26A0"; color: var(--r); font-size: 1rem; position: absolute; top: 1rem; right: 1rem; }
