@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f7f3ed;
  --bg-soft: #efe7dd;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: #fffdfa;
  --surface-tint: rgba(255, 255, 255, 0.56);
  --text: #1c1815;
  --muted: #6e6357;
  --border: rgba(87, 71, 56, 0.14);
  --primary: #718a69;
  --primary-strong: #586e52;
  --accent: #cb7654;
  --accent-soft: #f0d5c8;
  --success: #2f7e60;
  --danger: #b34f47;
  --shadow: 0 24px 60px rgba(71, 50, 35, 0.12);
  --shadow-soft: 0 16px 36px rgba(71, 50, 35, 0.08);
  --radius-xl: 36px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

body[data-theme="dark"] {
  --bg: #111311;
  --bg-soft: #181b17;
  --surface: rgba(26, 29, 26, 0.84);
  --surface-strong: #1b1f1b;
  --surface-tint: rgba(255, 255, 255, 0.04);
  --text: #f5efe7;
  --muted: #beb2a2;
  --border: rgba(241, 232, 221, 0.1);
  --primary: #9ab18a;
  --primary-strong: #80986f;
  --accent: #e69372;
  --accent-soft: rgba(230, 147, 114, 0.16);
  --success: #5bc190;
  --danger: #ff9084;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 16px 30px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(203, 118, 84, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(113, 138, 105, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

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

.small {
  font-size: 12px;
}

.stack {
  display: grid;
  gap: 14px;
}

.logo-mark {
  font-family: "Fraunces", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand-badge,
.eyebrow,
.mini-kicker,
.mini-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(113, 138, 105, 0.12);
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  border-color: transparent;
  background: var(--text);
  color: #fffaf4;
}

.btn-primary:hover {
  background: #2a241f;
}

.btn-ghost {
  background: transparent;
}

.btn-wide {
  width: 100%;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(113, 138, 105, 0.55);
  box-shadow: 0 0 0 4px rgba(113, 138, 105, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

textarea {
  resize: vertical;
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(179, 79, 71, 0.2);
  background: rgba(179, 79, 71, 0.12);
  color: var(--danger);
}

.success {
  border-color: rgba(47, 126, 96, 0.22);
  background: rgba(47, 126, 96, 0.12);
  color: var(--success);
}

.site-body {
  overflow-x: hidden;
}

.site-shell {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 72px;
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

[id="benefits"],
[id="discover"],
[id="start"] {
  scroll-margin-top: 96px; /* account for sticky site-header */
}

.site-nav,
.site-actions,
.hero-buttons,
.inline-actions,
.card-actions,
.auth-links,
.topbar-actions,
.pager,
.setting-row,
.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.site-main {
  display: grid;
  gap: 28px;
}

.hero-grid,
.benefit-section,
.discover-panel,
.cta-section,
.auth-card,
.auth-visual,
.panel,
.mini-card,
.preview-card,
.recipe-card,
.ad-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 28px;
  padding: 36px;
}

.hero-copy h1,
.section-head h2,
.panel-copy h2,
.cta-section h2,
.auth-visual h1,
.auth-card h2 {
  margin: 16px 0 12px;
  font-family: "Fraunces", Georgia, serif;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(50px, 7vw, 88px);
  max-width: 8ch;
}

.hero-lead {
  max-width: 620px;
  font-size: 18px;
  color: var(--muted);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-points span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.hero-scene {
  position: relative;
  min-height: 520px;
}

.hero-image-card {
  position: relative;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
  border-radius: 32px;
}

.hero-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-note {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(17, 19, 17, 0.74);
  color: #fff7f1;
  backdrop-filter: blur(12px);
}

.image-note span {
  color: rgba(255, 247, 241, 0.8);
}

.floating-taste-card {
  position: absolute;
  right: -12px;
  bottom: 42px;
  width: min(260px, 60%);
  padding: 18px;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.benefit-section,
.discover-panel,
.cta-section {
  padding: 30px;
}

.section-head {
  max-width: 720px;
}

.section-head h2 {
  font-size: clamp(34px, 4vw, 56px);
}

.benefit-grid,
.dashboard-grid,
.recipes-grid,
.recipe-preview-grid {
  display: grid;
  gap: 16px;
}

.benefit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.benefit-card,
.recipe-preview-card,
.metric-item,
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-tint);
}

.benefit-card,
.recipe-preview-card,
.stat-card,
.metric-item,
.preview-card,
.recipe-card,
.ad-card {
  padding: 20px;
}

.benefit-card h3,
.recipe-preview-card h3,
.panel-header h2,
.topbar h1 {
  margin: 0 0 8px;
}

.discover-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.94fr);
  gap: 22px;
}

.panel-copy h2 {
  font-size: clamp(34px, 4vw, 52px);
  max-width: 10ch;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.stat-tile {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
}

.stat-tile strong,
.stat-card strong,
.metric-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 28px;
  font-weight: 800;
}

.recipe-preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.recipe-preview-card.soft {
  background: rgba(203, 118, 84, 0.12);
}

.recipe-preview-card.wide {
  grid-column: 1 / -1;
  padding: 0;
  overflow: hidden;
}

.recipe-preview-card.wide img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.cta-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cta-section h2 {
  font-size: clamp(32px, 4vw, 50px);
  max-width: 11ch;
}

.auth-body {
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-layout {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(360px, 0.8fr);
  gap: 20px;
}

.auth-visual,
.auth-card {
  padding: 34px;
}

.auth-visual {
  display: grid;
  align-content: space-between;
  min-height: 640px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at top left, rgba(113, 138, 105, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(203, 118, 84, 0.14), transparent 30%),
    var(--surface);
}

.auth-visual h1 {
  font-size: clamp(44px, 6vw, 74px);
  max-width: 8.5ch;
}

.auth-visual p {
  max-width: 520px;
  color: var(--muted);
  font-size: 17px;
}

.auth-feature-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.auth-feature-item {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.42);
}

.auth-card {
  display: grid;
  align-content: center;
}

.auth-logo {
  margin-bottom: 14px;
}

.auth-card h2 {
  font-size: 44px;
}

.auth-card p {
  margin-top: 0;
}

.auth-form {
  margin-top: 8px;
}

.auth-links {
  margin-top: 16px;
}

.auth-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.auth-links-wide {
  justify-content: space-between;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  align-items: stretch;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 22px;
  border-right: 1px solid var(--border);
  background: rgba(255, 251, 246, 0.7);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.nav {
  margin: 0;
  padding: 0;
}

.nav-link {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.nav-link:hover {
  background: rgba(113, 138, 105, 0.08);
  border-color: var(--border);
  transform: translateX(2px);
}

.nav-link.active {
  background: rgba(113, 138, 105, 0.16);
  border-color: rgba(113, 138, 105, 0.32);
  color: var(--primary-strong);
}

.content {
  padding: 28px 32px 56px;
  min-width: 0; /* allow grid columns to shrink without overflow */
}

.section {
  display: none;
  scroll-margin-top: 24px;
}

.section.active {
  display: block;
}

.topbar,
.setting-row,
.pager,
.panel-header {
  justify-content: space-between;
}

.topbar {
  margin-bottom: 24px;
}

.topbar h1,
.panel-header h2 {
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.03em;
}

.user-chip {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}

.dashboard-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
  justify-content: space-between;
}

.three-columns,
.two-columns {
  display: grid;
  gap: 14px;
}

.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recipes-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.recipe-card img,
.card-cover {
  width: 100%;
  height: 180px;
  margin-bottom: 12px;
  border-radius: 18px;
  object-fit: cover;
}

.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

#ads-list {
  display: grid;
  gap: 16px;
  align-content: start;
}

#ads-list .ad-card,
#ads-list .campaign-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  position: relative;
  z-index: 1;
}

