:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-strong: #eef3ef;
  --text: #13201d;
  --muted: #61706b;
  --line: #d9e0dc;
  --primary: #116149;
  --primary-strong: #0b4434;
  --accent: #b8372d;
  --gold: #d9a441;
  --shadow: 0 18px 45px rgba(15, 30, 25, 0.13);
  --radius: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101714;
  --surface: #17231f;
  --surface-strong: #20332c;
  --text: #edf5f1;
  --muted: #a9b7b1;
  --line: #2b433a;
  --primary: #55c59f;
  --primary-strong: #89dec1;
  --accent: #ef7d6e;
  --gold: #efc56d;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  min-height: 68vh;
  position: relative;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  isolation: isolate;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 18, 15, 0.18), rgba(10, 18, 15, 0.78) 54%, rgba(10, 18, 15, 0.92)),
    linear-gradient(180deg, rgba(10, 18, 15, 0.5), rgba(10, 18, 15, 0.1) 38%, rgba(247, 245, 239, 1) 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 56px);
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
}

.topbar__actions,
.hero__actions,
.module-actions,
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-button,
.primary-button,
.secondary-button,
.filter-button,
.tab {
  border: 1px solid transparent;
  min-height: 42px;
  border-radius: var(--radius);
}

.icon-button {
  width: 42px;
  display: grid;
  place-items: center;
  color: inherit;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.icon-button svg,
.primary-button svg,
.secondary-button svg,
.search svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.icon-fallback {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.icons-ready .icon-fallback {
  display: none;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 800;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.secondary-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.hero__content {
  max-width: 760px;
  padding: 48px clamp(16px, 6vw, 72px) 110px;
  color: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 5.7rem);
  line-height: 0.96;
  max-width: 720px;
  letter-spacing: 0;
}

.hero__lead {
  max-width: 640px;
  margin: 22px 0;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
}

.side-panel {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -72px clamp(16px, 4vw, 56px) 24px;
  padding: 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.side-panel__header {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.progress-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 12px 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-card strong {
  display: block;
}

.progress-bar {
  height: 10px;
  background: var(--surface-strong);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  transition: width 180ms ease;
}

.module-list {
  display: grid;
  grid-template-columns: repeat(12, minmax(160px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.module-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  min-height: 56px;
  padding: 8px 10px;
  text-align: right;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.module-item.is-active {
  border-color: var(--primary);
  background: var(--surface-strong);
}

.module-item__number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
}

.module-item__title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 700;
}

.module-item__done {
  color: var(--primary);
}

.content {
  padding: 0 clamp(16px, 4vw, 56px) 48px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.metric {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric span {
  display: block;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.metric p {
  margin: 8px 0 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.module-view,
.mini-panel,
.toolkit-section,
.capstone-section,
.how-to-learn {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.how-to-learn {
  margin-bottom: 24px;
  padding: clamp(20px, 4vw, 34px);
}

.learn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.learn-grid article {
  padding: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.learn-grid strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
}

.learn-grid h3 {
  margin: 12px 0 6px;
}

.learn-grid p {
  margin: 0;
  color: var(--muted);
}

.module-view {
  overflow: hidden;
}

.learning-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: clamp(18px, 3vw, 26px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), var(--surface));
  border-bottom: 1px solid var(--line);
}

.learning-flow h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.2;
}

.learning-flow p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
}

.stepper {
  display: flex;
  gap: 8px;
}

.step-dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-weight: 900;
}

.step-dot.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.step-dot.is-done {
  color: var(--primary);
  border-color: var(--primary);
}

.module-view__header {
  padding: clamp(20px, 4vw, 34px);
  background: var(--surface-strong);
}

.module-view__header h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.module-view__header p:not(.eyebrow) {
  max-width: 720px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tab {
  padding: 12px 8px;
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  border-inline-start-color: var(--line);
  font-weight: 800;
}

.tab:first-child {
  border-inline-start-color: transparent;
}

.tab.is-active {
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: inset 0 -3px 0 var(--primary);
}

.tab-panel {
  display: none;
  padding: clamp(20px, 4vw, 34px);
}

.tab-panel.is-active {
  display: block;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px clamp(20px, 4vw, 34px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.content-block {
  display: grid;
  gap: 18px;
}

.content-block h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.guide-card {
  padding: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.guide-card p {
  margin: 0;
}

.guide-card ol {
  margin: 0;
  padding-inline-start: 24px;
}

.guide-card ol li::marker {
  color: var(--primary);
  font-weight: 900;
}

.guide-output {
  color: var(--text);
  font-weight: 800;
}

.content-block ul,
.capstone-grid ul {
  margin: 0;
  padding-inline-start: 22px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.task input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--primary);
}

.quiz {
  display: grid;
  gap: 12px;
}

.quiz-option {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  text-align: right;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quiz-option.is-right {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
}

.quiz-option.is-wrong {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.quiz-feedback {
  min-height: 28px;
  font-weight: 800;
}

.learning-panel {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 190px;
}

.mini-panel {
  padding: 18px;
}

.mini-panel h3 {
  margin: 0 0 12px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 150px;
  padding: 12px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quick-links {
  display: grid;
  gap: 8px;
}

.quick-links a {
  padding: 10px 12px;
  text-decoration: none;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
}

.toolkit-section,
.capstone-section {
  margin-top: 24px;
  padding: clamp(20px, 4vw, 34px);
}

.section-heading {
  margin-bottom: 16px;
}

.filter-button {
  padding: 9px 13px;
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--line);
  font-weight: 800;
}

.filter-button.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.tool-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tool-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
}

.tool-card a {
  color: var(--primary-strong);
  font-weight: 800;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  padding: 3px 8px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.capstone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.capstone-grid article {
  padding: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.capstone-grid h3 {
  margin: 0 0 8px;
}

@media (max-width: 980px) {
  .hero {
    min-height: 62vh;
  }

  .side-panel {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(390px, 92vw);
    margin: 0;
    border-radius: 0;
    transform: translateX(105%);
    transition: transform 180ms ease;
    overflow-y: auto;
  }

  .side-panel.is-open {
    transform: translateX(0);
  }

  .side-panel__header {
    display: flex;
  }

  .module-list {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .module-item {
    width: 100%;
  }

  .content {
    padding-top: 20px;
  }

  .dashboard {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .learning-panel {
    position: static;
  }

  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .learn-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .learning-flow {
    grid-template-columns: 1fr;
  }

  .stepper {
    justify-content: stretch;
  }

  .step-dot {
    flex: 1;
    border-radius: var(--radius);
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 14px 16px;
  }

  .brand span:last-child {
    max-width: 170px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .hero__content {
    padding: 34px 16px 72px;
  }

  .hero__actions,
  .module-actions {
    align-items: stretch;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .lesson-nav {
    flex-direction: column-reverse;
  }

  .dashboard,
  .tabs,
  .learn-grid,
  .tool-grid,
  .capstone-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    padding: 16px;
  }

  .tab {
    border-inline-start-color: transparent;
    border-top: 1px solid var(--line);
  }

  .module-view__header,
  .tab-panel,
  .toolkit-section,
  .capstone-section {
    padding: 18px;
  }
}
