/* ============================================================
   دکتر مجید برارپور — جراح و دندان‌پزشک
   سیستم طراحی: پرسلن + تیل پزشکی + برنز (کاور)
   ============================================================ */

:root {
  --porcelain: #faf6f0;
  --porcelain-2: #f2ebe1;
  --ink: #1e2e2c;
  --ink-soft: #3c4b47;
  --teal: #3e6c64;
  --teal-dark: #2a4c46;
  --gold: #b98d4f;
  --gold-light: #e3c395;
  --blush: #efd9c4;
  --line: #e4dacd;
  --white: #ffffff;
  --danger: #b3492f;

  --font-display: 'Markazi Text', 'Vazirmatn', serif;
  --font-body: 'Vazirmatn', Tahoma, sans-serif;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 32px;
  --shadow-soft: 0 20px 45px -25px rgba(30, 46, 42, 0.35);
  --shadow-card: 0 12px 30px -18px rgba(30, 46, 42, 0.28);

  --container: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .marquee-track { animation: none !important; overflow-x: auto; }
}

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.5em;
  line-height: 1.3;
}

p { margin: 0 0 1em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--teal);
  background: rgba(62, 108, 100, 0.09);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 52px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 38px);
}

.section-head p {
  color: var(--ink-soft);
  font-size: 17px;
}

section { padding: 96px 0; position: relative; }

/* -------------------- دکمه‌ها -------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover { transform: translateY(-2px); background: var(--teal-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.btn-gold {
  background: var(--gold);
  color: var(--white);
}

.btn-gold:hover { transform: translateY(-2px); background: #a67c3f; }

.btn-block { width: 100%; }

/* -------------------- هدر -------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 246, 240, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  max-width: var(--container);
  margin: 0 auto;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  flex-shrink: 0;
}

.brand-text .name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  display: block;
}

.brand-text .role {
  font-size: 12.5px;
  color: var(--ink-soft);
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.main-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
}

.main-nav a::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.25s ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after { width: 100%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.phone-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  direction: ltr;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* -------------------- هیرو -------------------- */

.hero {
  padding: 76px 0 60px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(36px, 5.4vw, 58px);
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: normal;
  color: var(--teal);
  position: relative;
}

.hero-lead {
  font-size: 18.5px;
  color: var(--ink-soft);
  max-width: 480px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 32px 0 40px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.trust-item .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blush);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1.05;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--teal) 0%, var(--teal-dark) 100%);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow-soft);
}

.hero-visual .arc-deco {
  position: absolute;
  inset: 0;
  opacity: 0.9;
}

.hero-visual-card {
  position: relative;
  z-index: 2;
  margin: 22px;
  background: rgba(250, 246, 240, 0.96);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  width: calc(100% - 44px);
  box-shadow: var(--shadow-card);
}

.hero-visual-card .label {
  font-size: 13px;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 4px;
}

.hero-visual-card .value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.smile-divider {
  width: 100%;
  height: 64px;
  display: block;
  color: var(--porcelain-2);
}

/* -------------------- درباره دکتر -------------------- */

.about {
  background: var(--porcelain-2);
}

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  align-items: center;
}

.about-frame {
  position: relative;
  aspect-ratio: 4 / 4.6;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.about-frame .placeholder-portrait {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--teal-dark);
  background:
    radial-gradient(circle at 50% 30%, var(--blush) 0%, transparent 60%),
    var(--porcelain);
  text-align: center;
  padding: 20px;
}

.about-frame .placeholder-portrait .initials {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 34px;
}

.about-frame .placeholder-portrait small {
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 220px;
}

.about-copy h2 { font-size: clamp(26px, 3.6vw, 34px); }

.credential-list {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}

.credential-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.credential-item .icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(185, 141, 79, 0.14);
  color: var(--gold);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.credential-item h4 { margin: 0 0 3px; font-size: 16px; }
.credential-item p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* -------------------- خدمات -------------------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 30px 26px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
  border-color: transparent;
}

.service-card.featured {
  background: linear-gradient(160deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: var(--white);
  border-color: transparent;
}

.service-card .service-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--blush);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.service-card.featured .service-icon {
  background: rgba(255, 255, 255, 0.16);
  color: var(--gold-light);
}

.service-card h3 { font-size: 19px; margin-bottom: 8px; }

.service-card p {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-bottom: 0;
}

.service-card.featured p { color: rgba(250, 246, 240, 0.86); }

.service-card .badge {
  display: inline-block;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(185, 141, 79, 0.14);
  padding: 4px 12px;
  border-radius: 999px;
}

