/* Kae site — shared styles.
   Layout: one calm centered column; the phone is the hero; soft tinted panels mark the interactive parts. */
:root {
  --bg: #FFFFFF;
  --panel: #F4F7FB;
  --panel-2: #EAF0F7;
  --card: #FFFFFF;
  --ink: #12161C;
  --muted: #5F6B78;
  --faint: #8A95A3;
  --line: #E1E8F0;
  --sky: #1E87EC;
  --sky-mid: #54B0F5;
  --sky-wash: #E7F2FD;
  --on-sky: #FFFFFF;
  --ok: #37C26B;
  --kcal: #FF7A0F;
  --protein: #E23B3B;
  --carbs: #2F6BFF;
  --fat: #E0A800;
  --tier-label: #37C26B;
  --tier-sfda: #1E9BF0;
  --tier-usda: #2FA8B5;
  --tier-rest: #EC4899;
  --tier-ai: #F5A623;
  --phone: #0E1116;
  --nav-bg: rgba(255,255,255,0.8);
  --shadow: 0 24px 60px -24px rgba(18,40,70,.28);
  --display: "Baloo Bhaijaan 2", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body-ar: "Tajawal", "Geeza Pro", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sparkles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132' fill='%231E87EC1F'%3E%3Cpath d='M18 14h4v4h4v4h-4v4h-4v-4h-4v-4h4z'/%3E%3Crect x='70' y='30' width='4' height='4'/%3E%3Cpath d='M96 72h3v3h3v3h-3v3h-3v-3h-3v-3h3z'/%3E%3Crect x='40' y='92' width='3' height='3'/%3E%3Crect x='112' y='112' width='4' height='4'/%3E%3Cpath d='M60 116h2v2h2v2h-2v2h-2v-2h-2v-2h2z'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1116; --panel: #141920; --panel-2: #1A2029; --card: #1A1F26; --ink: #F2F5F8; --muted: #9AA6B3; --faint: #6F7B88;
    --line: #262D36; --sky: #4DA6FF; --sky-mid: #78C2FF; --sky-wash: #132A40; --on-sky: #06121F; --ok: #3FD577;
    --kcal: #FF9A3D; --protein: #FF5E5E; --carbs: #5C8BFF; --fat: #FFD633;
    --tier-label: #3FD577; --tier-sfda: #3AAEF7; --tier-usda: #3FC3D1; --tier-rest: #F25BA6; --tier-ai: #FFB938;
    --phone: #000000; --sparkles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132' fill='%234DA6FF26'%3E%3Cpath d='M18 14h4v4h4v4h-4v4h-4v-4h-4v-4h4z'/%3E%3Crect x='70' y='30' width='4' height='4'/%3E%3Cpath d='M96 72h3v3h3v3h-3v3h-3v-3h-3v-3h3z'/%3E%3Crect x='40' y='92' width='3' height='3'/%3E%3Crect x='112' y='112' width='4' height='4'/%3E%3Cpath d='M60 116h2v2h2v2h-2v2h-2v-2h-2v-2h2z'/%3E%3C/svg%3E"); --nav-bg: rgba(14,17,22,0.8); --shadow: 0 24px 60px -24px rgba(0,0,0,.7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1116; --panel: #141920; --panel-2: #1A2029; --card: #1A1F26; --ink: #F2F5F8; --muted: #9AA6B3; --faint: #6F7B88;
  --line: #262D36; --sky: #4DA6FF; --sky-mid: #78C2FF; --sky-wash: #132A40; --on-sky: #06121F; --ok: #3FD577;
  --kcal: #FF9A3D; --protein: #FF5E5E; --carbs: #5C8BFF; --fat: #FFD633;
  --tier-label: #3FD577; --tier-sfda: #3AAEF7; --tier-usda: #3FC3D1; --tier-rest: #F25BA6; --tier-ai: #FFB938;
  --phone: #000000; --sparkles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132' fill='%234DA6FF26'%3E%3Cpath d='M18 14h4v4h4v4h-4v4h-4v-4h-4v-4h4z'/%3E%3Crect x='70' y='30' width='4' height='4'/%3E%3Cpath d='M96 72h3v3h3v3h-3v3h-3v-3h-3v-3h3z'/%3E%3Crect x='40' y='92' width='3' height='3'/%3E%3Crect x='112' y='112' width='4' height='4'/%3E%3Cpath d='M60 116h2v2h2v2h-2v2h-2v-2h-2v-2h2z'/%3E%3C/svg%3E"); --nav-bg: rgba(14,17,22,0.8); --shadow: 0 24px 60px -24px rgba(0,0,0,.7); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[dir="rtl"] body, [dir="rtl"] button, [dir="rtl"] .btn { font-family: var(--body-ar); }
img, video { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 10px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; line-height: 1.3; }
p { margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 720px; }
.label {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--sky);
}
[dir="rtl"] .label { font-family: var(--body-ar); letter-spacing: 0; font-size: 14px; font-weight: 700; }

