/* ============================================================
   sistani-online.org — Design System (نقلٌ واعٍ عن نظام khamenei-online)
   الهويّة البصريّة مستمدّة من شعار البوت ومن روح sistani.org:
     أخضر     #1A5C2A   (القبّة والمئذنتان — الأساس)
     نحاسيّ   #D2822F   (القاعدة والإطار — التوكيد)
     ذهبيّ    #C8A85A   (الزخرفة)
     عاجيّ    #F4F3EF   (الأرضيّة)
   ثابت · بلا بناء · RTL أوّلاً · ثلاث لغات (ar/en/fa)
   ============================================================ */
:root {
  --navy: #1A5C2A;
  --navy-deep: #123F1D;
  --navy-soft: #22733A;
  --teal: #D2822F;
  --teal-light: #E39A55;
  --teal-ink: #9A5A1C;
  --gold: #C8A85A;
  --gold-soft: #EADFC0;

  --bg-grad: linear-gradient(135deg, #1A5C2A 0%, #22733A 55%, #123F1D 100%);
  --surface: #ffffff;
  --surface-alt: #F4F3EF;
  --surface-tint: #ECEAE2;
  --ink: #1B2A1F;
  --ink-soft: #566158;
  --line: #E2E3DC;
  --accent: var(--teal);
  --accent-ink: var(--teal-ink);
  --accent-soft: #F8EBDD;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 12px rgba(18,63,29,.07);
  --shadow: 0 12px 36px rgba(18,63,29,.13);
  --shadow-lg: 0 24px 60px rgba(18,63,29,.20);
  --maxw: 900px;
  --ring: 0 0 0 3px rgba(210,130,47,.45);

  --font-ar: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --font-en: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

body {
  font-family: var(--font-ar);
  background: var(--surface-alt);
  color: var(--ink);
  line-height: 1.85;
  font-size: clamp(16px, 1rem + 0.15vw, 18px);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="en"] body { font-family: var(--font-en); line-height: 1.7; }

a { color: var(--accent-ink); text-decoration: none; transition: color .15s; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header { background: var(--bg-grad); color: #fff; padding: 14px 0; position: sticky; top: 0; z-index: 50; border-bottom: 2px solid rgba(200,168,90,.55); box-shadow: var(--shadow-sm); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 1rem; color: #fff; }
.brand img { width: 44px; height: 44px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(200,168,90,.6); background: #fff; }
.brand .dot { width: 42px; height: 42px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; font-size: 1.25rem; flex: none; box-shadow: 0 0 0 2px rgba(200,168,90,.6); }
.nav { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.nav a { color: #d9dcd3; font-size: .92rem; }
.nav a:hover { color: #fff; text-decoration: none; }
.lang-toggle { color: var(--gold-soft); border: 1px solid rgba(200,168,90,.5); border-radius: var(--radius-pill); padding: 5px 15px; font-size: .85rem; transition: all .18s; }
.lang-toggle:hover { color: var(--navy); background: var(--gold); border-color: var(--gold); text-decoration: none; }

/* Hero */
.hero { background: var(--bg-grad); color: #fff; padding: 72px 0 84px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 12%, rgba(210,130,47,.22), transparent 55%); pointer-events: none; }
.hero-logo { width: 132px; height: 132px; margin: 0 auto 26px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(200,168,90,.65), 0 16px 40px rgba(0,0,0,.35); background: #fff; position: relative; }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.7rem); font-weight: 600; line-height: 1.42; margin-bottom: 18px; position: relative; }
.hero p { color: #cfd3ca; max-width: 660px; margin: 0 auto 32px; font-size: clamp(1rem, 1.05rem, 1.12rem); position: relative; }
.honorific { color: var(--gold); font-weight: 600; }
.cta { display: inline-flex; align-items: center; gap: 10px; background: #229ED9; color: #fff; font-weight: 600; padding: 15px 32px; border-radius: var(--radius-pill); font-size: 1.06rem; box-shadow: 0 10px 28px rgba(34,158,217,.40); transition: transform .16s, box-shadow .16s; position: relative; }
.cta:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(34,158,217,.52); text-decoration: none; }
.cta:active { transform: translateY(0); }
.cta.wa { background: #25D366; box-shadow: 0 10px 28px rgba(37,211,102,.40); }
.cta.wa:hover { box-shadow: 0 14px 34px rgba(37,211,102,.52); }
.cta-secondary { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 18px; }
.cta.mcp { background: #6d4aff; box-shadow: 0 10px 28px rgba(109,74,255,.40); font-size: .98rem; padding: 13px 26px; }
.cta.mcp:hover { box-shadow: 0 14px 34px rgba(109,74,255,.52); }
.cta.dl { background: #0f766e; box-shadow: 0 10px 28px rgba(15,118,110,.40); font-size: .98rem; padding: 13px 26px; }
.cta.dl:hover { box-shadow: 0 14px 34px rgba(15,118,110,.52); }

/* Sections */
section.block { padding: 58px 0; }
section.block.alt { background: var(--surface); }
.block h2 { font-size: clamp(1.35rem, 2.4vw, 1.6rem); color: var(--navy); margin-bottom: 24px; font-weight: 600; position: relative; padding-bottom: 12px; }
.block h2::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 0; width: 58px; height: 3px; background: linear-gradient(90deg, var(--gold), var(--teal)); border-radius: 3px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal-light); }
.card .ic { font-size: 1.8rem; margin-bottom: 12px; }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--accent-ink); font-weight: 600; }
.card p { color: var(--ink-soft); font-size: .96rem; }

/* Legal / prose */
.legal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 44px clamp(24px, 5vw, 56px); margin: 44px auto; max-width: 820px; }
.legal h1 { font-size: clamp(1.6rem, 3vw, 1.9rem); color: var(--navy); margin-bottom: 6px; }
.legal .updated { color: var(--ink-soft); font-size: .9rem; margin-bottom: 30px; }
.legal h2 { font-size: 1.2rem; color: var(--accent-ink); margin: 32px 0 12px; }
.legal p, .legal li { color: var(--ink); margin-bottom: 12px; }
.legal ul { padding-inline-start: 26px; }
.legal a { font-weight: 500; }
.legal code { background: var(--surface-tint); padding: 2px 7px; border-radius: 6px; font-size: .92em; color: var(--teal-ink); }
.callout { background: var(--accent-soft); border-inline-start: 4px solid var(--teal); border-radius: var(--radius-sm); padding: 17px 19px; margin: 22px 0; color: var(--teal-ink); }

/* Footer */
.site-footer { background: var(--navy-deep); color: #9aa39b; padding: 40px 0; font-size: .9rem; border-top: 2px solid rgba(200,168,90,.4); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.site-footer a { color: #cfd3ca; }
.site-footer .fnav { display: flex; gap: 20px; flex-wrap: wrap; }

/* Lang visibility — JS swaps innerHTML; no CSS hiding (elements carry both data-ar & data-en). */

/* Responsive */
@media (max-width: 640px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .nav { gap: 14px; }
  .hero { padding: 56px 0 64px; }
  .hero-logo { width: 108px; height: 108px; }
}

/* ============================================================
   === expansion pages ===
   Components: inner hero, numbered steps, tier cards (graded),
   quote-box, chat bubbles, architecture strip, lead/arrow links.
   RTL-first; all logical props so the dir-toggle flips correctly.
   ============================================================ */

/* Inner page hero (smaller than home) */
.hero.inner { padding: 56px 0 56px; }
.hero.inner h1 { font-size: clamp(1.5rem, 3.6vw, 2.2rem); }
.hero.inner .sub { color: #cfd3ca; max-width: 720px; margin: 14px auto 0; font-size: clamp(1rem, 1.05rem, 1.1rem); line-height: 1.85; position: relative; }

/* Generic prose intro inside blocks */
.lead { color: var(--ink-soft); max-width: 760px; margin-bottom: 26px; }

/* Arrow link on cards */
.card .arrow { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 600; color: var(--teal-ink); font-size: .95rem; }
.card .arrow::after { content: "←"; transition: transform .15s; }
html[lang="en"] .card .arrow::after { content: "→"; }
.card a.arrow:hover { text-decoration: none; }
.card a.arrow:hover::after { transform: translateX(-4px); }
html[lang="en"] .card a.arrow:hover::after { transform: translateX(4px); }
a.cardlink { text-decoration: none; color: inherit; display: block; }
a.cardlink:hover { text-decoration: none; }
/* Downloads */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.dl-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
.dl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal-light); }
.dl-card .ic { font-size: 1.8rem; margin-bottom: 10px; }
.dl-card h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--accent-ink); font-weight: 600; }
.dl-card p { color: var(--ink-soft); font-size: .92rem; flex: 1 1 auto; margin-bottom: 14px; }
.dl-meta { color: var(--ink-soft); font-size: .82rem; margin-bottom: 12px; }
.dl-btn { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; background: #0f766e; color: #fff; font-weight: 600; padding: 9px 18px; border-radius: var(--radius-pill); font-size: .92rem; transition: transform .15s, box-shadow .15s; }
.dl-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,118,110,.4); text-decoration: none; }
.dl-empty { color: var(--ink-soft); text-align: center; padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* Numbered vertical steps */
.steps { list-style: none; counter-reset: step; max-width: 780px; margin: 8px auto 0; padding: 0; }
.steps > li { position: relative; padding-inline-start: 64px; padding-bottom: 30px; border-inline-start: 2px solid var(--line); margin-inline-start: 22px; }
.steps > li:last-child { border-inline-start-color: transparent; padding-bottom: 4px; }
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; inset-inline-start: -23px; top: -4px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-grad); color: #fff; font-weight: 600; font-size: 1.1rem;
  display: grid; place-items: center;
  box-shadow: 0 0 0 4px var(--surface-alt), 0 6px 16px rgba(18,63,29,.18);
}
.steps h3 { font-size: 1.12rem; color: var(--navy); margin-bottom: 7px; font-weight: 600; }
.steps p { color: var(--ink-soft); margin: 0; }
section.block.alt .steps > li::before { box-shadow: 0 0 0 4px var(--surface), 0 6px 16px rgba(18,63,29,.18); }

/* Quote / verbatim box */
.quote-box { background: var(--surface-tint); border: 1px solid var(--line); border-inline-start: 5px solid var(--gold); border-radius: var(--radius); padding: 24px 26px; margin: 26px auto; max-width: 780px; box-shadow: var(--shadow-sm); }
.quote-box .qb-title { font-weight: 600; color: var(--accent-ink); margin-bottom: 12px; font-size: .98rem; }
.quote-box blockquote { margin: 0; color: var(--ink); font-size: 1.02rem; line-height: 1.95; }
.quote-box.apology { border-inline-start-color: var(--teal); }

/* Tier cards (graded authority) */
.tiers { display: grid; gap: 18px; max-width: 820px; margin: 0 auto; }
.tier { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); border-inline-start: 5px solid var(--line); }
.tier .tier-tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 11px; border-radius: var(--radius-pill); margin-bottom: 9px; }
.tier h3 { font-size: 1.1rem; color: var(--navy); margin-bottom: 7px; font-weight: 600; }
.tier p { color: var(--ink-soft); margin: 0; }
.tier.t1 { border-inline-start-color: var(--gold); background: linear-gradient(180deg, #fffdf6, #fff); }
.tier.t1 .tier-tag { background: #f6eccc; color: #8a6d18; }
.tier.t2 { border-inline-start-color: var(--teal); }
.tier.t2 .tier-tag { background: var(--accent-soft); color: var(--teal-ink); }
.tier.t3 { border-inline-start-color: var(--teal-light); }
.tier.t3 .tier-tag { background: #F3ECE0; color: var(--teal-ink); }
.tier.t4 { border-inline-start-color: #aeb5ad; }
.tier.t4 .tier-tag { background: #EEECE5; color: #5f6a60; }

/* Architecture strip */
.arch-strip { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; max-width: 860px; margin: 10px auto 0; }
.arch-step { flex: 1 1 160px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 14px; text-align: center; font-weight: 600; color: var(--navy); font-size: .95rem; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.arch-arrow { display: grid; place-items: center; color: var(--gold); font-size: 1.5rem; padding: 0 6px; }
.arch-arrow::before { content: "←"; }
html[lang="en"] .arch-arrow::before { content: "→"; }
@media (max-width: 640px) {
  .arch-strip { flex-direction: column; }
  .arch-arrow::before { content: "↓"; }
  html[lang="en"] .arch-arrow::before { content: "↓"; }
}

/* Chat bubbles (Telegram-like) */
.chat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.chat-card { background: #ECEAE2; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.chat-card .ctitle { font-weight: 600; color: var(--navy); font-size: .92rem; margin-bottom: 14px; opacity: .85; }
.bubble { max-width: 86%; padding: 11px 15px; border-radius: 16px; margin-bottom: 12px; line-height: 1.8; font-size: .98rem; position: relative; box-shadow: 0 1px 2px rgba(18,63,29,.10); }
.bubble.q { background: #d7f0d2; color: #1d3a16; margin-inline-start: auto; border-end-end-radius: 5px; }
.bubble.a { background: #fff; color: var(--ink); margin-inline-end: auto; border-end-start-radius: 5px; }
.bubble.a.placeholder { color: var(--ink-soft); font-style: italic; }
.chat-card .caption { font-size: .85rem; color: var(--ink-soft); margin-top: 6px; }

/* List with bold lead (charter) */
.lead-list { list-style: none; padding: 0; max-width: 800px; margin: 0 auto; }
.lead-list > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.lead-list b { color: var(--accent-ink); display: block; margin-bottom: 4px; }
.lead-list span { color: var(--ink-soft); }

/* Center helper */
.center { text-align: center; }
.mt-cta { margin-top: 28px; }

/* Comparison strip (traditional ↔ assistant) */
.compare { display: grid; gap: 14px; max-width: 860px; margin: 0 auto; }
.compare-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 14px; }
.compare-cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); color: var(--ink-soft); font-size: .98rem; display: flex; align-items: center; }
.compare-cell.old { border-inline-start: 4px solid #c9cdc4; background: var(--surface-alt); }
.compare-cell.new { border-inline-start: 4px solid var(--teal); color: var(--ink); }
.compare-vs { display: grid; place-items: center; color: var(--gold); font-size: 1.3rem; font-weight: 600; min-width: 34px; }
.compare-vs::before { content: "←"; }
html[lang="en"] .compare-vs::before { content: "→"; }
@media (max-width: 640px) {
  .compare-row { grid-template-columns: 1fr; }
  .compare-vs::before { content: "↓"; }
  html[lang="en"] .compare-vs::before { content: "↓"; }
}

/* ============================================================
   === expansion v3 — multimodal demos · vision · deep tech ===
   New components, all built on the existing tokens & RTL logic.
   No external assets; figures are inline SVG / CSS only (CSP-safe).
   ============================================================ */

/* Capability badge — marks what a chat-card demonstrates */
.cap-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 3px 11px; border-radius: var(--radius-pill); margin-bottom: 12px; line-height: 1.5; }
.cap-badge .cb-ic { font-size: .82rem; line-height: 1; }
.cap-badge.cb-text   { background: var(--accent-soft); color: var(--teal-ink); }
.cap-badge.cb-image  { background: #F3ECE0; color: var(--teal-ink); }
.cap-badge.cb-doc    { background: #f6eccc; color: #8a6d18; }
.cap-badge.cb-voice  { background: #ece6f7; color: #5b46a6; }
.cap-badge.cb-expand { background: #e2f3ea; color: #1f7a4d; }
.cap-badge.cb-lang   { background: #fde9e7; color: #b1462f; }

/* Image attachment inside a question bubble (neutral placeholder) */
.att-img { display: block; width: 100%; max-width: 248px; aspect-ratio: 4 / 3; border-radius: 12px; margin-bottom: 9px; border: 1px solid rgba(18,63,29,.14); overflow: hidden; background: var(--surface-tint); }
.att-img svg { width: 100%; height: 100%; display: block; }

/* Document attachment chip */
.att-doc { display: flex; align-items: center; gap: 11px; background: rgba(255,255,255,.72); border: 1px solid rgba(18,63,29,.14); border-radius: 11px; padding: 10px 13px; margin-bottom: 9px; }
.att-doc .doc-ic { width: 30px; height: 36px; flex: none; }
.att-doc .doc-meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.att-doc .doc-name { font-weight: 600; color: var(--navy); font-size: .9rem; }
.att-doc .doc-size { font-size: .76rem; color: var(--ink-soft); }

/* Voice message — CSS waveform (no audio; illustrative) */
.voice-bubble { display: flex; align-items: center; gap: 11px; }
.voice-ic { font-size: 1.05rem; flex: none; }
.voice-play { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-size: .7rem; box-shadow: 0 2px 6px rgba(210,130,47,.4); }
.voice-play::before { content: "▶"; margin-inline-start: 2px; }
.waveform { display: flex; align-items: center; gap: 3px; height: 26px; flex: 1 1 auto; min-width: 64px; }
.waveform span { display: block; width: 3px; border-radius: 3px; background: currentColor; opacity: .5; }
.voice-dur { font-size: .8rem; font-variant-numeric: tabular-nums; opacity: .82; flex: none; }

/* Expandable answer demo — native <details>, no JS */
.expand-demo { margin: 4px 0 2px; }
.expand-demo > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--teal-ink); font-size: .9rem; padding: 7px 14px; background: var(--accent-soft); border-radius: var(--radius-pill); user-select: none; transition: background .15s; }
.expand-demo > summary::-webkit-details-marker { display: none; }
.expand-demo > summary::before { content: "⤵"; font-weight: 700; transition: transform .2s; }
.expand-demo[open] > summary { background: #EADFC0; }
.expand-demo[open] > summary::before { transform: rotate(-180deg); }
.facets { list-style: none; padding: 0; margin: 13px 0 2px; display: grid; gap: 9px; }
.facet { background: #fff; border: 1px solid var(--line); border-inline-start: 3px solid var(--teal); border-radius: 10px; padding: 11px 14px; }
.facet b { display: block; color: var(--accent-ink); font-size: .9rem; margin-bottom: 3px; }
.facet span { color: var(--ink-soft); font-size: .89rem; }
.facet.synthesis { border-inline-start-color: var(--gold); background: #fffdf6; }
.facet.synthesis b { color: #8a6d18; }

/* Cosmetic share affordance (illustrative only — does nothing) */
.demo-share { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 7px 15px; }
.demo-share .ds-ic { color: var(--teal); }

/* === Vision page — bridge toward Africa === */
.vision-map { max-width: 440px; margin: 6px auto 0; }
.vision-map svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 30px rgba(18,63,29,.22)); }
.lang-badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 26px auto 4px; max-width: 580px; }
.lang-badge { display: inline-flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 8px 17px; box-shadow: var(--shadow-sm); font-weight: 600; color: var(--navy); font-size: .92rem; }
.lang-badge .lb-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fig-cap { text-align: center; color: var(--ink-soft); font-size: .85rem; margin-top: 14px; max-width: 560px; margin-inline: auto; }

/* === Deep-tech collapsible layer (technology page) === */
details.tech-details { max-width: 880px; margin: 24px auto 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
details.tech-details > summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 11px; background: var(--surface-tint); user-select: none; font-size: 1.02rem; }
details.tech-details > summary::-webkit-details-marker { display: none; }
details.tech-details > summary .td-ic { color: var(--teal); transition: transform .2s; font-size: .85rem; }
details.tech-details[open] > summary .td-ic { transform: rotate(90deg); }
html[lang="en"] details.tech-details[open] > summary .td-ic { transform: rotate(90deg); }
details.tech-details > summary .td-hint { margin-inline-start: auto; font-weight: 500; font-size: .8rem; color: var(--ink-soft); }
.tech-details > .td-body { padding: 22px clamp(18px, 4vw, 28px) 30px; }
.tech-details .td-h { font-size: 1.18rem; color: var(--accent-ink); margin: 30px 0 6px; font-weight: 600; }
.tech-details .td-h:first-child { margin-top: 4px; }
.tech-details .td-intro { color: var(--ink-soft); max-width: 760px; margin-bottom: 16px; }

/* Embedding pipeline — numbered stages with tech tags */
.pipeline { list-style: none; counter-reset: pl; padding: 0; margin: 8px auto 0; max-width: 840px; display: grid; gap: 13px; }
.pipeline > li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 66px 17px 20px; box-shadow: var(--shadow-sm); }
.pipeline > li { padding-inline-start: 66px; padding-inline-end: 20px; }
.pipeline > li::before { counter-increment: pl; content: counter(pl); position: absolute; inset-inline-start: 15px; top: 16px; width: 36px; height: 36px; border-radius: 10px; background: var(--bg-grad); color: #fff; font-weight: 600; display: grid; place-items: center; font-size: 1rem; box-shadow: 0 4px 10px rgba(18,63,29,.16); }
.pipeline h3 { font-size: 1.04rem; color: var(--navy); margin-bottom: 5px; font-weight: 600; }
.pipeline p { color: var(--ink-soft); margin: 0 0 10px; font-size: .94rem; }
.pl-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.pl-tag { font-family: var(--font-en); font-size: .75rem; font-weight: 500; background: var(--surface-tint); color: var(--teal-ink); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; letter-spacing: .2px; direction: ltr; unicode-bidi: isolate; }
.pl-tag.gold { background: #f6eccc; color: #8a6d18; border-color: #EADFC0; }

/* Guarantee checklist */
.spec-list { list-style: none; padding: 0; margin: 16px auto 0; max-width: 840px; display: grid; gap: 9px; }
.spec-list > li { position: relative; padding-inline-start: 27px; color: var(--ink-soft); font-size: .95rem; }
.spec-list > li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--teal); font-weight: 700; }

/* Knowledge-graph figure — SVG geometry + HTML node labels overlay */
.kg-stage { position: relative; max-width: 660px; margin: 6px auto 0; aspect-ratio: 660 / 400; }
.kg-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.kg-node { position: absolute; transform: translate(-50%, -50%); background: var(--surface); border: 2px solid var(--teal); border-radius: var(--radius-pill); padding: 6px 13px; font-size: .82rem; font-weight: 600; color: var(--navy); box-shadow: var(--shadow-sm); white-space: nowrap; }
.kg-node.center { border-color: var(--gold); background: #fffdf6; color: #8a6d18; }
.kg-legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 20px auto 0; max-width: 680px; }
.kg-legend .kl { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-soft); font-weight: 500; }
.kg-legend .kl i { width: 24px; height: 3px; border-radius: 3px; display: inline-block; flex: none; }

/* Typed-relation chips */
.rel-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 780px; margin: 6px auto 0; }
.rel-chip { font-size: .85rem; font-weight: 500; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 6px 13px; color: var(--accent-ink); box-shadow: var(--shadow-sm); }

@media (max-width: 560px) {
  .kg-node { font-size: .72rem; padding: 5px 9px; }
}

/* ============================================================
   === upgrade v4 (2026-07-14) — a11y + mobile nav ===
   ============================================================ */

/* Skip link — hidden until keyboard focus */
.skip-link { position: absolute; inset-inline-start: 8px; top: -48px; z-index: 100; background: var(--gold); color: var(--navy); font-weight: 600; padding: 9px 18px; border-radius: 0 0 10px 10px; transition: top .15s; }
.skip-link:focus { top: 0; text-decoration: none; }

/* Hamburger toggle — hidden on desktop */
.nav-toggle { display: none; background: none; border: 1px solid rgba(200,168,90,.55); border-radius: 8px; padding: 8px 10px; cursor: pointer; flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: #d9dcd3; border-radius: 2px; transition: transform .18s, opacity .18s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 820px) {
  .site-header .wrap { flex-direction: row; align-items: center; justify-content: space-between; }
  .nav-toggle { display: inline-flex; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 4px; padding-top: 12px; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 1rem; }
  .nav .lang-toggle, .nav .lang-select { align-self: flex-start; margin-top: 8px; }
  .site-header .wrap { flex-wrap: wrap; }
}

/* Trust line under hero CTAs */
.trust-line { margin-top: 18px; font-size: .88rem; color: #c3c8bf; letter-spacing: .2px; }

/* Homepage single chat sample — centered, narrower */
.home-chat { max-width: 560px; margin: 0 auto; grid-template-columns: 1fr; }
