/* ========================================
   กก.ตชด.315 — Demo Design System
   ธีมม่วงสมเด็จพระเทพฯ — หน่วยงาน + สีม่วงราชสำนัก (เดโม)
   ======================================== */

:root {
  /* ม่วงสมเด็จพระเทพฯ — พื้นลึก + ไลแลคอุ่น */
  --navy-950: #14081f;
  --navy-900: #1c0f2e;
  --navy-800: #2a1645;
  --navy-700: #3d2260;
  --navy-600: #55307a;
  --gold-400: #c9a0e8;
  --gold-300: #e2c4f5;
  --gold-200: #f0defa;
  --gold-500: #9b6bc4;
  --cream: #f8f4fb;
  --cream-dark: #ebe4f2;
  --white: #ffffff;
  --slate-100: #f5f0fa;
  --slate-200: #e8dff2;
  --slate-400: #a89bb8;
  --slate-500: #7a6b8a;
  --slate-600: #5a4d6a;
  --slate-700: #3d3348;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(20, 8, 31, 0.08);
  --shadow-md: 0 8px 24px rgba(20, 8, 31, 0.12);
  --shadow-lg: 0 20px 50px rgba(20, 8, 31, 0.16);
  --shadow-glow: 0 0 40px rgba(155, 107, 196, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --font-display: "Prompt", "Sarabun", sans-serif;
  --font-body: "Sarabun", "Prompt", sans-serif;
  --nav-h: 84px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 220ms;
  --dur-mid: 450ms;
  --dur-slow: 650ms;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --glow-x: 50%;
  --glow-y: 50%;
  --orb-shift: 0px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--slate-700);
  background: var(--cream);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* ========== Page transitions (VT + fade fallback) ========== */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 520ms;
  animation-timing-function: var(--ease-out);
}

::view-transition-old(root) {
  animation-name: vt-fade-out;
}

::view-transition-new(root) {
  animation-name: vt-fade-in;
}

@keyframes vt-fade-out {
  from { opacity: 1; filter: blur(0); }
  to { opacity: 0; filter: blur(4px); }
}

@keyframes vt-fade-in {
  from { opacity: 0; filter: blur(4px); transform: translateY(8px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

html {
  opacity: 0;
  transition: opacity var(--dur-mid) var(--ease-out);
}

html.page-ready {
  opacity: 1;
}

html.page-exit {
  opacity: 0;
  transition: opacity 300ms var(--ease);
}

/* ========== Demo Badge ========== */
.demo-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: var(--gold-300);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border: 1px solid rgba(155, 107, 196, 0.3);
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  animation: badgePulse 4s ease-in-out infinite;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast);
}

.demo-badge:hover {
  transform: translateY(-2px);
}

@keyframes badgePulse {
  0%, 100% { box-shadow: var(--shadow-lg), 0 0 20px rgba(155, 107, 196, 0.1); }
  50% { box-shadow: var(--shadow-lg), 0 0 32px rgba(155, 107, 196, 0.25); }
}

/* ========== Navigation ========== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--nav-h);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), backdrop-filter 0.4s;
}

.site-nav.scrolled {
  background: rgba(20, 8, 31, 0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.site-nav.light.scrolled {
  background: rgba(247, 244, 239, 0.92);
  box-shadow: 0 4px 24px rgba(20, 8, 31, 0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: min(1120px, 92%);
  margin-inline: auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  min-width: 0;
  flex: 1 1 auto;
  max-width: min(340px, 55%);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.site-nav.light.scrolled .nav-brand { color: var(--navy-900); }

.nav-brand:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Unit logo — transparent PNG, no white pad, no color shifts. */
.brand-logo,
.emblem-large {
  filter: none !important;
}
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  flex-shrink: 0;
  display: block;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast);
}

.nav-brand:hover .brand-logo {
  transform: scale(1.05);
  opacity: 0.95;
  box-shadow: none;
}

/* Legacy text emblem — unused after official logo integration */
.brand-emblem {
  display: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
  max-width: min(280px, 42vw);
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 1.6vw, 0.88rem);
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.brand-text span {
  font-size: clamp(0.58rem, 1.2vw, 0.68rem);
  opacity: 0.62;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: normal;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  transition: color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease);
  position: relative;
}

.site-nav.light.scrolled .nav-links a { color: var(--slate-600); }

.nav-links a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.site-nav.light.scrolled .nav-links a:hover {
  color: var(--navy-900);
  background: rgba(20, 8, 31, 0.06);
}

.nav-links a.active {
  color: var(--gold-300);
  background: rgba(155, 107, 196, 0.15);
}

.site-nav.light.scrolled .nav-links a.active {
  color: var(--gold-500);
  background: rgba(155, 107, 196, 0.12);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--white);
  border-radius: 10px;
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle:active {
  transform: scale(0.96);
}

.site-nav.light.scrolled .nav-toggle { color: var(--navy-900); }

.nav-toggle svg { width: 24px; height: 24px; }

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  background: var(--navy-950);
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(42, 77, 122, 0.5) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(155, 107, 196, 0.08) 0%, transparent 50%),
    linear-gradient(165deg, var(--navy-950) 0%, var(--navy-900) 40%, var(--navy-800) 100%);
  will-change: transform;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

/* Soft glowing orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.55;
  z-index: 1;
  will-change: transform;
  transform: translate3d(0, var(--orb-shift), 0);
  animation: orbFloat 14s ease-in-out infinite;
}

.hero-orb-1 {
  width: min(380px, 55vw);
  height: min(380px, 55vw);
  top: 12%;
  right: 8%;
  background: radial-gradient(circle, rgba(155, 107, 196, 0.35) 0%, rgba(155, 107, 196, 0) 70%);
  animation-duration: 16s;
}

.hero-orb-2 {
  width: min(280px, 40vw);
  height: min(280px, 40vw);
  bottom: 18%;
  left: 6%;
  background: radial-gradient(circle, rgba(80, 140, 220, 0.28) 0%, transparent 70%);
  animation-duration: 18s;
  animation-delay: -4s;
}

.hero-orb-3 {
  width: min(200px, 30vw);
  height: min(200px, 30vw);
  top: 55%;
  right: 28%;
  background: radial-gradient(circle, rgba(180, 210, 255, 0.2) 0%, transparent 70%);
  animation-duration: 12s;
  animation-delay: -2s;
  opacity: 0.4;
}

@keyframes orbFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 12px -18px; }
}

#hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
}

/* Three.js interactive hero canvas */
#hero-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
  display: block;
  touch-action: pan-y;
  cursor: grab;
}

