/* Madar Things (مدار اشیاء) — shared styles for fa (RTL) and en (LTR) */

/* Self-hosted fonts (no Google Fonts dependency) */
@font-face {
  font-family: "Vazirmatn"; src: url("fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face { font-family: "Poppins"; src: url("fonts/poppins-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
:root {
  --ink: #244A4D;
  --ink-dark: #13282a;
  --sage: #9DBEAD;
  --sage-soft: #dbe8e1;
  --copper: #BC7958;
  --paper: #F4F6F7;
  --white: #ffffff;
  --text: #1f2d2e;
  --muted: #5b6c6d;
  --line: #dfe6e6;
  --radius: 18px;
}
html[lang="fa"] { --font: "Vazirmatn", Tahoma, sans-serif; }
html[lang="en"] { --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; }
:lang(fa) { font-family: "Vazirmatn", Tahoma, sans-serif; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--text);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { line-height: 1.65; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
img { max-width: 100%; }
.wrap { max-width: 1160px; margin-inline: auto; padding-inline: 20px; }

/* Scroll progress */
.progress {
  position: fixed; top: 0; inset-inline-start: 0; z-index: 30;
  height: 3px; width: 0; background: var(--copper);
}

/* Logo mark */
.mark { color: var(--ink); }

/* Header — transparent over the hero, solid once scrolled */
.site-header {
  position: fixed; top: 0; inset-inline: 0; z-index: 20;
  color: var(--white);
  transition: background .3s, color .3s, border-color .3s;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 74px; }
.site-header .mark { color: var(--white); --mark-bg: #1d3a3c; transition: color .3s; }
.site-header.scrolled {
  background: rgba(244, 246, 247, .94); backdrop-filter: blur(10px);
  color: var(--ink); border-bottom-color: var(--line);
}
.site-header.scrolled .mark { color: var(--ink); --mark-bg: var(--paper); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-weight: 800; font-size: 1.2rem; line-height: 1.15; }
.brand-name small { display: block; font-size: .72rem; font-weight: 500; opacity: .8; }
.nav { display: flex; align-items: center; gap: 28px; font-weight: 500; }
.nav .nav-link { opacity: .8; transition: opacity .2s; }
.nav .nav-link:hover { opacity: 1; }
.lang {
  border: 1.5px solid currentColor; border-radius: 999px;
  padding: 3px 16px; font-weight: 600; font-size: .9rem; transition: background .2s, color .2s;
}
.lang:hover { background: var(--white); color: var(--ink); }
.site-header.scrolled .lang:hover { background: var(--ink); color: var(--white); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 999px; font-weight: 600; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--ink-dark); }
.btn-ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--white); }
.btn-light { background: var(--white); color: var(--ink); }
.btn-light:hover { background: var(--sage-soft); }
.btn-outline-light { border: 1.5px solid rgba(255, 255, 255, .5); color: var(--white); }
.btn-outline-light:hover { border-color: var(--white); background: rgba(255, 255, 255, .08); }
.arrow { display: inline-block; transition: transform .2s; }
html[dir="rtl"] .arrow { transform: scaleX(-1); }

/* Hero */
.hero {
  position: relative; overflow: hidden; color: var(--white);
  min-height: min(100vh, 880px); display: flex; align-items: flex-end;
  padding: 150px 0 64px; background: var(--ink-dark);
}
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: hero-zoom 16s ease-out forwards;
}
@keyframes hero-zoom { from { transform: scale(1.12); } to { transform: scale(1); } }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(19, 40, 42, .70) 0%, rgba(19, 40, 42, .45) 35%, rgba(19, 40, 42, .94) 100%),
    linear-gradient(90deg, rgba(19, 40, 42, .55), rgba(19, 40, 42, 0) 70%);
}
html[dir="rtl"] .hero::after {
  background:
    linear-gradient(180deg, rgba(19, 40, 42, .70) 0%, rgba(19, 40, 42, .45) 35%, rgba(19, 40, 42, .94) 100%),
    linear-gradient(270deg, rgba(19, 40, 42, .55), rgba(19, 40, 42, 0) 70%);
}
.hero .wrap { position: relative; z-index: 1; width: 100%; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--copper); font-weight: 600; margin-bottom: 14px; font-size: .95rem;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: currentColor; }
.hero .eyebrow { color: var(--sage); letter-spacing: .02em; }
h1 {
  font-weight: 800; font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: 1.3; margin-bottom: 22px; max-width: 14em;
}
html[lang="en"] h1 { line-height: 1.05; letter-spacing: -.025em; }
h1 .accent { color: var(--sage); }
.lead { font-size: 1.15rem; color: rgba(255, 255, 255, .8); max-width: 36em; margin-bottom: 34px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-tags {
  display: flex; flex-wrap: wrap; gap: 10px; list-style: none;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .14);
}
.hero-tags li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: .9rem;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(6px);
}
.hero-tags li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--copper); }

