/* ============================================
   MAIN.CSS — Design System & Foundation
   ortodontideposu.com
   ============================================ */

/* ---------- Modern CSS Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 400;
  color: var(--primary);
  overflow-wrap: break-word;
}

p {
  overflow-wrap: break-word;
}

/* ---------- Design Tokens ---------- */
:root {
  /* Colors — Navy & Gold */
  --primary: #0A1F3F;
  --primary-light: #132D54;
  --primary-dark: #06142A;
  --secondary: #C8963E;
  --secondary-light: #D4A85A;
  --secondary-dark: #B07E2E;
  --accent: #0D7377;
  --accent-light: #11918F;

  --bg-main: #F8F6F2;
  --bg-surface: #FFFFFF;
  --bg-muted: #F0EDE8;
  --bg-dark: #0A1F3F;
  --bg-dark-lighter: #0F2847;

  --text-primary: #1A1A2E;
  --text-secondary: #5F6878;
  --text-light: #9CA3AF;
  --text-inverse: #F8F6F2;
  --text-on-gold: #FFFFFF;

  --border: #E5E2DC;
  --border-light: #F0EDE8;

  /* Typography */
  --font-heading: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Font sizes — fluid with clamp */
  --text-xs: clamp(0.7rem, 0.66rem + 0.2vw, 0.78rem);
  --text-sm: clamp(0.8rem, 0.76rem + 0.2vw, 0.875rem);
  --text-base: clamp(0.9rem, 0.86rem + 0.25vw, 1rem);
  --text-lg: clamp(1rem, 0.93rem + 0.35vw, 1.125rem);
  --text-xl: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --text-2xl: clamp(1.3rem, 1.1rem + 1vw, 1.65rem);
  --text-3xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  --text-4xl: clamp(1.75rem, 1.35rem + 2vw, 2.5rem);
  --text-hero: clamp(2rem, 1.5rem + 2.5vw, 3rem);

  /* Spacing scale */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;
  --space-section: clamp(2rem, 1.5rem + 2vw, 3rem);

  /* Shadows — subtle warm tones */
  --shadow-xs: 0 1px 2px rgba(10, 31, 63, 0.04);
  --shadow-sm: 0 2px 6px rgba(10, 31, 63, 0.06);
  --shadow-md: 0 4px 16px rgba(10, 31, 63, 0.08);
  --shadow-lg: 0 8px 32px rgba(10, 31, 63, 0.1);
  --shadow-xl: 0 16px 48px rgba(10, 31, 63, 0.14);
  --shadow-gold: 0 4px 20px rgba(200, 150, 62, 0.2);

  /* Border radius */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 280ms;
  --duration-slow: 450ms;

  /* Z-index layers */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* Container */
  --container-max: 1260px;
  --container-narrow: 860px;
  --container-pad: clamp(1.25rem, 4vw, 2.5rem);

  /* Topbar */
  --topbar-height: 34px;

  /* Navbar */
  --navbar-height: 62px;
  --navbar-height-scrolled: 52px;
}


/* ---------- Typography System ---------- */
h1 { font-size: var(--text-hero); letter-spacing: -0.01em; }
h2 { font-size: var(--text-4xl); letter-spacing: -0.005em; }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }

.text-secondary { color: var(--text-secondary); }
.text-gold { color: var(--secondary); }

.text-balance { text-wrap: balance; }


/* ---------- Layout Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--narrow {
  max-width: var(--container-narrow);
}

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

.section--dark {
  background-color: var(--bg-dark);
  color: var(--text-inverse);
}

.section--muted {
  background-color: var(--bg-muted);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

.grid {
  display: grid;
}

.text-center { text-align: center; }


/* ---------- Base Element Styles ---------- */
::selection {
  background-color: var(--secondary);
  color: var(--text-on-gold);
}

:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

img {
  border-radius: var(--radius-sm);
}


/* ---------- Scroll Reveal Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to { background-position: 200% 0; }
}

/* Scroll-triggered reveal classes */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

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

.reveal--delay-1 { transition-delay: 100ms; }
.reveal--delay-2 { transition-delay: 200ms; }
.reveal--delay-3 { transition-delay: 300ms; }
.reveal--delay-4 { transition-delay: 400ms; }


/* ---------- Accessibility ---------- */
.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;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ---------- Responsive Breakpoints ---------- */
/* Mobile-first approach:
   sm:  640px
   md:  768px
   lg: 1024px
   xl: 1280px
*/
