/* KIkal landing pages. Same tokens as the app, light + dark via prefers-color-scheme. */
:root {
  --bg: #f2f3f4; --surface: #ffffff; --surface-2: #e9eaec;
  --ink: #1c2321; --ink-2: #5b6663; --ink-3: #68716d; --line: #e3e5e1;
  --accent: #20794a; --accent-ink: #ffffff; --good: #20794a; --bad: #c2452f; --protein: #2a6da8; --weight: #b07620;
  --radius: 10px; --radius-card: 14px;
  --shadow: 0 1px 2px rgba(28, 35, 33, .05), 0 4px 16px rgba(28, 35, 33, .07);
  --weave: rgba(28, 35, 33, .032);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c; --surface: #1c2026; --surface-2: #23282f;
    --ink: #e8eae7; --ink-2: #a2aba7; --ink-3: #8a938f; --line: #2c323a;
    --accent: #2ca263; --accent-ink: #08130c; --good: #3fbf7c; --bad: #e06a52; --protein: #4a92cf; --weight: #bd8330;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .35);
    --weave: rgba(255, 255, 255, .022);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  background-image:
    repeating-linear-gradient(45deg, var(--weave) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, var(--weave) 0 1px, transparent 1px 7px);
  color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary:focus-visible, .cta-s:focus-visible { outline-color: var(--ink); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 14px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -.3px; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand .ki { color: var(--accent); }
.nav .spacer { flex: 1; }
.nav a.lang { color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: var(--radius); }
.nav a.lang:hover { background: var(--surface-2); color: var(--ink); }
.nav .links { display: flex; gap: 2px; margin-left: 18px; }
.nav a.nav-link {
  color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600;
  padding: 7px 13px; border-radius: 999px; line-height: 1;
  transition: color .2s ease;
}
.nav a.nav-link:hover { color: var(--accent); }
.nav a.nav-link[aria-current="page"] { color: var(--accent); }
@media (max-width: 700px) { .nav .links { display: none; } }
.nav a.cta-s { background: var(--accent); color: var(--accent-ink); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.btn { display: inline-block; text-decoration: none; font-weight: 650; padding: 13px 26px; border-radius: 999px; font-size: 16px; transition: transform .15s ease, box-shadow .15s ease; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(32, 121, 74, .35); }
.btn-ghost { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }
.hero { padding: 72px 0 64px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -1.2px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { margin-top: 18px; font-size: 19px; color: var(--ink-2); max-width: 46ch; }
.hero .ctas { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .note { margin-top: 14px; font-size: 13.5px; color: var(--ink-3); }
.phone-shot { max-width: 380px; margin: 0 auto; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.phone-shot img { display: block; width: 100%; height: auto; }
.phone { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: 18px 16px 20px; max-width: 380px; margin: 0 auto; width: 100%; }
.phone .ph-top { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12.5px; padding: 0 4px 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.phone .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; margin-bottom: 10px; }
.msg.user { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.ai { background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg .meta { display: block; font-size: 12.5px; margin-top: 3px; color: var(--ink-2); }
.msg.ai .stat { font-variant-numeric: tabular-nums; font-weight: 650; }
.msg.ai .stat.kcal { color: var(--good); }
.msg.ai .stat.prot { color: var(--protein); }
/* Mini proposal card, mirrors the app's confirmed chat proposal. */
.pcard { border: 1px solid var(--good); border-radius: var(--radius-card); background: color-mix(in srgb, var(--good) 8%, var(--surface)); padding: 10px 12px; margin: 4px 0 12px; max-width: 92%; }
.pc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pc-kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.pc-saved { font-size: 12px; color: var(--good); font-weight: 650; }
.pc-rows { list-style: none; }
.pc-rows li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 3px 0; color: var(--ink); }
.pc-meta { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.pc-meta .stat { font-weight: 650; font-variant-numeric: tabular-nums; }
.pc-meta .stat.kcal { color: var(--good); }
.pc-meta .stat.prot { color: var(--protein); }
/* Weight sparkline card, same idea as the dashboard chart. */
.wcard { border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-2); padding: 10px 12px 8px; margin-top: 12px; }
.wc-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.wc-now { color: var(--ink); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.wc-now em { font-style: normal; color: var(--good); font-size: 12.5px; font-weight: 650; }
.wcard svg { display: block; width: 100%; height: 44px; }
.balance { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-card); display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--ink-2); }
.balance strong { font-size: 20px; color: var(--good); font-variant-numeric: tabular-nums; }
section { padding: 64px 0; }
section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.kicker { color: var(--accent); font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: .08em; }
h2 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.6px; margin: 8px 0 10px; }
.sub { color: var(--ink-2); font-size: 17px; max-width: 58ch; }
.final .sub { margin: 0 auto; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; list-style: none; }
.step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--ink-2); font-size: 15px; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 40px; list-style: none; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 22px; transition: transform .18s ease, box-shadow .18s ease; }
section.alt .feature { background: var(--bg); }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 14.5px; }
.feature .ico { font-size: 22px; margin-bottom: 10px; display: block; }
a.feature { display: block; text-decoration: none; color: inherit; }
a.feature .more { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 14px; font-weight: 600; }
.about p { color: var(--ink-2); font-size: 16.5px; max-width: 68ch; margin-top: 14px; }
.os-tabs { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.os-tabs label { padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.os-tabs label:hover { color: var(--ink); }
.os-radio { position: absolute; opacity: 0; pointer-events: none; }
#os-ios:focus-visible ~ .os-tabs label[for="os-ios"],
#os-android:focus-visible ~ .os-tabs label[for="os-android"],
#os-desktop:focus-visible ~ .os-tabs label[for="os-desktop"] { outline: 2px solid var(--accent); outline-offset: 2px; }
#os-ios:checked ~ .os-tabs label[for="os-ios"],
#os-android:checked ~ .os-tabs label[for="os-android"],
#os-desktop:checked ~ .os-tabs label[for="os-desktop"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.os-panels { display: grid; margin-top: 24px; }
.os-panel { grid-area: 1 / 1; opacity: 0; transform: translateY(12px); visibility: hidden; transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s; }
#os-ios:checked ~ .os-panels .panel-ios,
#os-android:checked ~ .os-panels .panel-android,
#os-desktop:checked ~ .os-panels .panel-desktop { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.install-steps { margin: 0 0 14px 0; padding-left: 0; list-style: none; counter-reset: inst; max-width: 62ch; }
.install-steps li { counter-increment: inst; display: flex; gap: 12px; align-items: baseline; color: var(--ink-2); font-size: 15px; padding: 7px 0; }
.install-steps li::before { content: counter(inst); flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; align-self: center; }
.install-note { color: var(--ink-3); font-size: 13.5px; max-width: 62ch; }
.faq-list { margin-top: 32px; display: grid; gap: 26px; max-width: 760px; }
.faq-list h3 { font-size: 17px; margin-bottom: 6px; }
.faq-list p { color: var(--ink-2); font-size: 15px; }

/* App-view mockups on subpages: markup mirrors the app's chart-block,
   shopping list and settings form so examples look exactly like the app. */
.lchart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 16px; margin-top: 24px; max-width: 460px; }
.lchart h3 { font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; font-weight: 650; }
.lchart h3 .cdot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lchart h3 .cur { margin-left: auto; font-size: 13px; color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.lchart h3 .cur em { font-style: normal; color: var(--good); }
.lchart svg { width: 100%; height: auto; display: block; }
.lchart .grid line { stroke: var(--line); stroke-width: 1; }
.lchart .axis { font-size: 9px; fill: var(--ink-3); }
.lchart .wline { fill: none; stroke: var(--weight); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s ease-out .3s forwards; }
.lchart .wend { fill: var(--weight); opacity: 0; animation: pop .3s ease-out 1.8s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }
.lchart .bar { transform-origin: bottom; transform: scaleY(0); animation: grow .5s cubic-bezier(.2,.7,.3,1.1) forwards; }
.lchart .bar.over { fill: var(--bad); }
.lchart .bar.under { fill: var(--accent); }
@keyframes grow { to { transform: scaleY(1); } }
.lchart .target { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 4 3; }

.slist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 14px 16px; margin-top: 24px; max-width: 380px; }
.sl-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.sl-head span { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.slist ul { list-style: none; }
.slist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--ink); }
.slist li:last-child { border-bottom: 0; }
.slist li::before { content: ""; width: 18px; height: 18px; border: 1.5px solid var(--ink-3); border-radius: 50%; flex: 0 0 18px; }
.slist li.done { color: var(--ink-3); text-decoration: line-through; }
.slist li.done::before { content: "✓"; border-color: var(--good); background: var(--good); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; font-weight: 800; text-decoration: none; animation: pop .25s ease-out backwards; }
.slist li.done:nth-child(1)::before { animation-delay: .3s; }
.slist li.done:nth-child(2)::before { animation-delay: .5s; }

.sform { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 6px 16px; margin-top: 24px; max-width: 420px; }
.sform .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.sform .row:last-child { border-bottom: 0; }
.sform .row .k { color: var(--ink-2); }
.sform .row .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.sform .usage { flex: 1; max-width: 150px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.sform .usage i { display: block; height: 100%; width: 35%; border-radius: 3px; background: var(--accent); transform-origin: left; transform: scaleX(0); animation: fill 1s ease-out .4s forwards; }
@keyframes fill { to { transform: scaleX(1); } }

/* Subpages */
.page-hero { padding: 56px 0 10px; }
.page-hero h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -1px; font-weight: 800; max-width: 24ch; }
.page-hero .lead { margin-top: 16px; font-size: 18px; color: var(--ink-2); max-width: 56ch; }
.crumbs { font-size: 13.5px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-3); }
.shot { margin-top: 32px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; max-width: 420px; }
.shot img { display: block; width: 100%; height: auto; }
.shot.placeholder { display: grid; place-items: center; min-height: 340px; color: var(--ink-3); font-size: 14px; }
.shot figcaption { padding: 10px 14px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.checks { list-style: none; margin-top: 22px; max-width: 60ch; }
.checks li { display: flex; gap: 10px; color: var(--ink-2); font-size: 15.5px; padding: 6px 0; }
.checks li::before { content: "✓"; color: var(--good); font-weight: 800; }
.ways { margin-top: 34px; padding: 18px 20px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); font-size: 15px; max-width: 72ch; }
section.alt .ways { background: var(--bg); }

.final { text-align: center; padding: 84px 0; }
.final h2 { margin-bottom: 12px; }
.final .ctas { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
footer { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13.5px; }
footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 40px 0 24px; }
footer .fbrand { font-weight: 800; font-size: 17px; color: var(--ink); letter-spacing: -.3px; }
footer .fbrand .ki { color: var(--accent); }
footer .ftag { margin-top: 8px; max-width: 30ch; }
footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: 12px; font-weight: 700; }
footer ul { list-style: none; display: grid; gap: 9px; }
footer a { color: var(--ink-2); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .fbottom { border-top: 1px solid var(--line); padding: 16px 0 28px; display: flex; gap: 18px; flex-wrap: wrap; }
@media (max-width: 700px) { footer .cols { grid-template-columns: 1fr 1fr; } }
.prose { max-width: 70ch; padding-bottom: 40px; }
.prose h2 { font-size: 20px; margin: 30px 0 8px; }
.prose p, .prose li { color: var(--ink-2); font-size: 15.5px; margin-bottom: 10px; }
.prose ul { padding-left: 20px; }
.hero > div { animation: rise .55s ease-out backwards; }
.hero > div:nth-child(2) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero > div { animation: none; }
  .btn, .feature, .os-panel, .os-tabs label { transition: none; }
  .lchart .wline { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  .lchart .wend, .lchart .bar, .slist li.done::before, .sform .usage i { animation: none; opacity: 1; transform: none; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 44px 0 40px; gap: 36px; }
  .steps, .features, .split { grid-template-columns: 1fr; }
  section { padding: 48px 0; }
}
