:root {
  --bg: #f7f5f0;
  --surface: #efece4;
  --card: #ffffff;
  --ink: #1c1e1c;
  --muted: #555a55;
  --accent: #183d37;
  --accent-mid: #23534b;
  --warm-gold: #d9b06c;
  --live: #34a853;
  --border: #dcd6ca;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

html[lang="ar"] body,
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .section-title {
  font-family: var(--font-arabic);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding-inline: 1.5rem;
}

/* Scroll Progress Hairline */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--warm-gold);
  z-index: 60;
  transition: width 0.08s linear;
}

/* Sticky compact bar */
.sticky-bar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 40;
  background: rgba(247, 245, 240, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%);
  transition: transform 0.22s ease;
}

.sticky-bar.is-visible {
  transform: translateY(0);
}

.sticky-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sticky-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.sticky-wa {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.sticky-wa:hover {
  background: var(--accent-mid);
}

.sticky-wa-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.lang-select {
  display: none;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555a55' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 1.45rem 0.3rem 0.55rem;
  cursor: pointer;
}

.lang-select--dark {
  border-color: rgba(255, 255, 255, 0.24);
  background-color: rgba(255, 255, 255, 0.08);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f7f5f0' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color: #f7f5f0;
}

.lang-select option {
  color: var(--ink);
  background: var(--bg);
}

html[dir="rtl"] .lang-select {
  background-position: left 0.45rem center;
  padding: 0.3rem 0.55rem 0.3rem 1.45rem;
}

/* Dark-teal Hero Band */
.hero-band {
  background: var(--accent);
  color: #f7f5f0;
  padding: 1.75rem 0 3.5rem;
  border-bottom: 4px solid var(--warm-gold);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 2.5rem;
}

.topbar-location {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(247, 245, 240, 0.82);
}

.loc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warm-gold);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}

.lang-switch--dark {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.32rem 0.65rem;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.lang-switch--dark .lang-btn {
  color: rgba(247, 245, 240, 0.78);
}

.lang-btn + .lang-btn {
  border-inline-start: 1px solid var(--border);
}

.lang-switch--dark .lang-btn + .lang-btn {
  border-inline-start-color: rgba(255, 255, 255, 0.18);
}

.lang-btn:hover {
  color: var(--ink);
  background: var(--surface);
}

.lang-switch--dark .lang-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.lang-btn.is-active {
  background: var(--accent);
  color: #ffffff;
}

.lang-switch--dark .lang-btn.is-active {
  background: #f7f5f0;
  color: var(--accent);
}

/* Hero Grid */
.hero {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warm-gold);
}

html[lang="ar"] .eyebrow {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.95rem;
}

h1 {
  margin: 0 0 1.05rem;
  font-family: var(--font-serif);
  font-size: clamp(2.05rem, 4.5vw, 2.95rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: #ffffff;
}

.lead {
  margin: 0 0 1.85rem;
  font-size: 1.03rem;
  color: rgba(247, 245, 240, 0.86);
  max-width: 58ch;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    transform 0.12s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-light {
  background: #f7f5f0;
  color: var(--accent);
}

.btn-light:hover {
  background: #ffffff;
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.06);
  color: #f7f5f0;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-ghost-light {
  background: transparent;
  color: var(--warm-gold);
  padding-inline: 0.65rem;
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Portrait */
.portrait-frame {
  margin: 0;
  width: 230px;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.portrait-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
  transform-origin: 70% 50%;
  transform: scale(1.2);
}

.portrait-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1rem;
}

.portrait-placeholder[hidden] {
  display: none;
}

.portrait-monogram {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--warm-gold);
  letter-spacing: 0.04em;
}

.portrait-note {
  font-size: 0.78rem;
  color: rgba(247, 245, 240, 0.72);
}

/* Hero Staggered Entrance */
@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content .eyebrow,
.hero-content h1,
.hero-content .lead,
.hero-content .contact-actions,
.portrait-frame {
  animation: heroRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-content .eyebrow {
  animation-delay: 0.05s;
}
.hero-content h1 {
  animation-delay: 0.12s;
}
.hero-content .lead {
  animation-delay: 0.2s;
}
.hero-content .contact-actions {
  animation-delay: 0.28s;
}
.portrait-frame {
  animation-delay: 0.18s;
}

/* Hero Stats Strip */
.hero-stats {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  animation: heroRise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--warm-gold);
}

.stat-label {
  font-size: 0.82rem;
  color: rgba(247, 245, 240, 0.78);
  line-height: 1.35;
}

/* Main Body */
.main-body {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

.section {
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0 0 1.35rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--accent);
}

/* Pillars */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.pillar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.pillar-card:hover {
  transform: translateY(-2px);
  border-color: #c7bfb0;
  box-shadow: 0 8px 20px rgba(24, 61, 55, 0.06);
}

.pillar-num {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.pillar-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.pillar-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Territory Coverage */
.territory-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.5rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.35rem 1.5rem;
}

.territory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.territory-pill {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.territory-pill:hover {
  border-color: var(--accent);
}

.territory-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.territory-detail {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
  min-height: 3em;
}

.territory-map {
  background: var(--surface);
  border-radius: 8px;
  padding: 0.5rem;
}

.route-svg {
  width: 100%;
  height: auto;
  display: block;
  color: var(--accent);
}

.route-line {
  opacity: 0.48;
  animation: routeFlow 14s linear infinite;
}

@keyframes routeFlow {
  to {
    stroke-dashoffset: -112;
  }
}

.route-node {
  cursor: pointer;
}

.route-node .node-halo {
  fill: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.route-node .node-core {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
  transition:
    fill 0.2s ease,
    transform 0.2s ease;
}

.route-node:hover .node-core {
  transform: scale(1.18);
}

.route-node text {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  fill: var(--muted);
}

@keyframes nodePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.22;
  }
  50% {
    transform: scale(1.45);
    opacity: 0.08;
  }
}