/* Sections */
section { padding: 96px 0; }
.bg-white { background: var(--white); }
.section-head { max-width: 680px; margin-bottom: 48px; }
h2 {
  color: var(--ink); font-weight: 800;
  font-size: clamp(1.75rem, 3.4vw, 2.6rem); line-height: 1.4; margin-bottom: 12px;
}
html[lang="en"] h2 { line-height: 1.15; letter-spacing: -.02em; }
h2 .accent { color: var(--copper); }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* Feature panels (services) */
.features { display: grid; gap: 28px; }
.feature {
  display: grid; grid-template-columns: 1fr 1.1fr;
  background: var(--white); border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
}
.feature:nth-child(even) .feature-media { order: -1; }
.feature-body { padding: 52px 48px; display: flex; flex-direction: column; justify-content: center; }
.feature-num { color: var(--copper); font-weight: 700; font-size: .9rem; letter-spacing: .08em; margin-bottom: 10px; }
.feature h3 { color: var(--ink); font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.35; margin-bottom: 12px; }
html[lang="en"] .feature h3 { line-height: 1.15; letter-spacing: -.015em; }
.feature-body > p { color: var(--muted); margin-bottom: 24px; }
.feature-list { list-style: none; display: grid; gap: 14px; }
.feature-list li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.ico {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--sage-soft); color: var(--ink); display: grid; place-items: center;
}
.ico svg { width: 22px; height: 22px; }
.feature-list strong { display: block; color: var(--ink); font-size: 1.02rem; }
.feature-list span { color: var(--muted); font-size: .95rem; }
.feature-media { position: relative; min-height: 380px; overflow: hidden; background: var(--ink); }
.feature-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1s ease;
}
.feature:hover .feature-media img { transform: scale(1.05); }
.feature-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(19, 40, 42, 0) 55%, rgba(19, 40, 42, .45));
}

/* Process */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; position: relative; counter-reset: step; }
.steps::before {
  content: ""; position: absolute; top: 23px; inset-inline: 23px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--copper) 0 10px, transparent 10px 16px);
}
.steps li { position: relative; padding-top: 68px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; inset-inline-start: 0;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--ink); color: var(--white); font-weight: 700; font-size: 1.1rem;
  display: grid; place-items: center; box-shadow: 0 0 0 6px var(--white);
}
html[lang="fa"] .steps li::before { content: counter(step, persian); }
.steps h3 { color: var(--ink); font-size: 1.1rem; margin-bottom: 4px; }
.steps p { color: var(--muted); font-size: .97rem; }

