/* hamechiai.ir: Chi family showcase. Tokens from branding/Chi Family Design System v2 (mk(h, l, c)); spec: docs/ux-spec.md. */
@font-face { font-family: "Estedad"; src: url("/fonts/Estedad-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/fonts/Vazirmatn-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --font: "Estedad", "Vazirmatn", Tahoma, sans-serif;
  --kahgel: oklch(0.94 0.018 75);
  --kahgel-2: oklch(0.90 0.022 75);
  --sunk: oklch(0.97 0.008 75);
  --paper: #fff;
  --ink: oklch(0.24 0.02 30);
  --muted: oklch(0.42 0.02 30);
  --faint: oklch(0.50 0.015 30);
  --hair: rgba(60, 30, 30, .08);
  --saffron: oklch(0.82 0.16 80);
  --warn-ink: oklch(0.48 0.18 28);
  --lift: 0 12px 32px rgba(60, 30, 30, .10);
  --btn-bevel: inset 0 1px 1px rgba(255, 255, 255, .45), inset 0 -2px 4px rgba(0, 0, 0, .2);
  --r-tile: 12px 12px 4px 12px;
  --pad: 16px;
  --gap-section: clamp(72px, 48px + 8vw, 160px);
  --display: clamp(2rem, 1.2rem + 3.6vw, 4.5rem);
  --h2: clamp(1.625rem, 1.2rem + 1.6vw, 2.5rem);
  --h3: clamp(1.0625rem, 1rem + .4vw, 1.25rem);
  --small: .84375rem;
}

/* App tones: mk(h, l, c). A tone class sets the hue for everything inside it. */
.app-food  { --h: 8;   --l: .40; --c: .12; }
.app-shop  { --h: 200; --l: .50; --c: .09; }
.app-trip  { --h: 266; --l: .42; --c: .15; }
.app-book  { --h: 45;  --l: .48; --c: .13; }
.app-konam { --h: 160; --l: .42; --c: .15; }
.app-food, .app-shop, .app-trip, .app-book, .app-konam {
  --accent: oklch(var(--l) var(--c) var(--h));
  --deep: oklch(calc(var(--l) - .10) calc(var(--c) - .01) var(--h));
  --wash: oklch(.95 .03 var(--h));
  --tint: oklch(.93 .04 var(--h) / .75);
  --ring: oklch(var(--l) var(--c) var(--h) / .22);
  --glow: oklch(var(--l) var(--c) var(--h) / .32);
  --dot-on-ink: oklch(.72 var(--c) var(--h));
  --grad: linear-gradient(165deg, oklch(calc(var(--l) + .14) var(--c) var(--h)), oklch(var(--l) var(--c) var(--h)) 55%, oklch(calc(var(--l) - .08) calc(var(--c) - .01) var(--h)));
  --grad-text: linear-gradient(165deg, var(--accent), var(--deep));
  --field:
    radial-gradient(60% 70% at 85% 10%, oklch(.75 var(--c) var(--h) / .30), transparent 70%),
    radial-gradient(50% 60% at 10% 90%, oklch(.85 .14 80 / .25), transparent 70%),
    oklch(.95 .02 var(--h) / .6);
}
.app-hame {
  --accent: oklch(.22 .02 285);
  --deep: oklch(.22 .02 285);
  --wash: oklch(.965 .006 285);
  --tint: oklch(.93 .01 285 / .8);
  --ring: oklch(.22 .02 285 / .18);
  --glow: oklch(.22 .02 285 / .25);
  --dot-on-ink: var(--saffron);
  --grad: oklch(.22 .02 285);
  --grad-text: oklch(.22 .02 285);
  --field:
    radial-gradient(70% 45% at 50% 0%, oklch(.90 .10 85 / .35), transparent 70%),
    oklch(.965 .006 285 / .55);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  font: 400 1rem/1.75 var(--font); color: var(--ink);
  background: var(--kahgel);
  font-feature-settings: "ss01";
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--field); }
h1, h2, h3 { margin: 0; letter-spacing: 0; text-wrap: balance; }
h1 { font-size: var(--display); line-height: 1.25; font-weight: 800; }
h2 { font-size: var(--h2); line-height: 1.35; font-weight: 800; }
h3 { font-size: var(--h3); line-height: 1.6; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; box-shadow: 0 0 0 2px var(--ink) !important; }
.flow :focus-visible { box-shadow: 0 0 0 2px var(--kahgel) !important; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 10; background: var(--ink); color: var(--kahgel); padding: 8px 16px; border-radius: 10px; }
.skip:focus { top: 8px; }
.wrap { width: 100%; max-width: 1264px; margin-inline: auto; padding-inline: max(var(--pad), env(safe-area-inset-right)) max(var(--pad), env(safe-area-inset-left)); }
.lead { font-size: var(--h3); line-height: 1.75; color: var(--muted); max-width: 62ch; }
.sec-sub { color: var(--muted); max-width: 62ch; margin-top: 8px; }
.small { font-size: var(--small); color: var(--muted); }

