/* Layout: a petrol-blue hero carrying a live Business Model Canvas, then calm paper sections with one saffron accent. */
:root {
  --paper: #F6F8F7;
  --surface: #FFFFFF;
  --ink: #10262E;
  --muted: #4A5D64;
  --line: #DAE2E2;
  --petrol: #0F2F38;
  --petrol-2: #17404B;
  --on-petrol: #EEF4F4;
  --on-petrol-muted: #AFC3C6;
  --saffron: #D99A36;      /* button fills, marks on dark */
  --saffron-text: #8A5710; /* accent text on light ground */
  --saffron-soft: #FBF1E1;
  --on-saffron: #10262E;
  --display: "Noto Kufi Arabic", Vazirmatn, Tahoma, sans-serif;
  --body: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;
  --step-4: clamp(2.1rem, 4.6vw, 3.4rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B181C; --surface: #11242A; --ink: #E5EEEE; --muted: #9EB2B5; --line: #22383E;
    --petrol: #0E2C35; --petrol-2: #18434F; --on-petrol: #EEF4F4; --on-petrol-muted: #AFC3C6;
    --saffron: #E0A84B; --saffron-text: #E9B865; --saffron-soft: #2A2416; --on-saffron: #10262E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0B181C; --surface: #11242A; --ink: #E5EEEE; --muted: #9EB2B5; --line: #22383E;
  --petrol: #0E2C35; --petrol-2: #18434F; --on-petrol: #EEF4F4; --on-petrol-muted: #AFC3C6;
  --saffron: #E0A84B; --saffron-text: #E9B865; --saffron-soft: #2A2416; --on-saffron: #10262E;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.9;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--surface);
}
h1, h2, h3 { font-family: var(--display); line-height: 1.5; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--saffron); outline-offset: 3px; border-radius: 6px;
}
img { max-width: 100%; }

