/* ==========================================================================
   GLOBAL DESIGN SYSTEM & COMMON COMPONENTS (Ayanta Modak Portfolio)
   ========================================================================== */

:root {
  /* Color Palette - Premium Swiss Dark Aesthetics */
  --bg-color: #0b0c10;
  --bg-color-rgb: 11, 12, 16;
  --surface: #111318;
  --surface-container-lowest: #14171f;
  --surface-container-low: #181b24;
  --surface-container: #1e222d;
  --surface-container-high: #262b39;
  --surface-container-highest: #313749;
  --surface-dim: #090a0d;
  --surface-bright: #1c202b;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0b0c10;

  --accent: #818cf8;
  --accent-rgb: 129, 140, 248;
  --accent-hover: #9fa8ff;
  --accent-surface: #1e1e38;
  --accent-container: #4f46e5;

  --border-color: #1e293b;
  --border-subtle: #334155;
  --border-dark: #f8fafc;

  --tag-bg: #1e222d;
  --tag-text: #e2e8f0;

  /* Typography */
  --font-display: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing & Layout */
  --spacing-unit: 8px;
  --container-max: 1280px;
  --gutter: 28px;
  --margin-desktop: 64px;
  --margin-tablet: 32px;
  --margin-mobile: 18px;
  --section-gap: 120px;

  /* Corner Radius */
  --radius-sm: 4px;
  --radius-default: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --radius-pill: 9999px;

  /* Transitions & Shadows */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.5);
  --shadow-elevated: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
  --shadow-modal: 0 32px 64px -12px rgba(0, 0, 0, 0.85);
}

[data-theme="light"] {
  --bg-color: #f8fafc;
  --bg-color-rgb: 248, 250, 252;
  --surface: #ffffff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f1f5f9;
  --surface-container: #e2e8f0;
  --surface-container-high: #cbd5e1;
  --surface-container-highest: #94a3b8;
  --surface-dim: #f1f5f9;
  --surface-bright: #ffffff;

  --text-primary: #090a0f;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --accent: #4f46e5;
  --accent-rgb: 79, 70, 229;
  --accent-hover: #4338ca;
  --accent-surface: #eef2ff;
  --accent-container: #818cf8;

  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-dark: #090a0f;

  --tag-bg: #eef2ff;
  --tag-text: #3730a3;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.08);
  --shadow-elevated: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
  --shadow-modal: 0 32px 64px -12px rgba(0, 0, 0, 0.18);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section-padding {
  padding-top: 100px;
  padding-bottom: 100px;
}

@media (max-width: 768px) {
  .section-padding {
    padding-top: 64px;
    padding-bottom: 64px;
  }
}

/* ==========================================================================
   Accessibility: Skip-to-Content Link
   ========================================================================== */
.skip-to-content {
  position: fixed;
  top: -120px;
  left: 24px;
  background-color: var(--accent);
  color: #ffffff !important;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  z-index: 1000000;
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.skip-to-content:focus {
  top: 24px;
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* ==========================================================================
   Site Preloader
   ========================================================================== */
.site-preloader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--surface);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, visibility;
}

.site-preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-20px) scale(0.99);
}

.preloader-container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.preloader-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.preloader-brand {
  font-weight: 700;
  color: var(--text-primary);
}

.preloader-tag {
  color: var(--text-muted);
}

.preloader-middle {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preloader-counter {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text-primary);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.preloader-progress-track {
  width: 100%;
  height: 3px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.preloader-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  border-radius: var(--radius-full);
  transition: width 0.12s ease-out;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.5);
}

.preloader-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.preloader-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.preloader-pulse {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.preloader-pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.4);
  animation: pulseGreen 2s ease-in-out infinite;
}

@keyframes pulseGreen {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.8); opacity: 0; }
}

/* ==========================================================================
   Header & Navigation Bar
   ========================================================================== */
.navbar-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(var(--bg-color-rgb), 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.06);
  transition: all var(--transition-normal);
}

.navbar-fixed.scrolled {
  background-color: rgba(var(--bg-color-rgb), 0.94);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.brand-logo {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
  animation: pulse-subtle 2s infinite ease-in-out;
}

@keyframes pulse-subtle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  background-color: rgba(17, 19, 24, 0.65);
  padding: 6px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  position: relative;
  padding: 6px 4px;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  border-radius: 2px;
  transition: width var(--transition-fast);
}

