/* ============================================================
   ECO-WONDER PLAY INVITATION GENERATOR
   Design System — Brand-matched to ecowonderschools.com
   No emojis. Custom SVG line-art icons throughout.
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Brand Colors (from ecowonderschools.com) */
  --olive: #5B5B3D;
  --olive-light: #7A7A5A;
  --olive-dark: #3D3D28;
  --terracotta: #E09271;
  --terracotta-light: #EBB49D;
  --terracotta-dark: #C4704E;
  --cream: #F9F7F2;
  --cream-dark: #F0EDE5;
  --charcoal: #333333;
  --charcoal-light: #555555;

  /* Extended Palette */
  --sage: #A8B5A0;
  --sage-light: #C5CFC0;
  --sage-dark: #8A9B82;
  --warm-gold: #D4A853;
  --forest: #2D4A2D;
  --moss: #6B8F5E;
  --bark: #8B6F47;
  --sky: #87AABD;

  /* Functional Colors */
  --bg: var(--cream);
  --bg-card: #FFFFFF;
  --text: var(--charcoal);
  --text-muted: var(--charcoal-light);
  --accent: var(--terracotta);
  --accent-hover: var(--terracotta-dark);
  --primary: var(--olive);
  --primary-light: var(--olive-light);
  --border: #E5E1D8;
  --border-light: #EEEAE3;

  /* Typography — Fredoka matches ecowonderschools.com rounded playful style */
  --font-display: 'Fredoka', 'Nunito', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 50px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(59, 59, 41, 0.06), 0 1px 2px rgba(59, 59, 41, 0.04);
  --shadow-md: 0 4px 12px rgba(59, 59, 41, 0.08), 0 2px 4px rgba(59, 59, 41, 0.04);
  --shadow-lg: 0 12px 40px rgba(59, 59, 41, 0.12), 0 4px 12px rgba(59, 59, 41, 0.06);
  --shadow-xl: 0 20px 60px rgba(59, 59, 41, 0.15), 0 8px 20px rgba(59, 59, 41, 0.08);
  --shadow-glow: 0 0 30px rgba(224, 146, 113, 0.2);

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

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

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Icon System --- */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.chip-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.chip-icon svg {
  width: 100%;
  height: 100%;
}

.section-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: var(--olive);
  flex-shrink: 0;
}

.section-icon svg {
  width: 100%;
  height: 100%;
}

.nav-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--olive);
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.action-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.action-icon svg {
  width: 100%;
  height: 100%;
}

.panel-title-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.panel-title-icon svg {
  width: 100%;
  height: 100%;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 247, 242, 0.85);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  height: 42px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  transition: transform var(--duration-normal) var(--ease-spring);
}

.brand-logo:hover {
  transform: scale(1.05) rotate(-3deg);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--olive-dark);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.header-nav {
  display: flex;
  gap: var(--space-sm);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
}

.nav-btn:hover {
  background: var(--cream-dark);
  border-color: var(--olive-light);
  transform: translateY(-1px);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--terracotta);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50px;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.nav-badge.bumped {
  animation: badge-bump 0.4s var(--ease-spring);
}

@keyframes badge-bump {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
  }
}

/* --- Hero --- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--olive) 0%, var(--olive-dark) 60%, var(--forest) 100%);
  color: white;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(224, 146, 113, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.wave-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  line-height: 0;
}

.wave-divider svg {
  width: 100%;
  height: 60px;
  display: block;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl) calc(var(--space-3xl) + 40px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terracotta-light);
  margin-bottom: var(--space-md);
}

.eyebrow-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--terracotta-light);
}

.eyebrow-icon svg {
  width: 100%;
  height: 100%;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.01em;
}

.hero-title em {
  font-style: italic;
  color: var(--terracotta-light);
}

.hero-description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  max-width: 520px;
}

/* Daily Inspiration Card */
.hero-daily {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.hero-daily:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.daily-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta-light);
  margin-bottom: var(--space-md);
}

.daily-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: var(--terracotta-light);
  animation: gentle-sway 3s ease-in-out infinite;
}

.daily-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes gentle-sway {

  0%,
  100% {
    transform: rotate(-5deg);
  }

  50% {
    transform: rotate(5deg);
  }
}

.daily-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-lg);
  font-weight: 400;
}

.daily-try-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm) var(--space-lg);
  background: var(--terracotta);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.daily-try-btn:hover {
  background: var(--terracotta-dark);
  transform: translateX(4px);
}

.btn-arrow {
  display: inline-flex;
  width: 14px;
  height: 14px;
}

.btn-arrow svg {
  width: 100%;
  height: 100%;
}

/* --- Modifiers Section --- */
.modifiers-section {
  position: relative;
  z-index: 10;
  background: var(--bg);
}

.modifiers-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl);
}

.modifiers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.modifiers-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--olive);
}

