/* MealBuddy website. Colours mirror the app (ios/MealBuddy/DesignSystem/Colors.swift
   and ios/Shared/MBPalette.swift): warm cream, warm brown text, caramel accents. */

:root {
  --bg: #FAF5EB;          /* mbBackground */
  --surface: #FFFDF8;     /* mbSurface */
  --text: #2B2621;        /* mbTextPrimary */
  --text-soft: #756B61;   /* mbTextSecondary */
  --line: #E3D9C7;        /* mbLine */
  --accent-soft: #F2D9C4; /* mbAccentSoft */
  --button: #846C5B;      /* mbCtaBold */
  --button-text: #FFFDF8;
  --done: #B08463;        /* MBPalette.done */
  --done-wash: #F2E3D2;   /* MBPalette.doneWash */
  --sun: #EDBF61;
  --radius: 22px;
  --shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(90, 64, 40, .35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1F1C1A;
    --surface: #2B2724;
    --text: #F2EBDE;
    --text-soft: #ADA191;
    --line: #453D36;
    --accent-soft: #4D3830;
    --button: #9A7C66;
    --button-text: #FFFDF8;
    --done: #C9A283;
    --done-wash: #4A3A2E;
    --shadow: 0 1px 0 var(--line);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

a { color: var(--done); text-underline-offset: 3px; }
a:hover { color: var(--button); }

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

.wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow { max-width: 720px; }

/* Header */

.site-header { padding: 18px 0; }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
}

.brand img { width: 36px; height: 36px; border-radius: 10px; }

.site-nav { display: flex; gap: 20px; }

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 40px;
  padding: 48px 0 64px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-weight: 900;
}

.hero p.lead {
  font-size: 20px;
  color: var(--text-soft);
  margin: 0 0 28px;
  max-width: 30em;
}

.hero-art {
  position: relative;
  justify-self: center;
  width: min(360px, 80vw);
}

.hero-art img {
  width: 100%;
  border-radius: 28%;
  animation: bob 5s ease-in-out infinite;
}

.bubble {
  position: absolute;
  top: 6%;
  right: -6%;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}

.bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -9px;
  width: 14px;
  height: 14px;
  background: var(--surface);
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: rotate(45deg);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art img { animation: none; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--button);
  color: var(--button-text);
  padding: 14px 22px;
  border-radius: 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
}

.badge small { display: block; font-weight: 700; opacity: .8; font-size: 12px; line-height: 1.2; }
.badge span { line-height: 1.2; }

.badge-note { color: var(--text-soft); font-size: 14px; margin-top: 12px; }

/* Day strip: three meal ticks like the app's Your Day */

.day {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 72px;
}

.meal {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 999px;
  padding: 10px 18px 10px 10px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.tick {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--done-wash);
  color: var(--done);
  display: grid;
  place-items: center;
}

.meal.later .tick { background: transparent; border: 2px dashed var(--line); }
.meal.later { color: var(--text-soft); }

/* Sections */

section { padding: 0 0 72px; }

h2 {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.2;
  margin: 0 0 12px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.section-lead { color: var(--text-soft); margin: 0 0 32px; max-width: 34em; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card h3 { margin: 14px 0 6px; font-size: 19px; font-weight: 800; }
.card p { margin: 0; color: var(--text-soft); font-size: 16px; }

.icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--button);
  display: grid;
  place-items: center;
}

.promise {
  background: var(--done-wash);
  border-radius: var(--radius);
  padding: 36px;
}

.promise ul {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 28px;
}

.promise li { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; }
.promise li svg { flex: none; margin-top: 4px; color: var(--done); }

.care-note {
  color: var(--text-soft);
  font-size: 15px;
  margin-top: 24px;
}

/* Document pages: privacy, terms, support */

.doc { padding: 24px 0 72px; }

.doc h1 {
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.1;
  margin: 0 0 8px;
  font-weight: 900;
}

.doc .meta { color: var(--text-soft); margin: 0 0 32px; font-size: 15px; }

.doc h2 { font-size: 22px; margin: 40px 0 10px; }

.doc p, .doc li { color: var(--text); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 8px; }

.contact-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin: 0 0 16px;
}

.contact-card h2 { margin-top: 0; }

.email {
  display: inline-block;
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
}

details {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

summary { font-weight: 800; cursor: pointer; }
details[open] summary { margin-bottom: 8px; }
details p, details ol { margin: 8px 0 0; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--text-soft);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--text-soft); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--text); }

/* Phones */

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding: 24px 0 48px; gap: 28px; }
  .hero-art { order: -1; width: min(240px, 60vw); }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .bubble { right: -10%; font-size: 13px; }
  .cards { grid-template-columns: 1fr; }
  .promise { padding: 26px; }
  .promise ul { grid-template-columns: 1fr; }
  .site-nav { gap: 14px; }
  .brand span { display: none; }
}
