/* ---------------------------------------------------------
   Dr. Waseem Fathalla — Pediatric Neurology Consulting
   "Clinical Editorial" — deep pine + warm cream + muted gold
   --------------------------------------------------------- */

:root {
  --cream: #f1eee1;
  --cream-cool: #eceee7;
  --ink: #1a3d2e;        /* primary dark — deep pine green */
  --ink-soft: #3f4a44;   /* body text */
  --ink-faint: #767f78;  /* meta / faint labels */
  --line: #d8d2bd;
  --accent: #a67c3d;     /* muted brass/gold — sparing use only */
  --accent-dark: #8a6530;
  --white: #ffffff;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-sans-ar: "Segoe UI", Tahoma, "Geeza Pro", Arial, sans-serif;

  --max-width: 1120px;
  --radius: 4px;
  --radius-card: 8px;
  --shadow-card: 0 1px 3px rgba(26, 61, 46, 0.07), 0 10px 26px rgba(26, 61, 46, 0.07);
  --shadow-card-hover: 0 4px 10px rgba(26, 61, 46, 0.1), 0 18px 36px rgba(26, 61, 46, 0.13);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body {
  font-family: var(--font-sans-ar);
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
  font-family: var(--font-sans-ar);
  font-weight: 700;
}

/* Small decorative rule under every major section heading */
main h2::after {
  content: "";
  display: block;
  width: 52px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 14px;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

a {
  color: var(--ink);
  transition: color 0.15s ease;
}
a:hover { color: var(--accent); }

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

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin: 0 0 0.75em;
}

.skip-link {
  position: absolute;
  inset-inline-start: -999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 12px 20px;
  z-index: 1000;
}
.skip-link:focus {
  inset-inline-start: 12px;
  top: 12px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(26, 61, 46, 0.16); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--ink);
  color: var(--cream);
}
.btn-primary:hover { background: var(--accent-dark); color: var(--white); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover { background: var(--accent-dark); color: var(--white); border-color: var(--accent-dark); }
.btn-small {
  padding: 10px 20px;
  font-size: 0.85rem;
}
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.download-icon { flex-shrink: 0; }

/* ---------------- Header / Nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(241, 238, 225, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}
.site-header.scrolled {
  box-shadow: 0 2px 16px rgba(26, 61, 46, 0.09);
}

.navbar {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 18px;
  padding-bottom: 18px;
  padding-left: 32px;
  padding-right: 190px; /* reserved for .nav-fixed-controls, pinned physical right */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: padding-top 0.25s ease, padding-bottom 0.25s ease;
}
.scrolled .navbar {
  padding-top: 12px;
  padding-bottom: 12px;
}

.nav-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav-name:hover { color: var(--accent); }
html[dir="rtl"] .nav-name { font-family: var(--font-sans-ar); font-weight: 700; }

.nav-panel {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding-bottom: 3px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

/* Live indicator for whichever section is currently in view */
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-links a.active::after { transform: scaleX(1); }

/* Pinned to the physical top-right corner of the viewport, regardless of
   document direction, so it never mirrors or moves when language toggles. */
.nav-fixed-controls {
  position: absolute;
  top: 50%;
  right: 32px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
}

.lang-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
  min-width: 90px;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  display: block;
}

/* ---------------- Floating CTA ---------------- */
.floating-cta {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 300;
  background: var(--ink);
  color: var(--cream);
  padding: 15px 26px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(26, 61, 46, 0.32), 0 2px 8px rgba(26, 61, 46, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease,
    visibility 0.25s ease, background 0.2s ease;
}
.floating-cta:hover {
  background: var(--accent-dark);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(166, 124, 61, 0.32), 0 4px 10px rgba(26, 61, 46, 0.22);
}
.floating-cta.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 100px 0 90px;
  background: var(--cream);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  margin-bottom: 0.3em;
}
.hero-credential {
  font-size: 1.12rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.1em;
}
.hero-positioning {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin-bottom: 2em;
}
.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-media::before {
  content: "";
  position: absolute;
  top: -16px;
  bottom: -16px;
  left: -16px;
  right: -16px;
  background: linear-gradient(135deg, rgba(26, 61, 46, 0.1), rgba(166, 124, 61, 0.14));
  border-radius: 28px;
  z-index: 0;
}
.hero-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(26, 61, 46, 0.2);
}

