/* ============================================================
   Claros AI — Design System
   Fonts: Plus Jakarta Sans (headings) + Inter (body)
   ============================================================ */

/* ── Custom Properties ────────────────────────────────────── */
:root {
  /* Brand Colors */
  --color-brand-50:  #eef2ff;
  --color-brand-100: #e0e7ff;
  --color-brand-200: #c7d2fe;
  --color-brand-300: #a5b4fc;
  --color-brand-400: #818cf8;
  --color-brand-500: #6366f1;
  --color-brand-600: #4f46e5;
  --color-brand-700: #4338ca;
  --color-brand-800: #3730a3;
  --color-brand-900: #312e81;
  --color-brand-950: #1e1b4b;

  /* Accent (emerald) */
  --color-accent-400: #34d399;
  --color-accent-500: #10b981;
  --color-accent-600: #059669;

  /* Neutrals */
  --color-neutral-0:   #ffffff;
  --color-neutral-50:  #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2937;
  --color-neutral-900: #111827;
  --color-neutral-950: #030712;

  /* Semantic aliases */
  --color-bg:           var(--color-neutral-0);
  --color-bg-subtle:    var(--color-neutral-50);
  --color-bg-muted:     var(--color-neutral-100);
  --color-surface:      var(--color-neutral-0);
  --color-border:       var(--color-neutral-200);
  --color-border-muted: var(--color-neutral-100);

  --color-text:         var(--color-neutral-900);
  --color-text-muted:   var(--color-neutral-600);
  --color-text-subtle:  var(--color-neutral-400);
  --color-text-inverse: var(--color-neutral-0);

  --color-primary:      var(--color-brand-600);
  --color-primary-hover: var(--color-brand-700);
  --color-primary-light: var(--color-brand-50);

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Type Scale (Major Third — 1.25) */
  --text-xs:   0.64rem;   /* ~10.2px */
  --text-sm:   0.8rem;    /* 12.8px  */
  --text-base: 1rem;      /* 16px    */
  --text-md:   1.125rem;  /* 18px    */
  --text-lg:   1.25rem;   /* 20px    */
  --text-xl:   1.5625rem; /* 25px    */
  --text-2xl:  1.953rem;  /* ~31px   */
  --text-3xl:  2.441rem;  /* ~39px   */
  --text-4xl:  3.052rem;  /* ~49px   */
  --text-5xl:  3.815rem;  /* ~61px   */

  /* Font Weights */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold: 600;
  --fw-bold:    700;
  --fw-extrabold: 800;

  /* Line Heights */
  --lh-tight:   1.2;
  --lh-snug:    1.375;
  --lh-normal:  1.6;
  --lh-relaxed: 1.75;

  /* Spacing Scale (base-4, rem) */
  --space-1:  0.25rem;  /*  4px */
  --space-2:  0.5rem;   /*  8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* Section Spacing */
  --section-sm:  var(--space-12);
  --section-md:  var(--space-20);
  --section-lg:  var(--space-32);

  /* Border Radius */
  --radius-sm:  0.25rem;  /* 4px  */
  --radius-md:  0.5rem;   /* 8px  */
  --radius-lg:  0.75rem;  /* 12px */
  --radius-xl:  1rem;     /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  --shadow-brand: 0 8px 24px -4px rgba(79, 70, 229, 0.35);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   300ms ease;

  /* Layout */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1440px;

  --nav-height: 64px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* ── Background Grain Texture ─────────────────────────────── */
/*
  Subtle noise texture applied via a generated SVG pattern.
  Uses a pseudo-element on <body> so it never interferes with content.
*/
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-text);
  letter-spacing: -0.025em;
}

h1 { font-size: var(--text-5xl); font-weight: var(--fw-extrabold); }
h2 { font-size: var(--text-4xl); font-weight: var(--fw-bold); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl);  font-weight: var(--fw-semibold); }
h6 { font-size: var(--text-lg);  font-weight: var(--fw-semibold); }

p { max-width: 72ch; }

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-hover); }

strong { font-weight: var(--fw-semibold); }
small  { font-size: var(--text-sm); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-muted);
  color: var(--color-brand-700);
  padding: 0.125em 0.35em;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-neutral-950);
  color: var(--color-neutral-200);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  line-height: var(--lh-relaxed);
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

