:root {
  --bg: #f4f7f5;
  --bg-soft: #e9f0ec;
  --surface: #fbfdfc;
  --surface-strong: #ffffff;
  --text: #10231c;
  --text-strong: #07150f;
  --muted: #596f65;
  --line: rgba(16, 35, 28, 0.13);
  --line-strong: rgba(16, 35, 28, 0.22);
  --primary: #0e7054;
  --primary-strong: #094b3a;
  --primary-soft: #dcefe7;
  --on-primary: #f4fbf8;
  --accent: #b98842;
  --accent-soft: #f3e8d6;
  --inverse: #edf8f3;
  --dark-panel: #0b2119;
  --header-bg: rgba(244, 247, 245, 0.84);
  --shadow-sm: 0 10px 30px rgba(22, 49, 39, 0.07);
  --shadow-lg: 0 32px 80px rgba(22, 49, 39, 0.12);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 34px;
  --container: 1200px;
  --header-height: 76px;
  --font: "Segoe UI", Tahoma, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #08110e;
  --bg-soft: #0d1a15;
  --surface: #0d1915;
  --surface-strong: #12231c;
  --text: #e9f4ef;
  --text-strong: #f5fbf8;
  --muted: #9db2a8;
  --line: rgba(220, 239, 231, 0.12);
  --line-strong: rgba(220, 239, 231, 0.22);
  --primary: #63c4a2;
  --primary-strong: #9be0c7;
  --primary-soft: #15352a;
  --on-primary: #07150f;
  --accent: #d0a766;
  --accent-soft: #332919;
  --inverse: #07130f;
  --dark-panel: #10271e;
  --header-bg: rgba(8, 17, 14, 0.84);
  --shadow-sm: 0 10px 34px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, 0.28);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 36px);
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 85% -10%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 31rem),
    radial-gradient(circle at -5% 38%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 28rem),
    var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.menu-open {
  overflow: hidden;
}

.menu-open .kh-fab {
  opacity: 0 !important;
  pointer-events: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text-strong);
  line-height: 1.16;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  color: var(--inverse);
  background: var(--primary);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 70%, white);
  outline-offset: 4px;
}

.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

.site-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 18%, transparent) 0.55px, transparent 0.55px);
  background-size: 8px 8px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.skip-link {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--inverse);
  background: var(--primary-strong);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */
.site-header {
  position: fixed;
  inset: 12px 0 auto;
  z-index: 1000;
  transition: inset 0.25s ease;
}

.header-inner {
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 10px 12px 10px 18px;
  border: 1px solid transparent;
  border-radius: 22px;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

[dir="rtl"] .header-inner {
  padding: 10px 18px 10px 12px;
}

.site-header.is-scrolled {
  inset-block-start: 8px;
}

.site-header.is-scrolled .header-inner,
.site-header:focus-within .header-inner {
  border-color: var(--line);
  background: var(--header-bg);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--on-primary);
  background: var(--primary-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  color: var(--text-strong);
  font-size: 16px;
  letter-spacing: 0.015em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.desktop-nav a {
  position: relative;
  padding-block: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  inset: auto 50% 3px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  transform: translateX(-50%);
  transition: width 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
  color: var(--text-strong);
}

.desktop-nav a:hover::after,
.desktop-nav a.is-active::after {
  width: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.header-contact {
  color: var(--on-primary);
  background: var(--primary-strong);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary-strong) 20%, transparent);
}

.header-contact:hover {
  color: var(--on-primary);
  box-shadow: 0 13px 30px color-mix(in srgb, var(--primary-strong) 28%, transparent);
}

.icon-button,
.language-switch,
.menu-toggle {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.icon-button:hover,
.language-switch:hover,
.menu-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.theme-icon {
  font-size: 18px;
  line-height: 1;
}

.language-switch {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.menu-toggle {
  display: none;
  align-content: center;
  gap: 4px;
  padding: 0;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  width: min(var(--container), calc(100% - 48px));
  max-height: 0;
  margin: 8px auto 0;
  overflow: hidden;
  visibility: hidden;
  border: 1px solid transparent;
  border-radius: 22px;
  background: var(--header-bg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-8px);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.mobile-menu.is-open {
  max-height: 420px;
  visibility: visible;
  border-color: var(--line);
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu a {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 650;
}

.mobile-menu a:last-child { border-bottom: 0; }

/* Buttons */
.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 13px 21px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-small {
  min-height: 42px;
  padding: 10px 17px;
  border-radius: 13px;
}

.button-primary {
  color: var(--on-primary);
  background: var(--primary-strong);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--primary-strong) 24%, transparent);
}

.button-primary:hover {
  box-shadow: 0 18px 42px color-mix(in srgb, var(--primary-strong) 32%, transparent);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--text-strong);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
}

.button-secondary:hover {
  border-color: var(--primary);
  background: var(--surface-strong);
}

.button-light {
  color: #0a2118;
  background: #edf8f3;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.13);
}

.button-outline-light {
  border-color: rgba(237, 248, 243, 0.3);
  color: #edf8f3;
  background: rgba(237, 248, 243, 0.06);
}

/* Hero */
.hero {
  position: relative;
  min-height: 820px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 158px 0 100px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-strong), var(--primary), var(--accent), transparent 75%);
}

