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

:root {
  --bg: #0C0C0C;
  --surface: #111111;
  --border: #1C1C1C;
  --text-primary: #E8E8E8;
  --text-secondary: #777777;
  --text-muted: #4F4F4F;
  --accent: #B8A88A;
  --accent-dim: #5C5040;
  --font-size-sm: clamp(12px, 0.8rem + 0.1vw, 13.5px);
}

html {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 10000;
  transform-origin: left center;
  will-change: transform;
  pointer-events: none;
}

::selection { background: rgba(184, 168, 138, 0.25); color: var(--text-primary); }

::-moz-selection { background: rgba(184, 168, 138, 0.25); color: var(--text-primary); }

.container { max-width: 660px; margin: 0 auto; padding: 0 32px; width: 100%; }

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

@keyframes progress-grow {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-progress {
      animation-name: progress-grow;
      animation-duration: auto;
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: scroll(root);
      animation-range: 80px 100%;
    }
  }
}

header { padding: 80px 0 60px; border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }

header::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 320px;
  background: radial-gradient(ellipse, rgba(184, 168, 138, 0.06) 0%, transparent 65%);
  pointer-events: none;
}

.org-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.org-name {
  font-family: 'EB Garamond', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-wrap: pretty;
}

.page-home .org-name { font-size: clamp(36px, 6vw, 54px); }

.org-name em { font-style: italic; color: var(--accent); }

.org-domain {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.back-link {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.back-link:focus-visible,
.nav-link:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.back-link:hover { color: var(--accent); text-shadow: 0 0 12px rgba(184, 168, 138, 0.12); }

.section-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 24px;
  display: inline-block;
  padding: 3px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

h2 {
  font-family: 'EB Garamond', serif;
  font-size: clamp(20px, 1.4rem + 0.3vw, 24px);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.35;
  text-wrap: pretty;
}

p {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 0.85rem + 0.15vw, 15px);
  font-weight: 300;
  color: #888888;
  line-height: 1.85;
  margin-bottom: 14px;
}

p:last-child { margin-bottom: 0; }

.features-grid {
  counter-reset: feature;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 28px;
}

.feature-row {
  background: var(--bg);
  padding: 20px 22px;
  display: flex;
  gap: 20px;
  align-items: baseline;
  transition: background 0.15s;
}

.feature-row::before {
  counter-increment: feature;
  content: counter(feature, decimal-leading-zero);
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  min-width: 20px;
  flex-shrink: 0;
  padding-top: 2px;
}

.feature-row:hover { background: var(--surface); }

.feature-text {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 300;
  color: #787878;
  line-height: 1.75;
}

.feature-text strong { font-weight: 500; color: #A0A0A0; }

.steps-grid {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 28px;
}

.step-row {
  background: var(--bg);
  padding: 20px 22px;
  display: flex;
  gap: 20px;
  align-items: baseline;
  transition: background 0.15s;
}

.step-row::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  min-width: 20px;
  flex-shrink: 0;
  padding-top: 2px;
}

.step-row:hover { background: var(--surface); }

.step-text {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 300;
  color: #787878;
  line-height: 1.75;
}

.step-text strong { font-weight: 500; color: #A0A0A0; }

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 4px;
}

.nav-link {
  background: var(--bg);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  background: var(--surface);
  border-left-color: var(--accent);
  transform: translateY(-1px);
}

.nav-link:hover .link-label { color: var(--accent); text-shadow: 0 0 14px rgba(184, 168, 138, 0.15); }

.link-label {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: #909090;
  transition: color 0.2s;
}

.link-label::after {
  content: '→';
  display: inline-block;
  margin-left: 4px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}

.nav-link:hover .link-label::after {
  opacity: 1;
  transform: translateX(0);
}

.link-path {
  font-family: 'DM Sans', monospace;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

footer {
  padding: 36px 0 52px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-copy,
.footer-right {
  font-size: 10px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.lang-switch-wrapper {
  margin-bottom: 20px;
  display: flex;
  justify-content: flex-end;
}

.lang-switch {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.lang-switch:hover { color: var(--accent); }

.org-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-top: 20px;
}

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s, border-color 0.2s;
  pointer-events: none;
  line-height: 1;
  padding: 0;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--border);
  border-color: var(--accent);
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 300;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .org-name,
[dir="rtl"] h2 {
  font-family: 'Amiri', 'EB Garamond', serif;
}

[dir="rtl"] .org-label,
[dir="rtl"] .section-label,
[dir="rtl"] p,
[dir="rtl"] .feature-text,
[dir="rtl"] .step-text,
[dir="rtl"] .link-label,
[dir="rtl"] .link-path,
[dir="rtl"] .footer-copy,
[dir="rtl"] .footer-right,
[dir="rtl"] .footer-links a,
[dir="rtl"] .lang-switch,
[dir="rtl"] .back-link,
[dir="rtl"] .org-domain,
[dir="rtl"] .org-tagline,
[dir="rtl"] .feature-row::before,
[dir="rtl"] .step-row::before {
  font-family: 'Tajawal', 'DM Sans', sans-serif;
}

[dir="rtl"] .link-label::after {
  content: '←';
  margin-left: 0;
  margin-right: 4px;
  transform: translateX(4px);
}

[dir="rtl"] .nav-link:hover .link-label::after {
  transform: translateX(0);
}

[dir="rtl"] .nav-link {
  border-left: none;
  border-right: 2px solid transparent;
}

[dir="rtl"] .nav-link:hover {
  border-left-color: transparent;
  border-right-color: var(--accent);
}

[dir="rtl"] .back-to-top {
  right: auto;
  left: 32px;
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.07s; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.14s; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.21s; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.28s; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.35s; }
.stagger-children.revealed > *:nth-child(7) { transition-delay: 0.42s; }
.stagger-children.revealed > *:nth-child(8) { transition-delay: 0.49s; }

::view-transition-old(root) {
  animation: 0.25s ease-out both fade-out;
}

::view-transition-new(root) {
  animation: 0.35s ease-out 0.1s both fade-in;
}

@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .stagger-children > *,
  .stagger-children.revealed > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 600px) {
  header { padding: 52px 0 44px; }
  section { padding: 40px 0; }
  .container { padding: 0 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}