/* Calinja public site. Tokens follow the Calinja brand book (v4). */

@font-face { font-family: "Vazirmatn"; src: url("/fonts/vazirmatn/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/fonts/vazirmatn/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/fonts/vazirmatn/Vazirmatn-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/fonts/vazirmatn/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
    --brand: #14A89A;
    --brand-strong: #0B7A71;
    --brand-text: #0A635C;
    --brand-soft: #E6F7F5;
    --accent: #D0384F;
    --good: #1F8A4C;
    --bg: #F4F8F7;
    --surface: #FFFFFF;
    --fg: #14211F;
    --muted: #55645F;
    --line: #D5E2DF;
    --on-brand: #FFFFFF;
    --shadow: 0 1px 2px rgba(20, 33, 31, .06), 0 12px 32px -12px rgba(20, 33, 31, .18);
    --r-btn: 12px;
    --r-card: 16px;
    --r-bubble: 18px;
    --font: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --brand-strong: #5FD3C6;
        --brand-text: #5FD3C6;
        --brand-soft: #17302D;
        --bg: #0E1716;
        --surface: #16211F;
        --fg: #E7F0EE;
        --muted: #9DB0AB;
        --line: #29403C;
        --on-brand: #0E1716;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.8;
    direction: rtl;
    text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-text); }
h1, h2, h3 { line-height: 1.3; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
section[id] { scroll-margin-top: 80px; }

.skip { position: absolute; inset-inline-start: 12px; top: -48px; background: var(--surface); padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 12px; }

.wrap { max-width: 1160px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)); }
.wrap--narrow { max-width: 780px; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 700; text-decoration: none; line-height: 1.4;
    border-radius: var(--r-btn); padding: 11px 20px; border: 1.5px solid transparent;
    transition: background-color .15s, border-color .15s, transform .15s;
    cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-strong); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-text); }
.btn--ghost { background: transparent; color: var(--brand-text); border-color: var(--brand-strong); }
.btn--ghost:hover { background: var(--brand-soft); }
.btn--light { background: #FFFFFF; color: #0A635C; }
.btn--light:hover { background: #E6F7F5; }
.btn--sm { padding: 7px 16px; font-size: .95rem; }
.btn--lg { padding: 14px 24px; font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar__row { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand__mark { width: 36px; height: 36px; }
.brand__name { font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 6px 12px; border-radius: 10px; }
.nav a:hover { color: var(--fg); background: var(--brand-soft); }
.menu { display: none; position: relative; margin-inline-start: auto; }
.menu summary { list-style: none; cursor: pointer; padding: 8px; border-radius: 10px; color: var(--fg); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu__panel {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    width: min(280px, calc(100vw - 32px));
    display: grid; gap: 2px; padding: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow);
}
.menu__panel a:not(.btn) { color: var(--fg); text-decoration: none; padding: 10px 12px; border-radius: 10px; }
.menu__panel a:not(.btn):hover { background: var(--brand-soft); }
.menu__panel .btn { margin-top: 6px; }

@media (max-width: 860px) {
    .nav, .topbar__cta { display: none; }
    .menu { display: block; }
}

/* Hero */
.hero { padding-block: 56px 72px; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.eyebrow { color: var(--brand-text); font-weight: 700; font-size: .95rem; margin-bottom: 12px; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); font-weight: 900; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--brand-text); }
.lead { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--muted); margin-block: 20px 28px; max-width: 34em; }
.ticks { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .95rem; }
.ticks li { display: inline-flex; align-items: center; gap: 6px; }
.ticks li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B7A71' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* Phone demo */
.hero__demo { display: flex; justify-content: center; position: relative; }
.hero__demo::before {
    content: ""; position: absolute; inset: 8% 4%; border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 28%, transparent), transparent);
    filter: blur(8px);
}
.phone {
    position: relative; width: min(340px, 100%);
    background: var(--surface); border: 1px solid var(--line); border-radius: 36px;
    padding: 18px 14px 14px; box-shadow: var(--shadow);
    display: grid; gap: 12px;
}
.phone__bar { display: flex; align-items: center; gap: 8px; font-weight: 700; padding-inline: 6px; }
.phone__logo { width: 26px; height: 26px; }
.phone__left { margin-inline-start: auto; font-size: .78rem; font-weight: 600; color: var(--brand-text); background: var(--brand-soft); padding: 2px 10px; border-radius: 99px; }
.chat { display: grid; gap: 10px; align-content: start; min-height: 360px; padding: 4px 4px 0; }
.msg { max-width: 82%; padding: 9px 14px; border-radius: var(--r-bubble); font-size: .95rem; line-height: 1.6; }
.msg--me { justify-self: start; background: var(--brand-strong); color: var(--on-brand); border-start-start-radius: 4px; }
.msg--bot { justify-self: end; background: var(--brand-soft); color: var(--fg); border-start-end-radius: 4px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; display: grid; gap: 12px; transition: box-shadow .4s; }
.card.is-updated { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent); }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kcal { color: var(--brand-text); font-size: .9rem; white-space: nowrap; }
.kcal b { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.macros div { background: var(--surface); border-radius: 12px; padding: 8px; text-align: center; display: grid; line-height: 1.4; }
.macros span { font-size: .72rem; color: var(--muted); }
.macros b { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.macros small { font-size: .7rem; color: var(--muted); }
.card__walk { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); }
.card__walk .ico { width: 18px; height: 18px; color: var(--brand-text); }
.phone__input { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 99px; padding: 10px 16px; color: var(--muted); font-size: .92rem; }
.phone__input .ico { color: var(--brand-strong); }

.chat.is-playing [data-step] { opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; }
.chat.is-playing [data-step].is-in { opacity: 1; transform: none; }

/* Sections */
.section { padding-block: 72px; }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }
.section__title { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 800; text-align: center; margin-bottom: 40px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; display: grid; gap: 12px; align-content: start; }
.steps__n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; }
.steps h3 { font-size: 1.15rem; font-weight: 700; }
.steps p:not(.bubble) { color: var(--muted); font-size: .95rem; }