/* Lucide icons via mask, coloured by currentColor */
.ic {
  display: inline-block; flex: none; width: 1.25em; height: 1.25em; vertical-align: middle;
  background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
.i-search { --m: url("/pages/icons/search.svg"); }
.i-send-horizontal { --m: url("/pages/icons/send-horizontal.svg"); transform: scaleX(-1); }
.i-utensils { --m: url("/pages/icons/utensils.svg"); }
.i-shopping-bag { --m: url("/pages/icons/shopping-bag.svg"); }
.i-plane { --m: url("/pages/icons/plane.svg"); }
.i-book-open { --m: url("/pages/icons/book-open.svg"); }
.i-luggage { --m: url("/pages/icons/luggage.svg"); }
.i-sparkles { --m: url("/pages/icons/sparkles.svg"); }
.i-store { --m: url("/pages/icons/store.svg"); }
.i-shield-check { --m: url("/pages/icons/shield-check.svg"); }
.i-tag { --m: url("/pages/icons/tag.svg"); }
.i-circle-check { --m: url("/pages/icons/circle-check.svg"); }
.i-chevron-down { --m: url("/pages/icons/chevron-down.svg"); }
.i-chevron-left { --m: url("/pages/icons/chevron-left.svg"); }
.i-external-link { --m: url("/pages/icons/external-link.svg"); }
.i-info { --m: url("/pages/icons/info.svg"); }

/* Brand tile: --grad + saffron «؟» */
.tile {
  flex: none; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-tile);
  background: var(--grad);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .55), inset 0 -2px 5px rgba(0, 0, 0, .25);
}
.tile span { font-weight: 800; font-size: 28px; line-height: 1; color: var(--saffron); }
.tile-sm { width: 24px; height: 24px; border-radius: 7px 7px 2px 7px; }
.tile-sm span { font-size: 16px; }
.tile-xs { width: 20px; height: 20px; border-radius: 6px 6px 2px 6px; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5); }
.tile-xs span { font-size: 13px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 700; line-height: 1.5; text-decoration: none;
  transition: filter .2s, transform .1s, background-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--ink); color: var(--kahgel); box-shadow: var(--btn-bevel); }