.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-default);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  background-color: var(--surface);
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: var(--surface-container-low);
  border-color: var(--accent);
  color: var(--accent);
}

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

.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-default);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  background-color: var(--surface);
  cursor: pointer;
}

@media (max-width: 868px) {
  .nav-links,
  .nav-cta-desktop {
    display: none !important;
  }
  .hamburger-btn {
    display: flex !important;
  }
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 360px;
  height: 100vh;
  background-color: var(--surface);
  z-index: 150;
  box-shadow: var(--shadow-modal);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: right var(--transition-normal);
}

.mobile-nav-drawer.open {
  right: 0;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(9, 10, 15, 0.45);
  backdrop-filter: blur(6px);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mobile-nav-link {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--text-primary);
  transform: translateX(6px);
}

.mobile-nav-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* ==========================================================================
   Buttons & Action Utilities
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 12px 24px;
  border-radius: var(--radius-default);
  transition: all var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background-color: #ffffff;
  color: #0b0c10;
  border: 1px solid #ffffff;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  background-color: #e2e8f0;
  border-color: #e2e8f0;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background-color: var(--surface-container-low);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.btn-outline:hover {
  background-color: var(--surface-container-high);
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.25);
}

.btn-secondary {
  background-color: var(--surface-container);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--surface-container-high);
  color: #ffffff;
}

.btn-danger {
  background-color: #ba1a1a;
  color: #ffffff;
  border: 1px solid #ba1a1a;
}

.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.75rem;
  height: 34px;
  border-radius: var(--radius-sm);
}

.btn-sm .material-symbols-outlined {
  font-size: 1.05rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 0.9rem;
}

/* Button Spinner & Loading States */
.btn-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btnSpinnerRotate 0.65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  flex-shrink: 0;
  vertical-align: middle;
}

@keyframes btnSpinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn-loading-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: inherit;
  line-height: 1;
}

.btn-loading-wrapper span.btn-loading-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  animation: btnLabelPulse 1.2s ease-in-out infinite;
}

@keyframes btnLabelPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.btn.btn-is-loading {
  pointer-events: none !important;
  opacity: 0.92;
  cursor: wait !important;
  transform: none !important;
}

.btn.btn-is-success {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35) !important;
}

/* ==========================================================================
   Universal Form Controls & Inputs
   ========================================================================== */