.wrap {
  max-width: 1180px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.eyebrow { font-size: var(--step--1); font-weight: 700; color: var(--saffron-text); letter-spacing: 0.02em; }
.lead { color: var(--muted); font-size: var(--step-1); max-width: 62ch; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding-block: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 10px; background: var(--petrol); color: var(--saffron);
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.2rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.45; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.brand-role { font-size: 0.8rem; color: var(--muted); }
.site-nav { display: flex; gap: 4px 22px; overflow-x: auto; max-width: 100%; font-weight: 500; font-size: 0.95rem; }
.site-nav a { text-decoration: none; padding-block: 10px; white-space: nowrap; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 10px; text-decoration: none;
  font-weight: 700; font-size: 1rem; border: 1.5px solid transparent; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--saffron); color: var(--on-saffron); }
.btn-ghost { border-color: var(--on-petrol-muted); color: var(--on-petrol); }
.btn-ghost:hover { background: var(--petrol-2); }
.btn-dark { background: var(--petrol); color: var(--on-petrol); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 0.95rem; }

/* Hero */
.hero { background: var(--petrol); color: var(--on-petrol); }
.hero .wrap {
  padding-block: 72px 80px; display: grid; gap: 48px; align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}
.hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hero .eyebrow { color: var(--saffron); }
.hero h1 { font-size: var(--step-4); font-weight: 800; line-height: 1.45; }
.hero h1 em { font-style: normal; color: var(--saffron); }
.hero p { color: var(--on-petrol-muted); font-size: var(--step-1); max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* Business Model Canvas */
.bmc { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bmc-grid {
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(64px, auto));
  gap: 6px; padding: 6px; border-radius: 14px; background: var(--petrol-2);
}
.bmc-cell {
  background: var(--petrol); border-radius: 8px; padding: 10px; font-size: 0.78rem; line-height: 1.6;
  color: var(--on-petrol-muted); display: flex; flex-direction: column; gap: 4px;
  animation: rise .6s ease both;
}
.bmc-cell b { color: var(--on-petrol); font-weight: 700; font-size: 0.82rem; }
.bmc-cell.c1 { grid-column: span 2; grid-row: span 2; }
.bmc-cell.c2 { grid-column: span 2; }
.bmc-cell.c3 { grid-column: span 2; grid-row: span 2; }
.bmc-cell.c4 { grid-column: span 5; }
.bmc-cell.vp { background: var(--saffron); color: var(--on-saffron); }
.bmc-cell.vp b { color: var(--on-saffron); font-size: 0.9rem; }
.bmc-grid > :nth-child(2) { animation-delay: .05s } .bmc-grid > :nth-child(3) { animation-delay: .1s }
.bmc-grid > :nth-child(4) { animation-delay: .15s } .bmc-grid > :nth-child(5) { animation-delay: .2s }
.bmc-grid > :nth-child(6) { animation-delay: .25s } .bmc-grid > :nth-child(7) { animation-delay: .3s }
.bmc-grid > :nth-child(8) { animation-delay: .35s } .bmc-grid > :nth-child(9) { animation-delay: .4s }
.bmc figcaption { font-size: var(--step--1); color: var(--on-petrol-muted); }
@keyframes rise { from { transform: translateY(6px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (max-width: 560px) { .bmc-cell span { display: none; } .bmc-cell { padding: 8px 6px; } .bmc-cell b { font-size: 0.72rem; } }

/* Sections */
.section { padding-block: 80px 0; }
.section:last-of-type { padding-bottom: 80px; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 36px; }
.section-head h2 { font-size: var(--step-3); font-weight: 800; }
.section-head.row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.link-more { font-weight: 700; color: var(--saffron-text); text-decoration: none; }
.link-more:hover { text-decoration: underline; }

/* Audience paths */
.paths { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.path {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  display: flex; flex-direction: column; gap: 10px; text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.path:hover { border-color: var(--saffron); transform: translateY(-2px); }
.path h3 { font-size: var(--step-1); font-weight: 700; }
.path p { color: var(--muted); font-size: 0.98rem; }
.path .go { margin-top: auto; color: var(--saffron-text); font-weight: 700; font-size: 0.95rem; }

/* Services */
.services { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); border-top: 1px solid var(--line); }
.service { padding: 28px 0 28px 28px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.service h3 { font-size: var(--step-1); font-weight: 700; }
.service p { color: var(--muted); }
.service ul { margin: 4px 0 0; padding: 0 18px 0 0; color: var(--ink); font-size: 0.97rem; }

/* Process */
.process-band { background: var(--surface); border-block: 1px solid var(--line); margin-top: 80px; }
.process-band .wrap { padding-block: 72px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); counter-reset: step; }
.steps li { display: flex; flex-direction: column; gap: 8px; counter-increment: step; position: relative; padding-top: 18px; border-top: 3px solid var(--line); }
.steps li:first-child { border-top-color: var(--saffron); }
.steps li::before { content: "گام " counter(step, persian); font-size: var(--step--1); font-weight: 700; color: var(--saffron-text); }
.steps h3 { font-size: var(--step-1); font-weight: 700; }
.steps p { color: var(--muted); font-size: 0.98rem; }

/* Case studies */
.cases { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.case { display: grid; gap: 20px 40px; padding-block: 36px; border-bottom: 1px solid var(--line); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.case-id { display: flex; gap: 18px; align-items: flex-start; min-width: 0; }
.monogram {
  flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--petrol); color: var(--saffron);
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.5rem;
}
.case-id h3 { font-size: var(--step-2); font-weight: 800; }
.case-id .sector { color: var(--muted); font-size: 0.95rem; }
.case-body { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); min-width: 0; }
.case-body div { display: flex; flex-direction: column; gap: 4px; }
.case-body dt { font-size: var(--step--1); font-weight: 700; color: var(--saffron-text); }
.case-body dd { margin: 0; font-size: 0.97rem; color: var(--muted); }
.ph { color: var(--muted); background: var(--saffron-soft); border-radius: 4px; padding: 0 4px; }

/* Articles */
.articles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.article-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: border-color .15s ease;
}
.article-card:hover { border-color: var(--saffron); }
.article-card h3 { font-size: var(--step-1); font-weight: 700; }
.article-card p { color: var(--muted); font-size: 0.97rem; }
.article-card .meta { margin-top: auto; font-size: var(--step--1); color: var(--muted); }

/* Offer band */
.offer { background: var(--saffron-soft); border-radius: 18px; padding: 40px; display: grid; gap: 24px; align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.offer h2 { font-size: var(--step-2); font-weight: 800; }
.offer p { color: var(--muted); margin-top: 8px; }
.offer .actions { display: flex; justify-content: flex-start; }

/* About */
.about { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.about p { color: var(--muted); max-width: 62ch; }
.about .principles { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.about .principles li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.about .principles b { display: block; font-family: var(--display); font-weight: 700; }

/* FAQ */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 20px 0; font-weight: 700; font-size: var(--step-1); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--saffron-text); font-size: 1.5rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 20px; color: var(--muted); max-width: 70ch; }

/* Contact */
.contact { background: var(--petrol); color: var(--on-petrol); margin-top: 80px; }
.contact .wrap { padding-block: 72px; display: grid; gap: 36px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: center; }
.contact h2 { font-size: var(--step-3); font-weight: 800; }
.contact p { color: var(--on-petrol-muted); margin-top: 10px; max-width: 52ch; }
.channels { display: flex; flex-direction: column; gap: 10px; }
.channel {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--petrol-2); border-radius: 12px; padding: 14px 18px; text-decoration: none; color: var(--on-petrol);
}
.channel b { font-weight: 700; }
.channel span { color: var(--on-petrol-muted); direction: ltr; unicode-bidi: isolate; }
.channel:hover { outline: 1.5px solid var(--saffron); }

/* Footer */
.site-footer { background: var(--petrol); color: var(--on-petrol-muted); border-top: 1px solid var(--petrol-2); font-size: var(--step--1); }
.site-footer .wrap { padding-block: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--on-petrol); text-decoration: none; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* Article page */
.post-head { background: var(--petrol); color: var(--on-petrol); }
.post-head .wrap { padding-block: 56px 60px; display: flex; flex-direction: column; gap: 16px; }
.post-head .eyebrow { color: var(--saffron); }
.post-head h1 { font-size: var(--step-4); font-weight: 800; max-width: 22ch; }
.post-head .meta { color: var(--on-petrol-muted); font-size: var(--step--1); }
.post-head .crumb { color: var(--on-petrol-muted); font-size: var(--step--1); text-decoration: none; }
.prose { max-width: 70ch; padding-block: 48px 24px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--step-2); font-weight: 700; margin-top: 1.8em; }
.prose h3 { font-size: var(--step-1); font-weight: 700; margin-top: 1.4em; }
.prose ul, .prose ol { padding-right: 1.3em; padding-left: 0; }
.prose li + li { margin-top: .5em; }
.prose strong { color: var(--ink); }
.prose .callout { background: var(--saffron-soft); border-radius: 12px; padding: 18px 22px; }
.post-cta { max-width: 70ch; margin-block: 24px 80px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.post-cta h2 { font-size: var(--step-1); font-weight: 700; }
.post-cta p { color: var(--muted); }

/* Courses page */
.courses { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); padding-block: 48px 80px; }
.course { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.course h2 { font-size: var(--step-1); font-weight: 700; }
.course ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.course li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 8px; background: var(--paper); font-size: 0.95rem; }
.course li span { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 720px) {
  .section { padding-block: 56px 0; }
  .hero .wrap { padding-block: 48px 56px; }
  .offer { padding: 28px 22px; }
  .service { padding-left: 0; }
}

/* ============ Motion layer ============ */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .9; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(600px circle at var(--hx, 70%) var(--hy, 30%), color-mix(in srgb, var(--saffron) 14%, transparent), transparent 60%);
  transition: background .2s;
}
.hero h1 .w { display: inline-block; animation: wordUp .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
.hero .eyebrow, .hero p, .hero-actions { animation: fadeUp .9s ease both; }
.hero p { animation-delay: .7s; } .hero-actions { animation-delay: .85s; }
@keyframes wordUp { from { transform: translateY(.6em) rotate(2deg); opacity: 0; filter: blur(6px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes fadeUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.hero h1 em { position: relative; }
.hero h1 em::after {
  content: ""; position: absolute; inset-inline: 0; bottom: .08em; height: .12em; border-radius: 4px;
  background: var(--saffron); transform-origin: right; animation: sweep 1s .9s cubic-bezier(.7,0,.2,1) both;
}
@keyframes sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* BMC as an interactive spotlight */
button.bmc-cell { font: inherit; text-align: start; border: 1px solid transparent; cursor: pointer; transition: background .35s, border-color .35s, transform .35s, color .35s; }
button.bmc-cell:hover { border-color: var(--on-petrol-muted); }
.bmc-cell.active { border-color: var(--saffron); transform: translateY(-3px); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--saffron) 70%, transparent); }
.bmc-cell.vp { animation: rise .6s ease both, glow 3.2s 1.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--saffron) 25%, transparent); } }
.bmc-q { display: flex; gap: 10px; align-items: baseline; min-height: 3.6em; font-size: var(--step-0); color: var(--on-petrol); }
.bmc-q b { color: var(--saffron); white-space: nowrap; }
.bmc-q span { animation: fadeUp .45s ease both; }

/* Marquee */
.marquee { background: var(--saffron); color: var(--on-saffron); overflow: hidden; direction: ltr; }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; direction: rtl; }
.marquee li { display: flex; align-items: center; gap: 28px; padding: 14px 14px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.marquee li::after { content: ""; width: 9px; height: 9px; background: var(--on-saffron); transform: rotate(45deg); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Pointer-reactive cards */
.tilt { position: relative; transform-style: preserve-3d; will-change: transform; transition: transform .25s ease, border-color .15s ease; }
.tilt::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--saffron) 16%, transparent), transparent 65%);
}
.tilt:hover::before { opacity: 1; }
.magnetic { transition: transform .2s ease; }