.btn-ink:hover { filter: brightness(1.25); }
.btn-sm { min-height: 44px; padding: 0 18px; }
.nav .btn-sm { display: inline-flex; color: var(--kahgel); margin-inline-start: 4px; }
.btn-ghost { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--hair); }
.btn-ghost:hover { background: var(--sunk); }
.btn-app { background: var(--grad-text); color: #fff; box-shadow: var(--btn-bevel), 0 6px 16px var(--glow); width: 100%; }
.btn-app:hover { filter: brightness(1.08); }
.btn-soon { background: var(--sunk); color: var(--muted); width: 100%; box-shadow: 0 0 0 1px var(--hair); font-weight: 600; }
.linkish { background: none; border: 0; padding: 4px 2px; color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; text-decoration-color: var(--saffron); min-height: 44px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.wordmark { font-size: 18px; font-weight: 800; }
.nav { display: flex; gap: 4px; }
.nav a { display: none; padding: 10px 12px; font-weight: 600; text-decoration: none; border-radius: 10px; }
.nav a.nav-dev { display: inline-block; }
.nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* Hero */
.hero { padding-block: 24px 8px; display: grid; gap: 16px; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--muted); }
.fam { display: inline-flex; gap: 4px; }
.hero h1 { max-width: 16ch; }
.ask {
  display: flex; align-items: flex-end; gap: 8px; margin-top: 8px;
  border-radius: 30px; padding: 8px;
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--lift);
}
.ask:focus-within { outline: 3px solid var(--saffron); outline-offset: 2px; }
.ask textarea {
  flex: 1; min-width: 0; min-height: 48px; max-height: 160px;
  border: 0; background: transparent; resize: none;
  padding: 10px 14px; font-size: 17px; line-height: 1.6; overflow-y: hidden;
}
.ask textarea.is-max { overflow-y: auto; }
.ask textarea::placeholder { color: var(--faint); }
.ask textarea:focus { outline: none; }
.ask textarea:focus-visible { box-shadow: none !important; }
.ask-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-width: 48px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--grad-text); color: #fff; font-weight: 700;
  box-shadow: var(--btn-bevel), 0 6px 16px var(--glow);
  transition: filter .2s, transform .1s;
}
.ask-btn:hover { filter: brightness(1.08); }
.ask-btn:active { transform: scale(.97); }
.ask-hint { color: var(--warn-ink); font-weight: 600; }
.route { display: grid; gap: 8px; }
.route-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 32px; color: var(--muted); }
.route-line strong { color: var(--ink); }
.route-line .linkish { min-height: 32px; font-size: var(--small); }
.soon-note { font-size: var(--small); color: var(--ink); background: var(--paper); border-radius: 14px; padding: 10px 14px; box-shadow: 0 0 0 1px var(--hair); }
.route-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.route-pick legend { padding: 0; margin-bottom: 8px; font-size: var(--small); color: var(--muted); }
.pick {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 16px;
  background: var(--paper); border-radius: 999px; box-shadow: 0 0 0 1px var(--hair); cursor: pointer; font-weight: 600;
}
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick:has(input:checked) { background: var(--wash); box-shadow: 0 0 0 2px var(--deep); }
.pick:has(input:focus-visible) { outline: 3px solid var(--saffron); outline-offset: 2px; }

/* Chips (example questions) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px;
  background: var(--paper); border-radius: 999px; box-shadow: 0 0 0 1px var(--hair);
  font-weight: 600; line-height: 1.5; text-decoration: none;
  transition: background-color .2s, transform .1s;
}
.chip .ic { width: 18px; height: 18px; color: var(--deep); }
a.chip:hover { background: var(--wash); }
a.chip:active { transform: scale(.97); }
.chip.is-soon { color: var(--muted); }
.hero-chips li:nth-child(n+4) { display: none; }

/* App picker */
.apps { margin-top: 56px; }
.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; }
.app-grid .wide { grid-column: 1 / -1; }
.app-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%;
  padding: 20px; border-radius: 28px; background: var(--wash); text-decoration: none;
  transition: background-color .2s, transform .1s;
}
a.app-card:hover { background: var(--tint); }
a.app-card:active { transform: scale(.98); }
.app-card .tile { width: 48px; height: 48px; }
.app-card .tile span { font-size: 32px; }
.app-body { display: flex; flex-direction: column; gap: 4px; }
.app-name { display: inline-flex; align-items: center; gap: 8px; font-size: var(--h3); font-weight: 800; color: var(--deep); line-height: 1.5; }
.app-name .ic { width: 20px; height: 20px; }
.app-tag { font-weight: 600; line-height: 1.6; }
.app-src { font-size: var(--small); color: var(--muted); line-height: 1.6; }
.app-ex { display: none; }
.soon { align-self: flex-start; margin-top: 6px; font-size: var(--small); font-weight: 700; padding: 2px 12px; border-radius: 999px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--hair); }
.go { position: absolute; inset-inline-end: 18px; top: 22px; width: 22px; height: 22px; color: var(--deep); transition: transform .2s; }
a.app-card:hover .go { transform: translateX(-4px); }
.wide .app-card { flex-direction: row; align-items: flex-start; gap: 16px; padding-inline-end: 52px; }

