/*
 * style.css — Shared component library.
 *
 * Importing variables gives every rule in this file access to all design tokens.
 * Any page-specific CSS file should also start with this import:
 *   @import url('/static/css/variables.css');
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
@import url('/static/css/variables.css');

/* ════════════════════════════════════════════════════════════════
   GLOBAL
════════════════════════════════════════════════════════════════ */

html {
  scroll-behavior: smooth;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  width: 100%;
  position: relative;
}

*, *::before, *::after {
  box-sizing: border-box;
}


/* ════════════════════════════════════════════════════════════════
   LAYOUT
════════════════════════════════════════════════════════════════ */

.section-container {
  width: 90%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}


/* ════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   Naming convention:
     .heading-*   → headings (h1–h3 equivalents)
     .text-*      → body / prose text
     .section-*   → section layout helpers
════════════════════════════════════════════════════════════════ */

/* ── Section helpers ─────────────────────────────────────────── */
.section-label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: .5rem;
}

/* Convenience wrapper for centred section headings */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header-sm {
  text-align: center;
  margin-bottom: 3rem;
}

/* Tiny uppercase badge inside cards ("INTEGRATION", "AI & AUTOMATION" …) */
.feature-badge {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

/* ── Headings ────────────────────────────────────────────────── */

/* Hero H1 — full-bleed hero or page hero */
.heading-hero {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
@media (min-width: 768px)  { .heading-hero { font-size: 3rem;    } }
@media (min-width: 1024px) { .heading-hero { font-size: 3.75rem; } }

/* Main section H2 */
.section-title {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.015em;
}
@media (min-width: 768px) { .section-title { font-size: 2.25rem; } }

/* CTA-band section title (light text on primary bg) */
.section-title-invert {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--color-primary-foreground);
}
@media (min-width: 768px) { .section-title-invert { font-size: 2.25rem; } }

/* Card H3 — larger cards (service, events) */
.heading-card {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

/* Card H3 — smaller cards (feature, trust) */
.heading-card-sm {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

/* ── Body text ───────────────────────────────────────────────── */

/* Lead / intro paragraph — larger, used under hero h1 or section titles */
.text-lead {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-muted-foreground);
}
@media (min-width: 768px) { .text-lead { font-size: 1.1875rem; } }

/* Standard body paragraph */
.text-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-muted-foreground);
}

/* Small body — card descriptions on light bg */
.text-body-sm {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-muted-foreground);
}

/* Small body on dark/elevated backgrounds */
.text-body-dark {
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgba(203, 213, 225, 0.7);
}

/* Hero body copy — on dark hero background */
.text-hero-body {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(226, 232, 240, 0.75);
}

/* Quote / pull-quote style */
.text-quote {
  font-size: 1.0625rem;
  line-height: 1.75;
  font-style: italic;
}
@media (min-width: 768px) { .text-quote { font-size: 1.1875rem; } }

/* Caption / metadata text (dates, locations, labels) */
.text-caption {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-muted-foreground);
}


/* ════════════════════════════════════════════════════════════════
   BUTTONS
   Usage: <a class="btn btn-primary">…</a>
          <a class="btn btn-outline">…</a>
════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-sm { padding: 0.5rem 1rem;    font-size: 0.875rem; }
.btn-lg { padding: 0.875rem 2rem;  font-size: 1rem; }

/* — Primary (solid blue) */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
}
.btn-primary:hover { background: #1d4ed8; }

/* — Outline on light background */
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, .35);
}
.btn-outline:hover { background: rgba(37, 99, 235, .08); }

/* — Outline on dark / hero background */
.btn-outline-dark {
  background: transparent;
  color: var(--color-surface-dark-fg);
  border-color: rgba(226, 232, 240, .40);
}
.btn-outline-dark:hover { border-color: rgba(226, 232, 240, .70); }

/* — White solid (CTA band on primary bg) */
.btn-white {
  background: var(--color-background);
  color: var(--color-primary);
}
.btn-white:hover { background: #f8fafc; }

/* — White outline (CTA band on primary bg) */
.btn-white-outline {
  background: transparent;
  color: var(--color-primary-foreground);
  border-color: rgba(255,255,255,.40);
}
.btn-white-outline:hover { border-color: rgba(255,255,255,.70); }

/* — Ghost / text */
.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { text-decoration: underline; }


/* ════════════════════════════════════════════════════════════════
   CARDS
════════════════════════════════════════════════════════════════ */

/* Shared hover lift — add on any element that should lift on hover */
.card-hover {
  transition: var(--transition-default);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* Light card (white bg, border) */
.card-light {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition-default);
}
.card-light:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* Dark card (surface-elevated bg, used in dark sections) */
.card-dark {
  background: var(--color-surface-elevated);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition-default);
}
.card-dark:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* ── News card ───────────────────────────────────────────────── */
.news-card { display: block; cursor: pointer; }
.news-card:hover .news-card-img   { transform: scale(1.05); }
.news-card:hover .news-card-title { color: var(--color-primary); }