/* Nav */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); }
.nav-links { display: flex; gap: 26px; font-weight: 700; font-size: 15px; color: var(--muted); }
.nav-links a { text-decoration: none; transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.pill { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.pill button {
  border: 0; background: transparent; color: var(--muted); font: 700 13px var(--body);
  min-width: 32px; height: 28px; padding: 0 9px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s;
}
.pill button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.pill svg { width: 15px; height: 15px; vertical-align: -3px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 0; cursor: pointer;
  background: var(--sky); color: var(--on-sky); font: 700 15px var(--body);
  padding: 11px 20px; border-radius: 999px; transition: transform .2s, opacity .2s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn-lg { font-size: 17px; padding: 14px 26px; }
.btn-ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.nav .btn { padding: 8px 16px; font-size: 14px; }

/* Sections */
section { padding-block: 96px; }
.head { text-align: center; max-width: 660px; margin: 0 auto 48px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.head h2 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; }
.head p { color: var(--muted); font-size: 19px; }
.tint { background: var(--panel); }

/* Device: Apple's iPhone 17 Pro frame laid over the screen content.
   The frame image is 1350x2760; the screen sits 72px in from the sides and 69px from top and bottom. */
.device { position: relative; width: 100%; max-width: 310px; aspect-ratio: 1350 / 2760; margin-inline: auto; }
.device .screen {
  position: absolute; left: 5.33%; right: 5.33%; top: 2.5%; bottom: 2.5%;
  border-radius: 13% / 6.1%; overflow: hidden; background: var(--panel);
}
.device > img.frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.device { filter: drop-shadow(0 30px 40px rgba(18,40,70,.22)); }

/* Media slot: shows the real clip once it loads; until then a quiet placeholder with the Kae icon */
.media { position: relative; width: 100%; height: 100%; }
.media video, .media img.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.media.ready video, .media.ready img.shot { opacity: 1; }
.media .ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; text-align: center; padding: 16px;
}
.media .ph img { width: 44px; height: 44px; border-radius: 11px; opacity: .9; image-rendering: pixelated; }
.media.ready .ph { display: none; }

/* Footer: a full-width blue band with rounded top corners (Amy-style link columns) */
.foot { background: var(--sky); color: #FFFFFF; border-radius: 48px 48px 0 0; margin-top: 48px; padding-block: 64px 32px; }
.foot a { color: inherit; text-decoration: none; }
.foot-inner { display: flex; flex-direction: column; gap: 48px; }
.foot-cols { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.foot-logo { display: inline-flex; align-items: center; gap: 10px; font: 800 24px var(--display); }
.foot-logo img { width: 36px; height: 36px; border-radius: 9px; }
.foot-brand p { opacity: .85; }
.foot-dl { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; background: #FFFFFF; color: #0B4F92 !important; font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 999px; transition: opacity .2s; }
.foot-dl:hover { opacity: .9; }
.foot-dl svg { width: 16px; height: 16px; }
.foot h4 { margin: 0 0 14px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
[dir="rtl"] .foot h4 { font-family: var(--body-ar); font-size: 14px; letter-spacing: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-weight: 600; }
.foot ul a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-social { display: flex; gap: 8px; margin-top: 20px; }
.foot-social a { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.18); display: grid; place-items: center; transition: background .2s; }
.foot-social a:hover { background: rgba(255,255,255,.3); }
.foot-social svg { width: 16px; height: 16px; }
.foot-base { border-top: 1px solid rgba(255,255,255,.22); padding-top: 24px; text-align: center; font-size: 13px; opacity: .8; }
.foot-base a:hover { text-decoration: underline; }
@media (max-width: 800px) {
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  .foot { border-radius: 32px 32px 0 0; }
}

/* Fade-up: content is visible at rest; only animates once JS has marked the page */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Prose pages (privacy, terms, help articles) */
.page-head { padding-block: 72px 32px; }
.page-head h1 { font-size: clamp(38px, 5.5vw, 56px); font-weight: 800; margin-top: 10px; }
.page-head p { color: var(--muted); font-size: 19px; margin-top: 12px; }
.prose { padding-block: 8px 96px; }
.prose h2 { font-size: 28px; margin-top: 44px; margin-bottom: 12px; }
.prose h3 { font-size: 21px; margin-top: 28px; margin-bottom: 8px; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 12px; }
.prose ul, .prose ol { padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.prose strong { color: var(--ink); }
.prose a { color: var(--sky); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; }
.prose th, .prose td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); }
.table-scroll { overflow-x: auto; }
.callout { background: var(--sky-wash); border-radius: 20px; padding: 16px 20px; margin: 20px 0; color: var(--ink); }
.callout p { color: var(--ink); }
.updated { font-family: var(--mono); font-size: 13px; color: var(--faint); margin-top: 40px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media (max-width: 900px) { .nav-links { display: none; } }
@media (max-width: 560px) {
  body { font-size: 16px; }
  section { padding-block: 68px; }
  .nav .btn span { display: none; }
  .nav .btn { padding: 8px 11px; }
  .pill button { min-width: 28px; padding: 0 7px; }
}

/* Long pages carry both languages as separate blocks; the root lang picks one */
html[lang="ar"] .l-en, html:not([lang="ar"]) .l-ar { display: none !important; }

/* Doc layout: contents on the side, text in a readable column */
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-block: 8px 96px; align-items: start; }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 88px); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toc .label { margin-bottom: 8px; }
.toc a { color: var(--muted); text-decoration: none; padding: 5px 12px; border-radius: 10px; }
.toc a:hover { background: var(--panel); color: var(--ink); }
.doc .prose { padding-block: 0; max-width: 68ch; min-width: 0; }
.doc .prose > :first-child { margin-top: 0; }
.prose h2 { scroll-margin-top: 90px; }
.summary-box { background: var(--panel); border-radius: 24px; padding: 20px 24px; margin-bottom: 8px; }
.summary-box ul { margin: 8px 0 0; }
.summary-box li { color: var(--ink); }
@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .toc .label { width: 100%; }
  .toc a { background: var(--panel); }
}

/* Help center */
.help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-bottom: 96px; }
.help-card { background: var(--panel); border-radius: 24px; padding: 22px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; transition: background .2s, transform .2s; }
.help-card:hover { background: var(--panel-2); transform: translateY(-2px); }
.help-card h3 { font-size: 20px; }
.help-card p { color: var(--muted); font-size: 15px; }
.help-card .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--sky-wash); color: var(--sky); display: grid; place-items: center; margin-bottom: 6px; }
.help-card .ico svg { width: 22px; height: 22px; }
.help-group { margin-bottom: 12px; }
.help-group .label { display: block; margin: 8px 0 14px; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; gap: 8px; }
.crumbs a { color: var(--sky); text-decoration: none; }
.steps-list { counter-reset: s; list-style: none; padding: 0 !important; }
.steps-list > li { counter-increment: s; position: relative; padding-inline-start: 40px; min-height: 28px; }
.steps-list > li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--sky-wash); color: var(--sky); font: 700 13px var(--mono); display: grid; place-items: center; }
.shot-slot { margin: 18px 0; background: var(--panel); border-radius: 24px; aspect-ratio: 16 / 10; overflow: hidden; }
.tip { background: var(--sky-wash); border-radius: 18px; padding: 14px 18px; color: var(--ink) !important; margin-top: 20px; }
.tip p { color: var(--ink); }
@media (max-width: 900px) { .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .help-grid { grid-template-columns: 1fr; } }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); justify-content: center; gap: 16px; }
.plan { background: var(--panel); border-radius: 32px; padding: 30px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan.best { background: var(--card); box-shadow: 0 0 0 2px var(--sky), var(--shadow); }
.plan .tag { position: absolute; top: -12px; inset-inline-start: 24px; font-size: 12px; font-weight: 700; color: var(--on-sky); background: var(--sky); padding: 3px 12px; border-radius: 999px; }
.plan h3 { font-size: 24px; }
.price { font: 800 44px var(--display); line-height: 1; font-variant-numeric: tabular-nums; }
.price small { font: 600 16px var(--body); color: var(--muted); }
[dir="rtl"] .price small { font-family: var(--body-ar); }
.plan .sub { color: var(--muted); font-size: 15px; }
.plan ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.plan li { display: flex; gap: 10px; }
.plan li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: var(--sky-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E87EC' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 12px no-repeat; }
.plan .btn { margin-top: 12px; }
.compare { max-width: 760px; margin: 0 auto; }
@media (max-width: 700px) { .plans { grid-template-columns: 1fr; } }

/* Changelog */
.log { max-width: 760px; margin: 0 auto; padding-bottom: 96px; display: flex; flex-direction: column; gap: 16px; }
.release { background: var(--panel); border-radius: 28px; padding: 26px 28px; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; }
.release .when { font-family: var(--mono); font-size: 13px; color: var(--faint); display: flex; flex-direction: column; gap: 6px; }
.release .ver { display: inline-block; align-self: flex-start; background: var(--sky-wash); color: var(--sky); border-radius: 999px; padding: 2px 10px; font-weight: 500; }
.release h3 { font-size: 22px; margin-bottom: 8px; }
.release ul { margin: 0; padding-inline-start: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.release .media { aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--panel-2); margin-bottom: 14px; }
@media (max-width: 560px) { .release { grid-template-columns: 1fr; gap: 8px; } .release .when { flex-direction: row; align-items: center; } }

/* Contact */
.contact-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.contact-cards > div { background: var(--panel); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.contact-cards h3 { font-size: 20px; }
.contact-cards p { color: var(--muted); font-size: 15px; }
.contact-cards a { color: var(--sky); font-weight: 700; text-decoration: none; word-break: break-all; }
.copy-btn { align-self: flex-start; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: 700 13px var(--body); cursor: pointer; margin-top: 4px; }
@media (max-width: 800px) { .contact-cards { grid-template-columns: 1fr; } }
