/* ============================================================
   CURRICULUM — Styles for dedicated learning pages
   ============================================================ */


/* ---- Breadcrumb ---- */

.breadcrumb {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb .sep {
  margin: 0 0.4rem;
  color: var(--border);
}


/* ---- Curriculum Header ---- */

.curriculum-header {
  padding: var(--space-2xl) var(--space-xl) var(--space-xl);
  max-width: var(--max-w);
  margin: 0 auto;
}

.curriculum-header h1 {
  margin-bottom: var(--space-sm);
}

.curriculum-header .subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 580px;
}

.curriculum-meta {
  margin-top: var(--space-lg);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}


/* ---- Local Table of Contents ---- */

.curriculum-toc {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 0 auto var(--space-xl);
  max-width: var(--max-w);
}

.curriculum-toc h3 {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.3rem 1.5rem;
}

.toc-list a {
  font-size: 0.84rem;
  color: var(--text-dim);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0;
  transition: color var(--dur-normal) ease;
}

.toc-list a:hover { color: var(--accent); }

.toc-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  min-width: 1.5rem;
}


/* ---- Curriculum Sections ---- */

.curriculum-section {
  padding: var(--space-2xl) 0;
}

.curriculum-section + .curriculum-section {
  border-top: 1px solid var(--border-dim);
}

.curriculum-section > .section-header {
  margin-bottom: var(--space-xl);
}


/* ---- Math Notation ---- */

.math {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.math-block {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: var(--space-md) 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--text-bright);
  overflow-x: auto;
}

.math-block .label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.math-block .annotation {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.35rem;
  display: block;
}

.math-var {
  color: var(--accent);
  font-weight: 600;
}


/* ---- Key Term ---- */

.key-term {
  font-weight: 600;
  color: var(--text-bright);
  background: var(--accent-bg);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
}


/* ---- Insight Box ---- */

.insight {
  background: linear-gradient(135deg, var(--accent-bg), var(--surface) 60%);
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: var(--space-lg) 0;
}

.insight-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.insight p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}

.insight p + p { margin-top: 0.5rem; }


/* ---- Note Box ---- */

.note {
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: var(--space-md) 0;
}

.note-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.note p {
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}


/* ---- Prerequisites Checklist ---- */

.prereq-checklist {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0;
}

.prereq-checklist li {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
  padding: 0.35rem 0;
  padding-left: 1.6rem;
  position: relative;
}

.prereq-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
}

.prereq-checklist li.optional::before {
  border-style: dashed;
}

.prereq-checklist li a {
  color: var(--accent);
}


/* ---- Architecture Flow Diagram ---- */

.arch-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: var(--space-xl) 0;
  position: relative;
}

/* The central stream line */
.arch-flow::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
  z-index: 0;
}

.arch-node {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.5rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  min-width: 200px;
  transition: all var(--dur-normal) ease;
  cursor: default;
}

.arch-node:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(59, 91, 219, 0.08);
}

.arch-node--embed {
  border-color: var(--gold);
  background: rgba(230, 119, 0, 0.04);
}
.arch-node--embed:hover { border-color: var(--gold); }

.arch-node--output {
  border-color: var(--green);
  background: rgba(9, 146, 104, 0.04);
}
.arch-node--output:hover { border-color: var(--green); }

.arch-node .arch-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-family: var(--font-mono);
}

.arch-connector {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  background: var(--bg);
}

.arch-stream-label {
  position: relative;
  z-index: 1;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding: 0.5rem 0.85rem;
  background: var(--accent-bg-strong);
  border-radius: 100px;
  margin: 0.35rem 0;
}

.arch-block {
  position: relative;
  z-index: 1;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin: 0.35rem 0;
  min-width: 280px;
  background: var(--bg);
}

.arch-block-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-align: center;
}

.arch-component {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  transition: all var(--dur-normal) ease;
}

.arch-component:last-child { margin-bottom: 0; }

.arch-component:hover {
  border-color: var(--accent);
}

.arch-component--attn {
  border-left: 3px solid var(--accent);
}

.arch-component--mlp {
  border-left: 3px solid var(--green);
}

.arch-component .arch-rw {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.1rem;
}

.arch-dots {
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
  background: var(--bg);
  letter-spacing: 0.2em;
}


/* ---- Attention Pattern Grid ---- */

.attn-grid-wrap {
  overflow-x: auto;
  margin: var(--space-md) 0;
}