[dir="rtl"] .hero::before {
  background: linear-gradient(270deg, var(--primary-strong), var(--primary), var(--accent), transparent 75%);
}

.hero-grid-pattern,
.inner-grid-pattern {
  position: absolute;
  inset: 8% 0 0;
  pointer-events: none;
  opacity: 0.48;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 60% 55% at 78% 42%, black 10%, transparent 74%);
}

[dir="rtl"] .hero-grid-pattern,
[dir="rtl"] .inner-grid-pattern {
  mask-image: radial-gradient(ellipse 60% 55% at 22% 42%, black 10%, transparent 74%);
}

.hero-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(310px, 0.62fr);
  align-items: center;
  gap: clamp(60px, 8vw, 120px);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.045em;
}

.eyebrow > span {
  width: 30px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(54px, 7vw, 94px);
  font-weight: 780;
  letter-spacing: -0.055em;
}

[lang="ar"] .hero h1 {
  letter-spacing: -0.035em;
}

.hero-lead {
  max-width: 700px;
  margin-bottom: 18px;
  color: var(--text-strong);
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 650;
  line-height: 1.55;
}

.hero-note {
  max-width: 660px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.focus-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.focus-list li {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.hero-visual {
  position: relative;
  width: min(100%, 390px);
  justify-self: center;
  padding: 26px;
}

.visual-orbit {
  position: absolute;
  inset: -10px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.visual-orbit::before,
.visual-orbit::after {
  content: "";
  position: absolute;
  border: 1px dashed color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 50%;
}

.visual-orbit::before {
  inset: 34px;
}

.visual-orbit::after {
  inset: 72px;
}

.orbit-node {
  position: absolute;
  z-index: 2;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 14%, transparent);
}

.node-one { inset: 12% 12% auto auto; }
.node-two { inset: auto auto 10% 18%; background: var(--accent); }
.node-three { inset: 48% auto auto -4px; width: 7px; height: 7px; }

.portrait-card {
  position: relative;
  z-index: 3;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  box-shadow: var(--shadow-lg);
  transform: rotate(-2deg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

[dir="rtl"] .portrait-card {
  transform: rotate(2deg);
}

.portrait-topline,
.portrait-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portrait-topline {
  padding: 4px 7px 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0;
}

.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 13%, transparent);
}

.portrait-card picture {
  display: block;
  overflow: hidden;
  border-radius: 21px;
  background: var(--primary-soft);
}

.portrait-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.portrait-caption {
  padding: 15px 7px 5px;
}

.portrait-caption strong {
  color: var(--text-strong);
  font-size: 13px;
}

.portrait-caption span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.visual-index {
  position: absolute;
  z-index: 4;
  inset: auto -18px 65px auto;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--primary-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 800;
  direction: ltr;
}

[dir="rtl"] .visual-index {
  inset: auto auto 65px -18px;
}

/* Shared sections */
.section {
  position: relative;
  padding: 116px 0;
  scroll-margin-top: calc(var(--header-height) + 26px);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 48px;
}

.section-kicker {
  margin-bottom: 14px;
  text-transform: uppercase;
}

.section-kicker span {
  display: inline-grid;
  width: 32px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(40px, 5vw, 66px);
  letter-spacing: -0.04em;
}

[lang="ar"] .section-heading h2 {
  letter-spacing: -0.025em;
}

.section-heading > p:last-child,
.section-heading-split > p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.section-heading-split {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 0.65fr);
  align-items: end;
  gap: 60px;
}

.section-heading-split > p {
  margin-bottom: 7px;
}

/* About */
.about-section {
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 44%, transparent);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.65fr);
  gap: clamp(40px, 8vw, 110px);
  align-items: start;
}