.news-card-img-wrap {
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}
.news-card-img {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  transition: transform .5s;
}
.news-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-foreground);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  transition: color .15s;
}
.news-card-excerpt {
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Event card ──────────────────────────────────────────────── */
.event-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition-default);
}
.event-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.event-card-title {
  font-weight: 700;
  color: var(--color-foreground);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.event-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
  margin-bottom: 0.25rem;
}
.event-desc {
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
  margin-bottom: 1.5rem;
  flex: 1;
}

/* ── Trust / value-prop card (dark elevated) ─────────────────── */
.trust-card {
  background: var(--color-surface-elevated);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition-default);
}
.trust-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}


/* ════════════════════════════════════════════════════════════════
   LINKS / TEXT ACTIONS
════════════════════════════════════════════════════════════════ */

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color .15s;
}
.text-link:hover { color: #1d4ed8; }
.text-link-sm { font-size: 0.75rem; }


/* ════════════════════════════════════════════════════════════════
   ICONS  (Lucide CDN — <i data-lucide="name" class="icon-sm">)
════════════════════════════════════════════════════════════════ */

.icon-xs { width: 0.75rem; height: 0.75rem; }
.icon-sm { width: 1rem;    height: 1rem; }
.icon-md { width: 1.25rem; height: 1.25rem; }
.icon-lg { width: 1.5rem;  height: 1.5rem; }

/* Service card icon (primary, 2.5 rem) */
.icon-service {
  display: inline-block;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

/* Feature card icon (teal, 3 rem) */
.icon-feature {
  display: inline-block;
  width: 3rem;
  height: 3rem;
  color: var(--color-cyber-teal);
  margin-bottom: 1rem;
}

/* Arrow icon in buttons/links */
.icon-arrow { display: inline-block; width: 1rem; height: 1rem; flex-shrink: 0; }


/* ════════════════════════════════════════════════════════════════
   BRAND LOGOS (trust bar)
════════════════════════════════════════════════════════════════ */

.brand-logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  opacity: 0.6;
  filter: brightness(0) invert(0.5);
  transition: opacity .2s, filter .2s;
}
.brand-logo-img:hover {
  opacity: 1;
  filter: brightness(0) invert(0.35);
}

.brand-logo-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-muted-foreground);
}


/* ════════════════════════════════════════════════════════════════
   STATISTICS
════════════════════════════════════════════════════════════════ */

.stat-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(37,99,235,.5);
}
@media (min-width: 768px) { .stat-number { font-size: 3rem; } }

.stat-label {
  font-size: 0.75rem;
  color: rgba(226,232,240,.6);
  line-height: 1.4;
}


/* ════════════════════════════════════════════════════════════════
   HERO
════════════════════════════════════════════════════════════════ */

.hero-overlay {
  background: linear-gradient(to right, rgba(6,13,28,.65), rgba(6,13,28,.2));
}

.hero-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  background: rgba(226,232,240,.4);
}
.hero-dot:hover  { background: rgba(226,232,240,.6); }
.hero-dot.active { background: var(--color-primary); transform: scale(1.1); }

