/* Rezaei Mining Group — shared styles (LTR + RTL via logical properties) */

/* Self-hosted fonts (SIL Open Font License): Vazirmatn for Persian, Manrope for English */
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../fonts/vazirmatn-arabic.woff2") format("woff2-variations"), url("../fonts/vazirmatn-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../fonts/vazirmatn-latin.woff2") format("woff2-variations"), url("../fonts/vazirmatn-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../fonts/manrope-latin.woff2") format("woff2-variations"), url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --cream: #F3EEE4;
  --cream-2: #EAE3D6;
  --stone: #E4DCCD;
  --stone-dark: #B9AE9B;
  --ink: #2A2C30;
  --ink-2: #3A3D42;
  --ink-soft: #5E6168;
  --lapis: #1F4E8C;
  --lapis-deep: #163A6B;
  --lapis-soft: #DCE5F1;
  --line: rgba(42, 44, 48, .14);
  --white: #FFFDF9;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(42,44,48,.06), 0 8px 28px rgba(42,44,48,.08);
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;

  --font-en: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-fa: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font: var(--font-en);
}
:is(html[lang="fa"], html[lang="ar"]) { --font: var(--font-fa); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:is(html[lang="fa"], html[lang="ar"]) body { line-height: 1.95; }
img, svg, video, canvas { max-width: 100%; display: block; }
a { color: var(--lapis); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; font-weight: 800; letter-spacing: -.01em; }
:is(html[lang="fa"], html[lang="ar"]) h1, :is(html[lang="fa"], html[lang="ar"]) h2, :is(html[lang="fa"], html[lang="ar"]) h3 { letter-spacing: 0; line-height: 1.45; }
h1 { font-size: clamp(2.1rem, 5.4vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.num, .ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid var(--lapis); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(243, 238, 228, .82);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(243, 238, 228, .94); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand img { height: 40px; width: auto; mix-blend-mode: multiply; }
.brand span { font-size: .98rem; line-height: 1.2; }
.brand small { display: block; font-weight: 600; font-size: .72rem; color: var(--ink-soft); letter-spacing: .08em; text-transform: uppercase; }
:is(html[lang="fa"], html[lang="ar"]) .brand small { letter-spacing: 0; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-2); font-weight: 600; font-size: .94rem; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--cream-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--lapis); background: var(--lapis-soft); }
.nav .lang { border: 1px solid var(--line); margin-inline-start: 6px; font-size: .86rem; padding: 6px 10px; }
.nav .lang + .lang { margin-inline-start: 2px; }
.nav .btn { margin-inline-start: 6px; }
.menu-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; color: var(--ink); }
.menu-toggle svg { width: 26px; height: 26px; }

