/* =========================================================
   PRACTICEGRID — ROOT DESIGN SYSTEM (SAAS DARK)
========================================================= */

/* ============================================================================================================================
   1. DESIGN TOKENS
============================================================================================================================ */
:root {

  /* COLORS — BASE */
  --bg-primary: #000000;
  --bg-secondary: #000000;
   --danger: #ef4444;
  --success: #22c55e;
  /* BRAND (FROM LOGO) */
  --primary: #6366f1;             /* Indigo */
  --secondary: #3b82f6;           /* Blue */
  --accent: #8b5cf6;              /* Violet */
  /* TEXT */
  --text-primary: #ffffff;
  --text-secondary: #cbd5f5;
  --text-muted: #94a3b8;
  /* BORDERS */
  --border-subtle: rgba(255,255,255,0.08);
  --border-default: rgba(255,255,255,0.14);
  --border-strong: rgba(99,102,241,0.35);
  /* GRADIENTS (ONLY FOR TEXT / CTA) */
  --gradient-primary: linear-gradient(90deg, #ffffff, #c4b5fd, #93c5fd);
  --gradient-accent: linear-gradient(90deg, #6366f1, #3b82f6);
  --gradient-success: linear-gradient(90deg,#4ade80,#22c55e);
  --gradient-danger: linear-gradient(90deg,#f87171,#ef4444);
  --gradient-brand: linear-gradient(135deg,#6366f1,#3b82f6);
  /* GLOW */
  --glow-primary: none;
  --glow-soft: none;
  --glow-radial: radial-gradient(circle, rgba(255,255,255,0.25), transparent 60%);
  /* RADIUS */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  /* SPACING SYSTEM */
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-full: 999px;
  /* TYPOGRAPHY */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-xs: 10px;
  --font-sm: 12px;
  --font-md: 14px;
  --font-lg: 18px;
  --font-xl: 24px;
  /* SHADOW */
  --shadow-soft:
    0 10px 30px rgba(0,0,0,0.4);
  --shadow-elevated:
    0 30px 80px rgba(0,0,0,0.6),
    0 0 40px rgba(99,102,241,0.12);
  /* TRANSITIONS */
  --transition-fast: 0.2s ease;
  --transition-base: 0.4s ease;
  --transition-slow: 0.6s ease;
  /* LAYOUT */
  --container: 1200px;
  --nav-height: 80px;
  --grid-offset: calc((100vw - var(--container)) / 2);
  /* Z INDEX */
  --z-lower: -1;
  --z-base: 0;
  --z-up: 1;
  --z-navbar: 100;
  --z-overlay: 900;
  --z-drawer: 1000;
  --z-max: 9999;
}
/* ============================================================================================================================
   2. GLOBAL RESET
============================================================================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  height: 100vh;
  width: 1px;
  background: var(--border-default);
  box-shadow: none;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: var(--z-overlay);
  opacity: 0.7;
  transform: translateZ(0);
}
body::before {
  left: var(--grid-offset);
}
body::after {
  right: var(--grid-offset);
}
/* ============================================================================================================================
   3. TYPOGRAPHY (STRIPE STYLE)
============================================================================================================================ */
h1, h2, h3, h4 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}
h1 {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
}
h3 {
  font-size: var(--font-lg);
  font-weight: 600;
}
p {
  font-size: var(--font-md);
  line-height: 1.7;
}
/* ============================================================================================================================
   4. LAYOUT SYSTEM
============================================================================================================================ */
.viewport-safe {
  min-height: 100vh;
  display: flex;
  align-items: center;
}
.viewport-safe .section-frame {
  width: 100%;
}
.section {
  padding-block: clamp(12px, 3vw, 24px);
  opacity: 0;
  position: relative;
  z-index: 3;
  scroll-margin-top: var(--nav-height);
  transform: translateY(40px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow);
}
.section.visible {
  opacity: 1;
  transform: translateY(0);
}
.section-grid {
  position: relative;
  z-index: 0;
}
.section-grid::before,
.section-grid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-default);
  opacity: 0.4;
}
.section-grid::before {
  left: var(--grid-offset);
}
.section-grid::after {
  right: var(--grid-offset);
}
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-left: clamp(16px, 4vw, 32px);
  padding-right: clamp(16px, 4vw, 32px);
}
.section-frame {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 1;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-default);
  transition: transform var(--transition-base), border-color var(--transition-fast);
  will-change: transform;
  transform: none !important;
  backface-visibility: hidden;
  padding: clamp(12px, 2vw, 24px);
}
.section-frame > * {
  width: 100%;
}
.section-inner {
  padding-inline: clamp(16px, 2vw, 28px);
  padding-block: var(--space-md);
  width: 100%;
}
/* ============================================================================================================================
   5. LINKS (NO UNDERLINE, NO COLOR CHANGE)
============================================================================================================================ */
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: inherit;
}