/* Hero text group — carousel animation */
.hero-text-group {
  transition: opacity .3s ease, transform .3s ease;
}
.hero-text-in {
  opacity: 1;
  transform: translateY(0);
  animation: heroTextIn .45s cubic-bezier(.22,.61,.36,1) both;
}
.hero-text-out {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}
@keyframes heroTextIn {
  from { opacity: 0; transform: translateY(-80px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ════════════════════════════════════════════════════════════════
   INTERACTIVE / MISC
════════════════════════════════════════════════════════════════ */

.stat-glow { text-shadow: 0 0 20px rgba(37,99,235,.5); }

details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details > summary > svg { transition: transform .2s; }
details[open] > summary > svg { transform: rotate(180deg); }

/* Toggle button group (before/after comparison) */
.toggle-group {
  display: inline-flex;
  background: var(--color-surface-elevated);
  border-radius: var(--radius-full);
  padding: 0.25rem;
}
.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  color: rgba(203,213,225,.6);
  background: transparent;
}
.toggle-btn:hover { color: var(--color-surface-elevated-fg); }
.toggle-btn.active-danger {
  background: var(--color-destructive);
  color: var(--color-destructive-foreground);
  box-shadow: 0 2px 8px rgba(220,38,38,.4);
}
.toggle-btn.active-primary {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.toggle-btn.active-success {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}

/* Platform comparison panels */
.platform-panel {
  display: none;
}
.platform-panel.active {
  display: block;
}

/* Progress bar */
.progress-track {
  height: 0.75rem;
  background: var(--color-surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-danger {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(to right, var(--color-destructive), rgba(220,38,38,.6));
}
.progress-bar-success {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(to right, var(--color-primary), var(--color-cyber-teal));
}

/* Quote navigation */
.quote-nav-btn {
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.quote-nav-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Threat demo buttons */
.threat-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid rgba(226,232,240,.2);
  background: rgba(30,42,74,.5);
  color: rgba(226,232,240,.7);
  cursor: pointer;
  transition: var(--transition-fast);
}
.threat-btn:hover {
  border-color: rgba(37,99,235,.5);
  color: var(--color-primary);
}
.threat-btn.threat-active {
  border-color: var(--color-destructive);
  background: rgba(220,38,38,.15);
  color: var(--color-destructive);
}

/* Demo node states */
.demo-node-box {
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.demo-node.node-attack .demo-node-box {
  background: rgba(220,38,38,.25) !important;
  border-color: rgba(220,38,38,.7) !important;
  box-shadow: 0 0 16px rgba(220,38,38,.5);
  color: var(--color-destructive) !important;
}
.demo-node.node-blocked .demo-node-box {
  background: rgba(220,38,38,.15) !important;
  border-color: rgba(220,38,38,.6) !important;
}
.demo-node.node-safe .demo-node-box {
  background: rgba(37,99,235,.2) !important;
  border-color: rgba(37,99,235,.6) !important;
  box-shadow: 0 0 14px rgba(37,99,235,.4);
  color: var(--color-primary) !important;
}

/* Blocked badge inside firewall node */
.blocked-badge {
  display: none;
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-destructive);
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: .06em;
  padding: .15rem .4rem;
  border-radius: 3px;
  white-space: nowrap;
  align-items: center;
  gap: .2rem;
}
.blocked-badge.show { display: flex; }

/* Demo SVG lines */
.demo-line {
  stroke: hsl(var(--border));
  opacity: 0.3;
  transition: stroke .3s, opacity .3s;
}
.demo-line.line-attack  { stroke: var(--color-destructive); opacity: 0.8; stroke-dasharray: 4,2; }
.demo-line.line-safe    { stroke: var(--color-primary);     opacity: 0.6; stroke-dasharray: 4,2; }
.demo-line.line-blocked { stroke: var(--color-destructive); opacity: 0.4; }

/* Progress fill - animated */
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 1s cubic-bezier(.22,.61,.36,1);
}

/* Quote carousel */
#quote-group {
  transition: opacity .25s ease, transform .25s ease;
}
.quote-slide-in-left {
  animation: quoteInLeft .3s ease both;
}
.quote-slide-in-right {
  animation: quoteInRight .3s ease both;
}
@keyframes quoteInLeft  { from { opacity: 0; } to { opacity: 1; } }
@keyframes quoteInRight { from { opacity: 0; } to { opacity: 1; } }


/* ════════════════════════════════════════════════════════════════
   NAVIGATION — TOPBAR
════════════════════════════════════════════════════════════════ */

.topbar { 
  background: var(--color-topbar-bg);
  display: none;
}
@media (min-width: 768px) {
  .topbar { display: block; }
}

.topbar-link {
  font-size: 0.75rem;
  color: var(--color-topbar-fg);
  text-decoration: none;
  transition: color .15s;
}
.topbar-link:hover { color: var(--color-primary); }

.topbar-divider {
  color: rgba(148,163,184,.3);
  font-size: 0.75rem;
}


/* ════════════════════════════════════════════════════════════════
   NAVIGATION — MAIN NAV
════════════════════════════════════════════════════════════════ */

.nav-wrapper {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  width: 100%;
  background: var(--color-background);
}

.nav {
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

@media (max-width: 768px) {
  .nav-inner { height: 3.5rem; }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-foreground);
}
.nav-logo-accent { color: var(--color-primary); }

.nav-menu {
  display: none;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 1024px) { .nav-menu { display: flex; } }

.nav-item { position: relative; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(15,23,42,.8);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: color .15s;
  white-space: nowrap;
}
.nav-btn:hover,
.nav-item.is-open > .nav-btn { color: var(--color-primary); }
.nav-btn.is-active { color: var(--color-primary); font-weight: 600; }

.nav-chevron {
  width:  0.75rem !important;
  height: 0.75rem !important;
  transition: transform .2s;
  flex-shrink: 0;
}
/* Rotate chevron up when hovered OR when dropdown is open */
.nav-item:hover > .nav-btn .nav-chevron,
.nav-item.is-open > .nav-btn .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 280px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown);
  z-index: var(--z-dropdown);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  padding: 0.375rem;
}
/* Invisible bridge covers the gap between nav-btn and dropdown */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
}
.nav-item:hover > .nav-dropdown,
.nav-item.is-open > .nav-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.nav-dropdown-wide { min-width: 320px; }

