:root {
  --ink: #172033;
  --muted: #5c6b7e;
  --navy: #16324f;
  --cream: #f4efe6;
  --paper: #fffdf9;
  --line: rgba(22, 50, 79, 0.12);
  --gold: #b8893a;
  --teal: #0f766e;
  --future: #1d4e89;
  --follow: #0f766e;
  --today: #b5812f;
  --trust: #6a46a8;
  --worth: #9a4050;
  --obs: #1d6f93;
  --poll: #b5812f;
  --quest: #0f766e;
  --focus: #6a46a8;
  --talk: #9a4050;
  --shadow: 0 22px 50px rgba(22, 50, 79, 0.1);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(184, 137, 58, 0.18), transparent 55%),
    radial-gradient(760px 420px at -10% 12%, rgba(15, 118, 110, 0.12), transparent 50%),
    var(--cream);
  line-height: 1.75;
}
img { max-width: 100%; display: block; }
button, input { font: inherit; }
a { color: inherit; }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 12px 22px;
  background: rgba(244, 239, 230, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: grid; text-decoration: none; }
.brand small { color: var(--gold); font-weight: 600; letter-spacing: 0; }
.brand strong { font-size: 1.05rem; }
.nav { display: flex; gap: 8px; }
.nav a, .who input, .btn, .choice, .dot, .medal {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  text-decoration: none;
}
.nav a, .btn { padding: 8px 14px; cursor: pointer; }
.nav a[aria-current="true"] { background: var(--navy); color: white; border-color: var(--navy); }
.who { display: flex; gap: 8px; }
.who input {
  padding: 9px 12px;
  min-width: 140px;
  border-radius: 14px;
}
.live-clock {
  min-width: 72px;
  text-align: center;
  font-weight: 700;
  color: var(--navy);
}

.hero { padding: 42px 0 10px; }
.hero-grid, .method, .split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 42px;
  align-items: center;
}
.kicker {
  margin: 0 0 6px;
  color: var(--teal);
  font-weight: 700;
}
h1, h2, h3 { line-height: 1.35; margin: 0 0 10px; }
h1 { font-size: clamp(1.8rem, 3vw, 3rem); }
.lede { font-size: 1.12rem; color: #314255; }
.hero-visual { position: relative; }
.hero-visual svg.hero-art {
  width: 100%;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  aspect-ratio: 16/9;
}
.hero-visual img, .method img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
}
.hero-visual img { aspect-ratio: 16/9; animation: drift 18s ease-in-out infinite alternate; }
.method img { aspect-ratio: 4/3; }
.hero-visual::after {
  content: "";
  position: absolute;
  inset: auto 8% 8% auto;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(198, 161, 91, 0.7);
  border-radius: 50%;
  animation: spin 14s linear infinite;
}

.medals {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 28px 0 10px;
}
.medal {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  border-radius: 22px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: floaty 4.5s ease-in-out infinite;
}
.medal:nth-child(2) { animation-delay: .4s; }
.medal:nth-child(3) { animation-delay: .8s; }
.medal:nth-child(4) { animation-delay: 1.2s; }
.medal:nth-child(5) { animation-delay: 1.6s; }
.medal svg { width: 54px; height: 54px; }
.medal span { font-weight: 700; font-size: 0.86rem; line-height: 1.35; }
.medal[data-method="future"] { color: var(--future); }
.medal[data-method="follow"] { color: var(--follow); }
.medal[data-method="today"] { color: var(--today); }
.medal[data-method="trust"] { color: var(--trust); }
.medal[data-method="worth"] { color: var(--worth); }

.lesson { padding: 20px 0 10px; }
.section-head { max-width: 680px; margin: 28px 0 18px; }
.method { display: none !important; scroll-margin-top: 88px; }
.method.is-current { display: grid !important; }
.unit-bar {
  margin: 8px 0 28px;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid var(--line);
}
.method {
  margin: 18px 0 54px;
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.method:nth-child(even) .method-copy { order: 2; }
.method-copy h2 { font-size: 2rem; }
.en { margin: 0 0 12px; color: var(--gold); font-weight: 700; }
.signs { padding: 0; margin: 14px 0 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.signs li {
  background: rgba(22, 50, 79, 0.06);
  color: var(--c);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}
.lock input, #search {
  display: block;
  width: min(420px, 100%);
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
}
figure { margin: 0; position: relative; }
.motion-badge {
  position: absolute;
  inset: auto 16px 16px auto;
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.92);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  color: var(--c);
}
.motion-badge svg { width: 64px; height: 64px; overflow: visible; }

.scan { animation: scan 2.6s ease-in-out infinite; transform-origin: center; }
.star { fill: transparent; stroke: currentColor; stroke-width: 1.4; animation: starfill 2.8s ease-in-out infinite; }
.star:nth-child(2) { animation-delay: .2s; }
.star:nth-child(3) { animation-delay: .4s; }
.star:nth-child(4) { animation-delay: .6s; }
.star:nth-child(5) { animation-delay: .8s; }
.grow { transform-origin: bottom; animation: grow 2.2s ease-in-out infinite; }
.grow:nth-child(2) { animation-delay: .15s; }
.grow:nth-child(3) { animation-delay: .3s; }
.grow:nth-child(4) { animation-delay: .45s; }
.link-arc { stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw 3s ease-in-out infinite; }
.wave { stroke-dasharray: 90; stroke-dashoffset: 90; animation: draw 2.4s ease-in-out infinite; }

