/* ===========================================================================
   Relay: Instagram auto-reply guide (trymadar.co/service/instagram-auto-reply/).
   Follows the Relay brand contract (design-systems/madar-service/DESIGN.md):
   near-black canvas, warm off-white type, ONE coral accent, dark only,
   no gradients, one shadow (the thread panel). Rules below are taken from
   service/service.css so the two pages read as one product; the extra
   components (breadcrumb, tool rows, comparison, questions) follow the same
   tokens. Served from the Car Evaluator project: strict CSP, no inline styles.
   =========================================================================== */

@font-face { font-family: 'Archivo'; src: url('assets/fonts/Archivo-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'InterVar'; src: url('assets/fonts/Inter-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'PlexArabic'; src: url('assets/fonts/PlexArabic-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PlexArabic'; src: url('assets/fonts/PlexArabic-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --void: #0B0B0C;
  --surface: #141416;
  --raised: #1C1C1F;
  --raised-2: #26262A;
  --hairline: #2E2E33;
  --hairline-strong: #43434A;
  --bone: #F2F0ED;
  --bone-2: #B9B6B1;
  --bone-3: #8A8783;
  --coral: #FF5A3C;
  --coral-deep: #E04326;
  --coral-wash: rgba(255, 90, 60, .10);
  --live: #3DDC84;

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'InterVar', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --arabic: 'PlexArabic', 'InterVar', sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  --band: clamp(72px, 9vw, 128px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--bone-2);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }

h1, h2, h3 { font-family: var(--display); color: var(--bone); margin: 0; text-wrap: balance; }
h1 { font-weight: 900; font-size: clamp(44px, 6.4vw, 80px); line-height: .98; letter-spacing: -.035em; }
h2 { font-weight: 800; font-size: clamp(32px, 4.6vw, 58px); line-height: 1.05; letter-spacing: -.035em; }
h3 { font-weight: 700; font-size: 20px; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
strong, b { color: var(--bone); font-weight: 600; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 100;
  display: inline-flex; align-items: center; min-height: 44px;
  background: var(--coral); color: var(--void);
  padding: 10px 18px; font-size: 14px; font-weight: 600; border-radius: 0 0 8px 0;
}
.skip-link:focus { inset-inline-start: 0; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 4px; }
.lang-switch { direction: ltr; unicode-bidi: isolate; }
[lang="ar"] .lang-switch, .lang-switch[lang="ar"] { direction: rtl; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* labels, ledes, notes */
.label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--coral); margin-bottom: 24px;
}
.lede { font-size: 20px; line-height: 1.55; color: var(--bone-2); max-width: 62ch; }
.note { font-size: 15px; color: var(--bone-3); max-width: 72ch; }
.prose { max-width: 62ch; }
.prose p + p { margin-top: 16px; }
.prose a, .faq a, .cell a, .note a { color: var(--bone); text-decoration-color: var(--hairline-strong); text-underline-offset: 3px; }
.prose a:hover, .faq a:hover, .cell a:hover, .note a:hover { text-decoration-color: var(--coral); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--body); font-size: 15px; font-weight: 600; letter-spacing: .02em; line-height: 1;
  padding: 15px 32px; border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.btn-primary { background: var(--coral); color: var(--void); }
.btn-primary:hover { background: var(--coral-deep); }
.btn-secondary { background: transparent; border-color: var(--hairline-strong); color: var(--bone); }
.btn-secondary:hover { border-color: var(--bone); }
.btn-sm { padding: 11px 22px; font-size: 14px; min-height: 44px; }

/* header (no script on this page: the small-screen nav keeps the language
   switch and the demo button and drops the in-page links) */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 12, .94);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.wordmark { display: block; text-decoration: none; line-height: 1; }
.wordmark-name { display: block; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.03em; color: var(--bone); }
.wordmark-parent {
  display: block; margin-top: 5px; font-size: 12px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--bone-3); white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px); }
.nav-link {
  display: inline-flex; align-items: center; min-height: 24px;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--bone-3); text-decoration: none; white-space: nowrap;
  transition: color .16s var(--ease);
}
.nav-link:hover { color: var(--bone); }