/* ============================================================================================================================
  6. BUTTON SYSTEM
============================================================================================================================ */
.btn-primary,
.btn-outline {
  height: calc(var(--space-xl) + var(--space-lg));   
  padding: 0 var(--space-md);
  font-size: var(--font-sm);
  border-radius: var(--radius-xs);
  font-weight: 600;
}
/* PRIMARY */
.btn-primary {
  background: var(--gradient-accent);
  color: var(--text-primary);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}
/* glow */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: var(--glow-radial);
  transition: var(--transition-base);
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}
.btn-primary:hover::after {
  opacity: 1;
}
.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
/* arrow container */
.icon-arrow {
  width: var(--space-md);
  height: var(--space-md);
  position: relative;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}

/* arrow shaft */
.icon-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 2.5px;
  width: 0;
  opacity: 0;
  height: 1.6px;
  background: var(--text-primary);
  box-shadow: 1px 0 0 var(--text-primary);
  transform: translateY(-50%) translateZ(0);
  transform-origin: right center;
  transition: width 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.2s ease;
  will-change: transform;
}
/* arrow head */
.icon-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6.5px;
  height: 6.5px;
  border-top: 1.6px solid #fff;
  border-right: 1.6px solid #fff;
  transform: translateY(-50%) rotate(45deg);
  opacity: 0.9;
  will-change: transform;
}
/* HOVER = Stripe motion */
.btn-arrow:hover .icon-arrow::before {
  width: 6px;
  opacity: 1;
}
.btn-arrow:hover .icon-arrow {
  transform: translateX(1.5px);
}
/* OUTLINE */
.btn-outline {
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-primary);
  transition: var(--transition-base);
}
.btn-outline:hover {
  border-color: var(--border-strong);
  box-shadow: var(--glow-soft);
  transform: translateY(-1px);
}
/* ============================================================================================================================
   7. GLASS BORDER SYSTEM (NO BG)
============================================================================================================================ */
.card,
.glass,
.section-box {
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: var(--transition-base);
}
/* hover glow */
.card:hover,
.glass:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}
/* ============================================================================================================================
   8. INPUT SYSTEM
============================================================================================================================ */
input,
textarea {
  width: 100%;
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-base);
}
input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--glow-soft);
}
/* ============================================================================================================================
   9. ICON SYSTEM
============================================================================================================================ */
.icon {
  width: var(--space-lg);
  height: var(--space-lg);
  stroke-width: 1.5;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.icon:hover {
  color: var(--text-primary);
}

/* ============================================================================================================================
   10. IMAGE SYSTEM
============================================================================================================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}
.img-glow {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  transition: var(--transition-base);
  overflow: hidden;
}
.img-glow:hover {
  transform: translateY(-6px) scale(1.02);
}
.img-glow img {
  transition: var(--transition-base);
}
.img-glow:hover img {
  transform: scale(1.05);
}

/* ============================================================================================================================
   11. UTILITIES
============================================================================================================================ */

.center {
  text-align: center;
}
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.stack-sm > * + * { margin-top: var(--space-sm); }
.stack-md > * + * { margin-top: var(--space-md); }
.stack-lg > * + * { margin-top: var(--space-lg); }

/* ============================================================================================================================
   12. SCROLLBAR (PREMIUM)
============================================================================================================================ */

::-webkit-scrollbar {
  width: var(--space-sm);
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================================================================================================
   13. NAVBAR
============================================================================================================================ */
@media (min-width: 993px) {
  .nav-menu ul {
    display: flex;
    gap: 32px;
  }
}
.mobile-nav-header,
.nav-close {
   display: none;
}
.nav-menu {
  z-index: var(--z-max);
}
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
  transition: all var(--transition-base);
  z-index: var(--z-max);
}
.navbar .container {
  max-width: var(--container);
  padding: 0 var(--space-lg);
}
/* SCROLL STATE (Stripe style solid glass) */
.navbar.scrolled {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
}
.navbar-inner {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
}
/* LOGO */
.logo img {
  height: calc(var(--space-xl) * 2);
}
/* NAV LINKS */
.nav-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: calc(var(--space-xl) + var(--space-sm));
}
.nav-menu a {
  position: relative;
  font-size: var(--font-md);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
}
/* STRIPE HOVER EFFECT */
.nav-menu a:hover {
  color: var(--text-primary);
}
.nav-menu a:hover::after {
  width: 100%;
}
/* CTA BUTTON ALIGNMENT */
.nav-menu .btn-primary {
  margin-left: var(--space-md);
}
.nav-toggle {
  display: none;
}
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-base);
  z-index: var(--z-overlay);
}
.nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}
body.menu-open {
  overflow: hidden;
}
/* MOBILE NAV (STRIPE DRAWER) */
@media (max-width: 768px) {
  .navbar .container {
    padding: 0 16px;
   }
   .logo {
    justify-self: start;
  }
   .logo img {
    height: 28px;
  }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-sm);
    margin-right: 0px;
    cursor: pointer;
    justify-self: end;
    z-index: var(--z-drawer);
   
  }
  .nav-toggle span {
    width: var(--space-lg);
    height: 1px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-base);
  }
   .navbar-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    height: 56px;      /* 🔥 from 72 → 56 */
    padding: var(--space-sm) 0;
  }
