/* Yumta: site styles. Tokens from the app (Palette.swift, Typography.swift, design brief §3). */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/Archivo-Variable.woff2") format("woff2-variations"),
    url("/assets/fonts/Archivo-Variable.woff2") format("woff2");
  font-weight: 500 900;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --porcelain: #f6f7f4;
  --plate: #ffffff;
  --ink: #3a1f40; /* aubergine */
  --fig: #6e6472;
  --rim: #e4e1e6;
  --on-ink: #ffffff;
  --glass: #ffffff; /* jar interior */
  --pomegranate: #b8283b; /* protein */
  --wheat: #d9a441; /* carbs: fill only, never text */
  --olive: #707a2a; /* fat */
  --day-under: #3e7cc9;
  --day-on: #3fa36b;
  --day-over: #f2c94c;
  --day-way: #e5484d;

  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --display: "Archivo", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --r-card: 14px;
  --r-sheet: 28px;
  --gutter: 20px;
  --section: clamp(56px, 9vw, 104px);
  --max: 1080px;
  --spring: cubic-bezier(0.22, 1.2, 0.36, 1); /* CSS stand-in for the "snappy" spring (0.3 / 0.8) */
}

@media (prefers-color-scheme: dark) {
  :root {
    --porcelain: #1a1220;
    --plate: #251a2c;
    --ink: #f3eef4;
    --fig: #a89cad;
    --rim: #3a2e41;
    --on-ink: #1a1220;
    --glass: #3a2e41;
    --pomegranate: #d3364a;
    --wheat: #e0b463;
    --olive: #8c9834;
    --day-under: #5b95e0;
    --day-on: #4cbf7f;
    --day-over: #f5d365;
    --day-way: #f0646a;
  }
}

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

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

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font: 17px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  hyphens: auto;
  -webkit-hyphens: auto;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

p {
  margin: 0 0 1em;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--ink);
  color: var(--on-ink);
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
}

.skip:focus {
  top: 10px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------- type */

h1,
h2,
.display {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(42px, 9.6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.01em;
}

h2 {
  font-weight: 700;
  font-stretch: 100%;
  font-size: clamp(30px, 5.4vw, 44px);
  line-height: 1.06;
  margin-bottom: 16px;
}

h3 {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 4px;
}

.eyebrow {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 15px;
  color: var(--fig);
  margin: 0 0 14px;
}

.lead {
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.45;
  max-width: 34em;
}

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

.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- chrome (glass) */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--porcelain) 74%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid color-mix(in srgb, var(--rim) 80%, transparent);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: 23px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.brand svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--ink);
}

.nav a:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}

@media (max-width: 430px) {
  .site-header .wrap {
    gap: 6px;
  }
  .brand {
    font-size: 21px;
    gap: 6px;
  }
  .brand svg {
    width: 23px;
    height: 23px;
  }
  .nav {
    gap: 0;
  }
  .nav a {
    font-size: 14px;
    padding: 7px 8px;
  }
}

@media (max-width: 350px) {
  .brand svg {
    display: none;
  }
  .nav a {
    font-size: 13px;
    padding: 6px 6px;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 15px/1 var(--text);
  color: var(--ink);
  background: color-mix(in srgb, var(--plate) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border: 1px solid var(--rim);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s var(--spring);
}

.pill:active {
  transform: scale(0.97);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font: 600 17px/1.1 var(--text);
  text-decoration: none;
  background: var(--ink);
  color: var(--on-ink);
  transition: transform 0.25s var(--spring);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rim);
}

/* ---------------------------------------------------------------- hero */

.hero {
  padding-block: clamp(28px, 6vw, 72px) var(--section);
}

.hero-grid {
  display: grid;
  gap: 8px 48px;
  grid-template-areas: "text" "scene" "cta";
  align-items: center;
}

.hero-text {
  grid-area: text;
}

.hero-scene {
  grid-area: scene;
}

.hero-cta {
  grid-area: cta;
}

.hero h1 {
  margin-bottom: 18px;
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
    grid-template-areas: "text scene" "cta scene";
    align-items: end;
  }
  .hero-cta {
    align-self: start;
  }
}

.store {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-top: 8px;
}

.store-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-stretch: 100%;
  font-weight: 700;
  font-size: 17px;
  padding: 10px 16px 10px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
}

.store-soon svg {
  width: 22px;
  height: 22px;
}

.store-note {
  font-size: 15px;
  color: var(--fig);
  max-width: 30em;
  margin: 0;
}

/* ---------------------------------------------------------------- the jar scene */

.scene {
  margin: 0 auto;
  width: 100%;
  max-width: 460px;
  display: grid;
  justify-items: center;
}

.stage {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  border-radius: 20px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.stage canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 300 / 272;
}

.readout {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-top: 4px;
  text-align: center;
}

.readout-meal {
  font-size: 15px;
  color: var(--fig);
  min-height: 1.5em;
}