.nav-dropdown-all {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.25rem;
}
.nav-dropdown-all:hover { text-decoration: underline; }

.nav-dropdown-item {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background .12s;
}
.nav-dropdown-item:hover { background: var(--color-muted); }

.nav-dropdown-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-foreground);
}
.nav-dropdown-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
  margin-top: 0.1rem;
}

.nav-cta {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity .15s;
  white-space: nowrap;
}
.nav-cta:hover { opacity: 0.75; }

.nav-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-foreground);
  padding: 0.375rem;
  border-radius: var(--radius-md);
  transition: background .15s;
}
.nav-hamburger:hover { background: var(--color-muted); }
@media (min-width: 1024px) { .nav-hamburger { display: none; } }


/* ════════════════════════════════════════════════════════════════
   NAVIGATION — MOBILE DRAWER
════════════════════════════════════════════════════════════════ */

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.mobile-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(360px, 90vw);
  max-width: 100vw;
  background: var(--color-background);
  z-index: var(--z-mobile-menu);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}
.mobile-menu.is-open { 
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-foreground);
  padding: 0.375rem;
  border-radius: var(--radius-md);
  transition: background .15s;
}
.mobile-close:hover { background: var(--color-muted); }

.mobile-menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem 2rem;
}

.mobile-nav-group { border-bottom: 1px solid var(--color-border); }

.mobile-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-foreground);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.mobile-chevron {
  width:  1rem !important;
  height: 1rem !important;
  transition: transform .2s;
  flex-shrink: 0;
}
.mobile-nav-group.is-open .mobile-chevron { transform: rotate(180deg); }

.mobile-nav-sub {
  display: none;
  flex-direction: column;
  padding: 0.25rem 0 0.875rem 0.5rem;
}
.mobile-nav-group.is-open .mobile-nav-sub { display: flex; }

.mobile-nav-sub-link {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  color: var(--color-muted-foreground);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color .12s, background .12s;
}
.mobile-nav-sub-link:hover {
  color: var(--color-primary);
  background: var(--color-muted);
}
.mobile-nav-sub-all {
  font-weight: 700;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}


/* 
   SCROLL-REVEAL ANIMATIONS
   Usage: add .reveal (or variant) to any element.
          JS in app.js adds .is-visible when it enters the viewport.
   Variants:
     .reveal           default fade-up
     .reveal-fade      fade only (no movement)
     .reveal-scale     scale up from 93%
     .reveal-left      slide in from the left
     .reveal-right     slide in from the right
   Delays (chain on the same element):
     .reveal-delay-1  .reveal-delay-5  (100ms increments)
 */

/*  Keyframes  */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1);    }
}
@keyframes slideInLeft {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/*  Hidden / pre-animation states  */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(.22,.61,.36,1),
              transform 0.65s cubic-bezier(.22,.61,.36,1);
}
.reveal-fade {
  opacity: 0;
  transition: opacity 0.65s ease;
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.93);
  transition: opacity 0.65s ease,
              transform 0.65s cubic-bezier(.22,.61,.36,1);
}
.reveal-left {
  opacity: 0;
  transition: opacity 0.65s ease;
}
.reveal-right {
  opacity: 0;
  transition: opacity 0.65s ease;
}

/*  Visible state (added by IntersectionObserver)  */
.reveal.is-visible,
.reveal-fade.is-visible,
.reveal-scale.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
  opacity: 1;
  transform: none;
}

/*  Stagger delays  */
.reveal-delay-1 { transition-delay: 0.10s; }
.reveal-delay-2 { transition-delay: 0.20s; }
.reveal-delay-3 { transition-delay: 0.30s; }
.reveal-delay-4 { transition-delay: 0.40s; }
.reveal-delay-5 { transition-delay: 0.50s; }


/* ════════════════════════════════════════════════════════════════
   RESPONSIVE UTILITIES
   Prevent horizontal overflow and ensure mobile compatibility
════════════════════════════════════════════════════════════════ */

/* Ensure all images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Prevent pre/code blocks from overflowing */
pre, code {
  max-width: 100%;
  overflow-x: auto;
}

/* Ensure tables are scrollable on mobile */
table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

@media (min-width: 768px) {
  table {
    display: table;
  }
}

/* Prevent long words from breaking layout */
.text-body,
.text-body-sm,
.text-lead,
.text-hero-body {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Safe viewport-based widths */
.full-width-safe {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
.reveal-delay-4 { transition-delay: 0.40s; }
.reveal-delay-5 { transition-delay: 0.50s; }

/*  Respect reduced-motion preference  */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-fade, .reveal-scale,
  .reveal-left, .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}