/* self-hosted font (site CSP blocks Google Fonts) */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('../../assests/fonts/plus-jakarta-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('../../assests/fonts/plus-jakarta-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('../../assests/fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('../../assests/fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-style: normal; font-display: swap; src: url('../../assests/fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2'); }
/* IIA landing: static TCC background, glass header, centred title, map + chart carousel. */
:root {
  --ink: #06301d; --text: #f1fff7; --dim: rgba(241,255,247,.8);
  --lime: #bef264; --mint: #8ff0c2;
  --glass: rgba(10,30,26,.46); --glass-line: rgba(255,255,255,.2);
  --pad: clamp(14px, 3.2vw, 48px);
  --head-h: 4.6rem; --foot-h: 3rem;        /* measured by home.js */
  --interval: 12s;                         /* set by home.js */
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: clamp(14px, .5vw + 10px, 34px); }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--text); background: #05211c; min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
[hidden], .hidden { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
::selection { background: rgba(190,242,100,.88); color: var(--ink); }

/* ---------- static TCC background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; background: #05211c url("../../assests/data/bg_tcc.jpg") center / cover no-repeat; }
.bg-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,18,14,.3) 0%, rgba(2,18,14,.1) 40%, rgba(2,18,14,.28) 100%); }

/* ---------- header: blurred glass, logos left, actions right ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--pad) 10px;
  background: rgba(15,30,28,.38); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--glass-line);
}
.logos { display: flex; align-items: center; gap: .6rem; background: #fff; padding: .35rem .7rem; border-radius: .8rem; }
.logos img { height: 3rem; width: auto; object-fit: contain; }
.logos i { width: 1px; height: 1.2rem; background: #cbd5e1; }
.nav, .menu { display: flex; align-items: center; gap: .55rem; }
.user-chip { padding: .45rem .8rem; border-radius: .6rem; font-weight: 600; font-size: .85rem; background: rgba(255,255,255,.12); border: 1px solid var(--glass-line); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; padding: .5rem 1.05rem; border-radius: .8rem; font: inherit; font-weight: 700; font-size: .86rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; color: #fff; transition: transform .15s, background .2s, border-color .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); } .btn:active { transform: scale(.97); }
.btn-solid { background: #059669; border-color: rgba(52,211,153,.6); box-shadow: 0 0 18px rgba(16,185,129,.4); }
.btn-solid:hover { background: #10b981; }
.btn-danger { background: rgba(244,63,94,.8); border-color: rgba(251,113,133,.5); }
.btn-glass { background: var(--glass); border-color: var(--glass-line); }
.btn-glass:hover, .btn-glass[aria-expanded="true"] { border-color: var(--mint); background: rgba(16,80,60,.55); }

/* ---------- dropdown popup under the header buttons ---------- */
.panel {
  position: fixed; z-index: 40; top: calc(var(--head-h) + .6rem); right: var(--pad);
  width: min(30rem, calc(100vw - var(--pad) * 2)); max-height: calc(100dvh - var(--head-h) - var(--foot-h) - 2rem); overflow-y: auto;
  padding: 1.4rem 1.4rem 1.2rem; border-radius: 1.2rem; background: rgba(8,28,24,.78); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%); box-shadow: 0 20px 50px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(-12px) scale(.98); transform-origin: top right; pointer-events: none; visibility: hidden;
  transition: opacity .3s, transform .4s cubic-bezier(.2,.9,.3,1), visibility 0s .4s;
}
.panel.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.panel h3 { font-size: 1.2rem; font-weight: 800; color: var(--lime); margin-bottom: .8rem; padding-right: 2rem; }
.panel p { font-size: .9rem; line-height: 1.6; color: var(--dim); }
.panel a { color: var(--lime); font-weight: 600; text-underline-offset: 3px; }
.panel-close { position: absolute; top: .7rem; right: .8rem; width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 1.3rem; cursor: pointer; }
.feat { list-style: none; display: grid; gap: .55rem; }
.feat li, .two > div { display: flex; gap: .8rem; padding: .7rem; border-radius: .8rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.feat svg { flex: none; width: 2.1rem; height: 2.1rem; padding: .45rem; border-radius: .6rem; background: rgba(52,211,153,.18); color: var(--mint); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feat b, .two b { display: block; font-size: .92rem; color: #fff; }
.feat span, .two span { display: block; margin-top: .15rem; font-size: .8rem; line-height: 1.5; color: var(--dim); }
.two { margin-top: .8rem; display: grid; gap: .55rem; grid-template-columns: 1fr 1fr; } .two > div { display: block; }

/* ---------- page: title top-centre, then map | chart ---------- */
.page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; padding: calc(var(--head-h) + 1.4rem) var(--pad) calc(var(--foot-h) + 1.2rem); }
.hero { text-align: center; max-width: 54rem; }
.brand { font-size: clamp(4rem, 9.5vw, 7.5rem); font-weight: 800; line-height: .95; letter-spacing: .02em;
  background: linear-gradient(90deg, #9dff6b, #6dff9c 35%, #b8ff5c 70%, #d9ff7a);   /* static neon light green */
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 .9rem rgba(130,255,120,.45)) drop-shadow(0 .25rem .6rem rgba(0,0,0,.35)); }
.title { margin-top: .5rem; font-size: clamp(1.6rem, 3.3vw, 2.7rem); font-weight: 800; line-height: 1.15; text-shadow: 0 3px 8px rgba(0,0,0,.8); }
.lead { margin: .8rem auto 0; max-width: 46rem; font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.55; color: var(--dim); text-shadow: 0 2px 6px rgba(0,0,0,.9); }

.stage { width: min(74rem, 100%); flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 1rem; }
.card { display: flex; flex-direction: column; min-height: 0; padding: .9rem; border-radius: 1.2rem; background: rgba(8,28,24,.62); border: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.card-head h3 { font-size: 1rem; font-weight: 800; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: 99px; font-size: .74rem; font-weight: 600; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.chip i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; font-size: .75rem; color: var(--dim); }
.toggles { display: flex; gap: .9rem; } .toggles label { display: flex; gap: .35rem; align-items: center; cursor: pointer; } .toggles input { accent-color: #10b981; }
.legend { display: flex; align-items: center; gap: .35rem; } .legend i { width: .7rem; height: .7rem; border-radius: 2px; background: var(--c); margin-left: .4rem; }

/* map: 3 aligned layers (tcc / heat / outline) that zoom together */
.mapbox { position: relative; width: 100%; flex: 1; min-height: 0; border-radius: .9rem; overflow: hidden; background: #0b1f1a; cursor: zoom-in; }
.mslide, .cslide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1s ease, visibility 0s 1s; }
.mslide.active, .cslide.active { opacity: 1; visibility: visible; transition-delay: 0s; }
.zoomer { position: absolute; inset: 0; transform-origin: var(--ox, 50%) var(--oy, 50%); transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.mapbox:hover .zoomer { transform: scale(1.22); }
.drift { position: absolute; inset: 0; }
.mslide.active .drift { animation: drift var(--interval) ease-in-out forwards; }   /* slow push-in while a site is on screen */
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; -webkit-user-drag: none; user-select: none; }
.layer.tcc { image-rendering: auto; }
.layer.heat { opacity: 0; transform: scale(.96); transition: opacity .3s; }
.layer.outline { image-rendering: auto; opacity: 0; transition: opacity .3s; }
.mslide.active .layer.heat { animation: heatIn 1.1s .3s ease-out forwards; }
.mslide.active .layer.outline { animation: fadeIn .8s 1.2s ease-out forwards; }
/* re-ticking a checkbox: replay fast, no delay */
.mapbox.quick .mslide.active .layer.heat { animation: heatIn .5s ease-out forwards; }
.mapbox.quick .mslide.active .layer.outline { animation: fadeIn .35s ease-out forwards; }
@keyframes heatIn { from { opacity: 0; clip-path: inset(0 100% 0 0); transform: none; } to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
@keyframes fadeIn { to { opacity: 1; } }
.mapbox.no-heat .layer.heat, .mapbox.no-out .layer.outline { animation: none !important; opacity: 0 !important; }
.mapbox:hover .layer.outline { filter: drop-shadow(0 0 6px rgba(255,255,255,.9)); }   /* border highlights on hover */
.user-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-dropdown-wrap.hidden {
  display: none;
}

button.user-profile {
  cursor: pointer;
  font: inherit;
}

.user-chevron {
  width: 14px;
  height: 14px;
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.user-profile[aria-expanded="true"] .user-chevron {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  padding: 6px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18);
  z-index: 50;
}

.user-dropdown.hidden {
  display: none;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.user-dropdown-logout {
  color: #dc2626;
}

.user-dropdown-logout:hover {
  background-color: #fef2f2;
}
/* chart */
.chartbox { position: relative; flex: 1; min-height: 14rem; }
.cslide { display: flex; align-items: center; }
.cslide svg { width: 100%; height: auto; display: block; overflow: visible; }
.ax text { fill: rgba(241,255,247,.7); font-size: 11px; } .ax line { stroke: rgba(255,255,255,.14); }
.ln { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ar { opacity: 0; } .pt { opacity: 0; }
.cslide.active .ln { animation: draw 1.8s .3s ease-out forwards; }
.cslide.active .ar { animation: fadeIn 1s 1.4s forwards; } .cslide.active .pt { animation: fadeIn .4s 1.8s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.mark { stroke: rgba(255,255,255,.8); stroke-width: 1.6; stroke-dasharray: 2 5; stroke-linecap: round; opacity: 0; }
.mark-t { fill: #fff; font-size: 11px; font-weight: 700; opacity: 0; }
.seg { stroke-width: 1.6; stroke-dasharray: 6 4; stroke-opacity: .55; opacity: 0; } .seg.on { stroke-width: 3; stroke-opacity: 1; }
.cslide.active .mark, .cslide.active .mark-t, .cslide.active .seg { animation: fadeIn .6s 1.9s forwards; }
.tip .sep { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid rgba(255,255,255,.18); } .tip .sep span { display: block; }
.tip .sep em { display: block; font-style: normal; opacity: .7; margin-top: .15rem; } .tip .hot strong { color: var(--lime); }
.cross { stroke: rgba(255,255,255,.5); stroke-dasharray: 4 4; opacity: 0; } .dot-h { opacity: 0; stroke: #fff; stroke-width: 2; }
.tip { position: absolute; z-index: 3; pointer-events: none; min-width: 11rem; padding: .45rem .65rem; border-radius: .6rem; font-size: .76rem; background: rgba(5,20,16,.92); border: 1px solid var(--glass-line); opacity: 0; transform: translate(-50%, -110%); transition: opacity .15s; }
.tip b { display: block; margin-bottom: .2rem; } .tip span { display: flex; align-items: center; gap: .4rem; } .tip i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); }

/* carousel progress */
.dots { display: flex; gap: .5rem; }
.dot { position: relative; width: 2.8rem; height: .42rem; border: 0; padding: 0; border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.28); cursor: pointer; }
.dot::after { content: ''; position: absolute; inset: 0; background: #fff; transform-origin: left; transform: scaleX(var(--p, 0)); }
.dot.done::after { transform: scaleX(1); }

.foot { position: fixed; z-index: 10; inset: auto 0 0 0; padding: .5rem var(--pad) calc(env(safe-area-inset-bottom, 0px) + .5rem); font-size: .62rem; line-height: 1.4; text-align: center; color: #e2e8f0; text-shadow: 0 1px 3px #000, 0 0 10px rgba(0,0,0,.9); }

/* laptop / desktop: the stage takes exactly the space left under the title, so the page never scrolls.
   home.js writes the stage's real height to --stage-h; the width follows it so the map stays ~4:3 */
@media (min-width: 901px) {
  .stage { flex: 1 1 0; min-height: 17rem; max-height: 40rem; grid-template-rows: minmax(0, 1fr);
    width: min(74rem, 100%, max(34rem, calc(((var(--stage-h, 30rem) - 7.5rem) * 1.3333 + 1.8rem) * 2.35 + 1rem))); }
  .chartbox { min-height: 0; }
  .page { gap: clamp(.6rem, 1.6dvh, 1.2rem); }
  .brand { font-size: clamp(3rem, min(9.5vw, 14dvh), 7.5rem); }
  .title { font-size: clamp(1.4rem, min(3.3vw, 4.4dvh), 2.7rem); }
  .lead { font-size: clamp(.9rem, min(1.5vw, 2.2dvh), 1.25rem); }
}
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; width: min(36rem, 100%); }
  .chartbox { flex: none; aspect-ratio: 640 / 380; min-height: 0; }
  .mapbox { flex: none; aspect-ratio: 4 / 3; }
  .page { justify-content: flex-start; min-height: 0; padding-bottom: 1.2rem; }
  .foot { position: static; background: rgba(2,10,12,.75); }
  .panel { left: var(--pad); width: auto; }
}
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .logos { gap: .4rem; padding: .3rem .5rem; justify-content: space-around; } .logos img { height: 1.6rem; }
  .nav { width: 100%; flex-wrap: wrap; } .nav .btn { flex: 1 1 0; padding-inline: .4rem; min-height: 2.2rem; font-size: .74rem; } .nav .btn-solid { flex-grow: 1.5; }
  .menu { flex: 1 1 100%; } .user-chip { display: none; }
  .card { padding: .7rem; } .two { grid-template-columns: 1fr; } .foot { font-size: .55rem; }
  .card-foot { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .layer.heat, .layer.outline, .ar, .pt, .mark, .mark-t, .seg { opacity: 1; } .ln { stroke-dashoffset: 0; }
}