﻿/* ==========================================================================
   Hathority AI Labs — Dark Mode Stylesheet
   Deep slate bg · dark cards with teal/indigo glow · AI/tech premium feel
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg:           #080e1a;
  --bg-elev:      #0d1828;
  --surface:      #101c30;
  --surface-2:    #152238;
  --surface-3:    #1b2a44;
  --border:       #1c3055;
  --border-soft:  #22395e;
  --text:         #ddeeff;
  --text-muted:   #6b8fb5;
  --primary:      #00d8f0;
  --primary-2:    #00c4da;
  --accent:       #7c6fff;
  --danger:       #ff6b6b;
  --success:      #2ee8a0;
  --warning:      #ffcc44;
  --gray:         #3a5270;

  --radius:       14px;
  --radius-sm:    9px;
  --shadow-sm:    0 2px 8px rgba(0,0,0,.5);
  --shadow-md:    0 8px 28px rgba(0,0,0,.6);
  --shadow-lg:    0 24px 48px rgba(0,0,0,.7);

  --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -5%, rgba(0,216,240,.16) 0%, transparent 65%),
    radial-gradient(ellipse 55% 30% at 85% 100%, rgba(124,111,255,.12) 0%, transparent 65%),
    radial-gradient(ellipse 40% 25% at 15% 60%, rgba(0,180,255,.07) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Keyframes ---------- */
@keyframes title-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}
@keyframes gradShift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ---------- AI Laboratory Scene — Scroll-driven ---------- */

/* Tall container that creates scroll room for the pinned animation */
.lab-scroll-driver {
  position: relative;
  height: 320vh; /* 3.2× viewport = room for both phases */
}

/* Hero sticks to top while scroll-driver scrolls past */
.lab-scroll-driver .hero {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 4.5rem 1.25rem 0;
  text-align: center;
}

.hero { padding: 2rem 1.25rem 0; text-align: center; }