.hero.is-dragging-orbit,
.hero.is-dragging-orbit #hero-3d {
  cursor: grabbing;
  user-select: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 8, 31, 0.78) 0%, rgba(20, 8, 31, 0.45) 42%, rgba(20, 8, 31, 0.15) 68%, rgba(20, 8, 31, 0.35) 100%),
    linear-gradient(180deg, rgba(20, 8, 31, 0.25) 0%, transparent 35%, transparent 70%, rgba(20, 8, 31, 0.55) 100%);
}

.hero.has-3d .hero-content {
  z-index: 3;
}

.hero.has-3d .hero-orb {
  opacity: 0.28;
  filter: blur(50px);
}

.hero.has-3d .hero-bg {
  /* Let Three.js carry depth; keep subtle base */
  opacity: 0.92;
}

#hero-3d.hero-3d-static {
  opacity: 0.9;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 80px 0 100px;
  max-width: 720px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-300);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) 0.15s forwards;
}

.hero-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--gold-400);
  border-radius: 2px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) 0.28s forwards;
}

.hero-short {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--gold-300);
  font-weight: 500;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.65s var(--ease-out) 0.38s forwards;
}

.hero-location {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.05rem;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.65s var(--ease-out) 0.48s forwards;
}

.hero-location svg {
  width: 18px;
  height: 18px;
  color: var(--gold-400);
  flex-shrink: 0;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.65s var(--ease-out) 0.58s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast),
    background var(--dur-fast),
    color var(--dur-fast),
    border-color var(--dur-fast);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--navy-950);
  box-shadow: 0 4px 20px rgba(155, 107, 196, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(155, 107, 196, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-ornament {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: min(420px, 40vw);
  height: min(420px, 40vw);
  border-radius: 50%;
  border: 1px solid rgba(155, 107, 196, 0.15);
  opacity: 0;
  animation: fadeIn 1.1s var(--ease) 0.7s forwards;
  pointer-events: none;
  z-index: 1;
}

.hero-ornament::before,
.hero-ornament::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(155, 107, 196, 0.1);
}

.hero-ornament::before { inset: 40px; }
.hero-ornament::after {
  inset: 80px;
  background: radial-gradient(circle, rgba(155, 107, 196, 0.06), transparent 70%);
}



/* ========== 3D Interactive demo: intro, hints, hotspots, panel ========== */
.hero-3d-intro {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 248, 255, 0.92);
  background: rgba(226, 196, 245, 0.14);
  border: 1px solid rgba(226, 196, 245, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  animation: fadeUp 0.65s var(--ease-out) 0.05s forwards;
}

.hero-interact-hint {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 8px;
  max-width: min(90vw, 520px);
  padding: 9px 16px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 450;
  letter-spacing: 0.015em;
  color: rgba(255, 250, 255, 0.82);
  background: linear-gradient(
    135deg,
    rgba(28, 14, 42, 0.52) 0%,
    rgba(40, 22, 58, 0.42) 100%
  );
  border: 1px solid rgba(226, 196, 245, 0.22);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.6s;
}

.hero-interact-hint.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hero-interact-hint.is-dim {
  opacity: 0.55;
  filter: saturate(0.85);
}

.hero-interact-hint .hint-sep {
  color: rgba(232, 200, 120, 0.7);
  opacity: 0.75;
  font-weight: 400;
}

.hero-drag-zone {
  position: absolute;
  top: 12%;
  right: 0;
  width: min(48%, 520px);
  height: 70%;
  z-index: 2;
  pointer-events: auto;
  touch-action: pan-y;
  cursor: grab;
  background: transparent;
}

.hero.is-dragging-orbit .hero-drag-zone {
  cursor: grabbing;
}

.hero-hotspots {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.hero-hotspot {
  position: absolute;
  left: var(--hx, 70%);
  top: var(--hy, 40%);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 9px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(226, 196, 245, 0.28);
  background: linear-gradient(
    145deg,
    rgba(22, 12, 36, 0.62) 0%,
    rgba(36, 20, 55, 0.55) 100%
  );
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  color: rgba(255, 250, 255, 0.94);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.015em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(155, 107, 196, 0.06);
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease),
    background var(--dur-fast),
    border-color var(--dur-fast),
    box-shadow var(--dur-fast),
    opacity var(--dur-mid);
  animation: hotspotIdle 3.6s ease-in-out infinite;
}

.hero-hotspot:nth-child(2) { animation-delay: -0.7s; }
.hero-hotspot:nth-child(3) { animation-delay: -1.4s; }
.hero-hotspot:nth-child(4) { animation-delay: -2.1s; }

.hero-hotspot:hover,
.hero-hotspot:focus-visible {
  outline: none;
  transform: translate(-50%, -50%) scale(1.045);
  background: linear-gradient(
    145deg,
    rgba(42, 24, 68, 0.78) 0%,
    rgba(55, 32, 82, 0.72) 100%
  );
  border-color: rgba(232, 200, 120, 0.5);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.32),
    0 0 28px rgba(155, 107, 196, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-hotspot.is-active {
  border-color: rgba(232, 200, 120, 0.65);
  box-shadow:
    0 0 0 2px rgba(226, 196, 245, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.32),
    0 0 20px rgba(232, 200, 120, 0.18);
}

.hero-hotspot.is-occluded {
  opacity: 0.32;
  pointer-events: none;
}

.hotspot-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f0d48a, #c9a0e8);
  box-shadow:
    0 0 0 2px rgba(226, 196, 245, 0.22),
    0 0 10px rgba(232, 200, 120, 0.35);
  flex-shrink: 0;
}

.hotspot-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(212, 176, 240, 0.45);
  animation: hotspotRing 2.8s ease-out infinite;
}