.scene {
  min-height: 280px;
  border-radius: 28px;
  background: #fffdf9;
  background:
    radial-gradient(120px 80px at 20% 20%, color-mix(in srgb, var(--c) 28%, white), transparent 70%),
    color-mix(in srgb, var(--c) 10%, #fffdf9);
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--c);
}
.scene svg { width: min(100%, 340px); height: auto; }
.example {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(22, 50, 79, 0.05);
}
.example strong { color: var(--c); }
.reminders { display: grid; gap: 10px; margin: 8px 0 28px; }
.reminders article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-right: 6px solid var(--c, var(--navy));
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
.reminders h3 { margin-bottom: 4px; }
.reminders p { margin: 0; }
.also {
  margin: 0 0 28px;
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.also ul { margin: 8px 0 0; padding-inline-start: 18px; }

.split { margin: 10px 0 40px; }
.panel {
  background: var(--paper);
  border-radius: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 100%;
}
.panel h3 { font-size: 1.35rem; }
.panel.poll { border-top: 6px solid var(--poll); }
.panel.quest { border-top: 6px solid var(--quest); }

.exam-wrap { padding: 28px 0 48px; }
.exam-wrap h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.to-exam { text-align: center; padding: 8px 0 40px; }
.to-exam .btn { min-width: 240px; padding: 14px 28px; font-size: 1.12rem; }
.qcard, .gate, .result {
  scroll-margin-top: 88px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.yesno { display: flex; gap: 10px; margin-top: 16px; }
.q-text { font-size: 1.12rem; margin-bottom: 4px; }
.ask { margin: 0 0 2px; font-weight: 700; color: var(--navy); }
.choice-list { display: grid; gap: 10px; margin: 16px 0; }
.choice {
  text-align: right;
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.7;
  font-weight: 500;
}
.choice i {
  width: 12px;
  height: 12px;
  margin-top: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dot, var(--navy));
  display: block;
}
.choice span { display: block; }
.choice.is-on { border-color: var(--navy); background: #f3f7fb; outline: 2px solid rgba(22, 50, 79, 0.16); }
.choice.is-right { border-color: var(--teal); background: #e7f6f3; outline: 2px solid rgba(15, 118, 110, 0.2); }
.choice.is-wrong { border-color: var(--talk); background: #fdecee; outline: 2px solid rgba(154, 64, 80, 0.18); }
.choice:disabled { cursor: default; }
.hint.good { color: var(--teal); }
.dot.is-good { background: #e5f3f1; border-color: #b7ddd7; color: #0f766e; }
.dot.is-bad { background: #fdecee; border-color: #f3c9cf; color: #9a4050; }
.dot.is-on.is-good { background: #0f766e; color: white; }
.dot.is-on.is-bad { background: #9a4050; color: white; }
.choice[data-method="future"] { --dot: var(--future); }
.choice[data-method="follow"] { --dot: var(--follow); }
.choice[data-method="today"] { --dot: var(--today); }
.choice[data-method="trust"] { --dot: var(--trust); }
.choice[data-method="worth"] { --dot: var(--worth); }
.btn.primary { background: var(--navy); color: white; border-color: var(--navy); }
.btn.ghost { background: transparent; }
.q-top, .pager, .result-actions, .stats-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.meter { height: 8px; background: #ece6db; border-radius: 99px; overflow: hidden; margin: 10px 0; }
.meter b { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); width: 0; }
.dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 14px; }
.dot {
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}
.dot.is-on { background: var(--navy); color: white; }
.dot.is-done { background: #e5f3f1; border-color: #b7ddd7; }
.hint { color: var(--talk); min-height: 1.4em; font-weight: 600; }
.tag {
  display: inline-block;
  background: #f6efe2;
  color: var(--gold);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}
.confirm {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #f8f4ea;
}

.result-grid { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; }
.ring {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), #ece6db 0);
  animation: pop 0.6s ease;
}
.ring-hole {
  width: 146px;
  height: 146px;
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  align-content: center;
}
.ring strong { font-size: 2.4rem; line-height: 1; }
.bar-row { display: grid; grid-template-columns: minmax(128px, 190px) 1fr 52px; gap: 8px; align-items: center; margin: 6px 0; }
.track { height: 8px; background: #efeae1; border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--c); transition: width 0.8s ease; }
.mistake {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.mistake b { color: var(--talk); }
.ok { color: var(--teal); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 28px 22px 36px;
  color: var(--muted);
}

.reveal { animation: rise 0.8s ease both; }
.teacher-body { background: var(--cream); }
.teacher-head, .board, .lock, .setup { width: min(1180px, calc(100% - 28px)); margin: 18px auto; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card, .lock, .setup, .board {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.card strong { display: block; font-size: 1.6rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { background: #f7f3eb; }
tr.is-pick { background: #f3f7fb; }
.bad { color: var(--talk); font-weight: 700; }
.setup ol { padding-inline-start: 18px; }
.setup a { color: var(--teal); font-weight: 700; }

@keyframes drift { from { transform: scale(1); } to { transform: scale(1.045); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes scan { 0%, 100% { transform: translateY(-10px); opacity: 0.25; } 50% { transform: translateY(10px); opacity: 1; } }
@keyframes starfill { 0%, 100% { fill: transparent; } 45%, 70% { fill: currentColor; } }
@keyframes grow { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
@keyframes draw { 0% { stroke-dashoffset: 80; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0.92); } to { transform: none; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shake { animation: shake 0.35s ease; }

@media (max-width: 980px) {
  .hero-grid, .method, .split, .result-grid, .cards { grid-template-columns: 1fr; }
  .method:nth-child(even) .method-copy { order: 0; }
  .medals { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; }
  .dots { grid-template-columns: repeat(5, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