/* ---------------- Section reveal on scroll ---------------- */
#about, #services, #how-it-works, #faq, #contact {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#about.in-view, #services.in-view, #how-it-works.in-view, #faq.in-view, #contact.in-view {
  opacity: 1;
  transform: none;
}

/* ---------------- About ---------------- */
.about { padding: 90px 0; background: var(--cream-cool); }
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 64px;
}
.about-main h2 { font-size: 2rem; }
.about-sidebar {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 32px;
  align-self: start;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.about-sidebar:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}
.about-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 16px;
  border: 3px solid var(--cream);
  box-shadow: 0 4px 14px rgba(26, 61, 46, 0.2);
}
.about-sidebar h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.2em;
}
.about-sidebar dl { margin: 0 0 1.5em; }
.about-sidebar dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-top: 1em;
}
.about-sidebar dt:first-child { margin-top: 0; }
.about-sidebar dd {
  margin: 0.25em 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------------- Services ---------------- */
.services { padding: 90px 0; background: var(--cream); }
.services h2 { font-size: 2rem; max-width: 680px; margin-bottom: 1.4em; }
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.pillar {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 32px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.pillar:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}
.pillar-icon {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--accent);
  margin-bottom: 16px;
}
.pillar-icon svg { width: 100%; height: 100%; }
.pillar-audience {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 0.6em;
}
.pillar h3 {
  font-size: 1.25rem;
  margin-bottom: 1em;
}
.pillar-items { margin: 0; padding: 0; list-style: none; }
.pillar-item { margin-bottom: 1.3em; }
.pillar-item:last-child { margin-bottom: 0; }
.pillar-item h4 {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.35em;
  color: var(--ink);
}
html[dir="rtl"] .pillar-item h4 { font-family: var(--font-sans-ar); }
.pillar-item p { font-size: 0.9rem; margin: 0; }

/* ---------------- How It Works ---------------- */
.how-it-works { padding: 90px 0; background: var(--cream-cool); }
.how-it-works h2 { font-size: 2rem; margin-bottom: 1.4em; }
.steps {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
/* Connecting line threading through the numbered step badges */
.steps::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16.6%;
  right: 16.6%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.step {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 36px 28px 28px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.step:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}
.step-number {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(166, 124, 61, 0.35);
  z-index: 1;
}
.step-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-faint);
  margin: 0.5em 0 0.6em;
}
.step h3 { font-size: 1.15rem; margin-bottom: 0.5em; }
.step p { font-size: 0.92rem; margin: 0; }

/* ---------------- FAQ ---------------- */
.faq { padding: 90px 0; background: var(--cream); }
.faq h2 { font-size: 2rem; margin-bottom: 1.2em; }

.faq-list {
  max-width: 780px;
  margin-inline: auto; /* centered — active */
  /* margin-inline: 0; */ /* side-aligned (original) — comment the line above and uncomment this one to switch back */
}
.faq-item {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
  overflow: hidden;
}
.faq-item:last-child { margin-bottom: 0; }
.faq-question {
  width: 100%;
  text-align: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
html[dir="rtl"] .faq-question { font-family: var(--font-sans-ar); }
.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
  transition: transform 0.3s ease;
}
.faq-item.open .faq-icon { transform: rotate(180deg); }
.faq-icon::before, .faq-icon::after {
  content: "";
  position: absolute;
  background: var(--accent);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease;
}
.faq-icon::before { width: 14px; height: 2px; }
.faq-icon::after { width: 2px; height: 14px; }
.faq-item.open .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }

