/* ===== Theme variables ===== */
:root {
  --bg: #fff7ed;
  --surface: #ffffff;
  --text: #2b2118;
  --muted: #8a7a68;
  --accent: #c2410c;
  --accent-soft: #fed7aa;
  --border: #f0e0cf;
  --shadow: 0 6px 18px rgba(194, 65, 12, 0.08);
}

/* checkbox is checked => dark mode */
:root:has(#theme-toggle:checked) {
  --bg: #1a120b;
  --surface: #261a10;
  --text: #f5e8d8;
  --muted: #b09a82;
  --accent: #fb923c;
  --accent-soft: #5a3415;
  --border: #3a2a1c;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* keep the checkbox itself out of the layout */
.theme-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===== Sticky header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  margin: 0;
  color: var(--accent);
}

/* ===== Theme switch (checkbox hack) ===== */
.theme-switch {
  cursor: pointer;
  padding: 4px;
}
.switch-track {
  display: inline-block;
  width: 52px;
  height: 26px;
  border-radius: 14px;
  background: var(--accent-soft);
  position: relative;
  transition: background 0.25s;
}
.switch-track::after {
  content: '☀️';
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: transform 0.25s ease;
}
.theme-input:checked ~ .site-header .switch-track::after {
  content: '🌙';
  transform: translateX(26px);
}

/* ===== Layout ===== */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.intro { text-align: center; margin-bottom: 28px; }
.tagline {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
}

/* ===== Mood picker ===== */
.mood-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}
.mood-picker a {
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, background 0.2s, color 0.2s;
}
.mood-picker a:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* ===== Result cards ===== */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  scroll-margin-top: 90px; /* clears the sticky header when jumping */
}

/* slide-in when you land on the anchor */
.result-card {
  animation: slideIn 0.5s ease both;
}
.result-card:nth-child(odd)  { animation-delay: 0.05s; }
.result-card:nth-child(even) { animation-delay: 0.15s; }

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

.result-card h2 {
  margin: 0 0 4px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.dish-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2px 0 8px;
  color: var(--accent);
}
.dish-desc { margin: 0 0 16px; color: var(--text); }

.nutrition {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.nutrition span {
  font-size: 0.85rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

/* ===== Back to top ===== */
.back-to-top {
  display: inline-block;
  margin-top: 20px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.back-to-top:hover { text-decoration: underline; }

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* ===== Mobile ===== */
@media (max-width: 540px) {
  .header-inner { flex-direction: column; gap: 10px; }
  .dish-name { font-size: 1.3rem; }
  .nutrition span { font-size: 0.78rem; }
}