/* Why — dark band with photo */
.why { position: relative; overflow: hidden; background: var(--ink); color: var(--white); }
.why-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .18; }
.why .wrap { position: relative; }
.why h2 { color: var(--white); }
.why .section-head p { color: var(--sage); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.why-item { border-top: 2px solid var(--copper); padding-top: 22px; }
.why-item h3 { font-size: 1.2rem; margin-bottom: 6px; }
.why-item p { color: #c9dbd2; font-size: .97rem; }

/* Education */
.edu .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.edu-media { position: relative; }
.edu-media img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; border-radius: 28px; }
.edu-card {
  position: absolute; bottom: -24px; inset-inline-end: -16px; max-width: 260px;
  background: var(--white); border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 18px 40px rgba(36, 74, 77, .18); border: 1px solid var(--line);
}
.edu-card .tag { color: var(--copper); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.edu-card strong { display: block; color: var(--ink); font-size: 1.05rem; line-height: 1.4; }
.edu-card span { color: var(--muted); font-size: .85rem; }
.checklist { list-style: none; display: grid; gap: 12px; margin: 8px 0 32px; }
.checklist li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; color: var(--text); }
.checklist svg { width: 22px; height: 22px; color: var(--copper); margin-top: 4px; }

/* Founder */
.founder .wrap { display: grid; grid-template-columns: 340px 1fr; gap: 64px; align-items: center; }
.founder-photo {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden;
  background: linear-gradient(160deg, var(--sage-soft), var(--sage));
  display: grid; place-items: center;
}
.founder-photo img { width: 100%; height: 100%; object-fit: cover; }
.founder-photo .monogram { font-size: 4rem; font-weight: 800; color: var(--ink); opacity: .35; }
.founder-badge {
  position: absolute; inset-inline-start: 16px; bottom: 16px;
  background: var(--ink); color: var(--white); border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 10px 24px rgba(36, 74, 77, .25);
}
.founder-badge strong { display: block; font-size: 1.05rem; line-height: 1.3; }
.founder-badge span { font-size: .8rem; color: var(--sage); }
.founder .role { color: var(--copper); font-weight: 600; margin-bottom: 4px; }
.founder p.bio { color: var(--muted); font-size: 1.05rem; max-width: 36em; margin-bottom: 24px; }

/* Contact */
.contact-box {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--white); border-radius: 32px;
  padding: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.contact-box h2 { color: var(--white); margin-bottom: 10px; }
.contact-box > div > p { color: var(--sage); font-size: 1.05rem; margin-bottom: 28px; }
.contact-list { list-style: none; display: grid; gap: 12px; }
.contact-list a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 16px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  transition: background .2s, border-color .2s;
}
.contact-list a:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); }
.contact-list svg { width: 22px; height: 22px; color: var(--copper); flex: none; }
.contact-list span { font-weight: 500; }
.contact-list .label { display: block; font-size: .8rem; color: var(--sage); font-weight: 400; }

/* Placeholder marker — remove the class once real info is in */
.todo { outline: 2px dashed var(--copper); outline-offset: 3px; }

/* Footer */
.site-footer { background: var(--sage-soft); padding: 0 0 28px; }
.site-footer .trace { width: 100%; height: 28px; color: var(--copper); }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; flex-wrap: wrap; }
.site-footer .brand { color: var(--ink); }
.site-footer .brand .mark { width: 32px; height: 32px; --mark-bg: var(--sage-soft); }
.site-footer .brand-name { font-size: 1rem; }
.site-footer p { color: var(--muted); font-size: .9rem; }

/* Reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bg { animation: none; }
  html { scroll-behavior: auto; }
}

/* Responsive */
@media (max-width: 960px) {
  .nav .nav-link { display: none; }
  .feature { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature-media { order: 0; }
  .feature-media { min-height: 260px; order: -1; }
  .feature-body { padding: 32px 28px; }
  .edu .wrap, .founder .wrap { grid-template-columns: 1fr; gap: 48px; }
  .founder-photo { max-width: 320px; width: 100%; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
  .steps::before { display: none; }
  .contact-box { grid-template-columns: 1fr; padding: 36px; }
}
@media (max-width: 600px) {
  section { padding: 64px 0; }
  .hero { min-height: 92vh; padding: 120px 0 40px; }
  .hero-tags { margin-top: 36px; }
  .grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .contact-box { padding: 26px; border-radius: 24px; }
  .brand-name small { display: none; }
  .actions .btn { flex: 1; }
  .edu-card { position: static; margin-top: -40px; margin-inline: 16px; max-width: none; position: relative; }
}
