/* ============================================================
   MAIN.CSS — Design System
   Perfect Landing: Comfort Food — "A World of Warmth"
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* --- Colors --- */
  --color-bg:            #1a1410;
  --color-bg-warm:       #2a2018;
  --color-bg-warm-rgb:   42, 32, 24;
  --color-surface:       #352a20;
  --color-surface-light: #453828;
  --color-cream:         #f5efe6;
  --color-cream-rgb:     245, 239, 230;
  --color-amber:         #d4a574;
  --color-amber-rgb:     212, 165, 116;
  --color-sienna:        #c17f59;
  --color-gold:          #e8c547;
  --color-gold-rgb:      232, 197, 71;
  --color-muted:         #8a7b6b;
  --color-muted-light:   #a89888;
  --color-red:           #c25a4a;
  --color-green:         #7ab06a;
  --color-overlay:       rgba(26, 20, 16, 0.7);
  --color-overlay-heavy: rgba(26, 20, 16, 0.85);

  /* --- Typography --- */
  --font-serif:   'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Modular Scale (ratio 1.333 — Perfect Fourth) */
  --text-xs:      0.75rem;    /* 12px */
  --text-sm:      0.875rem;   /* 14px */
  --text-base:    1rem;       /* 16px */
  --text-md:      1.125rem;   /* 18px */
  --text-lg:      1.333rem;   /* ~21px */
  --text-xl:      1.5rem;     /* 24px */
  --text-2xl:     1.777rem;   /* ~28px */
  --text-3xl:     2.369rem;   /* ~38px */
  --text-4xl:     3.157rem;   /* ~50px */
  --text-5xl:     4.209rem;   /* ~67px */
  --text-6xl:     5.61rem;    /* ~90px */

  /* Line heights */
  --leading-tight:    1.1;
  --leading-snug:     1.25;
  --leading-normal:   1.5;
  --leading-relaxed:  1.7;

  /* Letter spacing */
  --tracking-tight:    -0.02em;
  --tracking-normal:   0;
  --tracking-wide:     0.05em;
  --tracking-wider:    0.1em;
  --tracking-widest:   0.2em;

  /* --- Spacing --- */
  --space-1:   0.25rem;   /* 4px */
  --space-2:   0.5rem;    /* 8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.5rem;    /* 24px */
  --space-6:   2rem;      /* 32px */
  --space-8:   3rem;      /* 48px */
  --space-10:  4rem;      /* 64px */
  --space-12:  5rem;      /* 80px */
  --space-16:  6rem;      /* 96px */
  --space-20:  8rem;      /* 128px */

  /* --- Layout --- */
  --max-width:         1400px;
  --max-width-narrow:  900px;
  --max-width-text:    680px;
  --gutter:            clamp(1.5rem, 4vw, 4rem);

  /* --- Borders & Radius --- */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl:   0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(212, 165, 116, 0.15);

  /* --- Transitions --- */
  --ease-out:      cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out:   cubic-bezier(0.76, 0, 0.24, 1);
  --duration-fast:   150ms;
  --duration-base:   300ms;
  --duration-slow:   500ms;
  --duration-slower: 800ms;

  /* --- Z-index layers --- */
  --z-base:      1;
  --z-above:     10;
  --z-nav:       100;
  --z-overlay:   200;
  --z-modal:     300;

  /* --- Glassmorphism --- */
  --glass-bg:     rgba(42, 32, 24, 0.65);
  --glass-border: rgba(245, 239, 230, 0.08);
  --glass-blur:   20px;
}

/* ============================================================
   2. CSS RESET (Modern, Accessible)
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 100%; /* 16px base */
}

/* Disable smooth scrolling for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-cream);
  background-color: var(--color-bg);
  -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;
}

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

/* Remove default focus styles and add custom accessible ones */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Screen reader only — visually hidden but 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 link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-5);
  background: var(--color-amber);
  color: var(--color-bg);
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-cream);
}

h1 {
  font-size: clamp(var(--text-4xl), 8vw, var(--text-6xl));
  font-weight: 800;
}

h2 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 700;
}

h3 {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-3xl));
  font-weight: 600;
}

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

p {
  max-width: 65ch;
  line-height: var(--leading-relaxed);
}

.text-serif {
  font-family: var(--font-serif);
}

.text-sans {
  font-family: var(--font-sans);
}

/* Label / Eyebrow text */
.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-amber);
}

/* Large body / intro text */
.text-intro {
  font-size: clamp(var(--text-md), 2.5vw, var(--text-xl));
  line-height: var(--leading-relaxed);
  color: rgba(var(--color-cream-rgb), 0.85);
}

/* Muted / secondary text */
.text-muted {
  color: var(--color-muted);
}

/* Gradient text */
.text-gradient {
  background: linear-gradient(135deg, var(--color-amber), var(--color-gold), var(--color-sienna));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Italic serif accent */
.text-accent {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-amber);
}

/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

.section {
  padding-block: clamp(var(--space-10), 10vw, var(--space-20));
}

.flex {
  display: flex;
}

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

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

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

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

.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-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

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

/* ============================================================
   5. COMPONENT PRIMITIVES
   ============================================================ */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-amber), var(--color-sienna));
  color: var(--color-bg);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(var(--color-cream-rgb), 0.2);
  color: var(--color-cream);
}

.btn--ghost:hover {
  border-color: var(--color-amber);
  color: var(--color-amber);
  background: rgba(var(--color-amber-rgb), 0.08);
}

/* --- Badges / Tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-full);
  background: rgba(var(--color-cream-rgb), 0.08);
  color: var(--color-muted-light);
  border: 1px solid rgba(var(--color-cream-rgb), 0.06);
}

/* --- Divider --- */
.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-amber), transparent);
  border: none;
  margin-block: var(--space-5);
}

.divider--center {
  margin-inline: auto;
  background: linear-gradient(90deg, transparent, var(--color-amber), transparent);
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

/* ============================================================
   6. SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-surface-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-surface-light) var(--color-bg);
}

/* ============================================================
   7. SELECTION STYLING
   ============================================================ */
::selection {
  background: rgba(var(--color-amber-rgb), 0.3);
  color: var(--color-cream);
}