/* breadcrumb: where this page sits under Relay */
.crumbs { margin: 0 0 28px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--bone-3); }
.crumbs li { display: inline-flex; align-items: center; gap: 10px; }
.crumbs li + li::before { content: "/"; color: var(--hairline-strong); }
.crumbs a { color: var(--bone-3); text-decoration: none; }
.crumbs a:hover { color: var(--bone); }
.crumbs [aria-current] { color: var(--bone-2); }

/* hero: no photograph on a guide page; the thread carries it */
.hero { border-bottom: 1px solid var(--hairline); }
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  align-items: center; gap: clamp(32px, 4vw, 64px);
  padding-block: clamp(64px, 8vw, 112px);
}
.hero h1 { margin-bottom: 28px; }
.hero .lede { max-width: 48ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.hero-foot { margin-top: 28px; font-size: 14px; color: var(--bone-3); max-width: 48ch; }

/* threads (the one shadow in the system) */
.thread {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 60px -30px rgba(0, 0, 0, .9);
  width: 100%; max-width: 440px; justify-self: end;
}
.thread-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 16px; border-bottom: 1px solid var(--hairline); }
.thread-name { font-size: 13px; font-weight: 600; color: var(--bone); margin-inline-end: auto; }
.ch-mark { color: var(--bone-2); }
.ch-mark svg { width: 18px; height: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--bone-3); border: 1px solid var(--hairline); border-radius: 999px; padding: 5px 11px; white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--live); }
.thread-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 4px 4px; }
.msg { max-width: 34ch; padding: 12px 16px; font-size: 15px; line-height: 1.45; color: var(--bone); border-radius: 16px; }
.msg[dir="rtl"] { font-family: var(--arabic); line-height: 1.75; }
.msg-ctx { align-self: flex-start; max-width: 34ch; font-size: 12px; color: var(--bone-3); padding: 0 4px; }
.msg-ctx[dir="rtl"] { align-self: flex-end; font-family: var(--arabic); }
.msg-in { background: var(--raised-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-in[dir="rtl"] { align-self: flex-end; border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.msg-out { background: var(--raised); border: 1px solid var(--hairline); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-out[dir="rtl"] { align-self: flex-start; border-bottom-right-radius: 16px; border-bottom-left-radius: 4px; }
.msg-sys {
  align-self: center; max-width: 44ch; text-align: center; background: transparent;
  border: 1px dashed var(--hairline-strong); color: var(--bone-3); font-size: 13px; padding: 8px 14px; border-radius: 10px;
}
.msg-sys[dir="rtl"] { font-family: var(--arabic); }
.thread-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); font-size: 12px; letter-spacing: .02em; color: var(--bone-3); }

/* sections */
.section { padding-block: var(--band); }
.section--surface { background: var(--surface); border-block: 1px solid var(--hairline); }
.sec-head { max-width: 760px; margin-bottom: 48px; }
.sec-head h2 { margin-bottom: 20px; }
[id] { scroll-margin-top: 100px; }

/* the free tools close on the line that names their limit */
.closer { margin-top: 32px; max-width: 62ch; font-size: 18px; line-height: 1.6; color: var(--bone); }

/* cells */
.cells { display: grid; gap: 20px; }
.cells-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cells-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cell { border: 1px solid var(--hairline); border-radius: 14px; padding: 28px; transition: border-color .16s var(--ease); }
.cell:hover { border-color: var(--hairline-strong); }
.cell h3 { margin-bottom: 12px; }
.cell p { font-size: 16px; }
.cells + .note { margin-top: 28px; }

/* split: copy beside a thread */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.split-copy h2 { margin-bottom: 20px; }
.split-copy p { font-size: 17px; max-width: 54ch; }
.split .thread { justify-self: center; }
.ticks { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-inline-start: 26px; font-size: 16px; color: var(--bone-2); }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .72em; width: 10px; height: 1px; background: var(--coral); }

/* steps */
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); counter-reset: step; }
.steps li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 24px; padding: 30px 0; border-bottom: 1px solid var(--hairline); }
.step-n { font-family: var(--display); font-weight: 900; font-size: 34px; letter-spacing: -.035em; color: var(--bone-3); line-height: 1; }
.steps h3 { margin-bottom: 10px; }
.steps p { font-size: 16px; max-width: 68ch; }
.steps + .note { margin-top: 32px; }

