/* Carex: shared by / (fa, RTL) and /en/ (en, LTR). Same design system as faravandgroup.ir. Logical properties throughout. */

@font-face { font-family: "IRANSans"; src: url("../fonts/IRANSansWebFaNum.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IRANSans"; src: url("../fonts/IRANSansWebFaNum_Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IRANSans"; src: url("../fonts/IRANSansWebFaNum_Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
/* Same face with Latin digits, for English text. */
@font-face { font-family: "IRANSans EN"; src: url("../fonts/IRANSansWeb.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IRANSans EN"; src: url("../fonts/IRANSansWeb_Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IRANSans EN"; src: url("../fonts/IRANSansWeb_Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #0e1a3d;
  --ink-deep: #0a1430;
  --paper: #f2f4f7;
  --white: #ffffff;
  --text: #0e1a3d;
  --text-2: #4c5872;
  --rule: #d6dce6;
  --carex: #1ec0f5;         /* logo cyan: fills only */
  --accent: #0a7ea4;        /* the same cyan, darkened for text on light surfaces */
  --on-ink-2: #aeb8d0;
  --on-ink-rule: rgba(255, 255, 255, .14);
  /* Reserved for urgency, like dashboard warning lights. */
  --ok: #2f9e55;
  --amber: #f7b500;
  --stop: #d3322a;
  --r-sm: 8px;
  --r-md: 14px;
  --container: 1180px;
  --header-h: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0c1530;
    --white: #121d3d;
    --text: #e6ebf6;
    --text-2: #9ba7c3;
    --rule: #233159;
    --accent: #1ec0f5;
    --ok: #46c070;
    --stop: #ff6a5e;
  }
}

/* Navy surfaces re-point the tokens, so components need no dark variants. */
.on-ink {
  --text: #ffffff;
  --text-2: var(--on-ink-2);
  --rule: var(--on-ink-rule);
  --white: #10204a;
  --accent: #1ec0f5;
  --ok: #46c070;
  --stop: #ff6a5e;
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
/* Font follows each element's language, so mixed snippets get the right digits. */
[lang|="fa"] { font-family: "IRANSans", Tahoma, sans-serif; }
[lang|="en"] { font-family: "IRANSans EN", "Segoe UI", system-ui, sans-serif; }
body {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.95;
  color: var(--text);
  background: var(--paper);
  overflow-x: hidden;
}
:lang(en) body, body:lang(en) { line-height: 1.65; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
h1, h2, h3 { line-height: 1.4; font-weight: 700; text-wrap: balance; }
:lang(en) h1, :lang(en) h2, :lang(en) h3 { line-height: 1.18; letter-spacing: -.02em; }
ul, ol { padding: 0; list-style: none; }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-inline { display: inline-block; vertical-align: -.2em; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.skip-link { position: absolute; inset-inline-start: 16px; inset-block-start: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-sm); background: var(--white); color: var(--text); }
.skip-link:focus { inset-block-start: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 10px 22px;
  border: 1.5px solid transparent; border-radius: var(--r-sm);
  font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.4; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-sm { min-height: 40px; padding: 6px 16px; font-size: .9rem; }
.btn-solid { background: var(--carex); color: var(--ink-deep); }
.btn-solid:hover { background: var(--text); color: var(--paper); }
.on-ink .btn-solid:hover { background: #fff; color: var(--ink-deep); }
.btn-line { border-color: color-mix(in srgb, currentColor 40%, transparent); }
.btn-line:hover { border-color: currentColor; color: var(--accent); }
.on-ink .btn-line:hover { color: #fff; }
.text-link { font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.text-link:hover { text-decoration-color: currentColor; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 50;
  background: var(--ink);
  border-block-end: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled, .site-header.is-open { border-block-end-color: var(--on-ink-rule); }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 1.3rem; line-height: 1; color: #fff; }
.brand img { width: 40px; height: 40px; }
.nav { display: flex; gap: 28px; margin-inline-start: auto; }
.nav a, .lang-switch { font-size: .95rem; text-decoration: none; color: var(--on-ink-2); transition: color .15s ease; }
.nav a:hover, .lang-switch:hover { color: #fff; }
.lang-switch { padding-inline-start: 24px; border-inline-start: 1px solid var(--on-ink-rule); }
.header-cta { margin-inline-start: -4px; }
.menu-toggle {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  margin-inline-start: auto; border: 1px solid var(--on-ink-rule); border-radius: var(--r-sm);
  background: transparent; color: #fff; cursor: pointer;
}
.menu-toggle .icon-close, .is-open .menu-toggle .icon-open { display: none; }
.is-open .menu-toggle .icon-close { display: block; }
.mobile-nav { display: none; }

@media (max-width: 860px) {
  .nav, .header-inner > .lang-switch, .header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .mobile-nav {
    display: grid; max-height: 0; overflow: hidden; padding-inline: 16px;
    transition: max-height .25s ease, padding .25s ease;
  }
  .is-open .mobile-nav { max-height: 420px; padding-block: 4px 16px; }
  .mobile-nav a { padding: 14px 0; border-block-end: 1px solid var(--on-ink-rule); text-decoration: none; color: #fff; }
  .mobile-nav a:last-child { border: 0; color: var(--on-ink-2); }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink); }
.hero-body { position: relative; z-index: 1; padding-block: clamp(56px, 9vw, 120px) clamp(48px, 7vw, 88px); }
.hero h1 {
  max-width: 13em;
  font-size: clamp(2.1rem, 4.7vw, 3.7rem);
  line-height: 1.38;
}
:lang(en) .hero h1 { max-width: 14em; line-height: 1.1; }
.hero-lead { max-width: 33em; margin-block-start: 28px; font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 40px; }
.hero-more { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-block-start: 20px; font-size: .92rem; color: var(--text-2); }

/* The emblem is the one large gesture: oversized and cropped by the hero's edge. */
.hero-emblem {
  position: absolute; z-index: 0;
  inset-inline-end: max(-7vw, -96px);
  inset-block-end: 56px;
  width: min(42vw, 560px);
  pointer-events: none;
}
.hero-emblem img { width: 100%; height: auto; }

.facts {
  position: relative; z-index: 1;
  background: var(--ink);
  box-shadow: 0 0 0 100vmax var(--ink);
  clip-path: inset(0 -100vmax -100vmax);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block-start: 1px solid var(--rule);
}
.facts > div { padding: 22px 0 26px; padding-inline-end: 20px; }
.facts > div + div { padding-inline-start: 24px; border-inline-start: 1px solid var(--rule); }
.facts dt { font-size: .85rem; color: var(--text-2); }
.facts dd { margin-block-start: 4px; font-weight: 500; }

@media (max-width: 900px) {
  .hero-emblem { width: 300px; inset-block-start: 36px; inset-block-end: auto; inset-inline-end: -90px; opacity: .4; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { padding-inline-start: 0; border-inline-start: 0; }
  .facts > div:nth-child(n+3) { border-block-start: 1px solid var(--rule); }
}
@media (max-width: 480px) {
  .hero-emblem { width: 220px; inset-inline-end: -70px; opacity: .3; }
  .facts > div { padding-block: 16px 18px; }
  .facts > div + div { padding-inline-start: 16px; }
  .facts > div:nth-child(3) { padding-inline-start: 0; }
}

/* ---------- Bands: copy on one side, a working sample on the other ---------- */
.band { padding-block: clamp(72px, 10vw, 128px); }
.band.on-ink { background: var(--ink-deep); }
@media (prefers-color-scheme: dark) { .band.on-ink { background: #060d22; } }

.band-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 104px);
  align-items: center;
}
.band.on-ink .band-grid > .specimen { order: -1; }

.band-copy h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
.band-copy > p { max-width: 32em; margin-block-start: 22px; font-size: 1.1rem; color: var(--text-2); }

.does { margin-block-start: 28px; border-block-start: 1px solid var(--rule); }
.does li { padding-block: 12px; border-block-end: 1px solid var(--rule); }

/* Urgency levels: one ruled row each, led by its warning-light colour. */
.levels li { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 16px; align-items: baseline; }
.levels strong { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.levels strong::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.levels p { color: var(--text-2); }
.level-ok { --c: var(--ok); }
.level-check { --c: var(--amber); }
.level-stop { --c: var(--stop); }

@media (max-width: 900px) {
  .band-grid { grid-template-columns: minmax(0, 1fr); }
  .band.on-ink .band-grid > .specimen { order: 0; }
  .specimen { max-width: 520px; }
}

/* ---------- Specimens: what Carex actually does ---------- */
.specimen {
  width: 100%; margin: 0;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--r-md);
  background: var(--white); border: 1px solid var(--rule);
  font-size: .95rem;
  line-height: 1.75;
}
.spec-caption { font-size: .82rem; color: var(--text-2); }

/* Complaint -> causes, urgency, advice */
.complaint {
  max-width: 330px; margin-block-start: 10px; margin-inline-start: auto;
  padding: 12px 16px; border-radius: 16px; border-start-end-radius: 4px;
  background: var(--carex); color: var(--ink-deep); font-weight: 500;
}
.dx { margin-block-start: 20px; display: grid; gap: 18px; }
.dx h3 { font-size: .8rem; font-weight: 500; color: var(--text-2); margin-block-end: 6px; }
.cause { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.cause + .cause { margin-block-start: 10px; }
.cause small { font-size: .78rem; color: var(--text-2); }
.cause .bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.cause .bar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--carex); border-radius: 2px; }
.lamps { display: flex; gap: 8px; }
.lamp { flex: 1; padding: 6px 0; border-radius: 6px; text-align: center; font-size: .82rem; border: 1px solid var(--rule); color: var(--text-2); }
.lamp.is-lit { background: var(--amber); border-color: var(--amber); color: #2a1d00; font-weight: 700; }
.advice { margin-block-start: 10px; font-size: .88rem; color: var(--text-2); }

/* Ranked repair shops */
.shops { margin-block-start: 14px; display: grid; gap: 10px; }
.shop {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px;
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--rule);
}
.shop.is-best { border-color: transparent; background: color-mix(in srgb, var(--text) 7%, transparent); }
.shop-rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 700; border: 1px solid var(--rule); color: var(--text-2); }
.is-best .shop-rank { background: var(--carex); border-color: var(--carex); color: var(--ink-deep); }
.shop strong { display: block; font-weight: 500; line-height: 1.5; }
.shop small { display: block; color: var(--text-2); font-size: .8rem; }
.shop .dist { white-space: nowrap; color: var(--accent); font-weight: 700; }
.shop.is-closed strong, .shop.is-closed .dist { color: var(--text-2); }
.shop-actions { grid-column: 2 / -1; display: flex; gap: 18px; margin-block-start: 6px; font-size: .85rem; font-weight: 500; }
.shop-actions span { display: inline-flex; align-items: center; gap: 6px; }

/* One moment of motion: each specimen plays once when it scrolls into view. */
.js .specimen .step { opacity: 0; transform: translateY(8px); }
.js .specimen.is-live .step { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--d, 0) * 1ms); }
.js .specimen .bar i { transform: scaleX(0); transform-origin: right; }
.js .specimen .bar i:dir(ltr) { transform-origin: left; }
.js .specimen.is-live .bar i { transform: none; transition: transform .8s cubic-bezier(.2,.7,.2,1) .7s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .specimen .step, .js .specimen .bar i { opacity: 1; transform: none; transition: none; }
}

/* ---------- Ruled sections: heading on one side, rows on the other ---------- */
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-white { background: var(--white); }
.section + .section:not(.section-white) { border-block-start: 1px solid var(--rule); }
.section h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.side-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 7vw, 104px); }
.side-grid + .side-grid { margin-block-start: clamp(56px, 8vw, 96px); }
.side-head > p { margin-block-start: 12px; color: var(--text-2); max-width: 26em; }
.side-head h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
@media (max-width: 860px) { .side-grid { grid-template-columns: minmax(0, 1fr); } }

.rows > * { padding-block: 18px; border-block-end: 1px solid var(--rule); }
.rows > *:first-child { border-block-start: 1px solid var(--rule); }

/* How it works */
.steps li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 4px 16px; align-items: baseline; }
.step-num { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 700; line-height: 1.3; color: var(--accent); }
.steps h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); }
.steps p { grid-column: 2; color: var(--text-2); }

/* Things drivers write */
.asks li { font-size: clamp(1.1rem, 1.8vw, 1.3rem); font-weight: 500; line-height: 1.7; }
:lang(en) .asks li { line-height: 1.45; }

/* ---------- Install ---------- */
.section-head > p { margin-block-start: 12px; color: var(--text-2); max-width: 34em; }
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px clamp(24px, 4vw, 56px); margin-block-start: clamp(36px, 5vw, 56px); }
.platform { display: flex; flex-direction: column; padding-block-start: 22px; border-block-start: 2px solid var(--rule); }
.platform.is-suggested { border-block-start-color: var(--carex); }
.platform-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.platform h3 { font-size: 1.3rem; }
.suggested-tag { display: none; font-size: .82rem; font-weight: 700; color: var(--accent); }
.is-suggested .suggested-tag { display: block; }
.platform-body { display: flex; flex-direction: column; flex: 1; margin-block-start: 10px; color: var(--text-2); }
.install-steps { counter-reset: s; }
.install-steps li { counter-increment: s; display: grid; grid-template-columns: 1.6em minmax(0, 1fr); padding-block: 8px; border-block-end: 1px solid var(--rule); }
.install-steps li::before { content: counter(s, persian); font-weight: 700; color: var(--text); }
:lang(en) .install-steps li::before { content: counter(s); }
.platform-actions { display: grid; gap: 10px; margin-block-start: auto; padding-block-start: 22px; color: var(--text); }
@media (max-width: 900px) { .platforms { grid-template-columns: minmax(0, 1fr); } .platform-actions { justify-items: start; grid-auto-flow: row; } .platform-actions .btn { min-width: min(100%, 280px); } }

/* ---------- FAQ ---------- */
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem); font-weight: 700; line-height: 1.6; cursor: pointer; list-style: none;
  transition: color .15s ease;
}
:lang(en) .faq summary { line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary .icon { color: var(--text-2); transition: transform .2s ease; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { max-width: 38em; margin-block-start: 10px; color: var(--text-2); }

/* ---------- Closing ---------- */
.closing-grid { align-items: end; }
.closing h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); max-width: 14em; }
.closing-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 48px 28px; background: var(--ink); color: var(--on-ink-2); font-size: .92rem; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-trust { display: block; padding: 6px; border-radius: var(--r-sm); background: #fff; }
.footer-trust img { width: auto; max-width: 96px; height: auto; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-block-start: 36px; padding-block-start: 20px; border-block-start: 1px solid var(--on-ink-rule); font-size: .85rem; }