.form-group {
  position: relative;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.form-input,
.form-textarea,
select.form-input {
  width: 100%;
  background-color: var(--surface-container-low);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.65;
  font-size: 0.875rem;
}

.form-input:focus,
.form-textarea:focus,
select.form-input:focus {
  background-color: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

select.form-input option {
  background-color: #12151e;
  color: #f8fafc;
  padding: 8px;
}

.form-feedback {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 6px;
  display: none;
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error select.form-input {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

.form-group.has-error .form-feedback {
  display: block;
}

@keyframes shakeAnimation {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake {
  animation: shakeAnimation 0.4s ease-in-out;
}

/* ==========================================================================
   Typography Helpers
   ========================================================================== */
.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-primary);
}

.headline-md {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.body-lg {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.body-md {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.body-sm {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.label-sm {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-tag,
.hero-tag {
  color: var(--accent);
  margin-bottom: 12px;
  display: inline-block;
}

/* ==========================================================================
   Universal Footer
   ========================================================================== */
.footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-copy a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.footer-copy a:hover {
  color: var(--accent);
}

.footer-heart {
  color: #ef4444;
  display: inline-block;
  margin: 0 2px;
}

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

.footer-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--accent);
}

.footer-analytics-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 5px 13px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  color: var(--text-muted);
  user-select: none;
}

.pulse-dot {
  width: 6.5px;
  height: 6.5px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
}

/* ==========================================================================
   Precision Cursor
   ========================================================================== */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-50%, -50%, 0);
  transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.75);
  opacity: 0;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate3d(-50%, -50%, 0);
  transition: width 0.3s ease, height 0.3s ease, opacity 0.2s ease;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.cursor-active .cursor-dot,
body.cursor-active .cursor-ring {
  opacity: 1;
}

body.cursor-hover .cursor-ring {
  width: 52px;
  height: 52px;
  background-color: rgba(var(--accent-rgb), 0.16);
  border-color: var(--accent);
}

@media (pointer: coarse), (max-width: 868px) {
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
}

/* ==========================================================================
   Floating Back to Top Button
   ========================================================================== */
.back-to-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.06);
}

/* ==========================================================================
   Universal Toast Notifications (Sleek Capsule Design)
   ========================================================================== */
.toast-notification {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(40px) scale(0.96);
  background-color: rgba(22, 27, 34, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #f8fafc;
  padding: 14px 28px;
  border-radius: var(--radius-pill, 9999px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  max-width: min(92vw, 640px);
  text-align: left;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.toast-success-icon,
.toast-icon {
  font-size: 1.25rem;
  line-height: 1;
  color: #10b981;
  flex-shrink: 0;
}

.toast-notification.toast-error .toast-icon,
.toast-notification.toast-error .toast-success-icon {
  color: #ef4444;
}

.toast-notification.toast-warning .toast-icon,
.toast-notification.toast-warning .toast-success-icon {
  color: #f59e0b;
}

.toast-notification.toast-info .toast-icon,
.toast-notification.toast-info .toast-success-icon {
  color: #6366f1;
}

.toast-message {
  color: inherit;
  word-break: break-word;
}

/* ==========================================================================
   Universal Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(9, 10, 15, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card,
.modal-content {
  position: relative;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--surface-container);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  cursor: pointer;
  padding: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.modal-close-btn:hover {
  background-color: var(--surface-container-high);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  transform: scale(1.08);
}

.modal-close-btn:active {
  transform: scale(0.95);
}

.modal-close-btn .material-symbols-outlined {
  font-size: 1.25rem;
  line-height: 1;
}

.modal-body {
  padding: 36px 32px 36px;
}

@media (max-width: 600px) {
  .modal-body {
    padding: 28px 20px 28px;
  }
}

/* ==========================================================================
   Floating Unsaved Changes Notification Bar
   ========================================================================== */
.unsaved-bar,
.modal-floating-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px) scale(0.96);
  background-color: rgba(18, 21, 30, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-pill, 9999px);
  padding: 10px 18px 10px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 158, 11, 0.15);
  z-index: 10005;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.unsaved-bar.active,
.modal-floating-bar.active {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.unsaved-bar-info,
.floating-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.unsaved-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.9);
  animation: pulseGlow 2s infinite ease-in-out;
  flex-shrink: 0;
}

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

.unsaved-bar-text,
.floating-bar-text {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
}

.unsaved-bar-actions,
.floating-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes barBounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  25% {
    transform: translateX(-50%) translateY(-14px) scale(1.06);
  }
  50% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  75% {
    transform: translateX(-50%) translateY(-6px) scale(1.02);
  }
}

.modal-floating-bar.bounce {
  animation: barBounce 0.45s ease-out both;
}

.modal-overlay.active .modal-card,
.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* ==========================================================================
   Global Responsive Breakpoints
   ========================================================================== */
@media (max-width: 640px) {
  :root {
    --margin-desktop: 18px;
    --section-gap: 64px;
    --gutter: 16px;
  }

  .container {
    padding-left: var(--margin-mobile);
    padding-right: var(--margin-mobile);
  }

  .nav-container {
    height: 62px;
  }

  .brand-logo {
    font-size: 1.15rem;
  }
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 48px 0;
  background-color: var(--surface);
  position: relative;
  z-index: 10;
  margin-top: 40px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}

.footer-copy:hover {
  opacity: 1;
}

.footer-copy a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-copy a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-heart {
  color: #ef4444;
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px;
  transition: transform var(--transition-fast);
}

.footer-copy:hover .footer-heart {
  animation: heartBeating 0.8s ease-in-out infinite;
}

@keyframes heartBeating {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.28); }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.footer-analytics-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface-container);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.online-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-weight: 600;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: livePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.analytics-divider {
  color: var(--text-muted);
  opacity: 0.5;
}

.total-visits-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Floating Back to Top Button
   ========================================================================== */
.back-to-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background-color var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast);
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.35);
}