.ai-lab {
  position: relative;
  width: 100%;
  max-width: 1300px;
  height: calc(100vh - 190px);
  margin: 0.25rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SVG connector lines */
.lab-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.lab-line {
  stroke: var(--primary);
  stroke-width: 1.5;
  opacity: .35;
  stroke-dasharray: 4 6;
  animation: lineDash 3s linear infinite;
}
.lab-line--out {
  stroke: var(--primary);
  stroke-width: 1.5;
  opacity: .35;
  stroke-dasharray: 4 6;
  animation: lineDash 3s linear infinite;
}
@keyframes lineDash {
  to { stroke-dashoffset: -40; }
}
body.light .lab-line { stroke: #FF5C00; }
body.light .lab-line--out { stroke: #172B4D; }

/* Floating particles */
.lab-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.lab-particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  15%  { opacity: .5; }
  85%  { opacity: .3; }
  100% { transform: translateY(-60px) scale(.4); opacity: 0; }
}

/* Orbit container */
.lab-orbit {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* Tech nodes — card tile style */
.tech-node {
  position: absolute;
  top: 50%;
  left: 50%;
  cursor: default;
  transform-origin: center center;
  transition: transform .3s ease, opacity .3s ease;
}
.tech-node-inner {
  width: 210px;
  min-height: 80px;
  border-radius: 40px;
  background: linear-gradient(135deg, #0d1525 0%, #111e30 100%);
  border: 1.5px solid #2a4060;
  border-left: 4px solid #3a5a7a;
  padding: .7rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
  transition: border-color .3s, box-shadow .3s;
  margin-left: -105px;
  margin-top: -40px;
  position: relative;
  overflow: hidden;
}
.tech-node:hover .tech-node-inner {
  border-color: var(--primary);
  border-left-color: var(--primary);
  box-shadow: 0 0 14px rgba(0,216,240,.25);
}
.node-warn-bg {
  position: absolute;
  width: 80%;
  height: 80%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #e8a020;
  opacity: .40;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(232,160,32,.5));
}

.node-tag--agent {
  color: var(--primary);
  background: rgba(0,216,240,.1);
  border-color: rgba(0,216,240,.25);
}
.node-text {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}
.node-agent-name {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -.01em;
}

/* merged state */
.tech-node.merged {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Agent output nodes ---------- */
.lab-agents {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.agent-node {
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 0;
  transform: translate(0,0) scale(0);
  transition: none;
  pointer-events: none;
}
.agent-node.spawning {
  pointer-events: auto;
  transition: transform .6s cubic-bezier(0.34,1.56,0.64,1), opacity .4s ease;
}
.agent-node-inner {
  width: 210px;
  min-height: 80px;
  border-radius: 40px;
  background: linear-gradient(135deg, #0d1525 0%, #111e30 100%);
  border: 1.5px solid #2a4060;
  border-left: 4px solid var(--primary);
  padding: .7rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
  margin-left: -105px;
  margin-top: -40px;
  position: relative;
  overflow: hidden;
}

/* Story message — shown between merge and agent spawn */
.lab-story-msg {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity .5s ease;
  max-width: 480px;
  width: 90%;
}
.lab-story-msg.visible { opacity: 1; }
.lab-story-msg p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
  text-shadow: 0 0 40px rgba(0,216,240,.25);
}
.lab-story-msg .msg-accent {
  color: var(--primary);
}
body.light .lab-story-msg p { color: var(--navy-primary); text-shadow: none; }
body.light .lab-story-msg .msg-accent { color: var(--orange-accent); }

/* Phase label */
.lab-phase-label {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity .4s ease;
  white-space: nowrap;
  pointer-events: none;
}
.lab-phase-label.visible { opacity: 1; }

/* Scroll hint arrow */
.lab-scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  opacity: 0;
  animation: hintFade 2s ease 1.5s forwards;
  pointer-events: none;
}
.lab-scroll-hint span {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lab-scroll-hint svg {
  animation: hintBounce 1.2s ease-in-out infinite;
  color: var(--text-muted);
}
@keyframes hintFade {
  to { opacity: 1; }
}
@keyframes hintBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* Core */
.lab-core {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.core-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  animation: coreRingPulse 3s ease-out infinite;
  pointer-events: none;
}
.core-ring-1 { width: 130px; height: 130px; animation-delay: 0s;   opacity: .35; }
.core-ring-2 { width: 170px; height: 170px; animation-delay: .6s;  opacity: .2; }
.core-ring-3 { width: 215px; height: 215px; animation-delay: 1.2s; opacity: .1; }
@keyframes coreRingPulse {
  0%   { transform: scale(.88); opacity: var(--ring-op, .3); }
  60%  { transform: scale(1);   opacity: .05; }
  100% { transform: scale(.88); opacity: var(--ring-op, .3); }
}
.core-inner {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  border: 2.5px solid var(--primary);
  box-shadow:
    0 0 24px rgba(0,216,240,.35),
    0 0 60px rgba(0,216,240,.12),
    inset 0 0 20px rgba(0,216,240,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: box-shadow .6s ease;
  position: relative;
  z-index: 1;
}
.core-label {
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .05em;
  line-height: 1.2;
}
.core-sub {
  font-size: .62rem;
  color: var(--text-muted);
  letter-spacing: .05em;
  font-weight: 500;
}

/* Drag indicator arrows on agent nodes */
.agent-drag-hint {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.agent-node.spawning .agent-drag-hint {
  opacity: 1;
  animation: dragHintPulse 2s ease-in-out infinite;
}
.agent-drag-hint svg {
  color: var(--primary);
  opacity: .55;
}
.agent-drag-hint span {
  font-size: .55rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: .7;
  white-space: nowrap;
}
@keyframes dragHintPulse {
  0%, 100% { transform: translateX(-50%) translateY(0);   opacity: .55; }
  50%       { transform: translateX(-50%) translateY(4px); opacity: .85; }
}
body.light .agent-drag-hint svg   { color: #FF5C00; }
body.light .agent-drag-hint span  { color: var(--navy-light); }

/* energy burst after all merged */
@keyframes energyBurst {
  0%   { box-shadow: 0 0 24px rgba(0,216,240,.35), 0 0 60px rgba(0,216,240,.12), inset 0 0 20px rgba(0,216,240,.08); }
  40%  { box-shadow: 0 0 60px rgba(0,216,240,.8),  0 0 120px rgba(0,216,240,.4), inset 0 0 40px rgba(0,216,240,.2); }
  100% { box-shadow: 0 0 24px rgba(0,216,240,.35), 0 0 60px rgba(0,216,240,.12), inset 0 0 20px rgba(0,216,240,.08); }
}
.core-inner.burst { animation: energyBurst 1.2s ease forwards; }

/* search wrap — starts hidden */
.hero-search-wrap {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
  padding-bottom: 1.5rem;
  margin-top: 5.5rem;
}
.hero-search-wrap.visible {
  opacity: 1;
  transform: translateY(0);
}

/* light mode */
body.light .tech-node-inner {
  background: #fff;
  border-color: rgba(9,30,66,.14);
  border-left-color: var(--navy-light);
  box-shadow: 0 2px 10px rgba(9,30,66,.07);
}
body.light .tech-node:hover .tech-node-inner {
  border-color: #FF5C00;
  border-left-color: #FF5C00;
  box-shadow: 0 0 14px rgba(255,92,0,.2);
}
body.light .node-tag { color: var(--navy-light); background: rgba(9,30,66,.06); border-color: rgba(9,30,66,.12); }
body.light .node-tag--agent { color: #FF5C00; background: rgba(255,92,0,.08); border-color: rgba(255,92,0,.25); }
body.light .node-text { color: var(--navy-light); }
body.light .node-agent-name { color: var(--navy-primary); }
body.light .lab-line { stroke: #FF5C00; }
body.light .lab-particle { background: #FF5C00; }
body.light .core-ring { border-color: #FF5C00; }
body.light .core-inner {
  background: linear-gradient(135deg, #F5F4F0, #ECEEF3);
  border-color: #FF5C00;
  box-shadow:
    0 0 24px rgba(255,92,0,.3),
    0 0 60px rgba(255,92,0,.1),
    inset 0 0 20px rgba(255,92,0,.06);
}
body.light .core-label { color: #FF5C00; }
@keyframes energyBurstLight {
  0%   { box-shadow: 0 0 24px rgba(255,92,0,.3),  0 0 60px rgba(255,92,0,.1),  inset 0 0 20px rgba(255,92,0,.06); }
  40%  { box-shadow: 0 0 60px rgba(255,92,0,.75), 0 0 120px rgba(255,92,0,.35), inset 0 0 40px rgba(255,92,0,.18); }
  100% { box-shadow: 0 0 24px rgba(255,92,0,.3),  0 0 60px rgba(255,92,0,.1),  inset 0 0 20px rgba(255,92,0,.06); }
}
body.light .core-inner.burst { animation: energyBurstLight 1.2s ease forwards; }

/* light mode agent nodes */
body.light .agent-node-inner {
  background: linear-gradient(135deg, rgba(255,92,0,.07), rgba(9,30,66,.04));
  border-color: #FF5C00;
  box-shadow: 0 0 14px rgba(255,92,0,.15), var(--shadow-sm);
}
body.light .lab-phase-label { color: var(--navy-light); }
body.light .lab-scroll-hint span { color: var(--navy-light); }
body.light .lab-scroll-hint svg { color: var(--navy-light); }

/* responsive */
@media (max-width: 640px) {
  .lab-scroll-driver { height: 280vh; }
  .ai-lab { height: 400px; max-width: 100%; }
  .tech-node-inner, .agent-node-inner { width: 148px; min-height: 80px; font-size: .68rem; margin-left: -74px; margin-top: -40px; }
  .node-text { font-size: .65rem; }
  .node-agent-name { font-size: .75rem; }
  .core-inner { width: 88px; height: 88px; }
  .core-ring-1 { width: 88px;  height: 88px; }
  .core-ring-2 { width: 120px; height: 120px; }
  .core-ring-3 { width: 155px; height: 155px; }
}


.site-header {
  position: sticky;
  top: 8px;
  z-index: 50;
  margin: 8px 0.5rem 0;
  border-radius: 999px;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  background: rgba(8,14,26,.88);
  border: 1px solid rgba(0,216,240,.22);
  box-shadow: 0 4px 24px rgba(0,0,0,.65), 0 0 0 1px rgba(0,216,240,.08);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: .35rem 1.5rem;
}
.header-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}
.header-brand-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.header-site-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  margin: 0;
  background: linear-gradient(135deg, #e2eaf5 0%, var(--primary) 50%, var(--accent) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  animation: title-float 3.5s ease-in-out infinite, gradShift 6s ease infinite;
}
.header-nav {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: center;
}
.nav-btn {
  background: rgba(11,188,212,.06);
  border: 1.5px solid rgba(11,188,212,.25);
  color: var(--text);
  padding: .5rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s;
}
.nav-btn:hover {
  color: #fff;
  background: rgba(11,188,212,.18);
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(11,188,212,.25);
}
.header-logo-link { display: flex; align-items: center; justify-content: flex-end; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.15rem; }
.brand-mark { color: var(--primary); font-size: 1.3rem; }
.brand-text strong { color: var(--primary); }
.site-nav { display: flex; gap: 1.25rem; align-items: center; font-weight: 500; color: var(--text-muted); }
.site-nav a:hover { color: var(--text); }
.nav-admin {
  padding: .45rem .9rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: all .2s ease;
}
.nav-admin:hover { border-color: var(--primary); background: rgba(11,188,212,.1); }

/* ---------- Main ---------- */
.site-main { flex: 1; }
.section { padding: 2rem 1.25rem 4rem; }

/* ---------- Hero ---------- */
.hero {
  padding: 0.25rem 1.25rem 0;
  text-align: center;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin: 0 0 .4rem;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 60%, var(--accent) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradShift 5s ease infinite;
}
.hero-subtitle {
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto 0.5rem;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 500;
  line-height: 1.7;
}

/* ---------- Search bar section (between animation and category nav) ---------- */
.search-bar-section {
  padding: 2.5rem 0 2rem;
  background: var(--bg);
}

/* ---------- Search ---------- */
.search {
  display: flex;
  gap: .6rem;
  max-width: 720px;
  margin: 0 auto;
  align-items: stretch;
}
.search-field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}
.search input[type="search"] {
  width: 100%;
  padding: .9rem 2.4rem .9rem 2.6rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: all .2s ease;
  box-shadow: var(--shadow-sm);
}
.search input[type="search"]::placeholder { color: var(--gray); }
.search input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,188,212,.18);
  background: var(--surface-2);
}
.search-clear {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border-soft);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
}
.search-clear:hover { background: var(--gray); }

.btn {
  border: none;
  padding: 0 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: transform .15s ease, box-shadow .2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 4px 18px rgba(11,188,212,.3);
  animation: gradShift 5s ease infinite;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
  transform: skewX(-15deg);
  animation: btnShimmer 3s ease-in-out infinite;
}
@keyframes btnShimmer {
  0%   { left: -75%; }
  60%  { left: 125%; }
  100% { left: 125%; }
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(99,102,241,.4);
}

.search-meta {
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: .95rem;
}

/* ---------- Category navigation ---------- */
.category-nav {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: .5rem 0;
  display: flex;
  justify-content: center;
}
.category-nav-list {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0 auto;
  padding: .25rem 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
}
.category-nav-list::-webkit-scrollbar { display: none; }
.category-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  white-space: nowrap;
  padding: .45rem 1rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
}
.cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  position: relative;
  transition: background .2s;
  animation: catDotPulse 2s ease-in-out infinite;
}
@keyframes catDotPulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.7); opacity: 0.5; }
}
.category-btn:hover .cat-dot,
.category-btn.active .cat-dot { background: var(--primary); animation-play-state: paused; }
body.light .category-btn:hover .cat-dot,
body.light .category-btn.active .cat-dot { background: #fff; }
.category-btn:hover {
  color: var(--primary);
  background: rgba(11,188,212,.08);
  border-color: rgba(11,188,212,.25);
}
.category-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  background-size: 200% 200%;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(11,188,212,.35);
  animation: gradShift 5s ease infinite;
}
@media (max-width: 640px) {
  .category-nav-list { gap: .35rem; }
  .category-btn { padding: .4rem .8rem; font-size: .82rem; }
}

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  gap: 2.25rem;
  grid-template-columns: 1fr;
  align-items: stretch;
}
@media (min-width: 640px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.card-wrap {
  position: relative;
  border-radius: var(--radius);
  transition: box-shadow .35s ease, transform .3s ease;
  height: 100%;
}
.card-wrap:hover {
  transform: translateY(-7px);
  box-shadow:
    0 0 0 1.5px var(--primary),
    0 0 18px rgba(0,216,240,.45),
    0 0 50px rgba(124,111,255,.2);
}
@keyframes shimmer {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(250%) skewX(-15deg); }
}
@keyframes borderPulse {
  0%, 100% { opacity: .55; }
  50%       { opacity: 1; }
}

@keyframes borderSpin {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Card */
.card-wrap {
  position: relative;
  border-radius: var(--radius);
  transition: box-shadow .35s ease, transform .3s ease;
}
.card-wrap:hover {
  transform: translateY(-7px);
  box-shadow:
    0 0 0 1.5px var(--primary),
    0 0 18px rgba(0,216,240,.45),
    0 0 50px rgba(124,111,255,.2);
}
.card {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1.5px solid #2e4d7a;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  transition: border-color .35s ease, box-shadow .3s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,.5), 0 1px 0 rgba(0,216,240,.06) inset;
  animation: fadeInUp .5s ease forwards;
  will-change: transform;
  cursor: pointer;
}
.card-wrap:hover .card {
  border-color: var(--primary);
  box-shadow: 0 0 24px rgba(0,216,240,.45), 0 0 60px rgba(124,111,255,.2), 0 8px 32px rgba(0,0,0,.5);
}

.card-grid .card:nth-child(2) { animation-delay: .07s; }
.card-grid .card:nth-child(3) { animation-delay: .14s; }
.card-grid .card:nth-child(4) { animation-delay: .21s; }
.card-grid .card:nth-child(5) { animation-delay: .28s; }
.card-grid .card:nth-child(6) { animation-delay: .35s; }
.card-grid .card:nth-child(n+7) { animation-delay: .42s; }

.card:hover {
  box-shadow: none;
  animation: none !important;
}
.card:hover::before { animation: none; opacity: 1; }
.card:hover::after  { opacity: 1; }

/* image media — still supported */
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.card:hover .card-media img { transform: scale(1.06); }

/* no-image tile: icon area instead of big blank placeholder */
.card-icon-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  padding: 2.75rem 1rem 2.5rem;
  min-height: 160px;
  background: linear-gradient(135deg, #090f1e 0%, #0d1e38 40%, #111428 70%, #080e1a 100%);
  overflow: hidden;
}
.card-icon-area::before { content: none; }
.card-icon-area::after  { content: none; }
.card-icon-glyph {
  position: relative;
  width: 62px; height: 62px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,216,240,.18), rgba(124,111,255,.18));
  border: 1.5px solid rgba(0,216,240,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 24px rgba(0,216,240,.22);
}
.card-icon-label {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  padding: 0 1rem;
  line-height: 1.4;
  word-break: break-word;
  letter-spacing: -.01em;
  text-shadow: 0 0 28px rgba(0,216,240,.4);
}
/* shimmer layer inside icon area */
.card-shimmer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.card-shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  transform: translateX(-100%) skewX(-15deg);
}

.card-body {
  padding: 1.2rem 1.4rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.01em;
}
.card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: .92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}
.card-date {
  margin: 0;
  color: var(--primary);
  font-size: .82rem;
  font-weight: 500;
  min-height: 1.2em;
}
.card-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: auto;
  padding-top: .75rem;
  padding-bottom: 1rem;
  padding-right: .3rem;
}
.card-view-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(0,216,240,.08);
  border: 1.5px solid rgba(0,216,240,.25);
  border-radius: 999px;
  padding: .32rem .85rem;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: color .25s ease, border-color .25s ease, box-shadow .25s ease;
  z-index: 0;
}
.card-view-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--primary);
  transform: translateX(-101%);
  transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}
