/* ============================================================================
   Pushkara Netra design system — lifted verbatim from the Pushkara Netra
   prototype (pushkara-netra/index.html) so the SPDT landing page and Command
   Center share its exact look: AP Government identity, navy/saffron/river
   palette, Marcellus SC display face, glass cards over a Ken Burns ghat photo.

   Used by index.html (landing) and geotwin-command-center.html.
   The operational consoles (ICCC, 3D simulation) keep the dark control-room
   theme in css/console.css — a map read for hours wants the dark ground.
   ========================================================================== */

  /* ---------- global ---------- */
  body { background:linear-gradient(160deg,#f4f7fc 0%,#eef4fb 40%,#fdf7ec 100%); }

  /* full-page background photo with slow Ken Burns zoom + warm wash overlay */
  @keyframes bgZoom { 0%,100%{transform:scale(1);} 50%{transform:scale(1.08);} }
  body::before {
    content:''; position:fixed; inset:0; z-index:-2;
    background:url('../assets/ghat-bg.jpg') center/cover no-repeat;   /* relative to css/, not to the page */
    animation:bgZoom 45s ease-in-out infinite; will-change:transform;
  }
  body::after {
    content:''; position:fixed; inset:0; z-index:-1;
    background:linear-gradient(160deg, rgba(244,247,252,.90) 0%, rgba(238,244,251,.84) 40%, rgba(253,243,226,.78) 100%);
  }
  ::-webkit-scrollbar { width:6px; height:6px; }
  ::-webkit-scrollbar-thumb { background:#c7d4ea; border-radius:3px; }

  /* ---------- animations ---------- */
  @keyframes pulseDot { 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.35; transform:scale(.8);} }
  .pulse-dot { animation:pulseDot 1.6s ease-in-out infinite; }

  @keyframes blinkRec { 0%,49%{opacity:1;} 50%,100%{opacity:.15;} }
  .rec-blink { animation:blinkRec 1s steps(1) infinite; }

  @keyframes waveMove { 0%{transform:translateX(0);} 100%{transform:translateX(-50%);} }
  .wave-1 { animation:waveMove 9s linear infinite; }
  .wave-2 { animation:waveMove 14s linear infinite; opacity:.6; }
  .wave-3 { animation:waveMove 22s linear infinite; opacity:.35; }

  @keyframes scanline { 0%{top:-10%;} 100%{top:110%;} }
  .scanline {
    position:absolute; left:0; right:0; height:22%;
    background:linear-gradient(to bottom, rgba(34,211,238,0), rgba(34,211,238,.18), rgba(34,211,238,0));
    animation:scanline 4.5s linear infinite;
  }

  @keyframes noiseShift {
    0%{background-position:0 0;} 25%{background-position:-14px 9px;}
    50%{background-position:11px -7px;} 75%{background-position:-6px -13px;} 100%{background-position:0 0;}
  }
  .cctv-noise {
    background-image:repeating-radial-gradient(circle at 17% 32%, rgba(255,255,255,.05) 0 1px, transparent 1px 3px),
                     repeating-radial-gradient(circle at 73% 61%, rgba(255,255,255,.04) 0 1px, transparent 1px 4px);
    animation:noiseShift .35s steps(4) infinite;
  }

  @keyframes drift1 { 0%{transform:translate(0,0);} 25%{transform:translate(26px,10px);} 50%{transform:translate(48px,-6px);} 75%{transform:translate(20px,14px);} 100%{transform:translate(0,0);} }
  @keyframes drift2 { 0%{transform:translate(0,0);} 33%{transform:translate(-30px,12px);} 66%{transform:translate(-12px,-14px);} 100%{transform:translate(0,0);} }
  @keyframes drift3 { 0%{transform:translate(0,0);} 40%{transform:translate(18px,-16px);} 80%{transform:translate(-22px,8px);} 100%{transform:translate(0,0);} }
  .crowd-dot { position:absolute; width:5px; height:5px; border-radius:9999px; background:rgba(255,255,255,.85); box-shadow:0 0 4px rgba(255,255,255,.6); }
  .d1{animation:drift1 11s ease-in-out infinite;} .d2{animation:drift2 9s ease-in-out infinite;} .d3{animation:drift3 13s ease-in-out infinite;}

  @keyframes dronePan { 0%{background-position:0% 0%;} 50%{background-position:100% 30%;} 100%{background-position:0% 0%;} }
  .drone-pan { background-size:160% 160%; animation:dronePan 26s ease-in-out infinite; }

  @keyframes tickerScroll { 0%{transform:translateX(0);} 100%{transform:translateX(-50%);} }
  .ticker { animation:tickerScroll 38s linear infinite; }
  .ticker:hover { animation-play-state:paused; }

  @keyframes glowPulse {
    0%,100%{box-shadow:0 0 0 0 rgba(245,158,11,.30);}
    50%{box-shadow:0 0 20px 5px rgba(245,158,11,.22);}
  }
  .glow-saffron { animation:glowPulse 3s ease-in-out infinite; }

  @keyframes riseIn { from{opacity:0; transform:translateY(14px);} to{opacity:1; transform:translateY(0);} }
  .rise-in { animation:riseIn .7s ease-out both; }
  .rise-in-1{animation-delay:.05s;} .rise-in-2{animation-delay:.15s;} .rise-in-3{animation-delay:.25s;}
  .rise-in-4{animation-delay:.35s;} .rise-in-5{animation-delay:.45s;} .rise-in-6{animation-delay:.55s;}

  @keyframes gaugeSweep { from{stroke-dashoffset:264;} }
  .gauge-arc { animation:gaugeSweep 1.8s ease-out both; }

  @keyframes flowArrow { 0%{transform:translateX(-4px); opacity:.2;} 50%{opacity:1;} 100%{transform:translateX(4px); opacity:.2;} }
  .flow-arrow { animation:flowArrow 1.2s ease-in-out infinite; }
  .flow-arrow-out { animation:flowArrow 1.2s ease-in-out infinite reverse; }

  .density-bar { transition:width 1.4s cubic-bezier(.4,0,.2,1); }

  /* ===== glass cards — EAM-style rotating gradient border ===== */
  /* @keyframes cardReveal {
    from { opacity:0; transform:translateY(28px) scale(.96); }
    to   { opacity:1; transform:translateY(0)    scale(1);   }
  } */
  @keyframes sparkleTwinkle {
    0%, 100% { opacity:0; transform:scale(.3) rotate(0deg); }
    50%      { opacity:1; transform:scale(1)  rotate(180deg); }
  }

  /* same technique as the EAM dashboard: an animated custom property drives
     the conic-gradient's angle. background-clip:border-box on its own paints
     across the WHOLE box (border + interior) — it's the opaque padding-box
     layer underneath that blocks it from the interior, leaving colour only
     on the border stroke. */
  @property --glow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
  }
  @keyframes cardBorderSpin { to { --glow-angle: 360deg; } }

  /* Fill sitting on top of the animated ring. It must be FULLY OPAQUE: the
     conic gradient is painted on the border-box, which extends underneath the
     padding-box, so any transparency here lets the sweep show through the
     whole card face — which looked like the animation was running across the
     card body instead of around its edge. */
  :root { --card-solid: #ffffff; }
  :root[data-theme="dark"] { --card-solid: #111823; }
  /* The ring, named once so the hover rule and its dark-theme counterpart
     cannot drift apart.

     The rest of the ring is a visible base colour, NOT transparent. With a
     transparent remainder the card appeared to lose its border on hover and
     all you saw was one short arc — it looked broken rather than animated.
     The saffron runs as a comet (soft tail -> bright head) over that base. */
  :root { --ring-w: 3px; }

  /* The card needs a positioning context for the ring layer. */
  .glass-card.card-spin { position: relative; }

  /* ---- saffron border animation, on hover -------------------------------
     Implemented as a masked ring in ::before rather than by painting a conic
     gradient into the element's own border-box. Two reasons:

       1. It travels. A conic gradient on the border-box maps angle to
          perimeter non-uniformly, so on a wide card the highlight crawled
          along the long edges and darted across the short ones — it read as
          a static two-tone border rather than something moving round.
       2. It leaves the card's background alone, so the light/dark themes
          keep their own fills and nothing can bleed through the card face.

     The ring is its own compositor layer, which also keeps the per-frame
     repaint off the card body. Nothing on the body animates: no lift, no
     glow halo. */
  .glass-card.card-spin::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: var(--ring-w);              /* ring thickness */
    background: conic-gradient(from var(--glow-angle),
      transparent           0%,
      transparent          55%,
      rgba(245,166,35,.25) 68%,
      #f5a623              82%,
      #ffe7b8              90%,
      #f5a623              95%,
      transparent         100%);
    /* Punch out the middle, leaving only the border ring. */
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
    z-index: 3;
  }
  .glass-card.card-spin:hover::before {
    opacity: 1;
    animation: cardBorderSpin 1.8s linear infinite;
  }
  /* body stays put: no lift, no outer glow */
  .glass-card.card-spin:hover {
    transform: none;
    box-shadow: 0 1px 0 rgba(255,255,255,.5) inset;
    animation: none !important;
  }
  /* The base card pulses a glow halo on ::after when hovered. That is motion
     on the card BODY, so it is suppressed here — the ring in ::before is the
     only thing that moves. */
  .glass-card.card-spin::after,
  .glass-card.card-spin:hover::after {
    animation: none !important;
    opacity: 0 !important;
    box-shadow: none !important;
  }

  @media (prefers-reduced-motion: reduce) {
    .glass-card.card-spin:hover::before { animation: none; opacity: 1; }
  }

  .glass-card {
    position:relative; overflow:hidden; isolation:isolate;
    border-radius:1rem;
    background:rgba(255,255,255,.82);
    border:1.5px solid rgba(15,37,87,.14);
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    box-shadow:0 1px 0 rgba(255,255,255,.5) inset;
    transition:transform .45s cubic-bezier(.22,.9,.3,1), box-shadow .45s ease, border-color .4s ease;
    animation:cardReveal .7s cubic-bezier(.34,1.4,.64,1) both;
  }
  .glass-card:hover {
    transform:translateY(-5px);
    border: 2px solid transparent;
    background:
      linear-gradient(var(--card-solid), var(--card-solid)) padding-box,
      conic-gradient(from var(--glow-angle),
        transparent 0%,   transparent 72%,
        #f5a623     72%,  #f5a623     93%,
        #ffffff     93%,  #ffffff     97%,
        transparent 97%,  transparent 100%) border-box;
    animation: cardBorderSpin 2.5s linear infinite !important;
  }

  /* pulsing "live" glow halo, layered on top of the spinning border */
  .glass-card::after {
    content:''; position:absolute; inset:0; z-index:0; border-radius:inherit;
    pointer-events:none;
    box-shadow:0 0 0 0 rgba(245,158,11,0);
    opacity:0;
    transition:opacity .4s ease;
  }
  .glass-card:hover::after {
    opacity:1;
    animation:cardGlowPulse 1.6s ease-in-out infinite;
  }
  @keyframes cardGlowPulse {
    0%,100% { box-shadow:0 0 14px 2px rgba(245,158,11,.35); }
    50%     { box-shadow:0 0 28px 6px rgba(245,158,11,.65); }
  }

  /* small twinkling sparkles (injected by JS at random spots) */
  .glass-card .sparkle {
    position:absolute; z-index:4; pointer-events:none; opacity:0;
    color:#fbbf24; text-shadow:0 0 6px rgba(251,191,36,.95), 0 0 14px rgba(255,255,255,.7);
    animation:sparkleTwinkle 3.4s ease-in-out infinite;
  }

  /* ===== dock nav (sticky, above the ticker footer) — Apple-dock-style
     hover magnification + tooltip, reskinned to match the glass/light
     theme instead of the reference's flat gray background ===== */
  .dock-item {
    position:relative;
    display:flex; align-items:center; justify-content:center;
    list-style:none;
  }
  .dock-btn {
    display:flex; align-items:center; justify-content:center;
    width:44px; height:44px;
    border-radius:14px;
    background:rgba(255,255,255,.85);
    border:1px solid rgba(15,37,87,.14);
    box-shadow:0 2px 8px rgba(15,37,87,.08);
    color:#475569;
    cursor:pointer;
    transition:transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, background .3s ease, color .3s ease, border-color .3s ease;
    transform-origin:bottom center;
  }
  .dock-item:hover .dock-btn {
    transform:scale(1.35) translateY(-6px);
    color:#0f2557;
    border-color:rgba(15,37,87,.22);
    box-shadow:0 12px 26px rgba(15,37,87,.2);
  }
  .dock-item.active .dock-btn {
    background:linear-gradient(135deg,#0ea472,#059669);
    color:#fff;
    border-color:transparent;
    box-shadow:0 4px 14px rgba(5,150,105,.35);
  }
  .dock-tooltip {
    position:absolute; bottom:100%; left:50%;
    transform:translate(-50%, -4px);
    margin-bottom:6px;
    padding:4px 10px;
    border-radius:8px;
    background:#0f2557;
    color:#fff;
    font-size:11px; font-weight:600; white-space:nowrap;
    opacity:0; pointer-events:none;
    transition:opacity .25s ease, transform .25s ease;
    z-index:10;
  }
  .dock-tooltip::after {
    content:''; position:absolute; top:100%; left:50%;
    transform:translateX(-50%);
    border:5px solid transparent; border-top-color:#0f2557;
  }
  .dock-item:hover .dock-tooltip { opacity:1; transform:translate(-50%, -10px); }

  /* staggered reveal (re-asserted after the animation shorthand above) */
  .glass-card.rise-in-1 { animation-delay:.10s; }
  .glass-card.rise-in-2 { animation-delay:.22s; }
  .glass-card.rise-in-3 { animation-delay:.34s; }
  .glass-card.rise-in-4 { animation-delay:.46s; }
  .glass-card.rise-in-5 { animation-delay:.58s; }
  .glass-card.rise-in-6 { animation-delay:.70s; }

  .tricolor { background:linear-gradient(90deg,#f59e0b 0%,#f59e0b 33%,#f8fafc 33%,#f8fafc 66%,#16a34a 66%,#16a34a 100%); }

  /* floating festival logo */
  @keyframes floaty { 0%,100%{transform:translateY(0) rotate(-1.5deg);} 50%{transform:translateY(-5px) rotate(1.5deg);} }
  .floaty { animation:floaty 4.5s ease-in-out infinite; }

  /* animated gradient title */
  @keyframes titleGrad { 0%{background-position:0% 50%;} 100%{background-position:200% 50%;} }
  .title-grad {
    font-family:'Marcellus SC', serif;
    background:linear-gradient(90deg,#0f2557 0%,#0891b2 30%,#d97706 55%,#0f2557 80%,#0f2557 100%);
    background-size:200% auto; -webkit-background-clip:text; background-clip:text; color:transparent;
    animation:titleGrad 7s linear infinite;
  }

  .kpi-value { font-family:'Marcellus SC', serif !important; }

  .hero-title { font-family:'Marcellus SC', serif; }

  h1, h2 { font-family:'Marcellus SC', serif; }


/* ============================================================================
   DARK THEME  (landing.html + geotwin-command-center.html)
   These two pages are built with Tailwind utility classes baked into the
   markup, so the dark theme can't be a token remap the way the console's is.
   Instead it overrides the specific utilities those two pages actually use —
   the list was taken from the markup, not guessed — plus the glass card and
   the page ground.

   Palette is the console's graphite so a dark landing page matches a dark
   ICCC: #0a0e14 ground, #111823 panels, #e8edf2 text, saffron accent kept.

   Set by js/theme.js as <html data-theme="dark">.
   ========================================================================== */
:root[data-theme="dark"] body { background: #0a0e14; color: #cbd5e1; }
:root[data-theme="dark"] body::before { opacity: .22; }          /* ghat photo, dimmed */
:root[data-theme="dark"] body::after {
  background: linear-gradient(160deg, rgba(10,14,20,.94) 0%, rgba(13,19,28,.92) 40%, rgba(17,24,35,.90) 100%);
}

/* cards and surfaces */
:root[data-theme="dark"] .glass-card {
  background: rgba(17, 24, 35, .88) !important;
  border-color: #1e2733 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3) !important;
}
:root[data-theme="dark"] .glass-card.glass-amber { background: rgba(60, 40, 8, .55) !important; }
/* The rule above is !important so it would erase the animated ring; re-assert
   the ring for a hovered spin card. Fill stays opaque dark, so the sweep is
   confined to the border in this theme too. */
/* The animated ring is its own layer (::before), so the dark theme needs no
   special handling for it — the card keeps its normal dark fill. */
:root[data-theme="dark"] .bg-white,
:root[data-theme="dark"] .bg-white\/95,
:root[data-theme="dark"] .bg-white\/90 { background-color: rgba(17, 24, 35, .92) !important; }
:root[data-theme="dark"] .bg-white\/70 { background-color: rgba(13, 19, 28, .7) !important; }
:root[data-theme="dark"] .bg-slate-100 { background-color: #1e2733 !important; }
:root[data-theme="dark"] .bg-slate-50 { background-color: #131b26 !important; }
:root[data-theme="dark"] .bg-slate-300 { background-color: #56627a !important; }

/* borders */
:root[data-theme="dark"] .border-slate-200 { border-color: #1e2733 !important; }

/* text */
:root[data-theme="dark"] .text-slate-700 { color: #cbd5e1 !important; }
:root[data-theme="dark"] .text-slate-600 { color: #b3c0d1 !important; }
:root[data-theme="dark"] .text-slate-500 { color: #8b96a5 !important; }
:root[data-theme="dark"] .text-slate-400 { color: #6b7789 !important; }
:root[data-theme="dark"] .text-navy-900 { color: #e8edf2 !important; }
:root[data-theme="dark"] .text-river-700 { color: #4dd8ff !important; }
:root[data-theme="dark"] .text-river-600 { color: #4dd8ff !important; }
:root[data-theme="dark"] .text-saffron-700,
:root[data-theme="dark"] .text-saffron-600 { color: #fbbf24 !important; }
:root[data-theme="dark"] .text-amber-700 { color: #fbbf24 !important; }

/* status tints used by the ghat cards on the landing page */
:root[data-theme="dark"] .bg-rose-50    { background-color: rgba(225,29,72,.12) !important; }
:root[data-theme="dark"] .border-rose-200 { border-color: rgba(225,29,72,.35) !important; }
:root[data-theme="dark"] .bg-amber-50   { background-color: rgba(217,119,6,.12) !important; }
:root[data-theme="dark"] .border-amber-200 { border-color: rgba(217,119,6,.35) !important; }
:root[data-theme="dark"] .bg-yellow-50  { background-color: rgba(202,138,4,.12) !important; }
:root[data-theme="dark"] .border-yellow-200 { border-color: rgba(202,138,4,.35) !important; }
:root[data-theme="dark"] .bg-emerald-50 { background-color: rgba(5,150,105,.12) !important; }
:root[data-theme="dark"] .border-emerald-200 { border-color: rgba(5,150,105,.35) !important; }
:root[data-theme="dark"] .bg-white\/70.h-1\.5,
:root[data-theme="dark"] .meter-track { background-color: rgba(255,255,255,.12) !important; }

/* the wordmark gradient needs the dark-side version */
:root[data-theme="dark"] .title-grad {
  background: linear-gradient(90deg,#fbbf24,#e8edf2 45%,#4dd8ff 75%,#fbbf24);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
}
/* Command Center tiles + gauge */
:root[data-theme="dark"] .tag { color: #4dd8ff !important; background: #131b26 !important; border-color: #2c3847 !important; }
:root[data-theme="dark"] .gauge-bg { stroke: #1e2733; }
:root[data-theme="dark"] .tile-bar { background: #1e2733; }
:root[data-theme="dark"] code { background: #131b26 !important; color: #b3c0d1; }

/* ---- theme toggle button, light-page styling ------------------------------ */
.pn-theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid #e2e8f0; background: #f8fafc; color: #475569;
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em;
}
.pn-theme-toggle:hover { color: #0f2557; border-color: #cbd5e1; }
:root[data-theme="dark"] .pn-theme-toggle {
  border-color: #2c3847; background: #131b26; color: #8b96a5;
}
:root[data-theme="dark"] .pn-theme-toggle:hover { color: #e8edf2; }
@media (max-width: 900px) { .pn-theme-toggle .t-label { display: none; } }