blockquote {
  border-left: 3px solid var(--color-brand-300);
  padding-left: var(--space-6);
  font-style: italic;
  color: var(--color-text-muted);
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--sm  { max-width: var(--container-sm); }
.container--md  { max-width: var(--container-md); }
.container--lg  { max-width: var(--container-lg); }
.container--2xl { max-width: var(--container-2xl); }

/* ── Section Spacing ──────────────────────────────────────── */
.section {
  padding-block: var(--section-md);
}

.section--sm { padding-block: var(--section-sm); }
.section--lg { padding-block: var(--section-lg); }

.section--bg-subtle { background-color: var(--color-bg-subtle); }
.section--bg-muted  { background-color: var(--color-bg-muted); }
.section--bg-brand  {
  background-color: var(--color-brand-950);
  color: var(--color-text-inverse);
}
.section--bg-brand h1,
.section--bg-brand h2,
.section--bg-brand h3,
.section--bg-brand h4,
.section--bg-brand h5,
.section--bg-brand h6 {
  color: var(--color-neutral-0);
}

/* ── Navigation ───────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}
.nav-logo img {
  height: 28px;
  width: auto;
}
.nav-logo:hover { opacity: 0.8; }

.nav-links {
  display: flex;
  gap: var(--space-8);
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-neutral-700);
  font-weight: var(--fw-medium);
  font-size: var(--text-base);
  transition: color var(--transition-fast);
  letter-spacing: 0.01em;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-primary);
}

/* Mobile nav toggle — hidden by default, shown in media query */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-neutral-700);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--color-neutral-950);
  color: var(--color-neutral-400);
  padding-block: var(--space-10);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-brand a {
  display: inline-block;
}

.footer-brand img {
  height: 24px;
  width: auto;
}

.footer-copy {
  font-size: var(--text-sm);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.footer-links a {
  color: var(--color-neutral-300);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--color-neutral-0); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary */
.btn--primary {
  background-color: #4ec1b8;
  color: var(--color-neutral-0);
  border-color: #4ec1b8;
  box-shadow: 0 8px 24px -4px rgba(78, 193, 184, 0.35);
}
.btn--primary:hover:not(:disabled) {
  background-color: #3da99f;
  border-color: #3da99f;
  color: var(--color-neutral-0);
  box-shadow: 0 8px 20px -4px rgba(78, 193, 184, 0.45);
}

/* Secondary */
.btn--secondary {
  background-color: var(--color-neutral-0);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--secondary:hover:not(:disabled) {
  background-color: var(--color-primary-light);
  color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

/* Ghost */
.btn--ghost {
  background-color: transparent;
  color: var(--color-neutral-700);
  border-color: transparent;
}
.btn--ghost:hover:not(:disabled) {
  background-color: var(--color-bg-muted);
  color: var(--color-text);
}

/* Outline on dark backgrounds — WCAG AA compliant */
.btn--outline-light {
  background-color: transparent;
  color: var(--color-neutral-0);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}
.btn--outline-light:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-neutral-0);
  border-color: var(--color-neutral-0);
}

/* Neutral */
.btn--neutral {
  background-color: var(--color-neutral-100);
  color: var(--color-neutral-800);
  border-color: var(--color-neutral-200);
}
.btn--neutral:hover:not(:disabled) {
  background-color: var(--color-neutral-200);
  border-color: var(--color-neutral-300);
}

/* Danger */
.btn--danger {
  background-color: #dc2626;
  color: var(--color-neutral-0);
  border-color: #dc2626;
}
.btn--danger:hover:not(:disabled) {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: var(--color-neutral-0);
}

/* Sizes */
.btn--sm {
  font-size: var(--text-xs);
  padding: 0.4rem var(--space-3);
  border-radius: var(--radius-sm);
}
.btn--lg {
  font-size: var(--text-base);
  padding: 0.875rem var(--space-8);
  border-radius: var(--radius-lg);
}
.btn--xl {
  font-size: var(--text-md);
  padding: 1rem var(--space-10);
  border-radius: var(--radius-lg);
}

/* Full width */
.btn--block { width: 100%; }

/* Icon only */
.btn--icon {
  padding: 0.625rem;
  aspect-ratio: 1;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

.card--flat {
  box-shadow: none;
}

.card--raised {
  box-shadow: var(--shadow-xl);
}

.card--brand {
  background: linear-gradient(135deg, var(--color-brand-600) 0%, var(--color-brand-800) 100%);
  border-color: var(--color-brand-700);
  color: var(--color-neutral-0);
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.25em 0.6em;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  line-height: 1;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge--brand {
  background: var(--color-brand-100);
  color: var(--color-brand-700);
}
.badge--accent {
  background: #d1fae5;
  color: #065f46;
}
.badge--neutral {
  background: var(--color-neutral-100);
  color: var(--color-neutral-700);
}

/* ── Utility Classes ──────────────────────────────────────── */

/* Text sizes */
.text-xs   { font-size: var(--text-xs);   }
.text-sm   { font-size: var(--text-sm);   }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md);   }
.text-lg   { font-size: var(--text-lg);   }
.text-xl   { font-size: var(--text-xl);   }
.text-2xl  { font-size: var(--text-2xl);  }
.text-3xl  { font-size: var(--text-3xl);  }
.text-4xl  { font-size: var(--text-4xl);  }
.text-5xl  { font-size: var(--text-5xl);  }

/* Text colors */
.text-muted   { color: var(--color-text-muted);   }
.text-subtle  { color: var(--color-text-subtle);  }
.text-brand   { color: var(--color-primary);      }
.text-inverse { color: var(--color-text-inverse); }
.text-accent  { color: var(--color-accent-500);   }

/* Font weights */
.fw-regular  { font-weight: var(--fw-regular);  }
.fw-medium   { font-weight: var(--fw-medium);   }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold     { font-weight: var(--fw-bold);     }
.fw-extrabold { font-weight: var(--fw-extrabold); }

/* Font families */
.font-heading { font-family: var(--font-heading); }
.font-body    { font-family: var(--font-body);    }
.font-mono    { font-family: var(--font-mono);    }

/* Text alignment */
.text-left   { text-align: left;   }
.text-center { text-align: center; }
.text-right  { text-align: right;  }

/* Display */
.d-block        { display: block;        }
.d-inline       { display: inline;       }
.d-inline-block { display: inline-block; }
.d-flex         { display: flex;         }
.d-inline-flex  { display: inline-flex;  }
.d-grid         { display: grid;         }
.d-none         { display: none;         }

/* Flex utilities */
.flex-row     { flex-direction: row;    }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap;        }
.flex-nowrap  { flex-wrap: nowrap;      }
.flex-1       { flex: 1;               }
.flex-auto    { flex: auto;            }
.flex-none    { flex: none;            }