#ads-list .ad-card h3,
#ads-list .ad-card p,
#ads-list .ad-card strong,
#ads-list .ad-card span,
#ads-list .ad-card a,
#ads-list .campaign-card h3,
#ads-list .campaign-card p,
#ads-list .campaign-card strong,
#ads-list .campaign-card span,
#ads-list .campaign-card a {
  color: inherit;
}

#ads-list .ad-card h3,
#ads-list .ad-card p,
#ads-list .campaign-card h3,
#ads-list .campaign-card p {
  margin: 0;
}

#ads-list .ad-card .card-meta,
#ads-list .campaign-card .card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--muted);
}

.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.preview-row:last-child {
  border-bottom: 0;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

.debug-panel {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(179, 79, 71, 0.28);
  background: rgba(179, 79, 71, 0.08);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .hero-grid,
  .discover-panel,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .benefit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-scene,
  .hero-image-card {
    min-height: 420px;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 18px 20px;
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-link {
    width: auto;
    flex: 1 1 140px;
    text-align: center;
  }

  .content {
    padding: 22px 20px 48px;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 24px, 1200px);
  }

  .site-header,
  .site-nav,
  .site-actions,
  .topbar,
  .setting-row,
  .pager,
  .panel-header,
  .cta-section,
  .auth-links-wide {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-grid,
  .benefit-section,
  .discover-panel,
  .cta-section,
  .auth-visual,
  .auth-card,
  .panel,
  .mini-card {
    padding: 20px;
  }

  .benefit-grid,
  .dashboard-grid,
  .three-columns,
  .two-columns,
  .stat-row,
  .recipe-preview-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 46px;
  }

  .section-head h2,
  .panel-copy h2,
  .cta-section h2,
  .auth-card h2 {
    font-size: 34px;
  }

  .auth-body {
    padding: 14px;
  }

  .auth-visual {
    min-height: auto;
  }

  .floating-taste-card {
    position: static;
    width: 100%;
    margin-top: 14px;
  }
}