.card-view-btn:hover {
  color: #080e1a;
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(0,216,240,.35);
}
.card-view-btn:hover::before {
  transform: translateX(0);
}
body.light .card-view-btn {
  color: #FF5C00;
  background: rgba(255,92,0,.08);
  border-color: rgba(255,92,0,.25);
}
body.light .card-view-btn::before {
  background: #FF5C00;
}
body.light .card-view-btn:hover {
  color: #fff;
  border-color: #FF5C00;
  box-shadow: 0 0 14px rgba(255,92,0,.3);
}
body.light .card-view-btn:hover::before {
  transform: translateX(0);
}

/* ---------- Tag ---------- */
.tag {
  display: inline-block;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--primary);
  background: rgba(11,188,212,.1);
  padding: .22rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(11,188,212,.28);
  align-self: flex-start;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.empty h2 { font-family: var(--font-display); color: var(--text); margin-bottom: .5rem; }
.empty a { color: var(--primary); }

/* ---------- Detail page ---------- */
.detail {
  padding: 2.5rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.detail-main {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  min-height: 100%;
}
.detail-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (max-width: 959px) {
  .detail-main { flex-direction: column; }
  .detail-side-wrap, .detail-side { width: 100%; position: static; }
}
.back-link { color: var(--text-muted); font-weight: 500; width: fit-content; transition: color .2s; }
.back-link:hover { color: var(--primary); }
.detail-header { display: flex; flex-direction: column; gap: .75rem; }
.detail-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0;
  letter-spacing: -.02em;
  color: var(--text);
}
.detail-lede { color: var(--text-muted); font-size: 1.25rem; margin: 0; max-width: 70ch; }
.detail-figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: #000;
}
.detail-figure img { width: 100%; height: auto; display: block; }

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none; display: block;
}