/* Flow band */
.flow { margin-top: var(--gap-section); background: var(--ink); color: var(--kahgel); padding-block: 72px 96px; }
.flow-sub { color: oklch(.86 .015 75); font-size: var(--h3); margin-top: 12px; max-width: 54ch; }
.stages { position: relative; margin-top: 40px; display: grid; gap: 28px; }
.stages::before { content: ""; position: absolute; inset-block: 28px 28px; inset-inline-start: 27px; width: 2px; background: oklch(.36 .02 30); }
.stage { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; }
.node { width: 56px; height: 56px; border-radius: 999px; background: oklch(.32 .02 30); display: grid; place-items: center; box-shadow: 0 0 0 6px var(--ink); }
.node .ic { width: 24px; height: 24px; color: var(--kahgel); }
.stage:nth-child(2) .node .ic { color: var(--saffron); }
.stage h3 { padding-top: 12px; }
.stage p { color: oklch(.86 .015 75); max-width: 58ch; }
.stage-mcp .node { width: 40px; height: 40px; margin: 8px; background: oklch(.30 .02 30); }
.stage-mcp .node .ic { width: 18px; height: 18px; }
.stage-mcp h3 { padding-top: 14px; }
.layer-label { margin-top: 14px; font-size: var(--small); font-weight: 700; color: var(--saffron); }
.site-pills { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px; margin-top: 10px; }
.site-pills li { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: oklch(.30 .02 30); font-size: 14px; font-weight: 600; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }
.site-pills .dot { background: var(--dot-on-ink); }
.flow-msg { margin-top: 48px; font-size: clamp(1.375rem, 1rem + 1.2vw, 2.25rem); line-height: 1.6; font-weight: 700; max-width: 30ch; }
.ticket { margin: 18px 0 0; max-width: 360px; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 18px 20px; }
.ticket figcaption { font-size: var(--small); font-weight: 700; color: var(--saffron-ink, oklch(.42 .09 70)); }
.flow .ticket p { color: var(--ink); }
.t-title { font-weight: 700; margin-top: 4px; }
.ticket dl { margin: 10px 0; display: grid; gap: 4px; }
.ticket dl div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--small); }
.ticket dt { color: var(--muted); }
.ticket dd { margin: 0; font-weight: 600; }
.t-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; border-top: 1px dashed oklch(.85 .01 75); }
.t-total strong { font-size: 22px; font-weight: 800; }
.flow .ticket .t-note { margin-top: 8px; color: var(--muted); font-size: var(--small); }
/* Reveal: added by app.js only when motion is allowed */
.will-reveal .stage { opacity: 0; transform: translateY(16px); transition: opacity .32s cubic-bezier(.2, .7, .2, 1), transform .32s cubic-bezier(.2, .7, .2, 1); }
.will-reveal .stage.is-on { opacity: 1; transform: none; }
.will-reveal .site-pills .dot { opacity: .35; transform: scale(.6); transition: opacity .3s, transform .3s; }
.will-reveal .is-on .site-pills .dot { opacity: 1; transform: none; }
.will-reveal .is-on .site-pills li:nth-child(2n) .dot { transition-delay: .12s; }
.will-reveal .is-on .site-pills li:nth-child(3n) .dot { transition-delay: .24s; }

/* Proof */
.proof { margin-top: var(--gap-section); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 16px; margin-top: 32px; }
.stats li { display: flex; flex-direction: column; gap: 4px; }
.stats strong { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.5rem); font-weight: 800; line-height: 1.25; }
.stats span { font-weight: 700; line-height: 1.6; }
.stats small { font-size: var(--small); color: var(--muted); line-height: 1.6; }

/* Services directory */
.services { margin-top: var(--gap-section); }
.filter { position: relative; margin-top: 20px; max-width: 420px; }
.filter .ic { position: absolute; inset-inline-start: 14px; top: 13px; width: 20px; height: 20px; color: var(--muted); }
.filter input { width: 100%; min-height: 48px; padding: 0 44px 0 14px; border: 0; border-radius: 999px; background: var(--paper); box-shadow: 0 0 0 1px var(--hair); font-size: 17px; }
.filter-empty { margin-top: 12px; color: var(--muted); }
.svc-cols { margin-top: 28px; }
.svc-group { break-inside: avoid; margin-bottom: 28px; }
.svc-group h3 { font-size: 18px; margin-bottom: 10px; }
.svc-group ul, .svc-list { display: flex; flex-wrap: wrap; gap: 8px; }
.svc {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  background: var(--paper); border-radius: 999px; box-shadow: 0 0 0 1px var(--hair);
  font-size: 15px; font-weight: 600; text-decoration: none; transition: background-color .2s, transform .1s;
}
.svc:hover { background: var(--wash); }
.svc:active { transform: scale(.97); }