/* questions */
.faq { border-top: 1px solid var(--hairline); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 24px 0; min-height: 44px;
  font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.35; letter-spacing: -.01em; color: var(--bone);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; font-family: var(--body); font-weight: 400; font-size: 22px; color: var(--bone-3);
  transition: color .16s var(--ease);
}
.faq details[open] summary::after { content: "\2212"; color: var(--coral); }
.faq summary:hover::after { color: var(--bone); }
.faq .answer { padding: 0 0 26px; max-width: 70ch; }
.faq .answer p { font-size: 16px; }
.faq .answer p + p { margin-top: 12px; }

/* final */
.final { border-top: 1px solid var(--hairline); }
.final-inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(32px, 6vw, 80px); align-items: end; }
.final h2 { margin-bottom: 20px; }
.final .hero-actions { margin-top: 0; justify-content: flex-end; }

/* footer */
.site-footer { border-top: 1px solid var(--hairline); padding-block: 64px 48px; background: var(--surface); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--hairline); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.footer-nav a {
  display: inline-flex; align-items: center; min-height: 24px; font-size: 14px; color: var(--bone-3);
  text-decoration: none; transition: color .16s var(--ease);
}
.footer-nav a:hover { color: var(--bone); }
.disclaimer { margin-top: 32px; font-size: 13px; line-height: 1.6; color: var(--bone-3); max-width: 92ch; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 40px; font-size: 13px; color: var(--bone-3); }

@media (prefers-reduced-motion: reduce) {
  .btn, .cell, .nav-link, .footer-nav a, .faq summary::after { transition: none; }
}
@media (pointer: coarse) {
  .nav-link, .footer-nav a, .crumbs a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ---------------------------------------------------------------- Arabic
   As on /ar/service/: the whole page moves onto Plex Arabic, tracking and
   uppercase are cleared (they pull a cursive script apart), and the leading
   opens up for Arabic dots and descenders. Latin islands keep .ltr. */
html[dir="rtl"] { --display: 'PlexArabic', 'IBM Plex Sans Arabic', system-ui, sans-serif; --body: 'PlexArabic', 'IBM Plex Sans Arabic', system-ui, sans-serif; }
[dir="rtl"] *:not(.ltr):not(.ltr *) { letter-spacing: normal !important; text-transform: none !important; }
html[dir="rtl"] body { line-height: 1.8; }
html[dir="rtl"] h1 { font-size: clamp(38px, 6.2vw, 70px); line-height: 1.22; font-weight: 600; }
html[dir="rtl"] h2 { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.28; font-weight: 600; }
html[dir="rtl"] h3 { font-size: 21px; line-height: 1.45; font-weight: 600; }
html[dir="rtl"] .label, html[dir="rtl"] .wordmark-parent, html[dir="rtl"] .pill,
html[dir="rtl"] .thread-note, html[dir="rtl"] .nav-link { font-size: 13px; }
html[dir="rtl"] .wordmark-name { font-size: 24px; font-weight: 600; }
html[dir="rtl"] .step-n { font-size: 30px; font-weight: 600; }
html[dir="rtl"] .lede, html[dir="rtl"] .closer { line-height: 1.8; }
html[dir="rtl"] .ticks li, html[dir="rtl"] .disclaimer, html[dir="rtl"] .note, html[dir="rtl"] .faq .answer p { line-height: 1.85; }
html[dir="rtl"] .faq summary { font-weight: 600; font-size: 19px; line-height: 1.6; }
html[dir="rtl"] .msg-in:not([dir]) { align-self: flex-end; }
html[dir="rtl"] .msg-out:not([dir]) { align-self: flex-start; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1120px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero .thread { justify-self: start; max-width: 480px; }
  .cells-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .site-nav .nav-link:not(.lang-switch) { display: none; }
  .split, .final-inner, .cells-2, .cells-3 { grid-template-columns: minmax(0, 1fr); }
  .split .thread { justify-self: start; }
  .final .hero-actions { justify-content: flex-start; }
  .sec-head { margin-bottom: 36px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .lede { font-size: 18px; }
  .header-inner { min-height: 68px; gap: 12px; }
  .wordmark-parent { display: none; }
  .btn-sm { padding: 10px 16px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero .thread { max-width: none; }
  .msg { max-width: 30ch; font-size: 14px; }
  .cell { padding: 22px; }
  .steps li { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .step-n { font-size: 26px; }
  .faq summary { font-size: 17px; }
  .footer-top { flex-direction: column; }
}