.detail-body h2 { font-family: var(--font-display); margin-top: 0; }
.detail-features h2 { font-family: var(--font-display); margin-top: 0; }
.features-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .75rem;
}
.features-list li {
  padding: .9rem 1.1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: .97rem;
  line-height: 1.6;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.features-list li:hover {
  transform: translateX(6px);
  background: var(--surface-3);
  border-color: var(--primary);
  border-left-color: var(--primary);
  border-left-width: 5px;
  box-shadow:
    -6px 0 20px rgba(0,216,240,.7),
    0 0 32px rgba(0,216,240,.3),
    0 4px 20px rgba(0,0,0,.4);
}
.features-list li strong { color: var(--primary); }
.prose { color: var(--text); font-size: 1.05rem; line-height: 1.75; }
.prose p { margin: 0 0 1em; }

.detail-side-wrap {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 7rem;
  height: fit-content;
  align-self: flex-start;
  margin-top: 18rem;
}
.about-details-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

/* Details banner — full-width horizontal bar above agent name */
.detail-meta-banner {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.1rem 1.75rem;
  box-shadow: var(--shadow-sm);
}
.meta-banner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.meta-banner-item {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 0 2rem 0 0;
  border-right: 1px solid var(--border-soft);
  margin-right: 2rem;
}
.meta-banner-item:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 0;
}
.meta-banner-item dt {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
}
.meta-banner-item dd {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
}
@media (max-width: 600px) {
  .meta-banner-list { flex-direction: column; gap: .9rem; }
  .meta-banner-item { border-right: none; margin-right: 0; padding-right: 0; border-bottom: 1px solid var(--border-soft); padding-bottom: .9rem; }
  .meta-banner-item:last-child { border-bottom: none; padding-bottom: 0; }
}
body.light .detail-meta-banner {
  background: var(--bg-white);
  border-color: var(--border-thin);
  border-top-color: var(--orange-accent);
}
body.light .meta-banner-item dt { color: var(--orange-accent); }
body.light .meta-banner-item dd { color: var(--navy-primary); }
body.light .meta-banner-item { border-right-color: var(--border-thin); }