.hotspot-label {
  white-space: nowrap;
  line-height: 1.2;
}

@keyframes hotspotIdle {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -2px; }
}

@keyframes hotspotRing {
  0% { transform: scale(0.75); opacity: 0.65; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Explore info panel (glassmorphism) */
.explore-panel {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  pointer-events: none;
}

.explore-panel[hidden] {
  display: none !important;
}

.explore-panel.is-open {
  pointer-events: auto;
}

.explore-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 22, 0.45);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}

.explore-panel.is-open .explore-panel-backdrop {
  opacity: 1;
}

.explore-panel-card {
  position: relative;
  z-index: 1;
  width: min(400px, 92vw);
  margin: 16px;
  margin-top: calc(var(--nav-h) + 12px);
  max-height: calc(100dvh - var(--nav-h) - 32px);
  overflow: auto;
  padding: 28px 26px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    160deg,
    rgba(24, 12, 40, 0.88) 0%,
    rgba(32, 18, 52, 0.82) 45%,
    rgba(42, 24, 62, 0.78) 100%
  );
  border: 1px solid rgba(226, 196, 245, 0.26);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.07) inset,
    0 0 48px rgba(155, 107, 196, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(26px) saturate(1.25);
  -webkit-backdrop-filter: blur(26px) saturate(1.25);
  color: rgba(255, 255, 255, 0.92);
  transform: translateX(28px) scale(0.985);
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s var(--ease);
}

.explore-panel.is-open .explore-panel-card {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.explore-panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-300);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.explore-panel-close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.explore-panel-close svg {
  width: 18px;
  height: 18px;
}

.explore-panel-eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 8px;
}

.explore-panel-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 14px;
  padding-right: 36px;
  line-height: 1.35;
}

.explore-panel-body {
  font-size: 0.98rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
}

.explore-panel-body p + p {
  margin-top: 10px;
}

.explore-panel-body .panel-note {
  font-size: 0.86rem;
  color: rgba(226, 196, 245, 0.75);
  margin-top: 14px;
}

.explore-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.88rem;
}

body.explore-panel-open {
  overflow: hidden;
}

/* ========== Scroll to Explore ========== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 1100;
  pointer-events: none;
  background: transparent;
}

.scroll-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  box-shadow: 0 0 8px rgba(226, 196, 245, 0.45);
  transform-origin: left center;
  transition: width 0.08s linear;
}

.scroll-explore {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.72);
  opacity: 0;
  transition: opacity 0.7s var(--ease), transform 0.55s var(--ease);
  pointer-events: none;
}

.scroll-explore.is-shown {
  opacity: 1;
  pointer-events: auto;
}

.scroll-explore.is-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(12px);
}

.scroll-explore-en {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(226, 196, 245, 0.85);
}

.scroll-explore-th {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.7);
}

.scroll-explore-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
  color: var(--gold-300);
}

.scroll-mouse {
  width: 18px;
  height: 27px;
  opacity: 0.85;
}

.scroll-wheel {
  animation: scrollWheel 1.6s ease-in-out infinite;
}

.scroll-chevron {
  width: 20px;
  height: 20px;
  opacity: 0.8;
  animation: scrollBounce 1.6s ease-in-out infinite;
}

.scroll-explore--page {
  bottom: 16px;
}

.scroll-explore--page .scroll-explore-en {
  display: none;
}

.page-hero {
  /* room for cue */
  padding-bottom: 72px;
}

/* Hero text soft parallax via CSS vars from JS */
.hero-content {
  --hero-parallax-y: 0px;
  --hero-parallax-opacity: 1;
  transform: translate3d(0, var(--hero-parallax-y), 0);
  opacity: var(--hero-parallax-opacity);
  will-change: transform, opacity;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(6px); opacity: 1; }
}

@keyframes scrollWheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(6px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ========== Sections ========== */
.section {
  padding: 100px 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-eyebrow {
  display: inline-block;
  color: var(--gold-500);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.35;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--slate-500);
  font-size: 1.05rem;
  max-width: 520px;
  margin-inline: auto;
}

/* ========== Leadership ========== */
.leadership {
  background: var(--white);
}

.commander-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: center;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition:
    transform var(--dur-mid) var(--ease-out),
    box-shadow var(--dur-mid);
}

.commander-card.has-depth {
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.commander-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(155, 107, 196, 0.12), transparent 70%);
  pointer-events: none;
}

.commander-card.has-depth::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    480px circle at var(--glow-x) var(--glow-y),
    rgba(155, 107, 196, 0.12),
    transparent 45%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.commander-card.has-depth:hover::after {
  opacity: 1;
}

.commander-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-600));
  border: 3px solid var(--gold-400);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 8px rgba(155, 107, 196, 0.15), var(--shadow-md);
  transition: box-shadow var(--dur-mid), transform var(--dur-mid) var(--ease);
}

.commander-card:hover .commander-avatar {
  transform: scale(1.03);
  box-shadow: 0 0 0 10px rgba(155, 107, 196, 0.2), 0 12px 32px rgba(0, 0, 0, 0.25);
}

.commander-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  display: block;
  filter: none;
}

.commander-avatar svg {
  width: 80px;
  height: 80px;
  color: var(--gold-300);
  opacity: 0.7;
}

.commander-info { position: relative; z-index: 1; }

.role-tag {
  display: inline-block;
  background: rgba(155, 107, 196, 0.2);
  color: var(--gold-300);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}

.commander-info h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1.4;
}