/* Developer panel */
.dev { margin-top: var(--gap-section); }
.dev-panel { background: var(--paper); border-radius: 36px; padding: 28px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.dev-text p { margin-top: 12px; max-width: 62ch; }
.checks { display: grid; gap: 10px; margin-top: 18px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .ic { width: 18px; height: 18px; margin-top: .3em; color: var(--deep); }
pre { margin: 0; overflow-x: auto; background: var(--sunk); border-radius: 16px; padding: 16px 18px; font: 14px/1.7 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: left; }
code { font-family: inherit; }

/* FAQ */
.faq { margin-top: var(--gap-section); max-width: 808px; display: grid; gap: 8px; }
.faq h2 { margin-bottom: 16px; }
.faq details { background: var(--paper); border-radius: 18px; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 20px; font-size: 17px; font-weight: 700; line-height: 1.6; cursor: pointer; list-style: none; border-radius: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { width: 20px; height: 20px; transition: transform .2s; }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details p { padding: 0 20px 20px; }

/* Footer */
.foot { margin-top: var(--gap-section); background: var(--kahgel-2); padding-block: 56px 72px; }
.foot-apps { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-app { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; text-decoration: none; }
.foot-app small { font-weight: 600; color: var(--muted); font-size: var(--small); }
a.foot-app:hover span { text-decoration: underline; text-underline-offset: 5px; }
.foot-mark { font-size: clamp(3.5rem, 2rem + 9vw, 9rem); font-weight: 800; line-height: 1.2; margin-block: 24px 16px; }
.foot-mark .q { color: var(--saffron); }
.foot-note { font-size: var(--small); color: var(--muted); max-width: 80ch; margin-top: 8px; }
.foot-note a { color: var(--ink); font-weight: 600; text-underline-offset: 4px; display: inline-block; padding-block: 6px; }

/* Service page */
.svc-page { display: grid; gap: 40px; padding-block: 16px 0; }
.svc-main { display: grid; gap: 28px; align-content: start; min-width: 0; }
.svc-main > section > h2, .related h2, .own h2 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.75rem); margin-bottom: 14px; }
.svc-page h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 2.5rem); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--small); color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a { display: inline-block; padding-block: 8px; text-underline-offset: 4px; }
.crumbs .ic { width: 14px; height: 14px; }
.unofficial { display: flex; align-items: flex-start; gap: 6px; font-size: var(--small); color: var(--muted); margin-top: -16px; }
.unofficial .ic { width: 16px; height: 16px; margin-top: .3em; }
.unofficial a { color: var(--ink); }
.own { background: var(--paper); border-radius: 22px; padding: 20px; }
.svc-page .faq { margin-top: 0; }
.side { display: grid; gap: 28px; align-content: start; }
.covered { background: var(--wash); border-radius: 28px; padding: 22px; display: grid; gap: 14px; }
.covered-app { display: flex; gap: 12px; align-items: center; }
.covered-app .tile { width: 48px; height: 48px; }
.covered-app .tile span { font-size: 32px; }
.covered-app > span { display: grid; }
.covered-app strong { font-size: var(--h3); color: var(--deep); font-weight: 800; }
.covered-app > span > span { font-size: var(--small); color: var(--muted); }
.aside-note { font-size: var(--small); color: var(--muted); }
.aside-note a { color: var(--ink); font-weight: 600; text-underline-offset: 4px; display: inline-block; padding-block: 6px; }
.svc-main .ask { margin-top: 0; }