/* Hamburger → X */
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  /* NAVBAR (FLOATING STRIPE STYLE) */
}
   .nav-menu ul {
    display: block;
    width: 100%;
  }
  .navbar {
    border-radius: 0px;
    margin: 0px;
    border: 1px solid var(--border-default);
  }
  /* FULLSCREEN MENU */
  .nav-menu {
    position: fixed;
    inset: 0;
    left: 0;
    right: 0;
    width: 100vw; /* ✅ FORCE FULL WIDTH */
    max-width: 100vw;
    height: 100dvh;
    background: var(--bg-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateY(-100%);
    transition: transform 0.4s ease;
    z-index: var(--z-max);
  }
  .nav-menu.active {
    transform: translateY(0);
  }
  /* HEADER */
  .mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl);
  }
  .nav-close {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--border-subtle);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* LINKS */
  .mobile-nav-links {
    flex: 1;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .mobile-nav-links li {
    padding: 0 20px;
    border-bottom: 1px dashed var(--border-subtle);
  }
  .mobile-nav-links a {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) 0;
    font-size: var(--font-lg);
    font-weight: 450;
    color: #fff;
  }
  .mobile-nav-links span {
    color: var(--primary);
    font-size: var(--font-md);
  }
  .mobile-nav-cta {
    padding: var(--space-xl);
    justify-self: center;
  }
  .nav-cta {
  display: flex;
  justify-content: center;
  }
  .nav-cta .btn-primary {
    width: 100%;
    height: 32px;
    padding: 0 var(--space-md);
    font-size: 12px;
    border-radius: 8px;
    width: auto;
  }
}
/* ============================================================================================================================
 14. FOOTER
============================================================================================================================ */

