/* ─────────────────────────────────────────────────────────────
   AI Dinner Planner - Hearth Design System
   Warm, trustworthy, playful family-friendly aesthetic
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,200;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,200;0,9..144,400;0,9..144,600;0,9..144,800;1,9..144,400&display=swap');

/* ─────────────────────────────────────────────────────────────
   Design Tokens - Light Theme (Default)
   ───────────────────────────────────────────────────────────── */

:root {
  /* Brand Colors */
  --terracotta: #e8723d;
  --terracotta-light: #f28a58;
  --terracotta-dark: #cc5f2e;
  --sage: #6b8f71;
  --sage-light: #8aaf8f;
  --sage-dark: #5a7a5f;
  --honey: #d4a855;
  --honey-light: #e4c275;
  --clay: #b8a089;

  /* Light Theme Surfaces */
  --bg-base: #fdfbf7;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f7f4ef;
  --bg-muted: #ede9e1;
  --bg-secondary: #ffffff;

  /* Light Theme Text */
  --text-primary: #2d2926;
  --text-secondary: #5c564e;
  --text-muted: #8a847a;
  --text-inverse: #fdfbf7;

  /* Light Theme Borders & Shadows */
  --border-subtle: rgba(45, 41, 38, 0.08);
  --border-default: rgba(45, 41, 38, 0.12);
  --border-strong: rgba(45, 41, 38, 0.2);
  --border: var(--border-default);
  --shadow-sm: 0 1px 3px rgba(45, 41, 38, 0.06), 0 1px 2px rgba(45, 41, 38, 0.04);
  --shadow-md: 0 4px 12px rgba(45, 41, 38, 0.08), 0 2px 4px rgba(45, 41, 38, 0.04);
  --shadow-lg: 0 12px 32px rgba(45, 41, 38, 0.12), 0 4px 8px rgba(45, 41, 38, 0.06);
  --shadow-focus: 0 0 0 3px rgba(232, 114, 61, 0.2);

  /* Semantic Colors */
  --accent: var(--terracotta);
  --accent-hover: var(--terracotta-light);
  --accent-active: var(--terracotta-dark);
  --success: var(--sage);
  --success-bg: rgba(107, 143, 113, 0.1);
  --warning: var(--honey);
  --warning-bg: rgba(212, 168, 85, 0.1);
  --error: #c75050;
  --error-bg: rgba(199, 80, 80, 0.1);

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
}

/* ─────────────────────────────────────────────────────────────
   Dark Theme
   ───────────────────────────────────────────────────────────── */

[data-theme='dark'] {
  /* Dark Theme Surfaces */
  --bg-base: #1a1816;
  --bg-surface: #242220;
  --bg-elevated: #2e2c29;
  --bg-subtle: #1e1c1a;
  --bg-muted: #343230;
  --bg-secondary: #2e2c29;

  /* Dark Theme Text */
  --text-primary: #f5f2eb;
  --text-secondary: #c4bfb5;
  --text-muted: #8a847a;
  --text-inverse: #1a1816;

  /* Adjusted Brand Colors for Dark */
  --terracotta: #d4845f;
  --terracotta-light: #e49b78;
  --terracotta-dark: #b86d4a;
  --sage: #8fb38f;
  --sage-light: #a8c8a8;

  /* Dark Theme Borders & Shadows */
  --border-subtle: rgba(245, 242, 235, 0.06);
  --border-default: rgba(245, 242, 235, 0.1);
  --border-strong: rgba(245, 242, 235, 0.18);
  --border: var(--border-default);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35), 0 4px 8px rgba(0, 0, 0, 0.25);
  --shadow-focus: 0 0 0 3px rgba(212, 132, 95, 0.3);

  /* Updated Semantic Colors */
  --accent: var(--terracotta);
  --accent-hover: var(--terracotta-light);
  --accent-active: var(--terracotta-dark);
  --success-bg: rgba(143, 179, 143, 0.15);
  --warning-bg: rgba(212, 168, 85, 0.15);
  --error-bg: rgba(199, 80, 80, 0.15);
}