.reset-btn {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.reset-btn:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.modifier-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.modifier-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.modifier-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--olive);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none;
  -webkit-user-select: none;
}

.chip:hover {
  border-color: var(--olive-light);
  background: var(--cream-dark);
  transform: translateY(-1px);
}

.chip.active {
  background: var(--olive);
  border-color: var(--olive);
  color: white;
  box-shadow: var(--shadow-sm);
}

.chip.active .chip-icon {
  color: white;
}

.chip.active:hover {
  background: var(--olive-dark);
  border-color: var(--olive-dark);
}

/* --- Generate Button --- */
.generate-section {
  margin-top: var(--space-2xl);
  text-align: center;
}

.generate-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  padding: 18px 48px;
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.generate-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 0 50px rgba(224, 146, 113, 0.3);
}

.generate-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.generate-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  transition: transform var(--duration-normal) var(--ease-spring);
}

.generate-icon svg {
  width: 100%;
  height: 100%;
}

.generate-btn:hover .generate-icon {
  transform: rotate(15deg) scale(1.1);
}

.generate-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

.generate-hint {
  margin-top: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Result Section --- */
.result-section {
  position: relative;
  z-index: 10;
  background: var(--cream-dark);
  padding: var(--space-3xl) 0;
}

.result-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* --- Invitation Card --- */
.invitation-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: card-appear 0.6s var(--ease-out) both;
  position: relative;
}

@keyframes card-appear {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }

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

.card-top-border {
  height: 6px;
  background: linear-gradient(90deg, var(--sage) 0%, var(--terracotta) 35%, var(--warm-gold) 65%, var(--moss) 100%);
}

.card-header {
  padding: var(--space-2xl) var(--space-2xl) var(--space-lg);
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.card-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--cream);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--olive);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-badge .badge-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
  color: var(--olive);
}

.card-badge .badge-icon svg {
  width: 100%;
  height: 100%;
}

.card-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--olive-dark);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}

.card-invitation {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--terracotta);
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
  font-weight: 400;
}

/* Card Sections */
.card-section {
  padding: var(--space-xl) var(--space-2xl);
  border-bottom: 1px solid var(--border-light);
}

.card-section:last-of-type {
  border-bottom: none;
}

.card-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--olive);
  margin-bottom: var(--space-lg);
}

/* Setup List */
.setup-list {
  list-style: none;
  counter-reset: setup-steps;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.setup-list li {
  counter-increment: setup-steps;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.setup-list li::before {
  content: counter(setup-steps);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--sage-light);
  color: var(--forest);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 1px;
}

/* Materials Grid */
.materials-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.material-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--duration-fast) var(--ease-out);
}

.material-tag .tag-dot {
  display: inline-flex;
  width: 6px;
  height: 6px;
  color: var(--sage-dark);
}

.material-tag .tag-dot svg {
  width: 100%;
  height: 100%;
}

.material-tag.have {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  border-color: var(--moss);
  color: var(--forest);
}

.material-tag.have .tag-dot {
  color: var(--moss);
}

/* Eco Why */
.eco-why-section {
  background: linear-gradient(135deg, #FDFCF8 0%, #F5F0E6 100%);
}

.eco-why-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
}

.eco-why-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.eco-why-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--olive);
  color: white;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eco-why-tag .tag-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
}

.eco-why-tag .tag-icon svg {
  width: 100%;
  height: 100%;
}

/* Variations */
.variations-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.variations-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
}

.variations-list li .var-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--terracotta);
}

.variations-list li .var-icon svg {
  width: 100%;
  height: 100%;
}

/* Card Actions */
.card-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl) var(--space-2xl);
  background: var(--cream);
  border-top: 1px solid var(--border-light);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.action-btn:hover {
  border-color: var(--olive-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.action-save.saved {
  background: #FFF0EB;
  border-color: var(--terracotta);
  color: var(--terracotta-dark);
}

.action-regenerate {
  background: var(--olive);
  border-color: var(--olive);
  color: white;
}

.action-regenerate:hover {
  background: var(--olive-dark);
  border-color: var(--olive-dark);
}

/* --- Slide Panels --- */
.panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 74, 45, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.panel-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-card);
  z-index: 201;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

.slide-panel.active {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--olive);
}

.panel-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease-out);
}

.panel-close svg {
  width: 14px;
  height: 14px;
}

.panel-close:hover {
  background: var(--cream-dark);
  color: var(--terracotta);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

.panel-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: var(--space-2xl) var(--space-lg);
  font-style: italic;
}

/* --- Favorites List --- */
.favorites-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.fav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--cream);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.fav-item:hover {
  background: var(--cream-dark);
  transform: translateX(4px);
}

.fav-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sage-light);
  border-radius: 50%;
  color: var(--forest);
  flex-shrink: 0;
}

