/* MeTrition website — "Fresh & Organic" palette from the app's design system */
:root {
  --accent: #009051;
  --accent-strong: #007a45;
  --accent-soft: rgba(0, 144, 81, 0.1);
  --bg: #faf7f2;
  --surface: #ffffff;
  --outline: #dddcd8;
  --text: #151617;
  --muted: #5c6166;
  --protein: #bc1500;
  --fat: #ff9300;
  --carb: #008e00;
  --on-accent: #ffffff;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --pill: 30px;
  --max: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #00e696;
    --accent-strong: #33ebab;
    --accent-soft: rgba(0, 230, 150, 0.12);
    --bg: #1e2022;
    --surface: #2a2d30;
    --outline: #52595e;
    --text: #efefef;
    --muted: #a9b0b5;
    --protein: #e0575b;
    --on-accent: #0d1f17;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--outline) 60%, transparent);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(250, 247, 242, 0.18); }
.brand b { color: var(--accent); font-weight: 800; }

.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: var(--pill);
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  display: flex; padding: 3px; border-radius: var(--pill);
  border: 1px solid var(--outline); background: var(--surface);
}
.lang-switch a {
  padding: 4px 9px; border-radius: var(--pill); font-size: 0.8rem; font-weight: 700;
  color: var(--muted); text-decoration: none; line-height: 1.4;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }

.menu-toggle { display: none; }
@media (max-width: 860px) {
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--outline);
    background: var(--surface); color: var(--text); cursor: pointer;
  }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; padding: 8px 16px 16px; background: var(--bg);
    border-bottom: 1px solid var(--outline);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: var(--pill);
  font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent); }

/* Store badges */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 20px 8px 16px; border-radius: 14px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid #000; transition: transform 0.15s ease;
}
@media (prefers-color-scheme: dark) { .store { border-color: #5b6166; } }
.store:hover { color: #fff; transform: translateY(-2px); }
.store svg { width: 26px; height: 26px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.15; }
.store small { font-size: 0.7rem; opacity: 0.85; }
.store strong { font-size: 1.15rem; font-weight: 600; }

/* Hero */
.hero { padding: 64px 0 48px; overflow: hidden; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; } .hero { padding: 96px 0 72px; } }
.eyebrow {
  display: inline-block; padding: 6px 14px; border-radius: var(--pill);
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.85rem; margin-bottom: 18px;
}
.lead { font-size: 1.2rem; color: var(--muted); max-width: 34em; }
.hero .stores { margin-top: 28px; }

/* Calorie ring illustration */
.ring-card {
  position: relative; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow);
  padding: 28px; max-width: 400px; margin: 0 auto; width: 100%;
}
.ring-card .ring { position: relative; width: 100%; aspect-ratio: 1; }
.ring-card .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: var(--outline); opacity: 0.5; }
.ring-fill { stroke: var(--accent); stroke-linecap: round; animation: fill 1.6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fill { from { stroke-dashoffset: 565; } }
@media (prefers-reduced-motion: reduce) { .ring-fill { animation: none; } }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center strong { font-size: clamp(2.2rem, 7vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.ring-center span { color: var(--muted); font-size: 0.95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.chip { padding: 6px 12px; border-radius: var(--pill); font-size: 0.85rem; font-weight: 700; }
.chip.p { color: var(--protein); background: color-mix(in srgb, var(--protein) 14%, transparent); }
.chip.f { color: var(--fat); background: color-mix(in srgb, var(--fat) 16%, transparent); }
.chip.c { color: var(--carb); background: color-mix(in srgb, var(--carb) 14%, transparent); }
@media (prefers-color-scheme: dark) { .chip.c { color: #3fcf3f; } }
.goal-row { display: flex; justify-content: space-between; border-top: 1px solid var(--outline); margin-top: 20px; padding-top: 16px; font-size: 0.95rem; }
.goal-row div { display: flex; flex-direction: column; }
.goal-row small { color: var(--muted); }
.goal-row b { font-size: 1.1rem; }

/* Sections */
section { padding: 56px 0; }
@media (min-width: 900px) { section { padding: 80px 0; } }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

/* Flex instead of grid so cards in an incomplete last row stretch to fill it.
   280px basis gives 3 columns on desktop, 2 on tablets, 1 on phones. */
.features { display: flex; flex-wrap: wrap; gap: 16px; }
.features > .card { flex: 1 1 280px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card p { color: var(--muted); margin: 0; }
.icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 16px;
}
.icon svg { width: 24px; height: 24px; }

.band { background: var(--surface); border-block: 1px solid var(--outline); }
.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checks li { display: flex; gap: 12px; }
.checks li::before {
  content: ""; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23009051' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.cta { text-align: center; }
.cta .stores { justify-content: center; margin-top: 24px; }
.cta p { color: var(--muted); max-width: 36em; margin-inline: auto; }

/* Page header for inner pages */
.page-head { padding-top: 56px; padding-bottom: 24px; }
.page-head p { color: var(--muted); font-size: 1.15rem; max-width: 40em; }

/* Legal documents */
.doc { max-width: 760px; padding-bottom: 72px; }
.doc .card { padding: 28px; }
@media (min-width: 720px) { .doc .card { padding: 44px 48px; } }
.doc h2 { font-size: 1.35rem; margin-top: 2em; }
.doc .card > :first-child { margin-top: 0; }
.doc h3 { margin-top: 1.4em; font-size: 1.05rem; }
.doc p, .doc li { color: var(--text); }
.doc .card p { margin: 0 0 0.9em; }
.doc .card p:last-child { margin-bottom: 0; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 0.5em; }
.meta { color: var(--muted); font-size: 0.95rem; }
.callout {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 1em 0;
}

/* Skills */
.skill { display: grid; gap: 28px; }
@media (min-width: 900px) { .skill { grid-template-columns: 1.3fr 1fr; } }
.skill .card { padding: 28px; }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent); margin: 0 6px 6px 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 14px; }
.steps li::before {
  content: counter(s); width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-weight: 800; display: grid; place-items: center;
}
.steps p { margin: 0; color: var(--muted); }
.files { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px solid var(--outline); }
.files li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--outline); font-size: 0.95rem; }
.files a { font-weight: 600; word-break: break-all; }
.files span { color: var(--muted); white-space: nowrap; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--accent-soft); padding: 2px 6px; border-radius: 6px; }
.download-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Contact */
.contact-grid { display: grid; gap: 20px; padding-bottom: 72px; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1.3fr; } }
.contact-grid .card { padding: 28px; }
.email-big { font-size: 1.2rem; font-weight: 700; word-break: break-all; }
label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--outline); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 150px; resize: vertical; }
.hint { color: var(--muted); font-size: 0.9rem; margin-top: 12px; }