/* System preference detection */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    /* Dark Theme Surfaces */
    --bg-base: #1a1816;
    --bg-surface: #242220;
    --bg-elevated: #2e2c29;
    --bg-subtle: #1e1c1a;
    --bg-muted: #343230;

    /* Dark Theme Text */
    --text-primary: #f5f2eb;
    --text-secondary: #c4bfb5;
    --text-muted: #8a847a;
    --text-inverse: #1a1816;

    /* Adjusted Brand Colors for Dark */
    --terracotta: #d4845f;
    --terracotta-light: #e49b78;
    --terracotta-dark: #b86d4a;
    --sage: #8fb38f;
    --sage-light: #a8c8a8;

    /* Dark Theme Borders & Shadows */
    --border-subtle: rgba(245, 242, 235, 0.06);
    --border-default: rgba(245, 242, 235, 0.1);
    --border-strong: rgba(245, 242, 235, 0.18);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35), 0 4px 8px rgba(0, 0, 0, 0.25);
    --shadow-focus: 0 0 0 3px rgba(212, 132, 95, 0.3);

    /* Updated Semantic Colors */
    --accent: var(--terracotta);
    --accent-hover: var(--terracotta-light);
    --accent-active: var(--terracotta-dark);
    --success-bg: rgba(143, 179, 143, 0.15);
    --warning-bg: rgba(212, 168, 85, 0.15);
    --error-bg: rgba(199, 80, 80, 0.15);
  }
}

/* ─────────────────────────────────────────────────────────────
   Reset & Base
   ───────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background-color var(--duration-normal) ease,
    color var(--duration-normal) ease;
  overflow-x: hidden;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}

[data-theme='dark'] body::before,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) body::before {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23FFFFFF' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }
}

/* ─────────────────────────────────────────────────────────────
   Typography
   ───────────────────────────────────────────────────────────── */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  font-variation-settings: 'opsz' 144;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  font-variation-settings: 'opsz' 72;
}

h3 {
  font-size: 1.375rem;
  font-weight: 600;
  font-variation-settings: 'opsz' 48;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

p {
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

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

/* ─────────────────────────────────────────────────────────────
   Navigation
   ───────────────────────────────────────────────────────────── */

.nav {
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--border-subtle);
  transition:
    background-color var(--duration-normal) ease,
    border-color var(--duration-normal) ease;
}

.nav-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-out);
}

.nav-logo:hover {
  transform: translateY(-1px);
}

.nav-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(200, 107, 74, 0.25);
  transition:
    transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) ease;
}

.nav-logo:hover .nav-logo-icon {
  transform: rotate(-6deg) scale(1.05);
  box-shadow: 0 4px 12px rgba(200, 107, 74, 0.35);
}

.nav-logo-icon svg {
  width: 22px;
  height: 22px;
  color: white;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 48;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.nav-icon-btn:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.nav-icon-btn svg {
  width: 20px;
  height: 20px;
}

/* User Menu */
.nav-user-menu {
  position: relative;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.nav-user-btn:hover,
.nav-user-btn.active {
  border-color: var(--border-default);
  background: var(--bg-muted);
}

.nav-user-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-dark) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-user-avatar svg {
  width: 16px;
  height: 16px;
  color: white;
}

.nav-user-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-arrow {
  color: var(--text-muted);
  transition: transform var(--duration-fast) ease;
}

.nav-user-arrow svg {
  width: 16px;
  height: 16px;
}

.nav-user-btn.active .nav-user-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all var(--duration-fast) var(--ease-out);
  overflow: hidden;
  z-index: var(--z-dropdown);
}

.nav-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--duration-fast) ease;
}

.nav-dropdown-item:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

.nav-dropdown-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color var(--duration-fast) ease;
}

.nav-dropdown-item:hover svg {
  color: var(--accent);
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}

