/**
 * 99tools Design System — Core & Layout
 * Brand: Gold (#D4A843) primary, Warm Copper (#C96A1E) secondary, Deep Slate dark mode
 * Typography: Plus Jakarta Sans (headings) + Inter (body) + JetBrains Mono (code)
 *
 * @package 99tools
 */

/* ==========================================================================
   GOOGLE FONTS — loaded here via @import as backup; primary via PHP enqueue
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Outfit:wght@500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================================================
   CSS CUSTOM PROPERTIES — Design Tokens
   ========================================================================== */
:root {
  /* --- Typography --- */
  --font-display: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* --- Type Scale (Harmonious Modern Scale) --- */
  --text-2xs:  0.6875rem; /* 11px */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-md:   1.0625rem;  /* 17px - ideal reading size */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */

  /* --- Transitions --- */
  --transition-fast:   0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Radii --- */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Layout --- */
  --container-max: 1240px;
  --container-narrow: 840px;
  --header-h: 68px;

  /* ==========================================
     LIGHT THEME  (default)
     ========================================== */

  /* Backgrounds */
  --bg-body:             #f7f8fc;
  --bg-surface:          #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-hover:    #f1f5f9;
  --bg-subtle:           #f3f6fb;
  --bg-overlay:          rgba(10, 14, 26, 0.55);

  /* Text — High Contrast, Ultra-Readable */
  --text-primary:   #090d16;
  --text-secondary: #334155;
  --text-muted:     #64748b;
  --text-inverse:   #ffffff;

  /* Borders */
  --border-subtle: #e2e8f0;
  --border-strong: #c9d3e0;
  --border-focus:  #D4A843;

  /* ============ BRAND COLOURS ============
     Primary = Logo Gold  #D4A843
     Secondary = Warm Copper  #C96A1E
     Tertiary = Warm Teal  #0A8A7A
     ======================================== */
  --brand-gold:          #D4A843;
  --brand-gold-hover:    #B8902F;
  --brand-gold-light:    rgba(212, 168, 67, 0.12);
  --brand-gold-glow:     rgba(212, 168, 67, 0.25);

  --brand-primary:       #D4A843;
  --brand-primary-hover: #B8902F;
  --brand-primary-light: rgba(212, 168, 67, 0.12);

  /* Copper — warm secondary that pairs with gold */
  --brand-copper:        #C96A1E;
  --brand-copper-hover:  #A8571A;
  --brand-copper-light:  rgba(201, 106, 30, 0.12);
  --brand-copper-glow:   rgba(201, 106, 30, 0.25);

  --brand-secondary:     #C96A1E;   /* Warm copper — no blue */
  --brand-secondary-hover: #A8571A;
  --brand-secondary-light: rgba(201, 106, 30, 0.12);

  /* Teal — tertiary accent (distinct from blue, pairs warm) */
  --brand-teal:          #0A8A7A;
  --brand-teal-light:    rgba(10, 138, 122, 0.12);

  --brand-accent:        #10b981;   /* Emerald for free/active/success badges */

  /* Badges */
  --badge-bg:   #f1f5f9;
  --badge-text: #334155;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 30px var(--brand-gold-glow);

  /* Glass */
  --glass-bg:     rgba(255, 255, 255, 0.88);
  --glass-border: rgba(226, 232, 240, 0.85);
}

/* ==========================================================================
   DARK THEME
   ========================================================================== */