.commander-info .rank {
  color: var(--gold-200);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.commander-info .note {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.deputies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.deputy-card {
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast),
    border-color var(--dur-fast);
  position: relative;
  transform-style: preserve-3d;
}

.deputy-card.has-depth {
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(0);
}

.deputy-card:hover,
.deputy-card.has-depth:hover {
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(155, 107, 196, 0.35);
}

.sample-label {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gold-500);
  background: rgba(155, 107, 196, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  z-index: 2;
}

.deputy-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--slate-100), var(--slate-200));
  border: 2px solid var(--gold-300);
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast);
}

.deputy-card:hover .deputy-avatar {
  transform: scale(1.06);
  border-color: var(--gold-400);
}


.deputy-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  filter: none;
}

.org-deputy-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px;
  border: 2px solid rgba(201, 160, 232, 0.55);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.org-deputy-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: none;
}

.deputy-avatar svg {
  width: 40px;
  height: 40px;
  color: var(--navy-600);
  opacity: 0.5;
}

.deputy-card h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 4px;
}

.deputy-card .rank {
  color: var(--slate-500);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.deputy-card .role {
  color: var(--gold-500);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ========== Gallery ========== */



/* ---------- Unit emblem showcase ---------- */
.emblem-section {
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: var(--white);
  padding-top: 48px;
  padding-bottom: 48px;
}

.emblem-showcase {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 980px;
  margin: 0 auto;
  align-items: flex-start;
}

.emblem-plate {
  flex-shrink: 0;
  width: 260px;
  height: auto;
  border-radius: 0;
  background: transparent;
  display: grid;
  place-items: center;
  box-shadow: none;
  padding: 0;
}

.emblem-large {
  width: 100%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  display: block;
  /* Keep original emblem colors exactly as the source PNG */
  filter: none !important;
  mix-blend-mode: normal;
}

.emblem-copy {
  flex: 1;
  min-width: 260px;
  max-width: 520px;
}

.emblem-facts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.emblem-fact h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--gold-300);
}

.emblem-fact p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.65;
}

.emblem-fact strong {
  color: var(--gold-200);
  font-weight: 600;
}


.emblem-copy .section-eyebrow {
  color: var(--gold-300);
}

.emblem-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  margin: 8px 0 12px;
  color: var(--white);
}

.emblem-copy p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 640px) {
  .emblem-showcase {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
  .emblem-plate {
    width: 200px;
    height: auto;
    border-radius: 0;
  }
  .brand-logo {
    width: 44px;
    height: 44px;
  }
}

.gallery-section {
  background: var(--cream);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  perspective: 1200px;
}

.gallery-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast);
  transform-style: preserve-3d;
}

.gallery-card.has-depth {
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.gallery-card:hover,
.gallery-card.has-depth:hover {
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-4px) scale(1.015);
  box-shadow: var(--shadow-md);
}

.gallery-card:nth-child(1) .gallery-frame {
  background: linear-gradient(145deg, #1a3a5c 0%, #2d5a87 40%, #3d7ab0 100%);
}
.gallery-card:nth-child(2) .gallery-frame {
  background: linear-gradient(160deg, #2c4a3e 0%, #3d6b55 45%, #5a8f72 100%);
}
.gallery-card:nth-child(3) .gallery-frame {
  background: linear-gradient(135deg, #3a3548 0%, #5a4e6d 40%, #7a6b8a 100%);
}
.gallery-card:nth-child(4) .gallery-frame {
  background: linear-gradient(150deg, #4a3a28 0%, #6b5a3d 45%, #8a7a55 100%);
}
.gallery-card:nth-child(5) .gallery-frame {
  background: linear-gradient(140deg, #1e3a4a 0%, #2a5a6a 40%, #3d7a8a 100%);
}
.gallery-card:nth-child(6) .gallery-frame {
  background: linear-gradient(155deg, #3a2a2a 0%, #5a3d3d 45%, #7a5555 100%);
}

.gallery-frame {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 500ms var(--ease-out);
}

.gallery-card:hover .gallery-frame {
  transform: scale(1.04);
}

.gallery-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,0.15), transparent 50%);
}

.gallery-icon {
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  transition: transform var(--dur-fast) var(--ease), color var(--dur-fast);
}

.gallery-card:hover .gallery-icon {
  transform: scale(1.08);
  color: rgba(255, 255, 255, 0.55);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 20px 18px;
  background: linear-gradient(transparent, rgba(20, 8, 31, 0.75));
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 2;
  transition: padding var(--dur-fast);
}

.gallery-card:hover .gallery-caption {
  padding-bottom: 22px;
}

.gallery-caption small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 2px;
  font-family: var(--font-body);
}

/* ========== Page Hero (subpages) ========== */
.page-hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 64px;
  background: var(--navy-950);
  overflow: hidden;
}

.page-hero .hero-bg {
  background:
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(42, 77, 122, 0.4) 0%, transparent 60%),
    linear-gradient(165deg, var(--navy-950), var(--navy-800));
}

.page-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp 0.65s var(--ease-out) 0.18s forwards;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.05rem;
  opacity: 0;
  animation: fadeUp 0.65s var(--ease-out) 0.32s forwards;
}

.page-hero .hero-eyebrow {
  justify-content: center;
  width: 100%;
  margin-bottom: 16px;
  animation-delay: 0.08s;
}

/* ========== Org Chart ========== */
.org-section {
  background: var(--white);
  padding: 80px 0 100px;
  overflow: visible;
}

.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 0;
  padding: 20px 0;
}

.org-level {
  display: flex;
  justify-content: center;
  gap: 24px;
  position: relative;
  width: 100%;
}

.org-node {
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 20px 28px;
  text-align: center;
  min-width: 180px;
  max-width: 240px;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast),
    border-color var(--dur-fast),
    opacity var(--dur-slow) var(--ease-out);
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transform-style: preserve-3d;
}

.org-node.revealed {
  opacity: 1;
  transform: translateY(0);
}

.org-node.revealed.has-depth {
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(0);
}