.items-start    { align-items: flex-start;    }
.items-center   { align-items: center;        }
.items-end      { align-items: flex-end;      }
.items-stretch  { align-items: stretch;       }

.justify-start    { justify-content: flex-start;    }
.justify-center   { justify-content: center;        }
.justify-end      { justify-content: flex-end;      }
.justify-between  { justify-content: space-between; }
.justify-around   { justify-content: space-around;  }

/* Gap */
.gap-1  { gap: var(--space-1);  }
.gap-2  { gap: var(--space-2);  }
.gap-3  { gap: var(--space-3);  }
.gap-4  { gap: var(--space-4);  }
.gap-6  { gap: var(--space-6);  }
.gap-8  { gap: var(--space-8);  }
.gap-12 { gap: var(--space-12); }

/* Padding */
.p-0  { padding: 0;              }
.p-2  { padding: var(--space-2); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }

.px-4 { padding-inline: var(--space-4); }
.px-6 { padding-inline: var(--space-6); }
.px-8 { padding-inline: var(--space-8); }
.py-4 { padding-block: var(--space-4);  }
.py-6 { padding-block: var(--space-6);  }
.py-8 { padding-block: var(--space-8);  }

/* Margin */
.m-0    { margin: 0;           }
.mx-auto { margin-inline: auto; }
.mt-4   { margin-top: var(--space-4);  }
.mt-6   { margin-top: var(--space-6);  }
.mt-8   { margin-top: var(--space-8);  }
.mb-4   { margin-bottom: var(--space-4);  }
.mb-6   { margin-bottom: var(--space-6);  }
.mb-8   { margin-bottom: var(--space-8);  }

/* Width / Height */
.w-full  { width: 100%;  }
.h-full  { height: 100%; }
.w-auto  { width: auto;  }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto;   }

/* Borders */
.rounded-sm   { border-radius: var(--radius-sm);   }
.rounded-md   { border-radius: var(--radius-md);   }
.rounded-lg   { border-radius: var(--radius-lg);   }
.rounded-xl   { border-radius: var(--radius-xl);   }
.rounded-2xl  { border-radius: var(--radius-2xl);  }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed;    }
.sticky   { position: sticky;   }

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Skip Navigation Link ─────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-6);
  background: var(--color-neutral-950);
  color: var(--color-neutral-0);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ── Focus Styles ─────────────────────────────────────────── */