.about-copy p {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(25px, 3vw, 40px);
  font-weight: 560;
  line-height: 1.7;
}

.principle-card {
  position: relative;
  overflow: hidden;
  padding: 31px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.principle-label {
  display: block;
  margin-bottom: 25px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.principle-card p {
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.principle-line {
  width: 70%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent), transparent);
}

[dir="rtl"] .principle-line {
  background: linear-gradient(270deg, var(--primary), var(--accent), transparent);
}

/* Focus cards */
.focus-section {
  overflow: hidden;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.focus-card {
  position: relative;
  min-height: 305px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.focus-card:nth-child(1) { grid-column: span 7; }
.focus-card:nth-child(2) { grid-column: span 5; }
.focus-card:nth-child(n+3) { grid-column: span 4; }

.focus-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.25s ease;
}

[dir="rtl"] .focus-card::before {
  inset: 0 0 0 auto;
}

.focus-card:hover {
  z-index: 2;
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}

.focus-card:hover::before {
  transform: scaleY(1);
}

.card-index {
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.card-code {
  position: absolute;
  inset: 22px 24px auto auto;
  color: color-mix(in srgb, var(--primary) 18%, transparent);
  font-size: 72px;
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 1;
}

[dir="rtl"] .card-code {
  inset: 22px auto auto 24px;
}

.focus-card h3 {
  position: relative;
  z-index: 1;
  margin-bottom: 13px;
  font-size: clamp(23px, 2.2vw, 32px);
}

.focus-card p {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin-bottom: 28px;
  color: var(--muted);
  line-height: 1.85;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.card-link span {
  transition: transform 0.2s ease;
}

.focus-card:hover .card-link span {
  transform: translateX(4px);
}

[dir="rtl"] .focus-card:hover .card-link span {
  transform: translateX(-4px);
}

/* Quiz */
.quiz-section {
  padding-top: 42px;
}

.quiz-panel,
.cta-panel {
  position: relative;
  min-height: 290px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 44px;
  overflow: hidden;
  padding: clamp(34px, 6vw, 68px);
  border-radius: var(--radius-lg);
  color: #eaf6f0;
  background:
    radial-gradient(circle at 10% 10%, rgba(208, 167, 102, 0.18), transparent 24rem),
    linear-gradient(135deg, #0b2119, #11382a);
  box-shadow: var(--shadow-lg);
}

[dir="rtl"] .quiz-panel,
[dir="rtl"] .cta-panel {
  background:
    radial-gradient(circle at 90% 10%, rgba(208, 167, 102, 0.18), transparent 24rem),
    linear-gradient(225deg, #0b2119, #11382a);
}

.quiz-copy {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.quiz-copy .section-kicker,
.cta-panel > div > span {
  color: #9ed9c3;
}

.quiz-copy .section-kicker span {
  border-color: rgba(237, 248, 243, 0.24);
  color: #c3dcd2;
}

.quiz-copy h2,
.cta-panel h2 {
  margin-bottom: 16px;
  color: #f2faf6;
  font-size: clamp(34px, 4.2vw, 56px);
  letter-spacing: -0.035em;
}

.quiz-copy p,
.cta-panel p {
  max-width: 670px;
  margin: 0;
  color: #b9cec5;
  font-size: 16px;
  line-height: 1.9;
}

.quiz-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
}

.quiz-visual span {
  position: absolute;
  color: #edf8f3;
  font-size: 52px;
  font-weight: 900;
}

.quiz-visual span:nth-child(1) { inset: 10% auto auto 8%; }
.quiz-visual span:nth-child(2) { inset: auto 31% 8% auto; font-size: 86px; }
.quiz-visual span:nth-child(3) { inset: 17% 30% auto auto; font-size: 24px; }
.quiz-visual span:nth-child(4) { inset: auto auto 10% 32%; }
.quiz-visual span:nth-child(5) { inset: 9% 8% auto auto; font-size: 33px; }

/* Footer */
.site-footer {
  margin-top: 54px;
  padding: 50px 0;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 36px;
}

.footer-inner strong {
  color: var(--text-strong);
  font-size: 18px;
}

.footer-inner p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

/* Detail pages */
.inner-hero {
  position: relative;
  overflow: hidden;
  padding: 154px 0 96px;
  border-bottom: 1px solid var(--line);
}

.inner-grid-pattern {
  inset-block-start: 0;
  opacity: 0.4;
}

.breadcrumb {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 56px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.inner-hero-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.52fr);
  gap: clamp(50px, 8vw, 110px);
  align-items: start;
}

.inner-hero-copy h1 {
  margin-bottom: 25px;
  font-size: clamp(52px, 6.5vw, 88px);
  letter-spacing: -0.052em;
}

[lang="ar"] .inner-hero-copy h1 {
  letter-spacing: -0.035em;
}

.inner-hero-copy > p:last-child {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 2;
}

.topic-panel {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 85%, transparent);
  box-shadow: var(--shadow-sm);
}

.topic-panel-label {
  display: block;
  margin-bottom: 18px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.topic-panel ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-panel li + li {
  border-top: 1px solid var(--line);
}

.topic-panel a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.topic-panel a:hover {
  color: var(--text-strong);
}

.topic-panel a span {
  color: var(--primary);
  font-size: 10px;
  direction: ltr;
}

.quick-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 64px;
}

.stat-card {
  min-height: 190px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 75%, transparent);
}

.stat-card > span {
  display: block;
  margin-bottom: 28px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  direction: ltr;
}

.stat-card strong {
  display: block;
  margin-bottom: 9px;
  color: var(--text-strong);
  font-size: 19px;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.article-section {
  padding-bottom: 82px;
}

.article-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: clamp(40px, 7vw, 92px);
  align-items: start;
}

.article-aside {
  position: sticky;
  inset-block-start: 120px;
}

.article-aside h2 {
  margin-bottom: 22px;
  font-size: 28px;
}

.article-aside nav {
  display: grid;
  border-top: 1px solid var(--line);
}

.article-aside nav a {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.article-aside nav a:hover {
  color: var(--primary);
}

.article-aside nav span {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 9px;
  direction: ltr;
}

.article-list {
  display: grid;
  gap: 18px;
}

.article-card {
  min-height: 260px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 25px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header-height) + 34px);
}

.article-number {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  direction: ltr;
}

.article-card h2 {
  margin-bottom: 18px;
  font-size: clamp(26px, 3vw, 39px);
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 2;
}

.related-section {
  padding-top: 66px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 42%, transparent);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 70px;
}

.related-card {
  min-height: 150px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.related-card > span:first-child {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.related-card strong {
  color: var(--text-strong);
  font-size: 17px;
}

.related-card > span:last-child {
  color: var(--primary);
}

.cta-panel {
  min-height: 320px;
}

.cta-panel > div > span {
  display: block;
  margin-bottom: 18px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.cta-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* 404 */
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 120px 0 70px;
}

.error-card {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 8vw, 86px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.error-code {
  display: block;
  color: color-mix(in srgb, var(--primary) 15%, transparent);
  font-size: clamp(120px, 25vw, 280px);
  font-weight: 900;
  letter-spacing: -0.09em;
  line-height: 0.75;
}

.error-card h1 {
  position: relative;
  margin: 20px 0 16px;
  font-size: clamp(35px, 5vw, 58px);
}

.error-card p {
  max-width: 620px;
  margin: 0 auto 28px;
  color: var(--muted);
}

/* Motion */
.reveal.reveal-ready {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.reveal.reveal-ready.is-visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 1080px) {
  .desktop-nav { gap: 16px; }
  .desktop-nav a { font-size: 13px; }
  .hero-layout { gap: 48px; }
  .hero-visual { padding: 22px; }
  .focus-card:nth-child(1),
  .focus-card:nth-child(2),
  .focus-card:nth-child(n+3) { grid-column: span 6; }
  .focus-card:last-child { grid-column: 4 / span 6; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero { min-height: auto; }
  .hero-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
    gap: 32px;
  }
  .hero h1 { font-size: clamp(48px, 8vw, 70px); }
  .hero-lead { font-size: 22px; }
  .about-layout,
  .inner-hero-layout {
    grid-template-columns: 1fr;
  }
  .section-heading-split { grid-template-columns: 1fr; gap: 20px; }
  .section-heading-split > p { max-width: 720px; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
  .quick-stats .stat-card:last-child { grid-column: 1 / -1; }
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .article-aside nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-aside nav a:nth-child(odd) { padding-inline-end: 16px; }
}

@media (max-width: 820px) {
  :root { --header-height: 66px; }
  .container { width: min(var(--container), calc(100% - 28px)); }
  .site-header { inset-block-start: 7px; }
  .header-inner {
    min-height: var(--header-height);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 9px 8px 12px;
    border-color: var(--line);
    background: var(--header-bg);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
  [dir="rtl"] .header-inner { padding: 8px 12px 8px 9px; }
  .brand-mark { width: 40px; height: 40px; }
  .desktop-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .header-contact {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 13px;
  }
  .header-contact-label { display: none; }
  .header-contact::before {
    content: "✉";
    font-size: 16px;
    line-height: 1;
  }
  .mobile-menu { width: calc(100% - 28px); }
  .hero {
    padding: 132px 0 84px;
  }
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 65px;
  }
  .hero-copy { max-width: 700px; }
  .hero-visual { width: min(78vw, 370px); }
  .focus-card:nth-child(1),
  .focus-card:nth-child(2),
  .focus-card:nth-child(n+3),
  .focus-card:last-child {
    grid-column: span 12;
  }
  .focus-card { min-height: 270px; }
  .quiz-panel,
  .cta-panel {
    grid-template-columns: 1fr;
  }
  .quiz-panel > .button { justify-self: start; }
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .footer-inner > p { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 620px) {
  .container { width: calc(100% - 24px); }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: 14px; }
  .header-actions { gap: 6px; }
  .icon-button,
  .language-switch,
  .header-contact,
  .menu-toggle { width: 40px; height: 40px; }
  .mobile-menu { width: calc(100% - 24px); }
  .hero { padding: 122px 0 72px; }
  .hero h1 { font-size: clamp(44px, 15vw, 66px); }
  .hero-lead { font-size: 20px; line-height: 1.65; }
  .hero-note { font-size: 15px; }
  .hero-actions { display: grid; }
  .hero-actions .button { width: 100%; }
  .focus-list { gap: 7px; }
  .focus-list li { font-size: 10px; }
  .hero-visual { width: min(82vw, 350px); padding: 16px; }
  .visual-index { inset-inline-end: -1px; }
  [dir="rtl"] .visual-index { inset-inline: -1px auto; }
  .portrait-caption { align-items: flex-start; flex-direction: column; }
  .section { padding: 82px 0; }
  .section-heading { margin-bottom: 36px; }
  .section-heading h2 { font-size: clamp(36px, 12vw, 52px); }
  .about-copy p { font-size: 24px; }
  .principle-card,
  .focus-card { padding: 24px; }
  .card-code { font-size: 60px; }
  .quiz-section { padding-top: 20px; }
  .quiz-panel,
  .cta-panel { padding: 30px 24px; border-radius: 25px; }
  .quiz-copy h2,
  .cta-panel h2 { font-size: 34px; }
  .footer-inner { grid-template-columns: 1fr; gap: 18px; }
  .footer-inner > p { grid-column: auto; grid-row: auto; }
  .inner-hero { padding: 126px 0 72px; }
  .breadcrumb { margin-bottom: 38px; }
  .inner-hero-copy h1 { font-size: clamp(43px, 13vw, 64px); }
  .inner-hero-copy > p:last-child { font-size: 16px; }
  .quick-stats { grid-template-columns: 1fr; margin-top: 44px; }
  .quick-stats .stat-card:last-child { grid-column: auto; }
  .stat-card { min-height: 0; }
  .article-section { padding-top: 72px; }
  .article-aside nav { grid-template-columns: 1fr; }
  .article-aside nav a:nth-child(odd) { padding-inline-end: 0; }
  .article-card {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 26px 22px;
  }
  .article-card p { font-size: 16px; }
  .related-grid { grid-template-columns: 1fr; }
  .related-section { padding-top: 54px; }
  .cta-actions { display: grid; }
  .cta-actions .button { width: 100%; }
  .error-page { padding-top: 100px; }
  .error-card { border-radius: 24px; }
}

@media (max-width: 390px) {
  .brand-copy { display: none; }
  .hero h1 { font-size: 44px; }
  .hero-lead { font-size: 18px; }
  .portrait-topline { font-size: 8px; }
  .focus-card h3 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal,
  .reveal.reveal-ready {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media print {
  .site-header,
  .site-noise,
  .hero-actions,
  .theme-toggle,
  .site-footer,
  .quiz-section,
  .cta-panel { display: none !important; }
  body { color: #111; background: #fff; }
  .hero,
  .inner-hero,
  .section { padding: 28px 0; }
  .article-card,
  .focus-card { break-inside: avoid; box-shadow: none; }
}
