@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --ink: #102a2a;
  --muted: #647676;
  --paper: #f5f7f2;
  --card: rgba(255, 255, 255, 0.88);
  --line: rgba(15, 118, 110, 0.15);
  --accent: #0f766e;
  --accent-dark: #094d49;
  --accent-soft: #d9eeea;
  --warm: #e69a56;
  --shadow: 0 18px 55px rgba(21, 63, 59, 0.1);
  --radius: 24px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eaf5f2;
  --muted: #a5b8b4;
  --paper: #0b1717;
  --card: rgba(17, 37, 36, 0.9);
  --line: rgba(128, 203, 192, 0.18);
  --accent: #65c6b8;
  --accent-dark: #a2ded4;
  --accent-soft: #153e3a;
  --warm: #f2b478;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  line-height: 1.75;
  transition: background 180ms ease, color 180ms ease;
}

button,
input,
select {
  font: inherit;
}

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

.shell {
  width: calc(100% - 36px);
  max-width: 1160px;
  margin-inline: auto;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 420px;
  height: 420px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle, rgba(50, 184, 168, 0.18), transparent 68%);
}

.ambient-two {
  width: 520px;
  height: 520px;
  bottom: -260px;
  left: -180px;
  background: radial-gradient(circle, rgba(230, 154, 86, 0.14), transparent 70%);
}

.hero {
  overflow: hidden;
  padding-bottom: 44px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(circle at 20% 30%, rgba(15, 118, 110, 0.1), transparent 30%);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  direction: ltr;
  max-width: calc(100% - 58px);
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: var(--paper);
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.3;
}

.brand strong {
  font: 800 15px "Manrope", sans-serif;
}

.brand small {
  color: var(--muted);
  font: 500 10px "Manrope", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.hero-content {
  padding: 64px 0 54px;
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero h1 {
  max-width: 850px;
  margin: 17px 0 18px;
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 700;
  line-height: 1.13;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.hero h1 span {
  color: var(--accent);
}

.hero-content > p {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 31px;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  padding: 11px 22px;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: var(--paper);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.stats div {
  min-width: 0;
  padding: 24px 30px;
}

.stats div + div {
  border-right: 1px solid var(--line);
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  color: var(--accent);
  font: 800 clamp(27px, 4vw, 38px) "Manrope", sans-serif;
  line-height: 1.1;
}

.stats span {
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.main-content {
  padding-block: 86px 100px;
}

.study-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 34px;
  margin-bottom: 25px;
}

.study-panel h2,
.high-yield h2 {
  margin: 2px 0 0;
  font-size: clamp(31px, 5vw, 49px);
  line-height: 1.25;
}

.progress-block {
  width: min(360px, 100%);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
}

.progress-label strong {
  color: var(--accent);
  font-family: "Manrope", sans-serif;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 250ms ease;
}

.controls {
  position: sticky;
  z-index: 10;
  top: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.35fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  box-shadow: 0 12px 35px rgba(15, 65, 60, 0.08);
  backdrop-filter: blur(18px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.search-box span {
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
}

.search-box input,
.controls select,
.control-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
}

.controls select {
  width: 100%;
  padding: 8px 12px;
  background: var(--card);
}

.control-button {
  padding: 8px 16px;
  background: var(--accent);
  color: var(--paper);
  font-weight: 700;
  cursor: pointer;
}

.results-summary {
  min-height: 41px;
  padding: 17px 4px 8px;
  color: var(--muted);
}

.question-list {
  display: grid;
  gap: 13px;
}

.question-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 8px 28px rgba(26, 74, 69, 0.055);
  transition: transform 160ms ease, border-color 160ms ease;
}

.question-card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  transform: translateY(-2px);
}

.question-card.reviewed {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.question-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 22px 24px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: right;
  cursor: pointer;
}

.question-number {
  display: grid;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 800 14px "Manrope", sans-serif;
}

.question-copy {
  flex: 1;
}

.topic-label {
  display: block;
  margin-bottom: 4px;
  color: var(--warm);
  font-size: 12px;
  font-weight: 700;
}

.question-copy h3 {
  margin: 0;
  font-family: "Manrope", "IBM Plex Sans Arabic", sans-serif;
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.55;
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
}

.chevron {
  flex: 0 0 auto;
  margin-top: 8px;
  color: var(--accent);
  font-size: 20px;
  transition: transform 180ms ease;
}

.question-card.open .chevron {
  transform: rotate(180deg);
}

.answer {
  display: none;
  padding: 2px 25px 25px 82px;
  direction: ltr;
  text-align: left;
}

.question-card.open .answer {
  display: block;
  animation: answer-in 180ms ease;
}

@keyframes answer-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}

.answer ul,
.answer ol {
  padding-left: 23px;
}

.answer li {
  margin: 5px 0;
}

.answer p {
  margin: 9px 0;
}

.answer-source {
  margin-top: 20px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
}

.answer-actions {
  display: flex;
  direction: rtl;
  margin-top: 13px;
}

.review-button {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.reviewed .review-button {
  background: var(--accent);
  color: var(--paper);
}

.empty-state {
  padding: 70px 25px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.high-yield {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 55px;
  margin-top: 90px;
  padding: clamp(27px, 5vw, 55px);
  border-radius: 30px;
  background: var(--accent-dark);
  color: var(--paper);
}

[data-theme="dark"] .high-yield {
  background: #06100f;
}

.priority-heading .section-kicker {
  color: var(--warm);
}

.priority-heading p {
  margin-bottom: 0;
  color: color-mix(in srgb, var(--paper) 68%, transparent);
}

.high-yield ol {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: priority;
}

.high-yield li {
  position: relative;
  padding: 11px 42px 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  direction: ltr;
  text-align: left;
  counter-increment: priority;
  overflow-wrap: anywhere;
}

.high-yield li::before {
  position: absolute;
  top: 10px;
  right: 0;
  content: counter(priority, decimal-leading-zero);
  color: var(--warm);
  font: 800 12px "Manrope", sans-serif;
}

footer {
  border-top: 1px solid var(--line);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 30px;
  color: var(--muted);
}

.footer-content a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 820px) {
  .hero-content {
    padding-top: 35px;
  }

  .study-panel {
    align-items: start;
    flex-direction: column;
  }

  .controls {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .high-yield {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .shell {
    width: calc(100% - 22px);
  }

  .nav {
    min-height: 74px;
  }

  .brand small {
    display: none;
  }

  .hero h1 {
    font-size: clamp(38px, 13vw, 55px);
    overflow-wrap: anywhere;
  }

  .hero-content > p {
    font-size: 16px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .primary-button,
  .secondary-button {
    min-width: 0;
    padding-inline: 12px;
    text-align: center;
  }

  .hero-content {
    padding-bottom: 38px;
  }

  .stats div {
    padding: 17px 13px;
    text-align: center;
  }

  .stats span {
    font-size: 13px;
  }

  .main-content {
    padding-block: 60px 70px;
  }

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

  .search-box {
    grid-column: auto;
  }

  .question-top {
    gap: 11px;
    padding: 18px 16px;
  }

  .question-number {
    width: 36px;
    height: 36px;
  }

  .answer {
    padding: 0 19px 21px;
  }

  .high-yield {
    margin-top: 60px;
  }

  .high-yield ol {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