/* STRUCTURE + SPACING */
.footer .container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-xl);
}
.footer {
  position: relative;
  padding: var(--space-xl) 0 var(--space-md);
  z-index: 0;
}
.footer::before {
  content: "";
  position: absolute;
  left: var(--grid-offset);
  right: var(--grid-offset);
  top: 0;
  bottom: 0;
  pointer-events: none;
}
.footer a {
  text-decoration: none;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.2fr 0.8fr;
  gap: var(--space-xl);
  align-items: flex-start;
}
/* BRAND COLUMN (LOGO + TRUST) */
.footer-brand {
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.footer-brand img {
  height: calc(var(--space-xl) * 2);
  width: auto;
  object-fit: contain;
  margin-bottom: var(--space-sm);
  margin: 0;
}
.footer-brand p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* SOCIAL ICONS (CLEAN + PREMIUM) */
.footer-social {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}
.footer-social img {
  width: calc(var(--space-lg) + var(--space-sm));
  height: calc(var(--space-lg) + var(--space-sm));
  opacity: 0.85;
  transition: var(--transition-fast);
}
.footer-social img:hover {
  opacity: 1;
  transform: translateY(-2px);
}
/* COLUMN HEADINGS (HIERARCHY FIX) */
.footer h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
/* LINKS (CONVERSION FOCUSED) */
.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.footer-links a {
  display: block;
  width: fit-content;
}
.footer-links a,
.footer-contact a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
}
.footer-links a:hover,
.footer-contact a:hover {
  color: var(--text-primary);
}
/* subtle SaaS underline */
.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0%;
  height: 1px;
  background: var(--gradient-primary);
  transition: width var(--transition-fast);
  display: none;
}
.footer-links a:hover::after {
  width: 100%;
}
/* CONTACT CARDS (HIGH IMPACT) */
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 340px;
  align-items: center;
}
.footer-contact-item {
  width: fit-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}
.footer-contact-item:hover {
  background: rgba(99,102,241,0.12);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}