.route-node.is-active .node-halo {
  opacity: 0.2;
  transform-box: fill-box;
  transform-origin: center;
  animation: nodePulse 2.4s ease-in-out infinite;
}

.route-node.is-active .node-core {
  fill: var(--accent);
}

.route-node.is-active text {
  fill: var(--accent);
}

/* Skills */
.skills-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.skills-list li {
  padding: 0.45rem 0.95rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.skills-list li:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--surface);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.entry {
  display: grid;
  grid-template-columns: 215px 1fr;
  gap: 1.75rem;
  align-items: start;
  padding: 1.25rem;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.entry:hover {
  transform: translateY(-2px);
  border-color: #c7bfb0;
  box-shadow: 0 8px 22px rgba(24, 61, 55, 0.06);
}

.entry--featured {
  border-inline-start: 3px solid var(--accent);
}

.entry-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.entry-date {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.entry-place {
  margin: 0.15rem 0 0.55rem;
  font-size: 0.84rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

.tag--live {
  background: rgba(52, 168, 83, 0.1);
  border-color: rgba(52, 168, 83, 0.28);
  color: #1f6b36;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  display: inline-block;
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.entry-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.entry-body .sep {
  color: var(--muted);
  margin: 0 0.25rem;
  font-weight: 400;
}

.entry-body .org {
  color: var(--accent);
  font-weight: 600;
}

.entry-body ul {
  margin: 0;
  padding-inline-start: 1.15rem;
  color: var(--muted);
}

.entry-body li + li {
  margin-top: 0.35rem;
}

.entry-desc {
  margin: 0;
  color: var(--muted);
}

/* Two-column details */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.25rem;
}

.clean-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.clean-list dt {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--ink);
}

.clean-list dd {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* Closing Contact Card */
.contact-card {
  margin-top: 2.5rem;
  background: var(--accent);
  color: #f7f5f0;
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.contact-card-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warm-gold);
}

html[lang="ar"] .contact-card-eyebrow {
  letter-spacing: 0;
  text-transform: none;
}

.contact-card h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 500;
  color: #ffffff;
}

.contact-card-copy p:last-child {
  margin: 0;
  font-size: 0.94rem;
  color: rgba(247, 245, 240, 0.82);
}

/* Footer */
.footer {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Subtle Scroll Reveal & Stagger */
.reveal {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-hidden {
  opacity: 0;
  transform: translateY(16px);
}

.reveal:not(.is-hidden) .pillar-card {
  animation: heroRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal:not(.is-hidden) .pillar-card:nth-child(1) {
  animation-delay: 0.04s;
}
.reveal:not(.is-hidden) .pillar-card:nth-child(2) {
  animation-delay: 0.12s;
}
.reveal:not(.is-hidden) .pillar-card:nth-child(3) {
  animation-delay: 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-hidden,
  .hero-content .eyebrow,
  .hero-content h1,
  .hero-content .lead,
  .hero-content .contact-actions,
  .portrait-frame,
  .hero-stats,
  .reveal:not(.is-hidden) .pillar-card {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }

  .live-dot,
  .route-line,
  .route-node.is-active .node-halo {
    animation: none;
  }
}

/* Responsive */
@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .portrait-frame {
    width: 240px;
    max-width: 72vw;
    margin: 0 auto;
    order: -1;
  }

  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .territory-card {
    grid-template-columns: 1fr;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .two-col-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-card {
    padding: 1.5rem;
  }

  .contact-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    width: 100%;
  }

  .contact-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    gap: 0.35rem;
    white-space: nowrap;
    text-align: center;
  }

  .contact-actions .btn-ghost-light {
    background: rgba(217, 176, 108, 0.1);
    border-color: rgba(217, 176, 108, 0.35);
  }

  .contact-card .contact-actions .btn:first-child {
    grid-column: 1 / -1;
  }

  .sticky-inner {
    padding: 0.45rem 1rem;
    gap: 0.5rem;
  }

  .sticky-name {
    font-size: 0.92rem;
  }

  .sticky-actions {
    gap: 0.4rem;
  }

  .sticky-wa {
    padding: 0;
    width: 32px;
    height: 32px;
    justify-content: center;
    border-radius: 8px;
  }

  .sticky-wa-text {
    display: none;
  }

  .sticky-wa-icon {
    width: 16px;
    height: 16px;
  }

  .lang-switch {
    display: none;
  }

  .lang-select {
    display: inline-block;
  }
}

/* Print / Save as PDF */
@media print {
  .sticky-bar,
  .topbar .lang-switch,
  .contact-actions,
  .contact-card,
  .territory-map {
    display: none;
  }

  .hero-band {
    background: #ffffff;
    color: #1c1e1c;
    border-bottom: 1px solid #cccccc;
    padding: 0 0 1.5rem;
  }

  h1,
  .lead,
  .topbar-location {
    color: #1c1e1c;
  }

  .reveal,
  .reveal.is-hidden {
    opacity: 1;
    transform: none;
  }
}