/* Theme Toggle in Dropdown */
.nav-dropdown-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-2);
}

.nav-dropdown-theme-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.nav-dropdown-theme-label svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

/* Theme Toggle Switch */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-spring);
}

.theme-toggle.dark::before {
  transform: translateX(24px);
}

.theme-toggle.dark {
  background: var(--accent);
  border-color: var(--accent);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: var(--z-overlay);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--duration-normal) var(--ease-out);
  transform-origin: center;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu Drawer */
.mobile-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--bg-surface);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  overflow-y: auto;
  border-left: 1px solid var(--border-subtle);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu-header {
  position: relative;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.mobile-menu-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.mobile-menu-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-menu-close svg {
  width: 18px;
  height: 18px;
}

.mobile-menu-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-1);
}

.mobile-menu-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.mobile-menu-section {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.mobile-menu-section:last-child {
  border-bottom: none;
}

.mobile-menu-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 var(--space-6);
  margin-bottom: var(--space-2);
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all var(--duration-fast) ease;
}

.mobile-menu-link:hover,
.mobile-menu-link:active {
  background: var(--bg-subtle);
  color: var(--accent);
}

.mobile-menu-link.active {
  color: var(--accent);
  background: var(--success-bg);
}

.mobile-menu-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all var(--duration-fast) ease;
}

.mobile-menu-link:hover .mobile-menu-icon,
.mobile-menu-link.active .mobile-menu-icon {
  background: var(--accent);
  color: white;
}

.mobile-menu-icon svg {
  width: 20px;
  height: 20px;
}

/* Mobile Theme Toggle */
.mobile-menu-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
}

.mobile-menu-theme-label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.mobile-menu-theme-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.mobile-menu-theme-icon svg {
  width: 20px;
  height: 20px;
}

/* Mobile Menu Logout - positioned at bottom with danger styling */
.mobile-menu-logout {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  border-bottom: none !important;
}

.mobile-menu-logout-btn {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4) var(--space-6);
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: #dc3545;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.mobile-menu-logout-btn:hover {
  background: rgba(220, 53, 69, 0.1);
}

.mobile-menu-logout-btn .mobile-menu-icon {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.mobile-menu-logout-btn:hover .mobile-menu-icon {
  background: #dc3545;
  color: white;
}

/* ─────────────────────────────────────────────────────────────
   Main Content
   ───────────────────────────────────────────────────────────── */

#content-slot {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.page {
  animation: pageEnter 0.5s var(--ease-out);
}

.page.padded {
  padding: var(--space-8) var(--space-6) var(--space-16);
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn-primary {
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(200, 107, 74, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(200, 107, 74, 0.35);
}

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

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* ─────────────────────────────────────────────────────────────
   Cards
   ───────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.card-interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ─────────────────────────────────────────────────────────────
   Form Elements
   ───────────────────────────────────────────────────────────── */

.input,
.select,
.textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  transition: all var(--duration-fast) ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

/* ─────────────────────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────────────────────── */

.footer {
  background: var(--bg-subtle);
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--terracotta), var(--honey), var(--sage)) 1;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6) var(--space-8);
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.footer-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-brand-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.footer-brand-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 260px;
}

.footer-col-title {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-copyright {
  white-space: nowrap;
}

.footer-powered {
  white-space: nowrap;
}

.footer-bottom spin-counter {
  opacity: 0.4;
  margin-left: auto;
}

@media (max-width: 640px) {
  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8) var(--space-6);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .footer-bottom spin-counter {
    margin-left: 0;
    width: 100%;
  }
}

/* ─────────────────────────────────────────────────────────────
   Blog Listing
   ───────────────────────────────────────────────────────────── */

.blog-page {
  max-width: 900px;
  margin: 0 auto;
}

.blog-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.blog-header-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.blog-header-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
  font-variation-settings: 'opsz' 144;
}