.bubble { position: relative; justify-self: start; background: var(--brand-strong); color: var(--on-brand); padding: 8px 14px; border-radius: var(--r-bubble); border-start-start-radius: 4px; font-weight: 500; }
.bubble--soft { background: var(--brand-soft); color: var(--fg); }
.bubble--big { font-size: clamp(1.15rem, 2.6vw, 1.45rem); font-weight: 700; padding: 14px 22px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; display: grid; gap: 10px; align-content: start; }
.feature h3 { font-size: 1.1rem; font-weight: 700; }
.feature p { color: var(--muted); font-size: .95rem; }
.feature__ico { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: grid; gap: 14px; align-content: start; }
.panel h2 { font-size: 1.5rem; font-weight: 800; }
.panel p { color: var(--muted); }
.panel .actions { margin-top: 8px; }
.panel--brand { background: #0B7A71; border-color: #0B7A71; color: #FFFFFF; }
.panel--brand p, .panel--brand .eyebrow { color: #E6F7F5; }
.panel--brand .eyebrow { margin: 0; }

.faq { display: grid; gap: 12px; }
.faq details { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 700; padding: 18px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--brand-text); border-bottom: 2px solid var(--brand-text); transform: rotate(45deg); transition: transform .2s; flex: none; margin-top: -4px; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.faq details p { color: var(--muted); padding-bottom: 18px; }

.cta { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 48px; align-items: center; }
.cta__cali { width: 100%; height: auto; border-radius: 32px; background: #E9E6E3; }
.cta__copy { display: grid; gap: 16px; justify-items: start; }
.cta__copy h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 800; }
.cta__copy > p:not(.bubble) { color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 48px 24px; margin-top: 24px; }
.footer__grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 32px; }
.footer__brand p { color: var(--muted); margin-top: 12px; max-width: 30em; font-size: .95rem; }
.footer__links { display: grid; gap: 6px; align-content: start; }
.footer__links h2 { font-size: .9rem; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.footer__links a { color: var(--fg); text-decoration: none; font-size: .95rem; }
.footer__links a:hover { color: var(--brand-text); }
.footer__legal { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 20px; color: var(--muted); font-size: .85rem; }

/* Inner pages */
.page { padding-block: 56px 72px; }
.page__head { text-align: center; display: grid; gap: 14px; justify-items: center; margin-bottom: 40px; }
.page__head h1 { font-size: clamp(1.9rem, 4.6vw, 2.8rem); font-weight: 900; }
.page__head .lead { margin: 0; }
.guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: g; }
.guide li { counter-increment: g; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 20px 20px 20px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 16px; align-items: start; }
.guide li::before { content: counter(g, persian); grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; }
.guide h2 { font-size: 1.1rem; font-weight: 700; }
.guide p { color: var(--muted); }
.kbd { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand-text); border-radius: 8px; padding: 0 8px; font-weight: 600; white-space: nowrap; }
.kbd svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.note { background: var(--brand-soft); border-radius: var(--r-card); padding: 16px 20px; margin-top: 24px; }
.center { text-align: center; }
.page .actions { justify-content: center; margin-top: 32px; }
.contact-card { max-width: 460px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; display: grid; gap: 16px; text-align: center; justify-items: center; box-shadow: var(--shadow); }
.contact-card .btn { width: 100%; }
.contact-card .num { font-weight: 800; font-size: 1.2rem; direction: ltr; unicode-bidi: isolate; color: var(--fg); text-decoration: none; }

@media (max-width: 900px) {
    .hero { padding-block: 32px 56px; }
    .hero__grid, .cta { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .cta__cali { max-width: 280px; justify-self: center; }
    .steps, .duo { grid-template-columns: minmax(0, 1fr); }
    .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .footer__brand { grid-column: 1 / -1; }
    .section { padding-block: 56px; }
}
@media (max-width: 480px) {
    .actions .btn { flex: 1 1 100%; }
    .panel { padding: 24px; }
    .chat { min-height: 330px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