.footer-contact-item span {
  line-height: 1;
}
/* ICON SYSTEM FIX */
.footer-contact-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer-contact-item svg {
  width: var(--space-lg);
  height: var(--space-lg);
  stroke: var(--primary);
}
/* HIPAA / TRUST BADGE */
.footer-hipaa {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}
.footer-brand {
  max-width: 260px;
}
.footer-social {
  justify-content: flex-start;
}
.footer-hipaa img {
  height: calc(var(--space-xl) * 2.5);
  width: auto;
  object-fit: contain;
  margin-bottom: var(--space-sm);
}
.hipaa-title {
  color: var(--accent);
}
.hipaa-sub {
  color: var(--accent);
  opacity: 0.7;
}
/* DIVIDER (PREMIUM TOUCH) */
.footer::after {
  height: 1px;
  opacity: 0.6;
}
/* FOOTER BOTTOM */
.footer-bottom {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-default);
  font-size: var(--font-md);
  text-align: center;
  width: 100%;
  display: block;
}
/* RESPONSIVE (CRITICAL) */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
  .footer-contact {
    max-width: 100%;
  }
}
@media (max-width: 768px) {
  .footer {
    padding: var(--space-lg) 0;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }
  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 100%;   /* 🔥 override 260px constraint */
    width: 100%;
  }
  .footer-brand,
  .footer-contact,
  .footer-hipaa {
    align-items: center;
  }
  .footer-contact-item {
    justify-content: center;
  }
  .footer-contact-item span {
  white-space: nowrap;
   }
  .footer-social {
    justify-content: center;
    align-items: center;
  }
  .footer .container {
    padding: 0 var(--space-sm);
  }
  .footer-links a {
    width: 100%;
  }
}
/* ============================================================================================================================
 15. COMMON RESPONSIVE (PERFORMANCE BASED)
============================================================================================================================ */
/* Reduce heavy effects on low-end devices */
@media (max-width: 768px) {
  .img-glow:hover img {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  .section {
    opacity: 1 !important;
    transform: none !important;
  }
}
/* ======================================================================
   16. GLOBAL RESPONSIVE SYSTEM (NON-NAV / NON-FOOTER)
====================================================================== */
/* LARGE DEVICES (≤1280px) */
@media (max-width: 1280px) {
  :root {
    --container: 1100px;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* TABLETS (≤1024px) */
@media (max-width: 1024px) {
  :root {
    --container: 960px;
  }
  /* TYPOGRAPHY */
  h1 {
    font-size: clamp(28px, 4vw, 40px);
  }
  h2 {
    font-size: clamp(22px, 3vw, 30px);
  }
  p {
    font-size: 14px;
  }
  h1, h2, h3, h4 {
    overflow-wrap: break-word;
  }
  /* LAYOUT */
  .section {
    padding-block: var(--space-lg);
  }
  .section-frame {
    padding: var(--space-lg);
  }
  .section-inner {
    padding-inline: var(--space-md);
  }
  /* GRID SYSTEM */
  .grid-2 {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
  /* CARDS */
  .card,
  .glass,
  .section-box {
    border-radius: var(--radius-md);
  }
  .btn-primary,
  .btn-outline {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* MOBILE (≤768px) */
@media (max-width: 768px) {
  :root {
    --container: 100%;
    --space-xl: 20px;
    --space-2xl: 28px;
    --nav-height: 56px;
  }
  /* REMOVE SIDE GRID LINES */
  body::before,
  body::after {
    display: none;
  }
  .section-grid::before,
  .section-grid::after {
    display: none;
  }
  /* TYPOGRAPHY */
  h1 {
    font-size: 26px;
    line-height: 1.2;
  }
  h2 {
    font-size: 22px;
  }
  h3 {
    font-size: 16px;
  }
  p {
    font-size: 14px;
    line-height: 1.6;
  }
  /* LAYOUT */
  .viewport-safe {
    min-height: auto;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }
  .section {
    padding-block: var(--space-lg);
    scroll-margin-top: 60px;
  }
  .section-frame {
    padding: var(--space-md);
    border-radius: var(--radius-sm);
  }
  .section-inner {
    padding-inline: 0;
  }
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  /* GRID SYSTEM */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  /* BUTTONS */
  .btn-primary,
  .btn-outline {
    width: 100%;
    height: 40px;
    font-size: 13px;
  }
  /* CARDS */
  .card,
  .glass,
  .section-box {
    padding: var(--space-md);
  }
  /* IMAGES */
  .img-glow {
    border-radius: var(--radius-md);
  }
}

/* SMALL MOBILE (≤480px) */
@media (max-width: 480px) {
  :root {
    --space-lg: 12px;
    --space-xl: 16px;
  }
  h1 {
    font-size: 22px;
  }
  h2 {
    font-size: 18px;
  }
  p {
    font-size: 13px;
  }
  .section {
    padding-block: var(--space-md);
  }
  .btn-primary,
  .btn-outline {
    height: 38px;
    font-size: 12px;
  }
}

/* ULTRA SMALL (≤360px) */
@media (max-width: 360px) {
  h1 {
    font-size: 20px;
  }
  h2 {
    font-size: 16px;
  }
  p {
    font-size: 12px;
  }
}

/* ======================================================================
   17. PERFORMANCE + TOUCH OPTIMIZATION
====================================================================== */
/* Disable hover effects on touch devices */
@media (hover: none) {
  .card:hover,
  .glass:hover,
  .img-glow:hover {
    transform: none;
  }
  .btn-primary:hover {
    transform: none;
    filter: none;
  }
  .section-frame:hover {
    transform: none !important;
  }
}
/* Reduce animations on low power devices */
@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .card,
  .glass,
  .img-glow {
    transition: none !important;
  }
}

/* ======================================================================
   18. FLEX UTILITIES (RESPONSIVE)
====================================================================== */

.flex {
  display: flex;
}
.flex-wrap {
  flex-wrap: wrap;
}
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 768px) {
  .flex-stack {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ======================================================================
   19. SPACING FIXES FOR MOBILE STACKING
====================================================================== */

@media (max-width: 768px) {
  .stack-lg > * + * {
    margin-top: var(--space-md);
  }
  .stack-md > * + * {
    margin-top: var(--space-sm);
  }
}