.detail-side {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  height: fit-content;
  box-shadow: var(--shadow-sm);
}
.detail-side h3 {
  margin: 0 0 .8rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.meta-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .5rem 1rem;
  margin: 0;
  font-size: .92rem;
}
.meta-list dt { color: var(--text-muted); }
.meta-list dd { margin: 0; color: var(--text); font-weight: 500; }

/* ---------- Inquiry card ---------- */
.inquiry-card {
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(11,188,212,.07);
  padding: 1.2rem 1.3rem;
}
.inquiry-header {
  margin-bottom: .85rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid rgba(11,188,212,.15);
}
.inquiry-header h3 {
  color: var(--primary) !important;
  font-size: 1rem !important;
  letter-spacing: .08em;
  margin: 0;
}
.inquiry-form { display: flex; flex-direction: column; gap: .5rem; }
.inquiry-field { display: flex; flex-direction: column; gap: .3rem; }
.inquiry-field label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.inquiry-field input,
.inquiry-field textarea {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem .8rem;
  font-size: .88rem;
  font-family: var(--font-body);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.inquiry-field input::placeholder,
.inquiry-field textarea::placeholder { color: var(--gray); }
.inquiry-field textarea { resize: vertical; min-height: 55px; }
.inquiry-field input:focus,
.inquiry-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(11,188,212,.15);
}
.req { color: var(--danger); font-size: .8rem; }
.optional { color: var(--gray); font-size: .78rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
.inquiry-submit {
  width: 100%;
  padding: .72rem;
  margin-top: .35rem;
  font-size: .95rem;
  letter-spacing: .03em;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  background-size: 200% 200%;
  box-shadow: 0 4px 16px rgba(11,188,212,.25);
  transition: transform .15s ease, box-shadow .2s ease;
  animation: gradShift 5s ease infinite;
}
.inquiry-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,.4);
}
.inquiry-success {
  margin: .25rem 0 0;
  font-size: .88rem;
  color: var(--success);
  font-weight: 500;
  text-align: center;
}

/* ---------- Public link ---------- */
.detail-public-link {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(11,188,212,.07), rgba(99,102,241,.07));
  border: 1px solid rgba(11,188,212,.18);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}