.faq-answer {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}
.faq-item.open .faq-answer { max-height: 400px; opacity: 1; }
.faq-answer p {
  padding: 0 24px 20px;
  margin: 0;
  font-size: 0.95rem;
}

/* ---------------- Contact ---------------- */
.contact { padding: 90px 0 110px; background: var(--cream-cool); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
}
.contact-intro h2 { font-size: 2rem; }
.contact-info { margin-top: 2em; }
.contact-info dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-top: 1.2em;
}
.contact-info dt:first-child { margin-top: 0; }
.contact-info dd {
  margin: 0.3em 0 0;
  color: var(--ink-soft);
}

.contact-tips { margin-top: 2em; }
.contact-tips h3 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 600;
  margin: 0 0 0.7em;
}
html[dir="rtl"] .contact-tips h3 { font-family: var(--font-sans-ar); }
.contact-tips ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-tips li {
  position: relative;
  padding-inline-start: 18px;
  margin-bottom: 0.55em;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.contact-tips li:last-child { margin-bottom: 0; }
.contact-tips li::before {
  content: "–";
  position: absolute;
  inset-inline-start: 0;
  color: var(--accent);
}

.pull-quote {
  margin: 32px 0 0;
  padding-block: 4px;
  padding-inline-start: 20px;
  border-inline-start: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
}
html[dir="rtl"] .pull-quote {
  font-family: var(--font-sans-ar);
  font-style: normal;
  font-weight: 600;
}

.contact-form {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 30px;
}
.form-row { margin-bottom: 15px; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4em;
  color: var(--ink);
}
.form-row label::after {
  content: " *";
  color: var(--accent-dark);
  font-weight: 700;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form-row textarea { resize: vertical; }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(166, 124, 61, 0.18);
}
.form-row input[aria-invalid="true"],
.form-row input[aria-invalid="true"]:focus {
  border-color: #a83a3a;
}
.field-error {
  color: #a83a3a;
  font-size: 0.8rem;
  margin: 5px 0 0;
  min-height: 1.1em;
}

.hp-field {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.confidentiality-notice {
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-style: italic;
  margin: 4px 0 18px;
}

.form-status {
  font-size: 0.9rem;
  margin: 14px 0 0;
  min-height: 1.2em;
}
.form-status.success { color: #2f6b3a; }
.form-status.error { color: #a83a3a; }

/* ---------------- Footer ---------------- */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
  text-align: center;
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #about, #services, #how-it-works, #faq, #contact {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .btn, .pillar, .step, .about-sidebar, .floating-cta, .faq-icon,
  .faq-icon::before, .faq-icon::after, .nav-links a::after {
    transition: none;
  }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-text { order: 1; }
  .hero-media { order: 2; margin-top: 12px; }
  .hero-photo { max-width: 320px; }

  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }
  .pillars,
  .steps { grid-template-columns: 1fr; }
  .steps::before { display: none; }
  .step { padding-top: 28px; }
  .step-number { position: static; transform: none; margin-bottom: 0.6em; }

  .navbar { padding-left: 32px; padding-right: 130px; }

  .nav-toggle { display: flex; }
  .nav-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 32px 28px;
    gap: 18px;
  }
  .nav-panel.open { display: flex; }
  .nav-links { flex-direction: column; gap: 14px; }

  .floating-cta { bottom: 20px; right: 20px; padding: 13px 22px; font-size: 0.88rem; }
}

@media (max-width: 520px) {
  .container { padding: 0 20px; }
  .navbar { padding-left: 20px; padding-right: 116px; }
  .nav-fixed-controls { right: 20px; gap: 8px; }
  .lang-toggle { min-width: 0; padding: 8px 10px; font-size: 0.78rem; }
  .hero { padding: 90px 0 60px; }
  .floating-cta { bottom: 16px; right: 16px; padding: 12px 18px; font-size: 0.85rem; }
}