.service-card.featured .badge {
  color: var(--ink);
  background: var(--gold-light);
}

/* -------------------- روند درمان -------------------- */

.process {
  background: var(--ink);
  color: var(--porcelain);
}

.process .section-head h2,
.process .section-head p { color: var(--porcelain); }
.process .section-head p { opacity: 0.75; }
.process .eyebrow { background: rgba(255, 255, 255, 0.1); color: var(--gold-light); }

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}

.process-step {
  position: relative;
  padding: 30px 22px 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.process-step .step-number {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--gold-light);
  opacity: 0.8;
  margin-bottom: 14px;
  display: block;
}

.process-step h4 { color: var(--porcelain); font-size: 17px; margin-bottom: 6px; }
.process-step p { color: rgba(250, 246, 240, 0.72); font-size: 14px; margin: 0; }

/* -------------------- نمونه کارها (گالری متحرک) -------------------- */

.portfolio { padding-bottom: 100px; }

.portfolio-marquee {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
  display: flex;
  gap: 22px;
  width: max-content;
  animation: marquee-scroll 38s linear infinite;
}

.portfolio-marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* در RTL جهت انیمیشن باید طبیعی از راست به چپ حرکت کند */
html[dir="rtl"] .marquee-track {
  animation-name: marquee-scroll-rtl;
}

@keyframes marquee-scroll-rtl {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

.marquee-item {
  flex: 0 0 auto;
  width: 260px;
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.marquee-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.marquee-item figcaption {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.portfolio-empty {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  padding: 44px 30px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.portfolio-empty .icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--blush);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-empty p {
  font-weight: 700;
  margin-bottom: 6px;
}

.portfolio-empty .hint-text {
  font-size: 14px;
  color: var(--ink-soft);
}

@media (max-width: 600px) {
  .marquee-item { width: 200px; }
  .marquee-item img { height: 230px; }
}

/* -------------------- تماس / نوبت‌دهی -------------------- */

.contact {
  background: var(--porcelain-2);
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 40px;
  align-items: start;
}

.contact-card,
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-card);
}

.contact-info-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.contact-info-item:last-child { border-bottom: none; }

.contact-info-item .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blush);
  color: var(--teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-item h4 { font-size: 15.5px; margin-bottom: 4px; }
.contact-info-item p, .contact-info-item a { font-size: 14.5px; color: var(--ink-soft); margin: 0; }
.contact-info-item a { display: block; direction: ltr; text-align: right; }
.contact-info-item a:hover { color: var(--teal); }

.map-wrap {
  margin-top: 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
}

.map-wrap iframe { width: 100%; height: 100%; border: 0; }

.form-card h3 { font-size: 21px; margin-bottom: 6px; }
.form-card > p.hint { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 26px; }

.form-row { margin-bottom: 18px; }

.form-row label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.form-row .req { color: var(--danger); }

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--porcelain);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(62, 108, 100, 0.15);
}

.form-row textarea { resize: vertical; min-height: 100px; }

.form-errors {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  margin-bottom: 20px;
  font-weight: 600;
}

.alert-success { background: rgba(62, 108, 100, 0.12); color: var(--teal-dark); }
.alert-error { background: rgba(179, 73, 47, 0.12); color: var(--danger); }

/* -------------------- فوتر -------------------- */

.site-footer {
  background: var(--ink);
  color: rgba(250, 246, 240, 0.82);
  padding: 56px 0 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand .name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--porcelain);
  display: block;
  margin-bottom: 6px;
}

.footer-brand p { font-size: 14.5px; color: rgba(250, 246, 240, 0.65); max-width: 340px; }

.footer-col h5 {
  font-size: 14.5px;
  color: var(--gold-light);
  margin-bottom: 16px;
  font-weight: 700;
}

.footer-col a, .footer-col p {
  display: block;
  font-size: 14px;
  color: rgba(250, 246, 240, 0.75);
  margin-bottom: 12px;
}

.footer-col a:hover { color: var(--gold-light); }

.footer-bottom {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: rgba(250, 246, 240, 0.55);
}

/* -------------------- انیمیشن ورود -------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------- ریسپانسیو -------------------- */

@media (max-width: 980px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-frame { max-width: 360px; margin: 0 auto; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .header-actions .phone-pill span.label { display: none; }
  .site-header.nav-open .main-nav {
    display: flex;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    background: var(--porcelain);
    padding: 20px 28px;
    gap: 18px;
    border-bottom: 1px solid var(--line);
  }
  section { padding: 68px 0; }
  .services-grid { grid-template-columns: 1fr; }
  .process-steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
