.home { --gutter: clamp(18px, 4vw, 56px); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(24px, 4vw, 60px); align-items: center;
  padding: clamp(26px, 4.4vw, 56px) 0 clamp(40px, 6vw, 76px) var(--gutter);
  padding-inline: var(--gutter);
  min-height: calc(100vh - var(--header-h));
}
.hero-copy { max-width: 580px; }
.wordmark {
  font-family: var(--font-en); font-weight: 800; font-size: var(--fs-3xl); line-height: .92;
  letter-spacing: -0.035em; color: var(--primary); margin-bottom: 20px; direction: ltr; text-align: start;
}
html[dir="rtl"] .wordmark { text-align: right; }
.tagline { font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; margin-bottom: 14px; max-width: 22ch; }
html[lang="ar"] .tagline { max-width: 24ch; line-height: 1.5; }
.lead { color: var(--muted); font-size: 1.04rem; max-width: 52ch; }

.continue {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 14px;
  margin-top: 22px; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  box-shadow: 0 10px 26px -22px var(--shadow); transition: border-color var(--t-fast), transform var(--t-fast) var(--ease);
}
.continue:hover { border-color: var(--secondary); transform: translateY(-1px); }
.continue-k { font-size: var(--fs-xs); color: var(--accent); font-weight: 700; grid-column: 1; }
.continue-v { grid-column: 1; font-weight: 700; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.continue-v em { font-style: normal; font-weight: 500; font-size: var(--fs-sm); color: var(--muted); }
.continue svg { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); }
html[dir="rtl"] .continue svg, html[dir="rtl"] .track-card .btn svg { transform: scaleX(-1); }

.pick-label { margin: 26px 0 10px; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.track-picker { display: grid; gap: 8px; }
.track-opt {
  display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 14px; text-align: start;
  padding: 11px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-med), transform var(--t-fast) var(--ease);
}
.track-opt:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.track-opt[aria-checked="true"] { border-color: var(--secondary); background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft)), var(--surface); box-shadow: 0 14px 30px -24px var(--accent); }
.track-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); border: 1px solid var(--border); }
.track-opt[aria-checked="true"] .track-ico { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.track-txt { display: grid; line-height: 1.35; }
.track-name { font-weight: 700; }
.track-for { font-size: var(--fs-sm); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 12px; }
.hero-stats { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }

.hero-graph {
  margin: 0; position: relative; width: 100%; aspect-ratio: 1 / 1;
  max-height: calc(100vh - var(--header-h) - 40px); overflow: hidden;
  background: radial-gradient(circle at 50% 48%, var(--stage-1) 0%, var(--stage-2) 70%);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 40px 80px -56px var(--shadow);
}
.hero-graph-host { position: absolute; inset: 3% 3% 9%; }
.hero-graph figcaption { position: absolute; inset-inline: 0; bottom: 18px; text-align: center; color: var(--muted); font-size: var(--fs-xs); }
.hero-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 22%; text-align: center; color: var(--muted); font-size: var(--fs-sm); pointer-events: none; }
.hero-empty[hidden], .hero-graph figcaption[hidden] { display: none; }

/* ---------- sections ---------- */
.home > section:not(.hero) { padding: clamp(48px, 7vw, 96px) var(--gutter); }
.section-head { max-width: 660px; margin-bottom: 34px; }
.section-head h2, .principles h2, .roadmap h2 { font-size: var(--fs-2xl); margin-bottom: 10px; }
.section-head p { color: var(--muted); }

.tracks { background: var(--surface); border-block: 1px solid var(--border); }
.track-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.track-card {
  display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: var(--bg); transition: border-color var(--t-med), box-shadow var(--t-med), transform var(--t-med) var(--ease);
}
.track-card.is-active { border-color: var(--secondary); box-shadow: 0 24px 50px -40px var(--accent); }
.track-card h3 { font-size: var(--fs-lg); margin-top: 6px; }
.track-card .track-desc { color: var(--muted); font-size: .95rem; }
.modules { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 0; font-size: var(--fs-sm); }
.modules li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); color: var(--muted); }
.modules li.is-now { color: var(--text); }
.modules em { font-style: normal; font-size: var(--fs-xs); font-weight: 700; color: var(--faint); white-space: nowrap; }
.modules li.is-now em { color: var(--accent); }
.track-card .btn { margin-top: auto; align-self: flex-start; }