.readout-number {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(48px, 9vw, 60px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.readout-unit {
  font-size: 15px;
  color: var(--fig);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.sw-protein { background: var(--pomegranate); }
.sw-carbs { background: var(--wheat); }
.sw-fat { background: var(--olive); }

.scene-tools {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.scene-tools .pill {
  font-size: 13px;
  padding: 7px 12px;
}

.scene-hint {
  font-size: 13px;
  color: var(--fig);
  margin: 10px 0 0;
  text-align: center;
}

/* ---------------------------------------------------------------- sections */

.section {
  padding-block: var(--section);
  border-top: 1px solid var(--rim);
}

.section-head {
  max-width: 40em;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-head p {
  font-size: 18px;
  margin: 0;
}

.split {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 880px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
  .split.flip > :first-child {
    order: 2;
  }
}

/* Four moods */
.moods {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 880px) {
  .moods {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

.mood {
  background: var(--plate);
  border: 1px solid var(--rim);
  border-radius: var(--r-card);
  padding: 10px 14px 16px;
  min-width: 0;
}

.mood p {
  font-size: 15px;
  color: var(--fig);
  margin: 0;
}

.mood .stage {
  margin-bottom: 6px;
}

/* Logging list: flat rows with hairlines */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rim);
}

.rows li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rim);
}

.rows svg {
  width: 26px;
  height: 26px;
  margin-top: 1px;
  color: var(--ink);
}

.rows p {
  margin: 0;
  color: var(--fig);
  font-size: 16px;
}

.tag {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 6px;
  font: 600 12px/1 var(--text);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--rim);
  color: var(--fig);
  white-space: nowrap;
}

/* Phones (screenshots) */
.phones {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
}

.phone {
  margin: 0;
  width: min(300px, 100%);
  background: var(--plate);
  border: 1px solid var(--rim);
  border-radius: 34px;
  padding: 7px;
  flex: 0 1 300px;
}

.phone img {
  width: 100%;
  height: auto;
  border-radius: 27px;
}

.phones .phone:nth-child(2) {
  margin-top: 48px;
}

@media (max-width: 560px) {
  .phones {
    gap: 10px;
  }
  .phone {
    border-radius: 24px;
    padding: 5px;
  }
  .phone img {
    border-radius: 19px;
  }
  .phones .phone:nth-child(2) {
    margin-top: 32px;
  }
}

@media (prefers-color-scheme: dark) {
  .phone img.light-only {
    filter: brightness(0.9);
  }
}

.phone figcaption {
  font-size: 13px;
  color: var(--fig);
  text-align: center;
  padding: 8px 6px 4px;
}

/* The label card (design brief §4.2) */
.label-card {
  background: var(--plate);
  border: 1px solid var(--rim);
  border-radius: var(--r-card);
  padding: 18px 20px 16px;
  max-width: 420px;
  width: 100%;
  margin-inline: auto;
}

.label-card .name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
}

.label-card .portion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--fig);
  font-size: 15px;
  margin: 6px 0 12px;
}

.label-card .portion .est {
  border: 1px solid var(--rim);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--ink);
  font-size: 14px;
}

.label-rows {
  margin: 0;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

.label-rows div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--rim);
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.label-rows div:first-child {
  border-top: 0;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 2px solid var(--ink);
}

.label-rows dt,
.label-rows dd {
  margin: 0;
}

.label-rows .sub {
  padding-left: 14px;
  color: var(--fig);
}

.source {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--fig);
  margin-top: 12px;
}

.source::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--fig);
  flex: none;
}

.laws {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.laws li {
  padding-left: 18px;
  border-left: 3px solid var(--rim);
}

.laws strong {
  display: block;
  font-weight: 600;
}

.laws span {
  color: var(--fig);
}

/* Projection chart */
.chart-card {
  background: var(--plate);
  border: 1px solid var(--rim);
  border-radius: var(--r-card);
  padding: 18px 16px 12px;
}

.chart-card .chart-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  margin: 0 4px 2px;
}

.chart-card .chart-sub {
  margin: 0 4px 10px;
  color: var(--fig);
  font-size: 15px;
}

.chart text {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 12px;
  fill: var(--fig);
  font-variant-numeric: tabular-nums;
}

/* Small facts grid */
.facts {
  display: grid;
  gap: 0 40px;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1000px) {
  .facts {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.facts li {
  padding: 18px 0;
  border-top: 1px solid var(--rim);
}

.facts p {
  margin: 0;
  color: var(--fig);
  font-size: 16px;
}

/* Sister app */
.sister {
  background: var(--plate);
  border: 1px solid var(--rim);
  border-radius: var(--r-card);
  padding: clamp(20px, 4vw, 36px);
  display: grid;
  gap: 18px;
}

.sister h2 {
  margin: 0;
}

.sister p {
  margin: 0;
  max-width: 40em;
}

.sister .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.closing {
  text-align: left;
}

/* ---------------------------------------------------------------- docs (support, impressum) */

.doc {
  padding-block: clamp(32px, 6vw, 64px) var(--section);
}

.doc .wrap {
  max-width: 760px;
}

.doc h1 {
  font-size: clamp(38px, 7vw, 56px);
  margin-bottom: 14px;
}

.doc h2 {
  font-size: clamp(24px, 4vw, 30px);
  margin: 44px 0 14px;
}

.doc h3 {
  font-size: 18px;
}

.contact-card {
  background: var(--plate);
  border: 1px solid var(--rim);
  border-radius: var(--r-card);
  padding: 20px;
  margin: 24px 0 8px;
}

.contact-card p {
  margin: 0 0 6px;
}

.contact-card .mail {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
}

.faq {
  border-top: 1px solid var(--rim);
}

.faq details {
  border-bottom: 1px solid var(--rim);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 32px 16px 0;
  font-weight: 600;
  font-size: 17px;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--fig);
  border-bottom: 2px solid var(--fig);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.3s var(--spring);
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq .answer {
  padding: 0 0 18px;
  color: var(--ink);
}

.faq .answer p,
.faq .answer ol,
.faq .answer ul {
  margin: 0 0 10px;
}

.faq .answer ol,
.faq .answer ul {
  padding-left: 22px;
}

.placeholder {
  background: color-mix(in srgb, var(--day-over) 30%, transparent);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}

.doc address {
  font-style: normal;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--rim);
  padding-block: 28px 40px;
  font-size: 14px;
  color: var(--fig);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.footer-links a {
  color: var(--fig);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