.blog-header-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 460px;
  margin-inline: auto;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-default);
  color: inherit;
}

.blog-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-muted);
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.04);
}

.blog-card-body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.blog-card-category {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(232, 114, 61, 0.08);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

.blog-card-excerpt {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.blog-card-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────
   Blog Article
   ───────────────────────────────────────────────────────────── */

.blog-article {
  max-width: 680px;
  margin: 0 auto;
}

.blog-back-link {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: var(--space-6);
  transition: color var(--duration-fast) ease;
}

.blog-back-link:hover {
  color: var(--accent);
}

.blog-article-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-8);
}

.blog-article-header {
  margin-bottom: var(--space-8);
}

.blog-article-header .blog-card-category {
  margin-bottom: var(--space-3);
}

.blog-article-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
  font-variation-settings: 'opsz' 144;
}

.blog-article-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.blog-article-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.blog-article-body p {
  margin: 0 0 var(--space-6);
  color: var(--text-secondary);
}

.blog-article-body h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-10) 0 var(--space-4);
}

.blog-article-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-8) 0 var(--space-3);
}

.blog-article-body blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 3px solid var(--sage);
  background: var(--bg-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.blog-article-body blockquote p {
  font-style: italic;
  color: var(--text-primary);
  margin: 0;
  font-size: 1.0625rem;
}

.blog-article-body ul,
.blog-article-body ol {
  margin: 0 0 var(--space-6);
  padding-left: var(--space-6);
}

.blog-article-body li {
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
}

.blog-article-body li strong {
  color: var(--text-primary);
}

.blog-article-body code {
  font-size: 0.9em;
  background: var(--bg-muted);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

.blog-article-body pre {
  background: var(--bg-muted);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 0 0 var(--space-6);
}

.blog-article-body pre code {
  background: none;
  padding: 0;
}

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

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

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

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

.text-primary {
  color: var(--text-primary);
}

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

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--error);
}

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

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

/* ─────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .nav-user-menu {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .mobile-menu-overlay {
    display: block;
  }

  .mobile-menu {
    display: flex;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .nav-container {
    padding: 0 var(--space-4);
    height: 60px;
  }

  .nav-logo-text {
    font-size: 1.125rem;
  }

  .nav-logo-icon {
    width: 32px;
    height: 32px;
  }

  .nav-logo:hover .nav-logo-icon,
  .nav-logo:focus .nav-logo-icon,
  .nav-logo:active .nav-logo-icon {
    transform: none;
  }

  .page.padded {
    padding: 0 0 1rem 0;
  }

  .mobile-menu {
    width: 100%;
    max-width: 100%;
  }

  .sticky-nav {
    padding: var(--space-3) var(--space-4);
  }

  .sticky-nav-spacer {
    min-width: 120px;
  }

  .sticky-nav-btn {
    height: 44px;
    min-width: 120px;
    padding: 0 var(--space-4);
    font-size: 0.875rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   Print Styles
   ───────────────────────────────────────────────────────────── */

@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
    padding-bottom: 0;
  }

  body::before {
    display: none;
  }

  .nav,
  .footer,
  .sticky-nav,
  spin-counter,
  .no-print {
    display: none !important;
  }

  #content-slot {
    padding: 0;
    max-width: none;
  }

  .page.padded {
    padding: 0;
  }

  .page {
    animation: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ─────────────────────────────────────────────────────────────
   Animations
   ───────────────────────────────────────────────────────────── */

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.animate-slide-up {
  animation: slideUp var(--duration-normal) var(--ease-out);
}

.animate-scale-in {
  animation: scaleIn var(--duration-fast) var(--ease-spring);
}

/* Staggered animation delays */
.stagger-1 {
  animation-delay: 50ms;
}

.stagger-2 {
  animation-delay: 100ms;
}

.stagger-3 {
  animation-delay: 150ms;
}

.stagger-4 {
  animation-delay: 200ms;
}

.stagger-5 {
  animation-delay: 250ms;
}