.org-node.revealed:hover,
.org-node.revealed.has-depth:hover {
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(155, 107, 196, 0.4);
}

.org-node.commander {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  border-color: var(--gold-400);
  color: var(--white);
  min-width: 280px;
  max-width: 360px;
  padding: 28px 32px 32px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.org-commander-photo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold-400);
  box-shadow: 0 0 0 6px rgba(155, 107, 196, 0.18);
  margin: 0 auto 12px;
  flex-shrink: 0;
}

.org-commander-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: none;
}

.org-node.commander.revealed:hover {
  box-shadow: var(--shadow-lg), 0 0 50px rgba(155, 107, 196, 0.2);
}

.org-node.deputy {
  background: var(--cream);
  border-color: rgba(155, 107, 196, 0.3);
}

.org-node.sub {
  background: var(--slate-100);
  min-width: 140px;
  padding: 16px 20px;
}

.org-node .node-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-500);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.org-node.commander .node-role { color: var(--gold-300); }

.org-node .node-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1.4;
}

.org-node.commander .node-name {
  color: var(--white);
  font-size: 1.1rem;
}

.org-node .node-rank {
  font-size: 0.8rem;
  color: var(--slate-500);
  margin-top: 4px;
}

.org-node.commander .node-rank { color: var(--gold-200); }

.org-connector {
  width: 2px;
  height: 40px;
  background: linear-gradient(var(--gold-400), rgba(155, 107, 196, 0.3));
  position: relative;
  opacity: 0;
  transition: opacity var(--dur-mid) var(--ease);
}

.org-connector.revealed { opacity: 1; }

.org-connector-h {
  position: relative;
  width: 100%;
  max-width: 620px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-400) 15%, var(--gold-400) 85%, transparent);
  margin: 0 auto;
  opacity: 0;
  transition: opacity var(--dur-mid) var(--ease);
}

.org-connector-h.revealed { opacity: 1; }

.org-connector-h::before,
.org-connector-h::after {
  content: "";
  position: absolute;
  top: 0;
  width: 2px;
  height: 20px;
  background: var(--gold-400);
}

.org-level-subs {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  width: 100%;
  max-width: 900px;
}

.org-note {
  text-align: center;
  margin-top: 48px;
  color: var(--slate-400);
  font-size: 0.85rem;
}

/* ========== Admin Departments ========== */
.admin-section {
  background: var(--cream);
  padding: 80px 0 100px;
}

.dept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.dept-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast),
    border-color var(--dur-fast);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.dept-card.has-depth {
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.dept-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-300));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease);
}

.dept-card:hover,
.dept-card.has-depth:hover {
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(155, 107, 196, 0.3);
}

.dept-card:hover::before {
  transform: scaleX(1);
}

.dept-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(155, 107, 196, 0.12), rgba(155, 107, 196, 0.05));
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: var(--gold-500);
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease);
}

.dept-card:hover .dept-icon {
  background: linear-gradient(145deg, var(--gold-400), var(--gold-500));
  color: var(--navy-950);
  transform: scale(1.06);
}

.dept-icon svg {
  width: 24px;
  height: 24px;
}

.dept-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 8px;
}

.dept-card p {
  color: var(--slate-500);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ========== Footer ========== */
.site-footer {
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.6);
  padding: 48px 0 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand .brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.footer-brand .brand-text {
  max-width: 300px;
}
.footer-brand strong {
  display: block;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(0.78rem, 1.5vw, 0.92rem);
}
.footer-brand span {
  font-size: 0.68rem;
  opacity: 0.65;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.9rem;
  transition: color var(--dur-fast), transform var(--dur-fast);
  display: inline-block;
}

.footer-links a:hover {
  color: var(--gold-300);
  transform: translateY(-1px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  text-align: center;
  font-size: 0.8rem;
}

/* ========== Reveal animations ========== */
.reveal,
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out),
    filter var(--dur-slow) var(--ease-out);
  filter: blur(2px);
  will-change: opacity, transform;
}

.reveal.visible,
[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-delay-1 { transition-delay: 0.05s; }
.reveal-delay-2 { transition-delay: 0.1s; }
.reveal-delay-3 { transition-delay: 0.16s; }
.reveal-delay-4 { transition-delay: 0.22s; }
.reveal-delay-5 { transition-delay: 0.28s; }
.reveal-delay-6 { transition-delay: 0.34s; }

.reveal.visible {
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


/* Reduced motion — keep layout, kill motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
    opacity: 1 !important;
    transition: none !important;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  [data-reveal],
  .org-node {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .hero-orb,
  #hero-particles {
    display: none !important;
  }

  #hero-3d {
    /* JS freezes animation; keep one static frame visible */
    opacity: 0.85 !important;
  }

  .scroll-explore,
  .scroll-progress {
    display: none !important;
  }

  .hero-interact-hint {
    opacity: 1 !important;
    transform: translateX(-50%) !important;
    animation: none !important;
  }

  .hero-hotspot {
    animation: none !important;
  }

  .hotspot-dot::after {
    animation: none !important;
  }

  .hero-drag-zone {
    pointer-events: none !important;
  }

  #hero-3d {
    pointer-events: none !important;
    cursor: default !important;
  }

  .hero-content {
    transform: none !important;
    opacity: 1 !important;
  }


  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}


/* ========== Contact ========== */
.contact-section {
  background: var(--cream);
  padding: 80px 0 100px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 32px 28px;
  position: relative;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast),
    border-color var(--dur-fast);
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(155, 107, 196, 0.35);
}

.contact-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--navy-800), var(--navy-700));
  color: var(--gold-300);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.contact-icon svg {
  width: 26px;
  height: 26px;
}

.contact-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy-900);
  margin: 0 0 10px;
}

.contact-card p {
  color: var(--slate-600);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 6px;
}

.contact-detail {
  font-weight: 600;
  color: var(--navy-800) !important;
}

.contact-placeholder {
  font-size: 0.85rem !important;
  color: var(--slate-500) !important;
  font-style: italic;
}