.attn-grid {
  display: inline-grid;
  gap: 2px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.attn-header {
  font-weight: 600;
  color: var(--text-dim);
  padding: 0.35rem 0.5rem;
  text-align: center;
  font-size: 0.7rem;
}

.attn-row-label {
  font-weight: 600;
  color: var(--text-dim);
  padding: 0.35rem 0.5rem;
  text-align: right;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.attn-cell {
  padding: 0.35rem 0.5rem;
  text-align: center;
  border-radius: 3px;
  color: var(--text-dim);
  background: rgba(59, 91, 219, calc(var(--weight, 0) * 0.6));
  min-width: 2.5rem;
  transition: all var(--dur-normal) ease;
}

.attn-cell[data-weight] {
  color: var(--text-bright);
}

.attn-cell.highlight {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}


/* ---- Stepper (Step-by-Step Walkthrough) ---- */

.stepper {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0;
}

.stepper-header {
  display: flex;
  border-bottom: 1px solid var(--border-dim);
  overflow-x: auto;
  scrollbar-width: none;
}
.stepper-header::-webkit-scrollbar { display: none; }

.stepper-tab {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition:
    color var(--dur-normal) ease,
    border-color var(--dur-normal) ease;
}

.stepper-tab:hover { color: var(--text); }

.stepper-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.stepper-tab .step-num-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.6rem;
  margin-right: 0.35rem;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
}

.stepper-tab.active .step-num-inline {
  background: var(--accent);
  color: white;
}

.stepper-body {
  position: relative;
  min-height: 200px;
}

.stepper-step {
  display: none;
  padding: 1.5rem;
}

.stepper-step.active {
  display: block;
  animation: stepFadeIn 0.3s ease;
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-visual {
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
  overflow-x: auto;
}

.step-text h4 {
  font-size: 0.95rem;
  color: var(--text-bright);
  margin-bottom: 0.3rem;
}

.step-text p {
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.65;
}

.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-dim);
  background: var(--surface-2);
}

.stepper-nav button {
  background: none;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--dur-normal) ease;
}

.stepper-nav button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.stepper-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.stepper-indicator {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}


/* ---- Token Blocks (for visuals) ---- */

.token-row {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.token-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border-dim);
  background: var(--surface);
  color: var(--text);
}

.token-block--q { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.token-block--k { border-color: var(--green); color: var(--green); background: rgba(9, 146, 104, 0.06); }
.token-block--v { border-color: var(--gold); color: var(--gold); background: rgba(230, 119, 0, 0.06); }
.token-block--embed { border-color: var(--gold); }
.token-block--output { border-color: var(--green); }

.token-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-align: center;
}

.token-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.visual-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 0 0.3rem;
}

.visual-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.5rem 0 0.25rem;
}


/* ---- Paper Guide Sections ---- */

.paper-section {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 0.75rem;
  transition:
    border-color var(--dur-normal) ease,
    box-shadow var(--dur-normal) ease;
}

.paper-section:hover {
  border-color: var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.paper-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 0.5rem;
}

.paper-section-header h3 {
  font-size: 1rem;
  color: var(--text-bright);
}

.paper-section-meta {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.difficulty {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  white-space: nowrap;
}

.difficulty--easy {
  background: rgba(9, 146, 104, 0.1);
  color: var(--green);
}

.difficulty--medium {
  background: rgba(230, 119, 0, 0.1);
  color: var(--gold);
}

.difficulty--hard {
  background: rgba(201, 42, 42, 0.08);
  color: var(--red);
}

.time-est {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}

.paper-section p {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.65;
}

.paper-section .subsection-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
}

.paper-section ul {
  padding-left: 1.2rem;
  margin: 0.35rem 0;
}

.paper-section li {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 0.2rem;
}
.paper-section li::marker { color: var(--accent); }


/* ---- Reading List ---- */

.reading-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reading-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  transition:
    border-color var(--dur-normal) ease,
    box-shadow var(--dur-normal) ease;
}

.reading-item:hover {
  border-color: var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.reading-priority {
  flex-shrink: 0;
  width: 3px;
  min-height: 40px;
  border-radius: 2px;
  align-self: stretch;
}

.reading-priority--essential { background: var(--accent); }
.reading-priority--recommended { background: var(--green); }
.reading-priority--optional { background: var(--border); }

.reading-content {
  flex: 1;
}

.reading-content h4 {
  font-size: 0.92rem;
  color: var(--text-bright);
  margin-bottom: 0.15rem;
}

.reading-content h4 a {
  color: var(--text-bright);
  text-decoration: none;
}
.reading-content h4 a:hover {
  color: var(--accent);
}

.reading-content .reading-author {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.3rem;
}

.reading-content p {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0;
}

.reading-badges {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
}


/* ---- Exercise Blocks ---- */

.exercise {
  background: var(--surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
}

.exercise-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.exercise h4 {
  font-size: 0.95rem;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

.exercise p {
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.65;
}

.exercise code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface-2);
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  color: var(--text-bright);
}

.exercise ul {
  padding-left: 1.2rem;
  margin: 0.35rem 0;
}

.exercise li {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 0.2rem;
}
.exercise li::marker { color: var(--accent); }


/* ---- Prose Content ---- */

.prose {
  max-width: 65ch;
}

.prose p {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: var(--space-md);
}

.prose p:last-child { margin-bottom: 0; }

.prose strong { color: var(--text-bright); }

.prose a { color: var(--accent); }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--surface-2);
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  color: var(--text-bright);
}


/* ---- Two-Column Layout ---- */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}


/* ---- Responsive ---- */

@media (max-width: 768px) {
  .curriculum-header {
    padding: var(--space-xl) var(--space-md) var(--space-lg);
  }

  .curriculum-toc {
    margin-left: var(--space-md);
    margin-right: var(--space-md);
  }

  .toc-list {
    grid-template-columns: 1fr;
  }

  .arch-node { min-width: 180px; }

  .arch-block { min-width: 200px; }

  .stepper-tab {
    font-size: 0.68rem;
    padding: 0.55rem 0.7rem;
  }

  .paper-section-header {
    flex-direction: column;
    gap: 0.35rem;
  }

  .reading-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .reading-priority {
    width: 100%;
    min-height: 3px;
    height: 3px;
  }
}
