/*
 * Dnevnik prehrane. The page is one day: it opens with the logo's bowl at dawn and scrolls towards night.
 * Colours and type come from the app (src/ui/theme.ts). Each section's gradient starts where the last one
 * ended, so the day runs on without a seam, and each section sets its own text colours.
 */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 200; font-display: swap; src: url('fonts/plus-jakarta-sans-200.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-display: swap; src: url('fonts/plus-jakarta-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url('fonts/plus-jakarta-sans-600.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url('fonts/plus-jakarta-sans-800.woff2') format('woff2'); }

:root {
  --ink: #23263a;
  --ink-soft: #4d4b5f;
  --surface: #fffefc;
  --line: #e8e4dd;
  --coral: #ff6a3d;
  --pink: #ff3d7f;
  --bowl-a: #f9591f;
  --bowl-b: #f52e73;
  --dawn: #ffe3d3;
  --morning: #fff1e4;
  --noon: #fff6ee;
  --afternoon: #ffe7ee;
  --dusk: #e3ddff;
  --calm: #7c8cff;
  --calm-2: #b69cff;
  --evening: #3a3a6b;
  --night: #171a2b;
  --on-night: #f4f2ff;
  --on-night-soft: #c9c7e0;
  --page: min(1120px, 100% - 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.night :focus-visible, .foot :focus-visible { outline-color: var(--on-night); }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: 0.6rem 1rem; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ----- top of the page ----- */
.top {
  position: relative; z-index: 3; width: var(--page); margin-inline: auto; padding-top: 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.top .logo { height: 40px; width: auto; }
.top a.lang { font-weight: 600; font-size: 0.95rem; padding: 0.5rem 0.25rem; }

/* ----- hero: the logo at the size of the screen ----- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, var(--dawn) 0%, #ffe4dc 55%, var(--morning) 100%);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}
.scene {
  position: relative; height: clamp(250px, 38vh, 380px); margin-top: -0.75rem;
  display: flex; justify-content: center; align-items: flex-end;
}
/* The leaves' tips rise a little above the phone. Their drawing is as tall as the scene plus that much. */
.leaves {
  position: absolute; left: 50%; bottom: -8px; height: calc(100% + 44px); width: auto; aspect-ratio: 1024 / 350; transform: translateX(-50%);
  overflow: visible;
}
.leaves path { transform-box: fill-box; transform-origin: 50% 100%; }

.bowl {
  position: relative; z-index: 2; width: min(1320px, 94%); margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.75rem) clamp(1.25rem, 6vw, 5rem) clamp(5rem, 12vw, 10rem);
  border-radius: 28px 28px 50% 50% / 28px 28px 46% 46%;
  background: linear-gradient(135deg, var(--bowl-a), var(--bowl-b));
  color: #fff; text-align: center;
}
.bowl h1 {
  font-size: clamp(2.6rem, 8.2vw, 6.75rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance;
}
.bowl h1 span { display: block; }
.bowl h1.long { font-size: clamp(2.3rem, 6.2vw, 5.25rem); }
/* This typeface sets punctuation far from the letter, which shows at this size. */
.bowl h1 i { font-style: normal; margin-left: -0.075em; }
.bowl .lead {
  max-width: 40rem; margin: 1.25rem auto 0; font-size: clamp(1.1rem, 1.7vw, 1.3rem); font-weight: 600; line-height: 1.5; text-wrap: pretty;
}
.bowl .status {
  max-width: 34rem; margin: 1rem auto 0; font-size: clamp(1.1875rem, 1.4vw, 1.25rem); font-weight: 800; line-height: 1.4;
}

/* The app, standing in the bowl. Its lower part is behind the rim. */
.phone {
  position: relative; z-index: 1; width: clamp(236px, 25vw, 300px); height: 100%; margin-bottom: -2px;
  border: 7px solid var(--ink); border-bottom: 0; border-radius: 38px 38px 0 0; overflow: hidden;
  background: #f5f3ef; color: var(--ink); font-size: 11px; line-height: 1.35;
  box-shadow: 0 18px 50px rgba(120, 40, 60, 0.28);
}
.phone-in { position: absolute; inset: 0 0 auto; padding: 16px 12px; display: grid; gap: 9px; }
.ph-head { display: flex; align-items: center; gap: 8px; }
.ph-head img { width: 28px; height: 28px; }
.ph-head small { display: block; font-size: 8px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.02em; }
.ph-head b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.ph-sos { margin-left: auto; padding: 5px 11px; border-radius: 99px; background: linear-gradient(135deg, var(--calm), var(--calm-2)); color: #fff; font-weight: 800; font-size: 10px; }
.ph-hero {
  display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--pink));
}
.ph-ring { position: relative; flex: none; width: 66px; height: 66px; }
.ph-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ph-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 800; }
.ph-num { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.ph-num small { font-size: 10px; }
.ph-hero p { font-size: 9px; }
.ph-pill { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.25); font-weight: 800; font-size: 9px; }
.ph-tiles { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; }
.ph-tile { padding: 9px 10px; border-radius: 13px; background: var(--surface); }
.ph-tile.warm { background: #fff3e4; }
.ph-tile small { font-size: 8.5px; color: var(--ink-soft); display: block; }
.ph-tile b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.ph-tile b.t { font-size: 12px; margin-top: 2px; }
.ph-bars { padding: 10px; border-radius: 13px; background: var(--surface); display: grid; gap: 8px; }
.ph-bar { display: grid; grid-template-columns: 1fr auto; gap: 3px 6px; font-size: 9.5px; font-weight: 600; }
.ph-bar i { grid-column: 1 / -1; display: block; height: 5px; border-radius: 9px; background: #efece6; overflow: hidden; }
.ph-bar i::after { content: ''; display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--coral); }

/* ----- the day ----- */
/* Sections overlap by a pixel, so rounding can't open a gap that shows the night behind them. */
main > * + *, .foot { margin-top: -1px; }
.day-title { width: var(--page); margin-inline: auto; padding-top: clamp(2.5rem, 6vw, 4.5rem); font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.stop { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.stop-in {
  width: var(--page); margin-inline: auto; display: grid; grid-template-columns: minmax(11rem, 17rem) minmax(0, 1fr) minmax(0, 24rem);
  gap: clamp(1.25rem, 3vw, 3rem); align-items: start;
}
.when { font-size: clamp(3.25rem, 7vw, 5.75rem); font-weight: 200; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.when small { display: block; margin-top: 0.5rem; font-size: 1rem; font-weight: 600; letter-spacing: 0; line-height: 1.3; }
.stop h3 { font-size: clamp(1.5rem, 2.6vw, 2.125rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance; }
.stop .say { margin-top: 0.75rem; max-width: 34rem; text-wrap: pretty; }

.s-morning { background: linear-gradient(180deg, var(--morning), var(--noon)); }
.s-noon { background: linear-gradient(180deg, var(--noon), #fff4ec); }
.s-afternoon { background: linear-gradient(180deg, #fff4ec, var(--afternoon)); }
.s-evening { background: linear-gradient(180deg, var(--afternoon), var(--dusk)); }
.s-week { background: linear-gradient(180deg, var(--dusk), #c9c4f2); }

/* Pieces of the app's interface, drawn at their real size. */
.piece {
  background: var(--surface); border-radius: 22px; padding: 1.1rem; font-size: 0.875rem; line-height: 1.4;
  box-shadow: 0 10px 30px rgba(70, 50, 80, 0.1);
}
.label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.rows { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) 3.4rem; gap: 0.4rem; }
.rows span { padding: 0.5rem 0.65rem; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .label { padding: 0; border: 0; }
.sum { display: flex; align-items: baseline; gap: 0.6rem; margin-top: 0.75rem; }
.sum b { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.sum small { color: var(--ink-soft); font-size: 0.75rem; }

.reply { background: #ffede6; }
.reply h4 { margin: 0; font-size: 1rem; font-weight: 800; }
.reply .kcal { display: block; margin: 0.35rem 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.reply ul { display: grid; gap: 0.15rem; font-weight: 600; }
.reply li { display: flex; justify-content: space-between; gap: 1rem; }
.reply p { margin-top: 0.6rem; color: var(--ink-soft); font-size: 0.8125rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.chip { padding: 0.45rem 0.8rem; border-radius: 99px; font-weight: 600; background: #fff3e4; }
.chip.b { background: #dfe3f7; }
.chip.c { background: #f8dfe6; }

/* SOS keeps the app's calm colours. */
.calm { background: linear-gradient(160deg, #eef0ff, #f7eeff); text-align: center; padding-block: 1.4rem; }
.calm strong { display: block; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.breath { position: relative; display: grid; place-items: center; height: 11rem; margin-block: 0.25rem; }
.breath i {
  position: absolute; width: 10rem; height: 10rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--calm), var(--calm-2)); transform: scale(0.55); opacity: 0.9;
}
.breath b { position: relative; color: #fff; font-weight: 800; font-size: 1.0625rem; }
.breath.in i { transform: scale(1); transition: transform 4s ease-in-out; }
.breath.out i { transform: scale(0.55); transition: transform 6s ease-in-out; }
.breath-btn {
  font: inherit; font-weight: 800; color: #fff; border: 0; border-radius: 99px; padding: 0.6rem 1.25rem; cursor: pointer;
  background: #5a5fd6;
}
.breath-btn:hover { background: #4a4fc4; }
.breath-btn:disabled { opacity: 0.65; cursor: default; }
.tools { justify-content: center; margin-top: 0.9rem; }
.tools .chip { background: #fff; }

/* The week's bars, from the report. */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; align-items: end; height: 7.5rem; position: relative; margin-top: 0.6rem; }
.bars::before { content: ''; position: absolute; left: 0; right: 0; bottom: 70%; border-top: 2px dashed #b7b3c6; }
.bars div { height: var(--h); border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--coral), var(--pink)); }
.bars div.none { height: 3px; background: #e8e4dd; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; margin-top: 0.35rem; text-align: center; font-size: 0.6875rem; font-weight: 600; color: var(--ink-soft); }

/* ----- night ----- */
.night { background: linear-gradient(180deg, #c9c4f2 0, #8784cd 5rem, #55559a 10rem, var(--evening) 15rem, var(--night) 34rem); color: var(--on-night); padding-block: 15rem clamp(3rem, 6vw, 5rem); }
.night-in { width: var(--page); margin-inline: auto; max-width: 44rem; margin-left: max(1.25rem, calc((100% - 1120px) / 2)); }
.night h2 { font-size: clamp(2rem, 4.4vw, 3.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.night ul { margin-top: 1.5rem; display: grid; gap: 0.9rem; font-size: 1.125rem; }
.night li { padding-left: 1.5rem; position: relative; }
.night li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 0.6rem; height: 0.3rem; border-radius: 0 0 0.6rem 0.6rem; background: var(--coral); }
.night .more { display: inline-block; margin-top: 1.75rem; font-weight: 800; }

.foot { background: var(--night); color: var(--on-night-soft); padding-block: 2.5rem 3rem; font-size: 0.875rem; }
.foot-in { width: var(--page); margin-inline: auto; display: grid; gap: 1rem; }
.foot .logo { height: 36px; width: auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-weight: 600; color: var(--on-night); }
.foot p { max-width: 46rem; }

/* ----- the privacy policy ----- */
.doc-top { background: linear-gradient(180deg, var(--dawn), var(--morning)); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.doc-head { width: var(--page); margin-inline: auto; padding-top: clamp(2rem, 5vw, 3.5rem); }
.doc-head h1 { font-size: clamp(2.5rem, 7vw, 4.75rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
.doc-head p { margin-top: 0.75rem; color: var(--ink-soft); font-weight: 600; }
.doc-body { display: flow-root; margin-top: -1px; background: linear-gradient(180deg, var(--morning), var(--noon) 16rem); padding-bottom: clamp(3rem, 7vw, 5rem); }
.doc { width: var(--page); max-width: 42rem; margin-left: max(1.25rem, calc((100% - 1120px) / 2)); }
.doc h2 { margin-top: 2.25rem; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.doc p, .doc ul { margin-top: 0.6rem; }
.doc > :first-child { margin-top: 0; }
.doc ul { display: grid; gap: 0.35rem; }
.doc li { padding-left: 1.25rem; position: relative; }
.doc li::before { content: ''; position: absolute; left: 0; top: 0.68em; width: 0.5rem; height: 0.25rem; border-radius: 0 0 0.5rem 0.5rem; background: var(--coral); }

/* ----- narrower screens ----- */
@media (max-width: 960px) {
  .stop-in { grid-template-columns: minmax(0, 1fr); }
  .stop-in > .piece { max-width: 26rem; }
  .when small { display: inline; margin: 0 0 0 0.6rem; }
}
@media (max-width: 640px) {
  .scene { height: 250px; margin-top: 1.5rem; }
  .leaves { height: calc(100% + 16px); }
  .bowl { width: 100%; border-radius: 0 0 50% 50% / 0 0 14% 14%; padding-bottom: 4.5rem; }
  .bowl h1 { font-size: clamp(2.4rem, 11.5vw, 3.5rem); }
  .top .logo { height: 34px; }
}

/* ----- one moment when the page opens: the leaves grow and the phone rises out of the bowl ----- */
@media (prefers-reduced-motion: no-preference) {
  .phone { animation: rise 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .leaves path { animation: grow 1100ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .leaves path:nth-child(1) { animation-delay: 150ms; }
  .leaves path:nth-child(2) { animation-delay: 250ms; }
  .leaves path:nth-child(3) { animation-delay: 80ms; }
  @keyframes rise { from { transform: translateY(32%); } to { transform: none; } }
  @keyframes grow { from { transform: scale(0.35) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  .breath.in i, .breath.out i { transition: none; }
}