.contact-link {
  color: var(--gold-300);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--gold-200);
  border-bottom-color: rgba(226, 196, 245, 0.55);
}

.contact-link--btn {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(226, 196, 245, 0.4);
  background: rgba(155, 107, 196, 0.18);
  border-bottom: 1px solid rgba(226, 196, 245, 0.4);
}

.contact-link--btn:hover {
  background: rgba(155, 107, 196, 0.3);
}

.contact-social {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-note .contact-link {
  font-weight: 700;
}

.contact-note {
  margin-top: 36px;
  text-align: center;
  color: var(--slate-500);
  font-size: 0.9rem;
}



/* Level 3: platoon leaders */
.org-level-3 {
  flex-wrap: wrap;
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
}
.org-node.platoon {
  background: var(--cream);
  border-color: rgba(155, 107, 196, 0.25);
  min-width: 170px;
  max-width: 200px;
  padding: 16px 14px;
}
.org-platoon-photo { width: 80px; height: 80px; }
.org-platoon-photo img { object-position: center top; }
.org-node.platoon .node-name { font-size: 0.98rem; }
.org-node.platoon .node-role { font-size: 0.78rem; }
.org-connector-h--wide { max-width: 900px; }


/* =====================================================================
   RESPONSIVE LAYER  (layout / usability only — no colour or content changes)
   Desktop  >= 1024px : original layout
   Tablet   768–1023  : hamburger nav, stacked hero, 2-col grids
   Mobile   <= 767    : single-column, bottom-sheet panel, compact chips
   ===================================================================== */

/* ---------- Global safety + touch ergonomics ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video, canvas { max-width: 100%; }
p, h1, h2, h3, h4, li, a { overflow-wrap: break-word; }
.contact-link, .contact-detail { overflow-wrap: anywhere; }
.btn, .nav-toggle, .hero-hotspot, .explore-panel-close { -webkit-tap-highlight-color: rgba(201, 160, 232, 0.25); touch-action: manipulation; }
.btn { min-height: 44px; }
.btn-sm { min-height: 44px; }

/* Desktop org chart: allow wrap instead of any overflow */
.org-chart { width: 100%; }
.org-level { flex-wrap: wrap; }
.org-node { flex: 0 1 auto; }
.org-node.commander { width: min(360px, 100%); min-width: 0; }
.contact-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.contact-social a { display: inline-flex; align-items: center; min-height: 44px; }

/* Reduced motion: also calm the responsive additions */
@media (prefers-reduced-motion: reduce) {
  .nav-links { transition: none !important; }
  .hero .hero-interact-hint { transition: none !important; }
}

/* Hover-lift effects are sticky on touch screens — disable them there */
@media (hover: none) {
  .btn:hover, .deputy-card:hover, .contact-card:hover, .nav-brand:hover,
  .footer-links a:hover, .demo-badge:hover { transform: none; }
  .gallery-card:hover, .gallery-card.has-depth:hover { transform: none; }
  .deputy-card:hover, .deputy-card.has-depth:hover,
  .org-node.revealed:hover, .org-node.revealed.has-depth:hover { transform: none; }
}

/* =====================================================================
   TABLET & MOBILE  (<= 1023px)
   ===================================================================== */
@media (max-width: 1023px) {
  :root { --nav-h: 68px; }

  /* ----- Nav: hamburger + readable dropdown ----- */
  .nav-inner { gap: 8px; }
  .nav-brand { flex: 1 1 auto; max-width: calc(100% - 56px); gap: 10px; }
  .brand-logo { width: 44px; height: 44px; }
  .brand-text { max-width: none; flex: 1 1 auto; }
  .brand-text strong {
    font-size: clamp(0.74rem, 0.5rem + 1.1vw, 0.9rem);
    line-height: 1.3;
    word-break: normal;
    overflow-wrap: break-word;
  }
  .brand-text span { font-size: clamp(0.58rem, 0.45rem + 0.6vw, 0.7rem); }

  .nav-toggle { display: grid; flex: 0 0 44px; width: 44px; height: 44px; margin-right: -6px; }
  .site-nav.menu-open {
    background: rgba(20, 8, 31, 0.97);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
  }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(20, 8, 31, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 4% calc(20px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    transform: translateY(-16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s var(--ease), opacity 0.3s, visibility 0s linear 0.3s;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid rgba(226, 196, 245, 0.12);
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.3s var(--ease), opacity 0.3s, visibility 0s;
  }
  .nav-links li { display: block; }
  .nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    text-align: center;
    padding: 12px 16px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.88) !important;
  }
  .nav-links a:hover { transform: none; }
  .nav-links a.active { color: var(--gold-300) !important; }

  /* ----- Sections & type ----- */
  .section { padding: clamp(56px, 9vw, 88px) 0; }
  .section-header { margin-bottom: clamp(32px, 6vw, 48px); }
  .section-header p { font-size: 1rem; }
  .page-hero { padding: calc(var(--nav-h) + 40px) 0 80px; }
  .page-hero h1 { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem); line-height: 1.35; }
  .page-hero p { font-size: 1rem; }
  .org-section, .contact-section, .admin-section { padding: clamp(48px, 8vw, 72px) 0 clamp(56px, 9vw, 88px); }

  /* ----- Homepage hero: stacked (3D stage on top, copy + chips below) ----- */
  .hero {
    --stage-h: clamp(300px, 44vh, 460px);
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-top: calc(var(--nav-h) + var(--stage-h));
  }
  #hero-3d {
    top: var(--nav-h);
    bottom: auto;
    height: var(--stage-h);
    touch-action: pan-y;          /* vertical swipes always scroll the page */
  }
  .hero-drag-zone {
    top: var(--nav-h);
    left: 0;
    right: 0;
    width: 100%;
    height: var(--stage-h);
    touch-action: pan-y;
  }
  .hero-overlay {
    background: linear-gradient(180deg, rgba(20, 8, 31, 0.25) 0%, rgba(20, 8, 31, 0.1) 35%, rgba(20, 8, 31, 0.55) 62%, rgba(20, 8, 31, 0.8) 100%);
  }
  .hero-orb-3, .hero-ornament { display: none; }
  .hero-orb-2 { display: none; }
  .hero-orb { filter: blur(30px); }

  .hero-content {
    width: min(1120px, 92%);
    max-width: 720px;
    padding: 8px 0 24px;
    text-align: center;
  }
  .hero-3d-intro { margin-bottom: 12px; }
  .hero-eyebrow { margin-bottom: 14px; justify-content: center; }
  .hero h1 { font-size: clamp(1.6rem, 1.15rem + 2.2vw, 2.6rem); margin-bottom: 10px; }
  .hero-short { font-size: clamp(1.05rem, 0.95rem + 0.8vw, 1.3rem); margin-bottom: 14px; }
  .hero-location {
    font-size: clamp(0.9rem, 0.85rem + 0.4vw, 1.02rem);
    justify-content: center;
    text-align: left;
    margin-bottom: 24px;
    line-height: 1.5;
  }
  .hero-cta { justify-content: center; }

  /* Hotspots → compact tappable grid under the hero copy */
  .hero-hotspots {
    position: relative;
    inset: auto;
    z-index: 5;
    pointer-events: auto;
    order: 3;
    width: min(1120px, 92%);
    margin: 0 auto 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .hero-hotspot,
  .hero-hotspot:hover,
  .hero-hotspot:focus-visible {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    padding: 10px 14px 10px 12px;
    font-size: 0.86rem;
    animation: none;
  }
  .hero-hotspot.is-occluded { opacity: 1; pointer-events: auto; }
  .hotspot-dot { width: 10px; height: 10px; }
  .hotspot-label { white-space: normal; line-height: 1.3; text-align: left; }

  .hero .hero-interact-hint,
  .hero .hero-interact-hint.is-shown {
    position: relative !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    order: 4;
    align-self: center;
    max-width: min(92%, 520px);
    margin: 0 auto 28px;
    font-size: 0.74rem;
    border-radius: 18px;
  }
  .hero > .scroll-explore { display: none; }

  /* ----- Leadership ----- */
  .commander-card { grid-template-columns: 1fr; text-align: center; padding: 32px 24px; gap: 20px; }
  .commander-avatar { margin-inline: auto; width: 140px; height: 140px; }
  .commander-info h3 { font-size: clamp(1.15rem, 1rem + 1vw, 1.5rem); }
  .deputies-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .deputies-grid > .deputy-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 10px);
  }
  .has-depth { --tilt-x: 0deg !important; --tilt-y: 0deg !important; }

  /* ----- Grids ----- */
  .gallery-grid, .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .contact-grid, .contact-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

  /* ----- Org chart: wrap, no side-scroll, no horizontal connectors ----- */
  .org-section { overflow: visible; }
  .org-chart { padding: 8px 0; }
  .org-connector-h { display: none; }
  .org-connector { height: 32px; }
  .org-level { gap: 16px; }
  .org-level-2 .org-node.deputy {
    flex: 0 1 calc(33.333% - 11px);
    min-width: 0;
    max-width: 260px;
    padding: 18px 14px;
  }
  .org-level-3 { gap: 14px; }
  .org-node.platoon {
    flex: 0 1 calc(33.333% - 10px);
    min-width: 0;
    max-width: 220px;
  }
  .org-node .node-role { line-height: 1.45; }

  /* ----- Footer ----- */
  .footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 24px; }
  .footer-brand { justify-content: center; text-align: left; max-width: 100%; }
  .footer-brand .brand-text { max-width: 280px; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
  .site-footer { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
}

/* =====================================================================
   TABLET ONLY (600–1023): 4 chips in one row
   ===================================================================== */
@media (min-width: 600px) and (max-width: 1023px) {
  .hero-hotspots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-hotspot, .hero-hotspot:hover, .hero-hotspot:focus-visible { font-size: 0.8rem; padding-right: 10px; }
}

/* =====================================================================
   MOBILE (<= 767px)
   ===================================================================== */
@media (max-width: 767px) {
  .hero { --stage-h: clamp(270px, 40vh, 380px); }
  .hero-cta { flex-direction: column; align-items: stretch; gap: 10px; width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; min-height: 50px; }

  .demo-badge {
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    right: 10px;
    max-width: calc(100vw - 20px);
    font-size: 0.68rem;
    padding: 7px 12px;
    pointer-events: none;
    opacity: 0.92;
  }
  .site-footer { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* Emblem / about */
  .emblem-section { padding-top: 40px; padding-bottom: 48px; }
  .emblem-showcase { flex-direction: column; align-items: center; text-align: left; gap: 24px; }
  .emblem-plate { width: min(240px, 64vw); }
  .emblem-copy { min-width: 0; width: 100%; max-width: 520px; }
  .emblem-copy .section-eyebrow, .emblem-copy h2 { display: block; text-align: center; }
  .emblem-fact p { font-size: 0.95rem; }

  /* Leadership: 1 column */
  .deputies-grid { grid-template-columns: 1fr; gap: 16px; }
  .deputies-grid > .deputy-card:last-child:nth-child(odd) { width: 100%; }
  .deputy-card { padding: 26px 20px; }
  .commander-card { padding: 28px 20px; }

  /* Gallery: 2 -> 1 handled at 480; keep frames comfortable */
  .gallery-caption { padding: 32px 16px 14px; font-size: 0.92rem; }
  .gallery-caption small { font-size: 0.75rem; }

  /* Org chart: deputies stack, platoon stays 2-up until 480 */
  .org-level-2 { flex-direction: column; align-items: center; gap: 14px; }
  .org-level-2 .org-node.deputy { flex: 0 0 auto; width: min(360px, 100%); max-width: none; }
  .org-node.commander { padding: 24px 20px 26px; }
  .org-level-3 { gap: 12px; }
  .org-node.platoon { flex: 0 1 calc(50% - 6px); max-width: none; padding: 14px 10px; }
  .org-node.platoon .node-name { font-size: 0.92rem; }
  .org-node.platoon .node-role { font-size: 0.74rem; }
  .org-note { margin-top: 32px; padding: 0 4px; }

  /* Contact: 1 column */
  .contact-grid, .contact-grid--4 { grid-template-columns: 1fr; gap: 16px; }
  .contact-card { padding: 26px 22px; }
  .contact-note { margin-top: 28px; line-height: 1.8; }
  .contact-note .contact-link { display: inline-block; padding: 8px 2px; }

  /* Explore panel → bottom sheet */
  .explore-panel { align-items: flex-end; justify-content: center; }
  .explore-panel-backdrop { background: rgba(6, 4, 14, 0.6); }
  .explore-panel-card {
    width: 100%;
    margin: 0;
    max-height: min(82vh, 600px);
    max-height: min(82dvh, 600px);
    padding: 30px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(40px);
    overscroll-behavior: contain;
  }
  .explore-panel.is-open .explore-panel-card { transform: translateY(0); }
  .explore-panel-card::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 44px;
    height: 4px;
    margin-left: -22px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.28);
  }
  .explore-panel-close { top: 12px; right: 12px; width: 44px; height: 44px; }
  .explore-panel-title { font-size: 1.2rem; }
  .explore-panel-body { font-size: 0.96rem; }
  .explore-panel-body a { display: inline-block; padding: 6px 0; }
  .explore-panel-actions { flex-direction: column; }
  .explore-panel-actions .btn { width: 100%; justify-content: center; }
}