.read-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(22px, 3vw, 44px); }
.read-item h3 { font-size: var(--fs-lg); margin-bottom: 8px; }
.read-item p { color: var(--muted); font-size: .95rem; max-width: 46ch; }
.ring-fig {
  --fig-c: var(--sp); --fig-l0: var(--cyan); --fig-l1: var(--purple); --fig-l2: var(--amber);
  width: 100%; max-width: 240px; height: auto; margin-bottom: 18px; padding: 10px 0 0;
  background: var(--stage-2); border: 1px solid var(--border); border-radius: var(--r-md);
}
:root[data-theme="light"] .ring-fig { --fig-c: #2E8C84; --fig-l0: #2E8C84; --fig-l1: #6A50C4; --fig-l2: #946110; }
.legend-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 9px; font-size: var(--fs-sm); }
.legend-list li { display: flex; align-items: center; gap: 10px; }
.legend-list .glyph-ico { flex: none; color: var(--accent); }
.rel-legend i { width: 22px; height: 2px; border-radius: 2px; background: var(--c); flex: none; }
.personal-legend .dash { width: 22px; height: 0; border-top: 2px dashed var(--personal); flex: none; }

.sp-index { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); border-top: 1px solid var(--border); }
.sp-row { display: grid; grid-template-columns: 6px 1fr auto; align-items: center; gap: 16px; padding: 16px 4px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.sp-swatch { width: 6px; height: 30px; border-radius: 3px; background: var(--c); transition: height var(--t-med) var(--ease); }
.sp-names { display: flex; flex-direction: column; line-height: 1.3; }
.sp-name { font-weight: 700; }
.sp-other { font-size: var(--fs-sm); color: var(--muted); }
.sp-other:lang(en) { font-family: var(--font-en); }
.sp-other:lang(ar) { font-family: var(--font-ar); }
.sp-n { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-row:hover .sp-swatch, .sp-row:focus-visible .sp-swatch { height: 42px; }
.sp-row:hover .sp-name { color: var(--accent); }
@media (min-width: 700px) { .sp-index li:nth-child(odd) .sp-row { margin-inline-end: 24px; } }

.principles { background: var(--surface-2); border-block: 1px solid var(--border); }
.principle-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 56px; margin: 32px 0 0; max-width: 1040px; }
.principle-list dt { font-weight: 700; font-size: var(--fs-lg); margin-bottom: 6px; color: var(--primary); }
.principle-list dd { margin: 0; max-width: 48ch; }

.phases { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.phases li { position: relative; padding: 28px 0 0; padding-inline-end: 24px; border-top: 2px solid var(--border); }
.phases li::before { content: ""; position: absolute; top: -7px; inset-inline-start: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border-strong); }
.phases li.is-done { border-top-color: var(--secondary); }
.phases li.is-done::before { background: var(--secondary); border-color: var(--secondary); }
.phases li.is-current::before { background: var(--bg); border-color: var(--secondary); box-shadow: 0 0 0 4px var(--accent-soft); }
.phases h3 { font-size: var(--fs-md); margin-bottom: 6px; }
.phases p { color: var(--muted); font-size: .95rem; max-width: 34ch; }

.site-footer { padding: 32px var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-sm); display: grid; gap: 6px; }
.site-footer p { max-width: 80ch; }

@media (max-width: 1100px) { .read-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-inline-end: var(--gutter); min-height: 0; }
  .hero-graph { border-radius: var(--r-lg); border-inline-end: 1px solid var(--border); max-height: none; order: 2; }
  .track-grid { grid-template-columns: 1fr; }
  .principle-list { grid-template-columns: 1fr; }
  .phases { grid-template-columns: 1fr; }
  .phases li { border-top: 0; border-inline-start: 2px solid var(--border); padding: 0 0 28px; padding-inline-start: 22px; }
  .phases li.is-done { border-inline-start-color: var(--secondary); }
  .phases li::before { top: 2px; inset-inline-start: -7px; }
}
@media (max-width: 600px) { .read-grid { grid-template-columns: 1fr; } }