/* /mcp/ page */
.mcp-page { display: grid; gap: 24px; padding-block: 16px 0; }
.mcp-page h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); max-width: 20ch; }
.mcp-page > p { max-width: 70ch; }
.choices { display: grid; gap: 12px; }
.choice { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--paper); border-radius: 22px; box-shadow: 0 0 0 1px var(--hair); }
.choice h2 { font-size: var(--h3); }
.choice p { color: var(--muted); }
.choice .btn { margin-top: auto; align-self: flex-start; }
.mcp-sec { display: grid; gap: 12px; margin-top: 24px; scroll-margin-top: 16px; }
.mcp-sec > p { max-width: 70ch; }
.mcp-sec .actions { margin-top: 4px; }
.mcp-page p code { font: .9em/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--sunk); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.mcp-page .url { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.mcp-page .url code { font-size: 15px; background: var(--paper); box-shadow: 0 0 0 1px var(--hair); padding: 8px 14px; border-radius: 14px; -webkit-user-select: all; user-select: all; }
.mcp-page .faq { margin-top: 24px; }
.prose { display: grid; gap: 28px; margin-top: 24px; }
.prose p { margin-top: 10px; max-width: 70ch; }
.prose h2, .built h2, .mcp-sec h2 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.75rem); }
.table-wrap { margin-top: 24px; }
.catalog { width: 100%; border-collapse: collapse; font-size: 15px; }
.catalog th { position: sticky; top: 0; background: var(--sunk); text-align: start; padding: 10px 12px; font-weight: 700; }
.catalog td { padding: 10px 12px; border-top: 1px solid var(--hair); vertical-align: top; }
.catalog td a { color: var(--ink); font-weight: 600; text-underline-offset: 4px; display: inline-block; padding-block: 4px; }
.catalog tbody tr:hover { background: rgba(255, 255, 255, .5); }
.built { margin-top: 32px; }
.built .foot-apps { margin-top: 14px; }
.nf { padding-block: 64px; display: grid; gap: 20px; }
.nf h2 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.75rem); margin-bottom: 14px; }

/* Mobile catalog: rows become blocks */
@media (max-width: 767px) {
  .ask textarea { min-height: calc(3lh + 20px); } /* labelled send button narrows the box; long example placeholders need 3 lines (no JS auto-grow here) */
  .catalog thead { display: none; }
  .catalog, .catalog tbody, .catalog tr, .catalog td { display: block; }
  .catalog tr { background: var(--paper); border-radius: 18px; padding: 10px 14px; margin-bottom: 10px; }
  .catalog td { border: 0; padding: 4px 0; display: flex; gap: 12px; justify-content: space-between; }
  .catalog td::before { content: attr(data-label); color: var(--muted); font-size: var(--small); }
  .hero .lead { font-size: 1rem; }
  .hero { gap: 12px; }
  .ask-btn { padding: 0 16px; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
}

/* Small phones: brand, /mcp/ link and «بپرسید» on one header line at 360px */
@media (max-width: 379px) {
  .top { gap: 8px; }
  .nav a { padding-inline: 8px; }
}

@media (min-width: 768px) {
  :root { --pad: 24px; }
  .top { min-height: 72px; }
  .nav a { display: inline-block; }
  .hero { padding-top: 48px; }
  .hero-chips li:nth-child(n+4) { display: list-item; }
  .app-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .app-grid .wide { grid-column: span 2; }
  .app-ex { display: grid; gap: 4px; margin-top: 10px; font-size: var(--small); color: var(--ink); }
  .app-ex li::before { content: "\00AB"; color: var(--muted); }
  .app-ex li::after { content: "\00BB"; color: var(--muted); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .svc-cols { columns: 2; column-gap: 40px; }
  .dev-panel { padding: 44px 40px; }
  .site-pills { grid-template-columns: repeat(4, minmax(0, max-content)); }
  .choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  :root { --pad: 32px; }
  .hero { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .hero > * { grid-column: 1; }
  .hero h1 { max-width: 18ch; }
  .flow .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 64px; align-items: start; }
  .flow h2, .flow-sub, .flow-msg { grid-column: 1; }
  .flow h2 { grid-row: 1; }
  .flow-sub { grid-row: 2; }
  .flow-msg { grid-row: 3; align-self: start; }
  .stages { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; }
  .stats { grid-template-columns: repeat(5, 1fr); }
  .svc-cols { columns: 3; column-gap: 48px; }
  .dev-panel { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; padding: 56px 48px; align-items: start; }
  .svc-page { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 56px; }
  .side { position: sticky; top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