/* =====================================================================
   SMALL PHONES (<= 480px)
   ===================================================================== */
@media (max-width: 480px) {
  .gallery-grid, .dept-grid { grid-template-columns: 1fr; }
  .gallery-card { aspect-ratio: 16 / 10; }
  .hero-hotspots { gap: 8px; }
  .hero-hotspot, .hero-hotspot:hover, .hero-hotspot:focus-visible { font-size: 0.82rem; padding: 10px 10px 10px 12px; gap: 9px; }

  /* Org chart: compact horizontal cards, single column */
  .org-level-3 { flex-direction: column; align-items: center; gap: 10px; }
  .org-level-2 { gap: 10px; }
  .org-level-2 .org-node.deputy,
  .org-level-3 .org-node.platoon {
    flex: 0 0 auto;
    width: min(360px, 100%);
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
    align-content: center;
    text-align: left;
    padding: 12px 14px;
  }
  .org-level-2 .org-node.deputy .org-deputy-photo,
  .org-level-3 .org-node.platoon .org-deputy-photo {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 64px;
    height: 64px;
    margin: 0;
  }
  .org-level-2 .org-node.deputy > p,
  .org-level-3 .org-node.platoon > p { grid-column: 2; margin: 0; }
  .org-level-2 .org-node.deputy .node-role,
  .org-level-3 .org-node.platoon .node-role { font-size: 0.72rem; margin-bottom: 2px; }
  .org-level-3 .org-node.platoon .node-name,
  .org-level-2 .org-node.deputy .node-name { font-size: 0.92rem; }
  .org-level-2 .org-node.deputy .node-rank,
  .org-level-3 .org-node.platoon .node-rank { margin-top: 2px; }
}