@media (max-width: 1180px) {
  .menu-toggle { display: block; }
  .nav {
    position: fixed; inset-inline: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--cream); padding: 12px var(--gutter) 24px;
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 14px; font-size: 1rem; }
  .nav .lang, .nav .btn { margin-inline-start: 0; margin-top: 6px; text-align: center; }
  .nav .lang { padding: 10px 14px; font-size: .95rem; }
  .nav .lang + .lang { margin-inline-start: 0; }
  .brand span { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: .96rem;
  background: var(--lapis); color: #fff !important; border: 2px solid var(--lapis);
  cursor: pointer; transition: background .2s, transform .2s, border-color .2s; font-family: inherit;
}
.btn:hover { background: var(--lapis-deep); border-color: var(--lapis-deep); text-decoration: none; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink) !important; border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff !important; }
.btn.light { background: var(--cream); color: var(--ink) !important; border-color: var(--cream); }
.btn.light:hover { background: #fff; border-color: #fff; }
.btn.sm { padding: 8px 16px; font-size: .9rem; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Scroll hero ---------- */
.scroll-hero { position: relative; height: 340vh; background: var(--ink); color: var(--cream); }
.scroll-hero .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.scroll-hero svg.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.scroll-hero canvas.frames { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scroll-hero .shade { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 45% at 50% 52%, rgba(20,22,26,.55), rgba(20,22,26,0) 100%), linear-gradient(180deg, rgba(20,22,26,.25), rgba(20,22,26,.05) 40%, rgba(20,22,26,.55)); pointer-events: none; }
@media (max-width: 640px) { .scroll-hero .shade { background: radial-gradient(ellipse 90% 40% at 50% 50%, rgba(20,22,26,.7), rgba(20,22,26,0) 100%), linear-gradient(180deg, rgba(20,22,26,.3), rgba(20,22,26,.2) 40%, rgba(20,22,26,.6)); } .scroll-hero .progress { display: none; } }
.scroll-hero.has-frames .stage { background: #2A2C30; }
.scroll-hero.has-frames .shade, .scroll-hero.static .shade { background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(20,22,26,.55), rgba(20,22,26,0) 100%), linear-gradient(180deg, rgba(20,22,26,.55), rgba(20,22,26,.2) 45%, rgba(20,22,26,.65)); }
.scroll-hero .captions { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: calc(var(--header-h) + 20px) var(--gutter) 40px; pointer-events: none; }
.scroll-hero .cap { grid-area: 1 / 1; max-width: 900px; opacity: 0; transform: translateY(30px); transition: opacity .6s, transform .6s; }
.scroll-hero .cap.on { opacity: 1; transform: none; pointer-events: auto; }
.scroll-hero .eyebrow { color: #A9C1E3; }
.scroll-hero h1, .scroll-hero h2 { color: var(--white); text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.scroll-hero p { font-size: clamp(1.02rem, 1.6vw, 1.25rem); color: #E9E3D7; text-shadow: 0 1px 12px rgba(0,0,0,.5); max-width: 680px; margin-inline: auto; }
.scroll-hero .cta-row { justify-content: center; }
.scroll-hero .progress { position: absolute; inset-inline-start: var(--gutter); bottom: 32px; display: flex; gap: 8px; }
.scroll-hero .progress i { width: 26px; height: 3px; background: rgba(243,238,228,.28); border-radius: 2px; overflow: hidden; position: relative; }
.scroll-hero .progress i b { position: absolute; inset: 0; background: var(--cream); transform-origin: left; transform: scaleX(0); }
html[dir="rtl"] .scroll-hero .progress i b { transform-origin: right; }
.scroll-hero .hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: 26px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(243,238,228,.7); display: flex; align-items: center; gap: 8px; transition: opacity .4s; }
:is(html[lang="fa"], html[lang="ar"]) .scroll-hero .hint { letter-spacing: 0; }
.scroll-hero .hint svg { width: 16px; height: 16px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
.scene .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }

/* Static fallback when motion is reduced */
.scroll-hero.static { height: auto; }
.scroll-hero.static .stage { position: relative; height: auto; min-height: 92vh; }
.scroll-hero.static .captions { position: relative; min-height: 92vh; }
.scroll-hero.static .cap { display: none; }
.scroll-hero.static .cap:first-child { display: block; opacity: 1; transform: none; }
.scroll-hero.static .progress, .scroll-hero.static .hint { display: none; }

/* ---------- Sections ---------- */
section { padding-block: clamp(64px, 10vw, 120px); }
.section-tight { padding-block: clamp(48px, 7vw, 80px); }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--lapis); margin-bottom: 14px; }
:is(html[lang="fa"], html[lang="ar"]) .eyebrow { letter-spacing: 0; font-size: .9rem; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--ink-soft); max-width: 720px; }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .lead { margin-inline: auto; }
.bg-white { background: var(--white); }
.bg-stone { background: var(--stone); }
.bg-ink { background: var(--ink); color: var(--cream); }
.bg-ink .lead, .bg-ink p { color: #CFC8BB; }
.bg-ink h2, .bg-ink h3 { color: var(--white); }
.bg-ink .eyebrow { color: #A9C1E3; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Page header (inner pages) */
.page-hero { padding-top: calc(var(--header-h) + clamp(48px, 8vw, 96px)); padding-bottom: calc(clamp(40px, 6vw, 72px) + 60px); background: var(--stone); position: relative; overflow: hidden; }
.page-hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 860px; }
.page-hero .ridge { position: absolute; inset-inline: 0; bottom: -1px; width: 100%; height: clamp(40px, 6vw, 90px); color: var(--cream); }
.crumbs { font-size: .88rem; color: var(--ink-soft); margin-bottom: 10px; }
.crumbs a { color: var(--ink-soft); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--white); padding: 28px 24px; }
.stat strong { display: block; font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.1; color: var(--ink); font-weight: 800; }
.stat strong em { font-style: normal; color: var(--lapis); }
.stat span { color: var(--ink-soft); font-size: .95rem; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Grids & cards */
.grid { display: grid; gap: 24px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .icon { width: 46px; height: 46px; border-radius: 12px; background: var(--lapis-soft); color: var(--lapis); display: grid; place-items: center; margin-bottom: 18px; }
.card .icon svg { width: 24px; height: 24px; }
.bg-ink .card { background: var(--ink-2); border-color: rgba(255,255,255,.08); box-shadow: none; }

/* Customer reference (logo + name + one sentence) */
.client { display: flex; align-items: center; gap: 24px; max-width: 760px; }
.client img { width: 112px; height: 112px; flex: none; border-radius: var(--radius-sm); background: #fff; }
.client h3 { margin-bottom: .3em; }
.client p { margin: 0; color: var(--ink-soft); }
@media (max-width: 520px) { .client { flex-direction: column; text-align: center; } }
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Grade cards */
.grade { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.grade .code { font-size: .8rem; font-weight: 800; letter-spacing: .12em; color: var(--ink-soft); text-transform: uppercase; }
:is(html[lang="fa"], html[lang="ar"]) .grade .code { letter-spacing: 0; }
.grade .na { font-size: 3rem; font-weight: 800; line-height: 1; margin: 14px 0 4px; color: var(--lapis); }
.grade .na small { font-size: 1rem; color: var(--ink-soft); font-weight: 700; }
.grade dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 18px 0 0; font-size: .94rem; }
.grade dt { color: var(--ink-soft); }
.grade dd { margin: 0; font-weight: 700; text-align: end; }
.grade .tag { display: inline-block; margin-inline-start: 8px; vertical-align: 1px; background: var(--lapis); color: #fff; font-size: .74rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.grade .more { margin-top: auto; padding-top: 18px; }

/* Process steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; position: relative; }
.steps li { list-style: none; padding: 0 20px 0 0; position: relative; }
html[dir="rtl"] .steps li { padding: 0 0 0 20px; }
.steps li::before { counter-increment: s; content: "0" counter(s); display: block; font-weight: 800; font-size: .9rem; color: var(--lapis); border-top: 2px solid var(--lapis); padding-top: 14px; margin-bottom: 10px; width: 100%; }
.bg-ink .steps li::before { color: #A9C1E3; border-color: #A9C1E3; }
.steps { padding: 0; margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; gap: 32px 0; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Analysis table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); -webkit-overflow-scrolling: touch; }
table.analysis { border-collapse: collapse; width: 100%; min-width: 880px; font-size: .92rem; direction: ltr; }
table.analysis th, table.analysis td { padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.analysis thead th { background: var(--ink); color: var(--cream); font-weight: 700; position: sticky; top: 0; }
table.analysis tbody th { text-align: start; background: var(--cream-2); font-weight: 800; position: sticky; left: 0; }
table.analysis tbody tr:last-child td, table.analysis tbody tr:last-child th { border-bottom: 0; }
table.analysis td.key { color: var(--lapis); font-weight: 800; }
table.analysis .unit th { background: var(--cream-2); color: var(--ink-soft); font-weight: 600; font-size: .8rem; }
.table-note { font-size: .88rem; color: var(--ink-soft); margin-top: 12px; }

/* Bar chart */
.bars { display: grid; gap: 28px; }
.bar-group h4 { font-size: .95rem; margin-bottom: 10px; }
.bar-row { display: grid; grid-template-columns: 54px 1fr 64px; align-items: center; gap: 12px; margin-bottom: 8px; font-size: .9rem; }
.bar-row .track { height: 12px; background: var(--cream-2); border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--lapis); border-radius: 999px; width: 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.bar-row:nth-child(3) .fill { background: #5B82B8; }
.bar-row:nth-child(4) .fill { background: #9DB5D6; }
.bar-row .v { font-weight: 800; text-align: end; direction: ltr; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .88rem; color: var(--ink-soft); margin-bottom: 18px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }

/* Feature list */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-inline-start: 32px; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 20px; height: 20px; border-radius: 50%; background: var(--lapis-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F4E8C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat; }
:is(html[lang="fa"], html[lang="ar"]) .ticks li::before { top: .55em; }

/* Terms tiles */
.terms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.term { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--white); }
.term b { font-size: 1.5rem; display: block; color: var(--lapis); direction: ltr; }
@media (max-width: 640px) { .terms { grid-template-columns: 1fr; } }

/* Visual blocks (placeholders until real photos arrive) */
.visual { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--ink); }
.visual svg, .visual img { width: 100%; height: 100%; }
.visual img { object-fit: cover; }
.visual .label { position: absolute; inset-inline-start: 16px; bottom: 14px; color: var(--cream); font-size: .82rem; font-weight: 700; background: rgba(20,22,26,.5); padding: 4px 10px; border-radius: 999px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--stone); aspect-ratio: 4/3; position: relative; }
.gallery figure.wide { grid-column: span 2; aspect-ratio: 8 / 3; }
.gallery figure svg, .gallery figure img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { position: absolute; inset-inline-start: 12px; bottom: 12px; font-size: .82rem; font-weight: 700; color: var(--cream); background: rgba(20,22,26,.55); padding: 4px 10px; border-radius: 999px; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery figure.wide { grid-column: span 2; } }
@media (max-width: 760px) { .gallery figure.wide { aspect-ratio: 16 / 9; } }
@media (max-width: 480px) { .gallery { grid-template-columns: 1fr; } .gallery figure.wide { grid-column: auto; aspect-ratio: 4 / 3; } }
/* Gallery videos: portrait clips, muted loop, played by main.js while on screen */
.gallery.videos figure { aspect-ratio: 3 / 4; cursor: pointer; }
.gallery.videos video { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 480px) { .gallery.videos { grid-template-columns: 1fr 1fr; gap: 10px; } .gallery.videos figcaption { font-size: .72rem; inset-inline-start: 8px; bottom: 8px; } }
.notice { background: var(--lapis-soft); color: var(--lapis-deep); border-radius: var(--radius-sm); padding: 14px 18px; font-size: .94rem; }

/* Blog */
.post-card { display: flex; flex-direction: column; color: var(--ink); }
.post-card:hover { text-decoration: none; transform: translateY(-2px); }
.post-card { transition: transform .2s; }
.post-card .meta { font-size: .84rem; color: var(--ink-soft); margin-bottom: 8px; }
.post-card h3 { font-size: 1.25rem; }
.post-card .read { margin-top: auto; color: var(--lapis); font-weight: 700; font-size: .94rem; }
.article { max-width: 760px; margin-inline: auto; }
.article h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-top: 1.8em; }
.article h3 { margin-top: 1.4em; }
.article ul, .article ol { padding-inline-start: 1.3em; }
.article li { margin-bottom: .4em; }
.article table { border-collapse: collapse; width: 100%; margin: 1em 0 1.6em; font-size: .94rem; }
.article th, .article td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: start; }
.article th { background: var(--cream-2); }
.article .callout { background: var(--white); border-inline-start: 4px solid var(--lapis); border-radius: var(--radius-sm); padding: 18px 22px; margin: 1.6em 0; }
.article-meta { color: var(--ink-soft); font-size: .92rem; }

/* Contact & form */
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person:first-child { padding-top: 0; }
.person b { display: block; }
.person .phone { direction: ltr; unicode-bidi: embed; color: var(--ink-soft); font-size: .95rem; }
.person .acts { display: flex; gap: 8px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); background: var(--white); }
.icon-btn:hover { background: var(--ink); color: #fff; text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }
.info-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.info-list li { display: flex; gap: 12px; align-items: flex-start; }
.info-list svg { width: 22px; height: 22px; color: var(--lapis); flex: none; margin-top: 4px; }

form.quote { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
form.quote .full { grid-column: 1 / -1; }
@media (max-width: 600px) { form.quote { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field label .req { color: #B3412E; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--lapis); box-shadow: 0 0 0 4px var(--lapis-soft); }
.field input[type="email"], .field input[type="tel"] { direction: ltr; }
html[dir="rtl"] .field input[type="email"], html[dir="rtl"] .field input[type="tel"] { text-align: right; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--lapis); }
.channel { display: flex; gap: 12px; flex-wrap: wrap; }
.channel label { flex: 1 1 180px; display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; background: var(--white); font-weight: 700; }
.channel input { accent-color: var(--lapis); width: 18px; height: 18px; }
.channel label:has(input:checked) { border-color: var(--lapis); background: var(--lapis-soft); }
.channel svg { width: 22px; height: 22px; }
.form-msg { font-size: .92rem; color: var(--ink-soft); }
.form-msg.err { color: #B3412E; font-weight: 700; }

/* CTA band */
.cta-band { background: var(--lapis); color: #fff; border-radius: calc(var(--radius) + 6px); padding: clamp(32px, 6vw, 64px); display: grid; grid-template-columns: 1.5fr auto; gap: 24px; align-items: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; margin-bottom: .3em; }
.cta-band p { color: #DCE5F1; margin: 0; }
.cta-band svg.bgm { position: absolute; inset-inline-end: -40px; bottom: -20px; width: 420px; opacity: .12; color: #fff; pointer-events: none; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--ink); color: #CFC8BB; padding: 64px 0 28px; font-size: .95rem; }
.site-footer a { color: #E9E3D7; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; }
.site-footer h4 { color: var(--white); font-size: .95rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-logo { width: 190px; height: auto; filter: invert(1); mix-blend-mode: screen; margin-bottom: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 44px; padding-top: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: #9C968B; }
.socials { display: flex; gap: 10px; margin-top: 16px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.socials a:hover { background: var(--lapis); }
.socials svg { width: 19px; height: 19px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Floating WhatsApp */
.wa-float { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: transform .2s; }
.wa-float:hover { transform: scale(1.06); text-decoration: none; }
.wa-float svg { width: 30px; height: 30px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bar-row .fill { transition: none; }
  .scroll-hero .hint svg { animation: none; }
}

/* Phones: smaller type scale (rem-based sizes shrink with the root) */
@media (max-width: 640px) {
  html { font-size: 15px; }
  body { font-size: 15.5px; line-height: 1.65; }
  :is(html[lang="fa"], html[lang="ar"]) body { line-height: 1.85; }
  h1 { font-size: 1.95rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.1rem; }
  .page-hero h1 { font-size: 1.8rem; }
  .article h2 { font-size: 1.3rem; }
  .lead, .scroll-hero p { font-size: 1rem; }
  .stat strong { font-size: 1.8rem; }
  .stat { padding: 20px 16px; }
  .grade .na { font-size: 2.4rem; }
  .post-card h3 { font-size: 1.12rem; }
  .term b { font-size: 1.3rem; }
  .card { padding: 22px; }
  .field input, .field select, .field textarea { font-size: 16px; } /* keeps iOS from zooming on focus */
  .article table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: .88rem; } /* wide analysis tables scroll instead of widening the page */}

.hidden { display: none !important; }