.fav-item-icon svg {
  width: 16px;
  height: 16px;
}

.fav-item-content {
  flex: 1;
  min-width: 0;
}

.fav-item-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--olive);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.fav-remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease-out);
}

.fav-remove svg {
  width: 12px;
  height: 12px;
}

.fav-remove:hover {
  background: #FFEBEE;
  color: #D32F2F;
  border-color: #FFCDD2;
}

/* --- Pantry Callout Card --- */
.pantry-callout {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  background: linear-gradient(135deg, #f0ebe3 0%, #e8f5e9 50%, #fff8e1 100%);
  border: 2px solid var(--olive-light);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.pantry-callout::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(139, 119, 75, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.pantry-callout:hover {
  border-color: var(--olive);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(90, 79, 59, 0.12);
}

.pantry-callout-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--olive-light);
  border-radius: var(--radius-lg);
  color: var(--olive-dark);
  font-size: 1.5rem;
  animation: pantryPulse 3s ease-in-out infinite;
}

.pantry-callout-icon svg {
  width: 28px;
  height: 28px;
}

@keyframes pantryPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.pantry-callout-content {
  flex: 1;
  min-width: 0;
}

.pantry-callout-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--olive-dark);
  margin-bottom: 2px;
}

.pantry-callout-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.pantry-callout-desc em {
  color: var(--olive-dark);
  font-weight: 600;
  font-style: normal;
}

.pantry-callout-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px 18px;
  background: var(--olive);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.pantry-callout-btn:hover {
  background: var(--olive-dark);
  transform: scale(1.05);
}

.pantry-callout-btn svg {
  width: 16px;
  height: 16px;
}

.pantry-callout-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pantry-callout-count:empty {
  display: none;
}

/* Responsive: stack on mobile */
@media (max-width: 600px) {
  .pantry-callout {
    flex-direction: column;
    text-align: center;
    padding: var(--space-lg);
    gap: var(--space-md);
  }

  .pantry-callout-btn {
    width: 100%;
    justify-content: center;
  }
}

/* --- Pantry Panel --- */
.pantry-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.pantry-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.pantry-toggle-btn {
  padding: 6px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.pantry-toggle-btn:hover {
  background: var(--cream-dark);
}

.pantry-filter-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background var(--duration-fast);
}

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

.pantry-filter-toggle input:checked+.toggle-slider {
  background: var(--moss);
}

.pantry-filter-toggle input:checked+.toggle-slider::after {
  transform: translateX(20px);
}

.pantry-filter-toggle input {
  display: none;
}

.pantry-categories {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.pantry-category {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pantry-category-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--olive);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pantry-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pantry-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none;
  -webkit-user-select: none;
}

.pantry-item:hover {
  border-color: var(--sage-dark);
}

.pantry-item.checked {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  border-color: var(--moss);
  color: var(--forest);
}

.pantry-item .check-icon {
  display: none;
  width: 12px;
  height: 12px;
  color: var(--moss);
}

.pantry-item .check-icon svg {
  width: 100%;
  height: 100%;
}

.pantry-item.checked .check-icon {
  display: inline-flex;
}

/* --- Footer --- */
.site-footer {
  background: var(--olive-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-2xl) var(--space-xl);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.footer-credit {
  font-size: 0.82rem;
  margin-top: var(--space-sm);
}

.footer-credit a {
  color: var(--terracotta-light);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.footer-credit a:hover {
  color: var(--terracotta);
}

.footer-note {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
}

.footer-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--sage);
}

.footer-icon svg {
  width: 100%;
  height: 100%;
}

/* --- Search Bar --- */
.search-container {
  margin-bottom: var(--space-xl);
}

.search-bar {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  transition: all var(--duration-normal) var(--ease-out);
  outline: none;
}

.search-bar:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(91, 91, 61, 0.1);
}

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

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-icon svg {
  width: 100%;
  height: 100%;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--cream-dark);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--duration-fast);
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  background: var(--border);
  color: var(--text);
}

.search-clear svg {
  width: 12px;
  height: 12px;
}

/* --- Share Button --- */
.action-share {
  background: var(--sage-light);
  border-color: var(--sage-dark);
  color: var(--forest);
}

.action-share:hover {
  background: var(--sage);
  border-color: var(--sage-dark);
}

/* --- Similar Invitations --- */
.similar-section {
  margin-top: var(--space-2xl);
}

.similar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--olive);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.similar-card {
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.similar-card:hover {
  border-color: var(--olive-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.similar-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--olive-dark);
  margin-bottom: var(--space-xs);
}

.similar-card-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.similar-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-sm);
}

.similar-card-badges .card-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--olive-dark);
  color: white;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- PWA Install Banner --- */