/* Very small (<= 360px) */
@media (max-width: 360px) {
  .brand-logo { width: 40px; height: 40px; }
  .brand-text strong { font-size: 0.72rem; }
  .brand-text span { font-size: 0.56rem; }
  .hero-hotspot, .hero-hotspot:hover, .hero-hotspot:focus-visible { font-size: 0.78rem; }
  .commander-avatar { width: 120px; height: 120px; }
}

/* Short landscape phones: don't let the stage eat the viewport */
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 520px) {
  .hero { --stage-h: 260px; }
}

/* ========== Hero clip (atmospheric video background) ========== */
.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--navy-950);
}
.hero-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  opacity: 0.34;             /* poster / pre-play state; JS drives it once playing */
  transform: scale(1.12);    /* crop the video's own emblem toward the edge, keep motion */
  will-change: opacity;
}
.hero-video.is-poster video { opacity: 0.3; }
/* Scrim: purple veil for legibility + dims the video's own emblem so the big logo leads */
.hero-video-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 34% 46% at 62% 50%, rgba(20, 8, 31, 0.62) 0%, rgba(20, 8, 31, 0.3) 60%, transparent 100%),
    linear-gradient(90deg, rgba(20, 8, 31, 0.72) 0%, rgba(38, 14, 62, 0.38) 45%, rgba(38, 14, 62, 0.2) 100%),
    linear-gradient(180deg, rgba(20, 8, 31, 0.4) 0%, transparent 30%, transparent 65%, rgba(20, 8, 31, 0.7) 100%);
}
.hero-video--page video { object-position: 50% 50%; transform: scale(1.05); }
.hero-video--page .hero-video-scrim {
  background:
    linear-gradient(180deg, rgba(20, 8, 31, 0.55) 0%, rgba(38, 14, 62, 0.55) 60%, rgba(20, 8, 31, 0.85) 100%);
}
@media (max-width: 1023px) {
  .hero-video video { object-position: 50% 38%; transform: scale(1.08); }
  .hero-video-scrim {
    background:
      radial-gradient(ellipse 60% 40% at 50% 34%, rgba(20, 8, 31, 0.55) 0%, transparent 100%),
      linear-gradient(180deg, rgba(20, 8, 31, 0.35) 0%, rgba(38, 14, 62, 0.3) 40%, rgba(20, 8, 31, 0.85) 70%, rgba(20, 8, 31, 0.95) 100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-video video { opacity: 0.32 !important; transform: none; }
}

/* gallery real photos */
.gallery-frame .gallery-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:0;display:block}
.gallery-frame::before{z-index:1;pointer-events:none}
.gallery-caption small{opacity:.85}