:focus-visible {
  outline: 2.5px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Ensure focus ring is visible on dark-background sections */
.hero :focus-visible,
.section--bg-brand :focus-visible {
  outline-color: var(--color-neutral-0);
}

/* ── Main Content ─────────────────────────────────────────── */
.site-main {
  flex: 1;
}

/* ── Dividers ─────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-8);
}

/* ── Responsive Breakpoints ───────────────────────────────── */
/*
  Breakpoints:
  --bp-sm:  640px  (landscape phones)
  --bp-md:  768px  (tablets)
  --bp-lg:  1024px (small laptops)
  --bp-xl:  1280px (desktops)
  --bp-2xl: 1536px (large screens)
*/

@media (max-width: 1024px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  h4 { font-size: var(--text-xl);  }

  .section     { padding-block: var(--space-16); }
  .section--sm { padding-block: var(--space-10); }
  .section--lg { padding-block: var(--space-20); }
}

@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl);  }
  h4 { font-size: var(--text-lg);  }

  .container { padding-inline: var(--space-4); }

  .section     { padding-block: var(--space-12); }
  .section--sm { padding-block: var(--space-8);  }
  .section--lg { padding-block: var(--space-16); }

  /* Stack nav links on mobile */
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-neutral-0);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-6);
    gap: var(--space-1);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding-block: var(--space-3);
    font-size: var(--text-base);
    border-bottom: 1px solid var(--color-border-muted);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  h1 { font-size: var(--text-2xl); letter-spacing: -0.02em; }
  h2 { font-size: var(--text-xl);  }
  h3 { font-size: var(--text-lg);  }

  .btn--xl {
    font-size: var(--text-base);
    padding: 0.875rem var(--space-6);
  }

  .card {
    padding: var(--space-6);
  }
}

/* ── Interactions & Motion ────────────────────────────────── */

/* Sticky nav: stronger presence once page is scrolled */
.site-nav {
  transition:
    background-color var(--transition-slow),
    box-shadow var(--transition-slow);
}

.site-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
}

/* Mobile nav toggle: hamburger → X animation */
.nav-toggle {
  transition: color var(--transition-fast);
}

.nav-toggle .line-mid {
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  transform-origin: center;
}

.nav-toggle .line-top,
.nav-toggle .line-bot {
  transition: transform var(--transition-base);
  transform-origin: center;
}

.nav-toggle.is-active .line-mid {
  opacity: 0;
}

.nav-toggle.is-active .line-top {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle.is-active .line-bot {
  transform: translateY(-5px) rotate(-45deg);
}

/* Mobile nav menu: slide-down entrance */
@media (max-width: 768px) {
  .nav-links {
    transform: translateY(-8px);
    opacity: 0;
    transition:
      opacity var(--transition-base),
      transform var(--transition-base);
    pointer-events: none;
  }

  .nav-links.is-open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* Card hover lift — applies globally to all .card elements */
.card {
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base),
    border-color var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-3px);
}

/* Nav links: sliding underline micro-interaction */
.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
  border-radius: 1px;
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ── Scroll Reveal ────────────────────────────────────────── */
/*
  Elements with .reveal start invisible and slide up.
  .is-visible is added by IntersectionObserver.
  The entire feature is skipped when prefers-reduced-motion fires
  (the JS never adds .reveal, so elements are always visible).
*/
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger sibling reveals inside grids */
.features-grid .reveal:nth-child(2),
.specialties-grid .reveal:nth-child(2),
.steps-grid .reveal:nth-child(2) {
  transition-delay: 0.08s;
}

.features-grid .reveal:nth-child(3),
.specialties-grid .reveal:nth-child(3),
.steps-grid .reveal:nth-child(3) {
  transition-delay: 0.16s;
}

.features-grid .reveal:nth-child(4),
.specialties-grid .reveal:nth-child(4) {
  transition-delay: 0.24s;
}

.features-grid .reveal:nth-child(5),
.specialties-grid .reveal:nth-child(5) {
  transition-delay: 0.32s;
}

.features-grid .reveal:nth-child(6),
.specialties-grid .reveal:nth-child(6) {
  transition-delay: 0.40s;
}

/* Safety net: never hide content if JS fails to run */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  body::before { display: none; }
  .site-nav,
  .site-footer { display: none; }
  .btn { box-shadow: none; }
}