/* FAQ */
details { border-bottom: 1px solid var(--outline); padding: 16px 0; }
details:first-of-type { border-top: 1px solid var(--outline); }
summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); margin: 10px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--outline); padding: 40px 0; color: var(--muted); font-size: 0.95rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* Copy buttons and the no-email-app fallback */
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; border-width: 1.5px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.fallback { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--outline); }
.fallback p { color: var(--muted); }
.fallback textarea { min-height: 170px; font-size: 0.95rem; }

/* Brand green sections (header, hero / page head, closing call to action, footer).
   Same dark green as the app icon background. */
:root {
  --brand: #255537;
  --brand-deep: #1b4029;
  --on-brand: #faf7f2;
  --on-brand-muted: rgba(250, 247, 242, 0.78);
  --brand-line: rgba(250, 247, 242, 0.16);
  --brand-hl: #ff9f1c; /* bright orange highlight on the green */
}
@media (prefers-color-scheme: dark) {
  :root { --brand: #1f4a30; --brand-deep: #163522; }
}

.site-header {
  background: color-mix(in srgb, var(--brand) 92%, transparent);
  border-bottom-color: var(--brand-line);
  color: var(--on-brand);
}
.brand, .brand:hover { color: var(--on-brand); }
.brand b { color: inherit; }
.nav-links a { color: var(--on-brand-muted); }
.nav-links a:hover { color: var(--on-brand); background: rgba(250, 247, 242, 0.1); }
.nav-links a[aria-current="page"] { color: var(--on-brand); background: rgba(250, 247, 242, 0.16); }
.lang-switch { background: rgba(250, 247, 242, 0.08); border-color: var(--brand-line); }
.lang-switch a { color: var(--on-brand-muted); }
.lang-switch a:hover { color: var(--on-brand); }
.lang-switch a[aria-current="true"] { background: var(--on-brand); color: var(--brand); }
@media (max-width: 860px) {
  .menu-toggle { background: rgba(250, 247, 242, 0.08); border-color: var(--brand-line); color: var(--on-brand); }
  .nav-links { background: var(--brand); border-bottom-color: var(--brand-line); }
}

.hero, .page-head, .brand-band { background: var(--brand); color: var(--on-brand); }
.hero .lead, .page-head p, .brand-band p { color: var(--on-brand-muted); }
.hero .hl { color: var(--brand-hl); }
.hero .eyebrow, .page-head .eyebrow { background: rgba(255, 159, 28, 0.16); color: var(--brand-hl); }
.hero .store, .brand-band .store { border-color: rgba(250, 247, 242, 0.28); }
.hero .ring-card { color: var(--text); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28); }

.page-head { padding-bottom: 48px; margin-bottom: 40px; }
.page-head .meta { color: var(--on-brand-muted); }

.brand-band { border-top: 1px solid var(--brand-line); }
.brand-band + .site-footer, .site-footer { border-top: 0; }

.site-footer { background: var(--brand-deep); color: var(--on-brand-muted); }
.footer-links a { color: var(--on-brand-muted); }
.footer-links a:hover { color: var(--on-brand); }

.not-found { padding-top: 56px; padding-bottom: 72px; }

/* Skills page tip card */
.card.tip { border-left: 4px solid var(--accent); }