/* Header on scroll */
.site-header { transition: box-shadow .3s, background .3s; }
.site-header.scrolled { box-shadow: 0 8px 24px -16px rgba(0,0,0,.35); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); }

/* Process bars that fill as you scroll */
.steps li { border-top-color: var(--line) !important; }
.steps li::after {
  content: ""; position: absolute; top: -3px; inset-inline: 0; height: 3px; background: var(--saffron);
  transform-origin: right; transform: scaleX(1);
}

/* Logos */
.case-logo { flex: none; width: 132px; aspect-ratio: 1; max-width: 100%; border-radius: 18px; overflow: hidden; box-shadow: 0 14px 30px -18px rgba(0,0,0,.5); transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.case:hover .case-logo { transform: rotate(-3deg) scale(1.04); }
.case-logo svg { display: block; width: 100%; height: 100%; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s cubic-bezier(.6,0,.2,1); }
.logo-pre .draw { stroke-dashoffset: 1; }
.logo-pre .pop { transform: scale(0); }
.pop { transform-box: fill-box; transform-origin: center; transition: transform .6s 1s cubic-bezier(.3,1.6,.5,1); }
.case-id { align-items: center; }

/* Reading progress on articles */
.read-progress { position: fixed; top: env(safe-area-inset-top, 0px); inset-inline: 0; height: 3px; z-index: 30; background: var(--saffron); transform-origin: right; transform: scaleX(0); }

/* Contact facts */
.meet { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-top: 22px; }
.meet div { border: 1px solid var(--petrol-2); border-radius: 12px; padding: 14px 16px; }
.meet b { display: block; color: var(--saffron); font-size: var(--step--1); }

/* Scroll-driven effects, only where supported */
@supports (animation-timeline: view()) {
  .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  @keyframes reveal { from { opacity: .15; transform: translateY(40px) scale(.98); } to { opacity: 1; transform: none; } }
  .steps li::after { animation: fillbar linear both; animation-timeline: view(); animation-range: entry 30% cover 45%; }
  @keyframes fillbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .read-progress { animation: fillbar linear both; animation-timeline: scroll(root); }
  .section-head h2 { animation: headIn linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  @keyframes headIn { from { letter-spacing: .04em; opacity: .3; } to { letter-spacing: 0; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  .hero-canvas { display: none; }
  .read-progress { display: none; }
  .tilt { transform: none !important; }
}