.pwa-install-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md) var(--space-xl);
  background: var(--olive-dark);
  color: white;
  z-index: 150;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.pwa-install-banner.show {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  animation: slide-up 0.4s var(--ease-out);
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.pwa-install-text {
  font-size: 0.9rem;
}

.pwa-install-btn {
  padding: 8px 20px;
  background: var(--terracotta);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast);
}

.pwa-install-btn:hover {
  background: var(--terracotta-dark);
}

.pwa-dismiss-btn {
  padding: 8px 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.pwa-dismiss-btn:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.6);
}

/* --- Print Styles --- */
@media print {

  .site-header,
  .hero,
  .modifiers-section,
  .card-actions,
  .site-footer,
  .slide-panel,
  .panel-overlay {
    display: none !important;
  }

  .result-section {
    display: block !important;
    background: white !important;
    padding: 0 !important;
  }

  .invitation-card {
    box-shadow: none !important;
    border: 2px solid #ddd;
    border-radius: 12px !important;
    break-inside: avoid;
  }

  .card-top-border {
    height: 4px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .eco-why-section {
    background: #f8f6f0 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body {
    background: white !important;
  }
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding: var(--space-2xl) var(--space-lg) calc(var(--space-2xl) + 40px);
  }

  .hero-daily {
    order: -1;
  }

  .header-inner {
    padding: var(--space-sm) var(--space-md);
  }

  .nav-label {
    display: none;
  }

  .nav-btn {
    padding: var(--space-sm);
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .brand-name {
    font-size: 1.2rem;
  }

  .brand-tagline {
    font-size: 0.65rem;
  }

  .modifiers-inner {
    padding: var(--space-2xl) var(--space-lg);
  }

  .chip-group {
    gap: 6px;
  }

  .chip {
    padding: 10px 14px;
    font-size: 0.82rem;
    min-height: 44px;
  }

  .card-header {
    padding: var(--space-xl) var(--space-lg) var(--space-md);
  }

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

  .card-actions {
    padding: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .action-btn {
    flex: 1;
    justify-content: center;
    min-width: 100px;
    min-height: 44px;
  }

  .generate-btn {
    padding: 16px 36px;
    font-size: 1rem;
    min-height: 56px;
    width: 100%;
    max-width: 400px;
    justify-content: center;
  }

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

  .slide-panel {
    width: 100%;
    max-width: 100vw;
  }

  .result-inner {
    padding: 0 var(--space-md);
  }

  .card-badges {
    gap: 6px;
  }

  .card-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  /* Search bar responsive */
  .search-bar {
    padding: 12px 16px;
    font-size: 16px;
    /* Prevents iOS zoom on focus */
  }
}

/* Phone */
@media (max-width: 480px) {
  .hero-inner {
    padding: var(--space-xl) var(--space-md) calc(var(--space-xl) + 40px);
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .hero-daily {
    padding: var(--space-lg);
  }

  .daily-text {
    font-size: 1rem;
  }

  .modifiers-inner {
    padding: var(--space-xl) var(--space-md);
  }

  .modifiers-title {
    font-size: 1.3rem;
  }

  .modifier-label {
    font-size: 0.78rem;
  }

  .chip {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .card-header {
    padding: var(--space-lg) var(--space-md) var(--space-md);
  }

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

  .card-title {
    font-size: 1.4rem;
  }

  .card-invitation {
    font-size: 0.95rem;
  }

  .card-actions {
    flex-direction: column;
    padding: var(--space-md);
  }

  .action-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  .generate-btn {
    padding: 16px 24px;
    font-size: 0.95rem;
  }

  .brand-logo {
    height: 36px;
  }

  .brand-tagline {
    font-size: 0.6rem;
  }

  .brand-tagline {
    font-size: 0.6rem;
  }

  .header-nav {
    gap: 4px;
  }

  .footer-inner {
    padding: var(--space-lg) var(--space-md);
  }

  .setup-list li {
    font-size: 0.88rem;
  }

  .eco-why-text {
    font-size: 0.88rem;
  }

  .material-tag {
    font-size: 0.78rem;
    padding: 5px 10px;
  }
}

/* Small phone */
@media (max-width: 375px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .brand-name {
    font-size: 1rem;
  }

  .chip {
    padding: 7px 10px;
    font-size: 0.75rem;
  }

  .modifiers-title {
    font-size: 1.15rem;
  }

  .card-title {
    font-size: 1.25rem;
  }
}

/* --- Loading Animation --- */
.generate-btn.loading .generate-icon svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.generate-btn.loading .generate-text {
  opacity: 0.7;
}

/* --- Card Entrance Stagger --- */
.card-section {
  animation: section-fade-in 0.5s var(--ease-out) both;
}

.card-section:nth-child(2) {
  animation-delay: 0.1s;
}

.card-section:nth-child(3) {
  animation-delay: 0.2s;
}

.card-section:nth-child(4) {
  animation-delay: 0.3s;
}

.card-section:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes section-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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