/**
 * HERITAGE HARDWOOD FLOORS NWA — DESIGN SYSTEM
 * Single source of truth for all design tokens
 * No page may override these tokens
 */

/* ═══════════════════════════════════════════════════════════════════════════
   ROOT TOKENS
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ─── COLOR PALETTE ─── */
  --color-primary:       #8B5E3C;
  --color-primary-dark:  #5C3D1E;
  --color-primary-light: #C49A6C;
  --color-accent:        #D4A853;
  --color-accent-dark:   #A07830;
  --color-black:         #1A1410;
  --color-dark:          #2C2018;
  --color-mid:           #4A3728;
  --color-muted:         #9C8677;
  --color-light:         #E8DDD4;
  --color-offwhite:      #F5F0EA;
  --color-white:         #FEFCF9;

  /* ─── TYPOGRAPHY ─── */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* ─── FLUID TYPE SCALE ─── */
  --text-xs:   clamp(0.75rem, 1vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 1.5vw, 1rem);
  --text-base: clamp(1rem, 2vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 2.5vw, 1.375rem);
  --text-xl:   clamp(1.375rem, 3vw, 1.75rem);
  --text-2xl:  clamp(1.75rem, 4vw, 2.5rem);
  --text-3xl:  clamp(2.5rem, 6vw, 4rem);
  --text-4xl:  clamp(3.5rem, 8vw, 6rem);
  --text-hero: clamp(4rem, 10vw, 9rem);

  /* ─── SPACING SCALE ─── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-48: 12rem;

  /* ─── ANIMATION ─── */
  --ease-expo:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart:   cubic-bezier(0.76, 0, 0.24, 1);
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:   150ms;
  --dur-base:   300ms;
  --dur-slow:   600ms;
  --dur-slower: 1200ms;

  /* ─── LAYOUT ─── */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1536px;

  /* ─── SHADOWS ─── */
  --shadow-sm:   0 1px 3px rgba(26,20,16,0.12);
  --shadow-md:   0 4px 16px rgba(26,20,16,0.16);
  --shadow-lg:   0 8px 32px rgba(26,20,16,0.20);
  --shadow-xl:   0 24px 64px rgba(26,20,16,0.28);
  --shadow-glow: 0 0 40px rgba(212,168,83,0.15);

  /* ─── BORDERS & RADIUS ─── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-full: 9999px;
  --border:      1px solid rgba(156,134,119,0.2);

  /* ─── Z-INDEX SCALE ─── */
  --z-base:    1;
  --z-above:   10;
  --z-nav:     100;
  --z-modal:   1000;
  --z-cursor:  9999;

  /* ─── GOLDEN RATIO ─── */
  /* VISUAL-TACTIC: Golden Ratio */
  --golden-ratio: 1.618;
  --golden-small: 0.618;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BASE RESET
   ═══════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-dark);
  background-color: var(--color-offwhite);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ─── COGNITIVE EASE: Generous line heights and word spacing ─── */
/* PSYCH-TACTIC: Cognitive Ease */
p, li, dd {
  max-width: 70ch;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

/* VISUAL-TACTIC: Typographic Contrast */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-black);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-hero);
  font-weight: 300;
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

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

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

strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   SELECTION & FOCUS
   ═══════════════════════════════════════════════════════════════════════════ */

::selection {
  background-color: var(--color-accent);
  color: var(--color-black);
}

:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   IMAGES & MEDIA
   ═══════════════════════════════════════════════════════════════════════════ */

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

img {
  image-rendering: -webkit-optimize-contrast;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LISTS
   ═══════════════════════════════════════════════════════════════════════════ */

ul, ol {
  list-style: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

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

/* ═══════════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════════════════
   CSS NOISE TEXTURE
   ═══════════════════════════════════════════════════════════════════════════ */

/* VISUAL-TACTIC: CSS Grain Noise */
.noise-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
}