[data-theme="dark"] {
  /* Backgrounds */
  --bg-body:             #07090e;
  --bg-surface:          #0d1117;
  --bg-surface-elevated: #131922;
  --bg-surface-hover:    #1a2336;
  --bg-subtle:           #0f1620;
  --bg-overlay:          rgba(2, 5, 15, 0.82);

  /* Text — Clean, Crisp, Low Eye-Strain */
  --text-primary:   #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted:     #8497b0;
  --text-inverse:   #07090e;

  /* Borders */
  --border-subtle: #1c2840;
  --border-strong: #263350;
  --border-focus:  #D4A843;

  /* Brand — gold stays gold in dark mode */
  --brand-gold:          #E6B84A;
  --brand-gold-hover:    #D4A843;
  --brand-gold-light:    rgba(230, 184, 74, 0.14);
  --brand-gold-glow:     rgba(230, 184, 74, 0.3);

  --brand-primary:       #E6B84A;
  --brand-primary-hover: #D4A843;
  --brand-primary-light: rgba(230, 184, 74, 0.14);

  /* Dark mode copper — slightly lighter to pop on dark bg */
  --brand-copper:        #E07A35;
  --brand-copper-hover:  #C96A1E;
  --brand-copper-light:  rgba(224, 122, 53, 0.14);
  --brand-copper-glow:   rgba(224, 122, 53, 0.28);

  --brand-secondary:     #E07A35;
  --brand-secondary-hover: #C96A1E;
  --brand-secondary-light: rgba(224, 122, 53, 0.14);

  --brand-teal:          #0FB8A5;
  --brand-teal-light:    rgba(15, 184, 165, 0.14);

  --brand-accent:        #34d399;

  /* Badges */
  --badge-bg:   rgba(255, 255, 255, 0.06);
  --badge-text: #b0c0d8;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.55), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.65), 0 8px 10px -6px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 36px var(--brand-gold-glow);

  /* Glass */
  --glass-bg:     rgba(13, 17, 23, 0.88);
  --glass-border: rgba(255, 255, 255, 0.07);
}

/* ==========================================================================
   BASE RESET & TYPOGRAPHIC ENGINE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Prevent iOS text-size boost on orientation change */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Safe area for notch / home-bar iPhones */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.72;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02' 1, 'cv03' 1, 'cv04' 1, 'cv11' 1;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* ==========================================================================
   AMBIENT GLOW (Gold + Warm Copper tint — No Blue)
   ========================================================================== */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1400px;
  height: 560px;
  background: radial-gradient(
    ellipse 80% 50% at 50% 0%,
    rgba(212, 168, 67, 0.12) 0%,
    rgba(201, 106, 30, 0.06) 45%,
    transparent 75%
  );
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
}

[data-theme="dark"] .ambient-glow {
  background: radial-gradient(
    ellipse 80% 55% at 50% 0%,
    rgba(230, 184, 74, 0.16) 0%,
    rgba(224, 122, 53, 0.08) 45%,
    transparent 75%
  );
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  text-wrap: balance;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fluid headings — carefully calibrated for clean hierarchy & zero overflow */
h1 {
  font-size: clamp(2rem, 4.5vw + 0.5rem, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.038em;
}

h2 {
  font-size: clamp(1.45rem, 2.5vw + 0.4rem, 2.25rem);
  font-weight: 750;
  line-height: 1.22;
  letter-spacing: -0.032em;
}

h3 {
  font-size: clamp(1.15rem, 1.8vw + 0.25rem, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.022em;
}

h4 {
  font-size: clamp(1.025rem, 1.2vw + 0.2rem, 1.25rem);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

h5 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

h6 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: var(--text-muted);
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.72;
  letter-spacing: -0.011em;
  text-wrap: pretty;
}

strong, b {
  font-weight: 700;
  color: var(--text-primary);
}

small {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-feature-settings: 'calt' 1, 'zero' 1;
}

code {
  font-size: 0.86em;
  color: var(--brand-copper);
  background-color: var(--bg-subtle);
  padding: 0.18em 0.45em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
}

pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

pre code {
  background: transparent;
  padding: 0;
  border: none;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   CONTAINERS
   ========================================================================== */
.site-container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 4vw, 1.5rem);
  padding-right: clamp(1rem, 4vw, 1.5rem);
  position: relative;
  z-index: 1;
}

.site-container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 4vw, 1.5rem);
  padding-right: clamp(1rem, 4vw, 1.5rem);
}