.detail-public-link p { margin: 0; font-size: 1rem; color: var(--text); line-height: 1.6; }
.external-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(11,188,212,.3);
  text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s;
}
.external-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- Footer ---------- */
.footer-section {
  background: #060c18;
  color: #6a84a0;
  font-size: .95rem;
  border-top: 1px solid var(--border);
}
.footer-cta { border-bottom: 1px solid #152030; }
.pt-5 { padding-top: 1.2rem; }
.pb-5 { padding-bottom: 1rem; }
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.col-xl-4, .col-lg-4, .col-md-4, .col-md-6 {
  padding: 0 15px;
  flex: 0 0 33.333%;
  max-width: 33.333%;
}
.col-xl-12 { flex: 0 0 100%; max-width: 100%; }
.mb-30 { margin-bottom: 0.5rem; }
.mb-50 { margin-bottom: 0.75rem; }

.single-cta { display: flex; align-items: flex-start; gap: 1rem; }
.single-cta i { font-size: 2rem; color: var(--primary); margin-top: .2rem; flex-shrink: 0; }
.cta-text h4 { color: #fff; font-size: 1rem; margin: 0 0 .25rem; font-family: var(--font-display); }
.cta-text span { color: #5a7290; font-size: .9rem; line-height: 1.6; }

.footer-content { border-bottom: 1px solid #152030; }
.footer-widget { padding-right: 1rem; }
.footer-logo { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.3rem; min-height: 1cm; }
.footer-text p { color: #5a7290; font-size: .88rem; line-height: 1.5; margin-bottom: 0.3rem; }

.footer-social-icon { display: flex; align-items: center; gap: .75rem; }
.footer-social-icon span { color: #fff; font-weight: 600; font-size: .9rem; }
.footer-social-icon a { color: #3d5470; font-size: 1.6rem; transition: color .2s, transform .2s; }
.footer-social-icon a:hover { color: var(--primary); transform: translateY(-2px); }
.footer-social-icon .bg-gradient { color: #0077b5; }

.footer-widget-heading h3 {
  color: #fff;
  font-size: .95rem;
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
  position: relative;
  padding-bottom: .3rem;
}
.footer-widget-heading h3::before {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.footer-widget ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1rem; }
.footer-widget ul li { margin-bottom: .5rem; }
.footer-widget ul li a { color: #4a6480; font-size: .9rem; transition: color .2s, padding-left .2s; }
.footer-widget ul li a:hover { color: var(--primary); padding-left: .4rem; }

.subscribe-form .footer-form { display: flex; flex-direction: column; gap: .6rem; }
.subscribe-form input,
.subscribe-form textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-size: .9rem;
  font-family: var(--font-body);
  width: 100%;
  resize: none;
}
.subscribe-form input::placeholder,
.subscribe-form textarea::placeholder { color: var(--gray); }
.subscribe-form textarea { min-height: 80px; }
.subscribe-form input[type="submit"] {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .7rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.subscribe-form input[type="submit"]:hover { opacity: .88; }

.copyright-area { background: #030609; padding: 0.4rem 0; text-align: center; }
.copyright-text p { color: #243040; margin: 0; font-size: .85rem; }

@media (max-width: 900px) {
  .col-xl-4, .col-lg-4, .col-md-4, .col-md-6 { flex: 0 0 100%; max-width: 100%; }
  .footer-widget ul { columns: 1; }
}

/* ---------- Get in Touch ---------- */
.get-in-touch-area {
  background: #08111e;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid #152030;
}
.git-heading { text-align: center; margin-bottom: 1.75rem; }
.git-heading h2 { font-family: var(--font-display); font-size: 1.6rem; color: #fff; margin: 0 0 .4rem; }
.git-heading p { color: #5a7290; font-size: .95rem; margin: 0; }
.git-form { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: .9rem; }
.git-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 600px) { .git-row { grid-template-columns: 1fr; } }
.git-field { display: flex; flex-direction: column; gap: .3rem; }
.git-field label { font-size: .75rem; font-weight: 600; color: #4a6480; text-transform: uppercase; letter-spacing: .05em; }
.git-field input,
.git-field textarea {
  background: #0b1828;
  border: 1.5px solid #1a3050;
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-size: .9rem;
  font-family: var(--font-body);
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.git-field input::placeholder,
.git-field textarea::placeholder { color: #2a3f58; }
.git-field textarea { min-height: 100px; resize: vertical; }
.git-field input:focus,
.git-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,188,212,.15);
}
.git-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.git-submit { padding: .7rem 2rem; font-size: .95rem; }
.git-feedback { font-size: .9rem; font-weight: 500; }

/* ---------- Theme toggle button ---------- */
.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.toggle-track {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,216,240,.12);
  border: 1.5px solid rgba(0,216,240,.35);
  border-radius: 999px;
  padding: 2px 5px;
  position: relative;
  width: 54px;
  height: 24px;
  transition: background .3s, border-color .3s;
}
.toggle-thumb {
  position: absolute;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(0,216,240,.5);
  transition: transform .3s cubic-bezier(0.34,1.56,0.64,1), background .3s, box-shadow .3s;
  z-index: 1;
}
body.light .toggle-thumb {
  transform: translateX(30px);
  background: #FF5C00;
  box-shadow: 0 0 8px rgba(255,92,0,.5);
}
.toggle-icon {
  font-size: .72rem;
  line-height: 1;
  z-index: 2;
  transition: opacity .3s;
  pointer-events: none;
  flex-shrink: 0;
}
.toggle-icon--sun  { color: #ffcc44; opacity: .5; margin-left: 2px; }
.toggle-icon--moon { color: var(--primary); opacity: 1; margin-left: auto; margin-right: 2px; }
body.light .toggle-icon--sun  { opacity: 1; }
body.light .toggle-icon--moon { opacity: .4; color: #FF5C00; }
body.light .toggle-track {
  background: rgba(255,92,0,.1);
  border-color: rgba(255,92,0,.35);
}

/* ---------- Light mode ---------- */
body.light {
  /* Brand palette */
  --bg-white:       #FFFFFF;
  --bg-warm:        #FBFBFA;
  --bg-warm-dim:    #F5F4F0;
  --navy-primary:   #091E42;
  --navy-secondary: #172B4D;
  --navy-light:     #42526E;
  --orange-accent:  #FF5C00;
  --orange-hover:   #E04F00;
  --orange-glow:    rgba(255,92,0,.15);
  --border-thin:    rgba(9,30,66,.08);
  --border-accent:  rgba(255,92,0,.25);

  /* Map to existing tokens */
  --bg:           var(--bg-warm);
  --bg-elev:      var(--bg-warm-dim);
  --surface:      var(--bg-white);
  --surface-2:    var(--bg-warm);
  --surface-3:    var(--bg-warm-dim);
  --border:       var(--border-thin);
  --border-soft:  rgba(9,30,66,.12);
  --text:         var(--navy-primary);
  --text-muted:   var(--navy-light);
  --primary:      var(--orange-accent);
  --primary-2:    var(--orange-hover);
  --accent:       var(--navy-secondary);
  --danger:       #d93025;
  --success:      #1a8a5a;
  --warning:      #b07d00;
  --gray:         #8a9db5;

  --shadow-sm:    0 1px 4px rgba(9,30,66,.06), 0 4px 16px rgba(9,30,66,.04);
  --shadow-md:    0 4px 20px rgba(9,30,66,.08), 0 12px 40px rgba(9,30,66,.06);
  --shadow-lg:    0 16px 48px rgba(9,30,66,.12), 0 32px 64px rgba(9,30,66,.08);

  --transition-smooth: 0.4s cubic-bezier(0.16,1,0.3,1);
  --transition-fast:   0.2s ease;
}

body.light {
  background: var(--bg-warm);
  background-image:
    radial-gradient(ellipse 70% 35% at 50% -5%, rgba(255,92,0,.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 25% at 90% 100%, rgba(9,30,66,.04) 0%, transparent 60%);
  color: var(--navy-primary);
}

/* Header */
body.light .site-header {
  background: rgba(255,255,255,.92);
  border-color: var(--border-thin);
  box-shadow: 0 1px 0 var(--border-thin), 0 4px 24px rgba(9,30,66,.06);
}
body.light .header-brand img {
  /* Convert white SVG → navy #091E42 */
  filter: brightness(0) saturate(100%) invert(8%) sepia(30%) saturate(2000%) hue-rotate(195deg) brightness(90%) contrast(110%);
}
body.light .header-brand-label { color: var(--navy-primary); font-weight: 700; }
body.light .header-site-title {
  background: linear-gradient(135deg, var(--navy-primary) 0%, var(--orange-accent) 60%, var(--orange-hover) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Nav buttons */
body.light .nav-btn {
  color: var(--navy-light);
  background: transparent;
  border-color: var(--border-thin);
  transition: all var(--transition-fast);
}
body.light .nav-btn:hover {
  color: var(--orange-accent);
  background: var(--orange-glow);
  border-color: var(--border-accent);
  box-shadow: none;
}

/* Category nav */
body.light .category-nav {
  background: var(--bg-warm-dim);
  border-color: var(--border-thin);
}
body.light .category-btn { color: var(--navy-light); }
body.light .category-btn:hover {
  color: var(--orange-accent);
  background: var(--orange-glow);
  border-color: var(--border-accent);
}
body.light .category-btn.active {
  background: var(--orange-accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--orange-glow);
  animation: none;
}

/* Search */
body.light .search input[type="search"] {
  background: var(--bg-white);
  border-color: var(--border-thin);
  color: var(--navy-primary);
  box-shadow: var(--shadow-sm);
}
body.light .search input[type="search"]::placeholder { color: var(--navy-light); opacity: .6; }
body.light .search input[type="search"]:focus {
  border-color: var(--orange-accent);
  box-shadow: 0 0 0 3px var(--orange-glow);
  background: var(--bg-white);
}
body.light .search-clear { background: var(--bg-warm-dim); color: var(--navy-light); }
body.light .search-icon { color: var(--navy-light); opacity: .5; }

/* Btn primary */
body.light .btn-primary {
  background: var(--orange-accent);
  background-image: none;
  box-shadow: 0 4px 16px var(--orange-glow);
  animation: none;
  color: #fff;
}
body.light .btn-primary:hover {
  background: var(--orange-hover);
  box-shadow: 0 8px 24px rgba(255,92,0,.25);
  transform: translateY(-2px);
}

/* Cards */
body.light .card {
  background: linear-gradient(160deg, #ffffff 0%, #f8f9fc 100%);
  border: 1.5px solid rgba(9,30,66,.12);
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(9,30,66,.07), 0 8px 32px rgba(9,30,66,.06);
  transition: box-shadow var(--transition-smooth), transform var(--transition-smooth), border-color var(--transition-fast);
}
body.light .card-wrap:hover {
  transform: translateY(-8px);
  box-shadow: 0 0 0 1.5px var(--orange-accent), 0 16px 48px rgba(255,92,0,.14), 0 28px 64px rgba(9,30,66,.09);
}
body.light .card-wrap:hover .card {
  border-color: var(--orange-accent);
  box-shadow: none;
}
body.light .card-title { color: var(--navy-primary); }
body.light .card-desc  { color: var(--navy-light); }
body.light .card-date  { color: var(--orange-accent); }

body.light .card-icon-area {
  background:
    linear-gradient(145deg, #E8EBF4 0%, #F2F1ED 50%, #E6E8F0 100%);
  border-bottom: 1.5px solid rgba(9,30,66,.10);
  min-height: 160px;
}
body.light .card-icon-area::before { content: none; }
body.light .card-icon-area::after  { content: none; }
body.light .card-icon-glyph {
  background: linear-gradient(135deg, rgba(255,92,0,.12), rgba(9,30,66,.07));
  border-color: var(--border-accent);
  box-shadow: 0 0 22px var(--orange-glow);
  width: 62px; height: 62px;
  border-radius: 16px;
}
body.light .card-icon-label { color: var(--navy-primary); text-shadow: none; }

/* Tag */
body.light .tag {
  color: var(--orange-accent);
  background: var(--orange-glow);
  border-color: var(--border-accent);
}

/* Detail page */
body.light .detail-side {
  background: var(--bg-white);
  border-color: var(--border-thin);
  box-shadow: var(--shadow-sm);
}
body.light .detail-side h3 { color: var(--orange-accent); }
body.light .meta-list dt { color: var(--navy-light); }
body.light .meta-list dd { color: var(--navy-primary); }
body.light .back-link { color: var(--navy-light); }
body.light .back-link:hover { color: var(--orange-accent); }
body.light .detail-title { color: var(--navy-primary); }
body.light .detail-lede { color: var(--navy-light); }
body.light .detail-figure { border-color: var(--border-thin); }
body.light .external-link { color: var(--orange-accent); text-decoration-color: var(--border-accent); }
body.light .external-link:hover { color: var(--orange-hover); }
body.light .detail-public-link {
  background: var(--orange-glow);
  border-color: var(--border-accent);
  border-left-color: var(--orange-accent);
}
body.light .features-list li {
  background: var(--bg-white);
  border-color: var(--border-thin);
  border-left-color: var(--orange-accent);
  color: var(--navy-primary);
}
body.light .features-list li:hover {
  background: var(--bg-warm-dim);
  border-color: var(--orange-accent);
  border-left-color: var(--orange-accent);
  border-left-width: 5px;
  box-shadow:
    -6px 0 20px rgba(255,92,0,.65),
    0 0 30px rgba(255,92,0,.22),
    0 4px 20px rgba(9,30,66,.08);
}
body.light .features-list li strong { color: var(--orange-accent); }
body.light .prose { color: var(--navy-primary); }

/* Inquiry / contact */
body.light .inquiry-card {
  background: var(--bg-white);
  border-color: var(--border-thin);
  border-top-color: var(--orange-accent);
  box-shadow: var(--shadow-sm);
}
body.light .inquiry-header { border-bottom-color: var(--border-thin); }
body.light .inquiry-header h3 { color: var(--orange-accent) !important; }
body.light .inquiry-field label { color: var(--navy-light); }
body.light .inquiry-field input,
body.light .inquiry-field textarea {
  background: var(--bg-warm);
  border-color: var(--border-thin);
  color: var(--navy-primary);
}
body.light .inquiry-field input::placeholder,
body.light .inquiry-field textarea::placeholder { color: var(--navy-light); opacity: .5; }
body.light .inquiry-field input:focus,
body.light .inquiry-field textarea:focus {
  border-color: var(--orange-accent);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px var(--orange-glow);
}
body.light .inquiry-submit {
  background: var(--orange-accent);
  background-image: none;
  box-shadow: 0 4px 16px var(--orange-glow);
  animation: none;
}
body.light .inquiry-submit:hover {
  background: var(--orange-hover);
  box-shadow: 0 8px 24px rgba(255,92,0,.25);
}
body.light .inquiry-success { color: var(--success); }

/* Contact modal */
body.light .contact-modal-overlay { background: rgba(9,30,66,.35); backdrop-filter: blur(8px); }
body.light .contact-modal-box {
  background: var(--bg-white);
  border-color: var(--border-thin);
  border-top-color: var(--orange-accent);
  box-shadow: var(--shadow-lg);
}
body.light .contact-modal-close { color: var(--navy-light); }
body.light .contact-modal-close:hover { color: var(--navy-primary); }

/* Hide images in light mode — show icon/name tile instead */
body.light .card-media { display: none !important; }
body.light .card-icon-area { display: flex !important; }

/* Detail page — hide the project image figure in light mode */
body.light .detail-figure { display: none; }

/* Hero */
body.light .hero-title {
  background: linear-gradient(135deg, var(--navy-primary) 0%, var(--orange-accent) 60%, var(--orange-hover) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradShift 5s ease infinite;
}
body.light .hero-subtitle { color: var(--navy-light); }
body.light .search-meta { color: var(--navy-light); }

/* Empty state */
body.light .empty { color: var(--navy-light); }
body.light .empty h2 { color: var(--navy-primary); }
body.light .empty a { color: var(--orange-accent); }


/* ==========================================================================
   Light-mode interactive animations
   ========================================================================== */

/* --- 1. Card spotlight glow (driven by JS --mx/--my custom props) --- */
body.light .card {
  --mx: 50%;
  --my: 50%;
}
body.light .card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(280px circle at var(--mx) var(--my),
    rgba(255,92,0,.10) 0%,
    transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
  z-index: 1;
}
body.light .card:hover::after { opacity: 1; }

/* --- 2. Card entrance animation --- */
@keyframes lightCardIn {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
body.light .card-wrap {
  animation: lightCardIn .55s cubic-bezier(0.16,1,0.3,1) both;
}
body.light .card-wrap:nth-child(1) { animation-delay: .04s; }
body.light .card-wrap:nth-child(2) { animation-delay: .10s; }
body.light .card-wrap:nth-child(3) { animation-delay: .16s; }
body.light .card-wrap:nth-child(4) { animation-delay: .22s; }
body.light .card-wrap:nth-child(5) { animation-delay: .28s; }
body.light .card-wrap:nth-child(6) { animation-delay: .34s; }
body.light .card-wrap:nth-child(n+7) { animation-delay: .40s; }

/* --- 3. Hero subtitle shimmer sweep --- */
body.light .hero-subtitle { position: relative; }
body.light .shimmer-text {
  background: linear-gradient(
    105deg,
    var(--navy-light) 40%,
    #FF5C00          47%,
    #FFB450          50%,
    #FF5C00          53%,
    var(--navy-light) 60%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerSweep 6s linear infinite;
  display: inline;
}
@keyframes shimmerSweep {
  0%   { background-position: 120% 0; }
  100% { background-position: -20% 0; }
}

/* --- 4. Search bar focus pulse ring --- */
body.light .search input[type="search"]:focus {
  animation: searchPulse .4s cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes searchPulse {
  0%   { box-shadow: 0 0 0 0   rgba(255,92,0,.35); }
  60%  { box-shadow: 0 0 0 7px rgba(255,92,0,.08); }
  100% { box-shadow: 0 0 0 3px rgba(255,92,0,.15); }
}

/* --- 5. Category button ripple --- */
body.light .category-btn {
  position: relative;
  overflow: hidden;
}
body.light .category-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,92,0,.22);
  transform: scale(0);
  animation: rippleOut .5s linear;
  pointer-events: none;
}
@keyframes rippleOut {
  to { transform: scale(4); opacity: 0; }
}

/* --- 6. Card icon area floating dots --- */
body.light .card-icon-area .dot {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,92,0,.18);
  pointer-events: none;
  animation: floatDot linear infinite;
}
@keyframes floatDot {
  0%   { transform: translateY(0)   scale(1);   opacity: .7; }
  50%  { transform: translateY(-18px) scale(1.1); opacity: .4; }
  100% { transform: translateY(0)   scale(1);   opacity: .7; }
}

/* --- 7. Tag pop on card hover --- */
body.light .card:hover .tag {
  transform: scale(1.06);
  transition: transform .2s cubic-bezier(0.16,1,0.3,1);
}
body.light .tag { transition: transform .2s ease; }

/* ---------- Mobile nav ---------- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1.5px solid rgba(0,216,240,.3);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  margin-right: .25rem;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    padding: .35rem 1rem;
  }
  .header-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: .5rem;
    right: .5rem;
    background: rgba(8,14,26,.97);
    border: 1px solid rgba(0,216,240,.22);
    border-radius: 16px;
    flex-direction: column;
    padding: .75rem;
    gap: .4rem;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .header-nav.open { display: flex; }
  .nav-btn { width: 100%; text-align: center; padding: .65rem 1rem; }
  .nav-hamburger { display: flex; }
  .header-right .theme-toggle { display: flex; }
  .site-header { position: sticky; }
}

body.light .nav-hamburger {
  border-color: rgba(9,30,66,.2);
}
body.light .nav-hamburger span { background: var(--navy-primary); }
body.light .header-nav {
  background: rgba(255,255,255,.97);
  border-color: rgba(9,30,66,.12);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Contact Modal ---------- */
.contact-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 10, 20, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeInUp .2s ease;
}
.contact-modal-box {
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(11,188,212,.1);
  padding: 1.5rem 1.75rem;
  width: 100%;
  max-width: 560px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.contact-modal-close {
  position: absolute;
  top: .75rem;
  right: .9rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  padding: 0 .25rem;
  cursor: pointer;
  transition: color .2s;
}
.contact-modal-close:hover { color: var(--text); }
.inquiry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
@media (max-width: 480px) { .inquiry-grid { grid-template-columns: 1fr; } }

/* Sidebar inquiry card — single column, clean stacked layout */
.inquiry-card .inquiry-grid {
  grid-template-columns: 1fr;
}

/* Websites / Contact button highlight */
.footer-link-highlight {
  background: rgba(0, 200, 180, 0.18);
  border-radius: 4px;
  padding: 2px 6px;
  transition: background 1.5s ease;
}