/* ==========================================================================
   HEADER — Glassmorphism Sticky Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

/* Safe-area inset for iPhones with notches */
@supports (padding-top: env(safe-area-inset-top)) {
  .site-header {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 0.75rem;
  flex-wrap: nowrap;
}

/* ==========================================================================
   LOGO / BRANDING
   ========================================================================== */
.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

/* Ensure WP custom_logo is contained */
.custom-logo-link {
  display: flex !important;
  align-items: center !important;
}
.custom-logo {
  height: 36px !important;
  max-height: 36px !important;
  width: auto !important;
  max-width: 165px !important;
  object-fit: contain !important;
}

/* Light / Dark Mode Logo Switch */
img.logo-dark,
.site-branding img.logo-dark,
.custom-logo-link img.logo-dark,
.mobile-drawer-header img.logo-dark {
  display: none !important;
}

img.logo-light,
.site-branding img.logo-light,
.custom-logo-link img.logo-light,
.mobile-drawer-header img.logo-light {
  display: block !important;
}

[data-theme="dark"] img.logo-light,
[data-theme="dark"] .site-branding img.logo-light,
[data-theme="dark"] .custom-logo-link img.logo-light,
[data-theme="dark"] .mobile-drawer-header img.logo-light {
  display: none !important;
}

[data-theme="dark"] img.logo-dark,
[data-theme="dark"] .site-branding img.logo-dark,
[data-theme="dark"] .custom-logo-link img.logo-dark,
[data-theme="dark"] .mobile-drawer-header img.logo-dark {
  display: block !important;
}

/* Text-based fallback logo */
.brand-text-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 0;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.brand-text-logo .brand-99 {
  color: var(--brand-gold);
  display: inline-block;
}

.brand-badge {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-hover));
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  margin-left: 0.35rem;
  vertical-align: middle;
  line-height: 1.4;
}

/* ==========================================================================
   DESKTOP NAV
   ========================================================================== */
.desktop-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-menu,
.nav-menu ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: nowrap;
}

.nav-menu > li {
  position: relative;
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.nav-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a {
  color: var(--brand-gold);
  background-color: var(--brand-gold-light);
}

/* Dropdown chevron */
.nav-menu li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition-fast);
  opacity: 0.65;
}

.nav-menu li.menu-item-has-children:hover > a::after {
  transform: rotate(-135deg) translateY(1px);
  opacity: 1;
}

/* Dropdown submenu */
.nav-menu .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-subtle);
  padding: 0.4rem !important;
  list-style: none !important;
  margin: 0 !important;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-menu .sub-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-menu li.menu-item-has-children:hover > .sub-menu,
.nav-menu li.menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-menu .sub-menu li {
  list-style: none !important;
  margin: 0;
  padding: 0;
  width: 100%;
}

.nav-menu .sub-menu li a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.nav-menu .sub-menu li a:hover,
.nav-menu .sub-menu li.current-menu-item > a {
  color: var(--brand-gold);
  background: var(--brand-gold-light);
  padding-left: 1.05rem;
}

/* ==========================================================================
   HEADER ACTIONS
   ========================================================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.search-trigger-btn:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.search-kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-muted);
}

.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  color: var(--brand-gold);
  background: var(--brand-gold-light);
  border-color: var(--brand-gold);
}

.theme-toggle-btn .icon-sun  { display: none; }
.theme-toggle-btn .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle-btn .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-hover) 100%);
  color: #1a1000;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--brand-gold-glow);
  border-color: var(--brand-gold-hover);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--brand-gold-glow);
  color: #1a1000;
  opacity: 0.95;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-secondary-hover) 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--brand-copper-glow);
  border-color: var(--brand-secondary-hover);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  color: #fff;
  opacity: 0.94;
  box-shadow: 0 4px 16px var(--brand-copper-glow);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--brand-gold);
  color: var(--brand-gold);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.38rem 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  font-size: 1.05rem;
  padding: 0.8rem 1.65rem;
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   MOBILE NAV TOGGLE
   ========================================================================== */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.45rem;
  margin-left: 0.1rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.mobile-nav-toggle:hover {
  background: var(--bg-subtle);
  color: var(--brand-gold);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 2;
}

.footer-top-cta {
  background: linear-gradient(
    135deg,
    rgba(212, 168, 67, 0.08) 0%,
    rgba(201, 106, 30, 0.06) 100%
  );
  border-bottom: 1px solid var(--border-subtle);
  padding: 3.5rem 0;
}

.footer-cta-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.75rem;
}

.footer-cta-text h3 {
  font-size: clamp(1.3rem, 2.5vw + 0.5rem, 1.75rem);
  margin-bottom: 0.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding: 3.5rem 0 2.5rem;
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.9rem;
  max-width: 300px;
  line-height: 1.65;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col ul li a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-col ul li a:hover {
  color: var(--brand-gold);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding: 1.25rem 0;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #10b981;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  animation: pulseDot 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.25); }
}

/* ==========================================================================
   SCROLL-TO-TOP
   ========================================================================== */
.scroll-top-btn {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 42px;
  height: 42px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 90;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:hover {
  background: var(--brand-gold);
  color: #1a1000;
  border-color: var(--brand-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--brand-gold-glow);
}
