/* ==========================================================================
   course.css — shared styles for the course guides (NLP.html, llm.html, LTP.html).
   Loaded after site.css, which provides tokens, header/sub-nav, sections,
   buttons, tags, footer and the .fade-in reveal.
   Per-course accents come from the body class (course-nlp|course-llm|course-ltp).
   ========================================================================== */

/* ── COURSE TOKENS ── */
.course-page {
  --c-accent:   var(--gold);   /* curriculum, stat bars, framework */
  --c-accent2:  var(--teal);
  --c-badge:    var(--teal);   /* hero badge */
  --c-collabel: var(--teal);   /* week column labels */
  --c-num-alpha: 12%;          /* faint objective numbers */
  --c-bg4:      #0a1119;       /* framework panel */
  --c-hairline: rgba(255,255,255,0.04);
  --c-soft:     #aab;          /* "Privacy" principle title */
  --c-glow-alpha: 1;
}
.course-llm { --c-accent: var(--teal); --c-accent2: var(--gold); --c-num-alpha: 10%; }
.course-ltp { --c-badge: var(--gold); --c-collabel: var(--gold); --c-num-alpha: 10%; }

:root[data-theme="light"] .course-page {
  --c-bg4: var(--bg2);
  --c-hairline: rgba(27,36,51,0.07);
  --c-soft: var(--muted);
  --c-glow-alpha: 0.55;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .course-page {
    --c-bg4: var(--bg2);
    --c-hairline: rgba(27,36,51,0.07);
    --c-soft: var(--muted);
    --c-glow-alpha: 0.55;
  }
}

/* ── COURSE FACTS (from _data/courses.yml) ── */
.course-facts {
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem var(--gutter);
  position: relative; z-index: 1;
}
.course-facts-inner {
  max-width: 1100px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.75rem;
}
.course-facts-name { font-family: var(--serif); font-size: 1rem; color: var(--text); line-height: 1.3; }
.course-facts-list { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.course-facts-list > div { display: flex; align-items: baseline; gap: 0.45rem; }
.course-facts-list dt {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.course-facts-list dd { font-family: var(--mono); font-size: 0.75rem; color: var(--text); }
.course-facts-note {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em;
  color: var(--red); border: 1px solid var(--red-line); background: var(--red-dim);
  padding: 0.15rem 0.6rem; border-radius: 2px;
}
.course-facts-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-left: auto;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); text-decoration: none;
  border-bottom: 1px solid var(--gold-line); padding: 0.15rem 0;
}
.course-facts-link:hover { border-bottom-color: var(--gold); }

/* ── HERO ── */
#hero {
  min-height: calc(100vh - var(--header-h) - 3.5rem);
  padding: 4rem var(--gutter);
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse at 60% 50%, black 10%, transparent 65%);
  mask-image: radial-gradient(ellipse at 60% 50%, black 10%, transparent 65%);
}
.hero-glow, .hero-glow2 { position: absolute; border-radius: 50%; pointer-events: none; opacity: var(--c-glow-alpha); }
.hero-glow {
  width: 700px; height: 700px; top: -150px; right: -200px;
  background: radial-gradient(circle, color-mix(in srgb, var(--c-accent) 6%, transparent) 0%, transparent 70%);
}
.hero-glow2 {
  width: 500px; height: 500px; bottom: -100px; left: -100px;
  background: radial-gradient(circle, color-mix(in srgb, var(--c-accent2) 5%, transparent) 0%, transparent 70%);
}
.hero-inner {
  position: relative;
  max-width: 1100px;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 5rem; align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--c-badge);
  border: 1px solid color-mix(in srgb, var(--c-badge) 25%, transparent);
  background: color-mix(in srgb, var(--c-badge) 11%, transparent);
  padding: 0.35rem 0.85rem; margin-bottom: 1.5rem;
}
.hero-badge::before { content: '●'; font-size: 0.5rem; animation: course-blink 2s 3; }
@keyframes course-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero-title {
  font-family: var(--serif); font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 400; line-height: 1.05; color: var(--text); margin-bottom: 0.5rem;
}
.course-ltp .hero-title { font-size: clamp(2.6rem, 5.5vw, 4.8rem); }
.hero-title em { font-style: italic; color: var(--gold); }
.hero-subtitle {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1rem, 2vw, 1.3rem); color: var(--muted); margin-bottom: 1.75rem;
}
.hero-desc { font-size: 0.95rem; color: var(--muted); line-height: 1.85; max-width: 460px; margin-bottom: 2rem; }
.hero-note { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--muted); margin: -0.75rem 0 2rem; line-height: 1.6; }
.hero-note a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.hero-note a:hover { color: var(--text); }
.hero-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.hero-meta a.tag { text-decoration: none; }
.hero-meta a.tag:hover { color: var(--text); }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.hero-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  border: 1px solid var(--line); background: var(--line);
}
.hero-stat { background: var(--bg3); padding: 1.25rem 1.5rem; position: relative; overflow: hidden; }
.hero-stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--c-accent), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.hero-stat:hover::before { transform: scaleX(1); }
.hero-stat-num { font-family: var(--serif); font-size: 2rem; color: var(--gold); line-height: 1; }
.hero-stat-label { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 0.2rem; }

/* "Jump to section" box */
.quick-nav { margin-top: 1.25rem; border: 1px solid var(--line); background: var(--bg3); padding: 1.25rem 1.5rem; box-shadow: var(--card-shadow); }
.quick-nav-label {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem;
}
.quick-nav-links { display: flex; flex-direction: column; gap: 0.35rem; }
.quick-nav-link {
  font-size: 0.82rem; color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0; border-bottom: 1px solid var(--line);
  transition: color 0.2s;
}
.quick-nav-link:last-child { border-bottom: none; }
.quick-nav-link:hover { color: var(--gold); }
.quick-nav-num { font-family: var(--mono); color: var(--gold); font-size: 0.75rem; }

/* ── SHARED BITS ── */
.course-page code {
  font-family: var(--mono); font-size: 0.75rem; color: var(--teal);
  background: var(--teal-dim); padding: 0.1rem 0.35rem; border-radius: 2px;
}
.inline-link { color: var(--gold); }
.inline-link:hover { color: var(--text); }

/* ── PREREQUISITES ── */
.prereqs-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; align-items: start; }
.prereqs-grid > * { min-width: 0; }
.prereqs-desc { font-size: 0.95rem; color: var(--muted); line-height: 1.85; margin-bottom: 1.5rem; }

.skill-bars { display: flex; flex-direction: column; gap: 1.1rem; }
.skill-bar-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.4rem; }
.skill-bar-name { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--text); }
.skill-bar-level { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-align: right; }
.skill-bar-track { height: 4px; background: var(--line); position: relative; overflow: hidden; }
.skill-bar-fill {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent2));
  transform: scaleX(var(--w, 0.7)); transform-origin: left;
  transition: transform 1s var(--ease);
}
/* with JS the bars start empty and fill when scrolled into view (course.js adds .animate) */
.js .skill-bar-fill { transform: scaleX(0); }
.js .skill-bar-fill.animate { transform: scaleX(var(--w, 0.7)); }

.radar-wrap { position: relative; width: 100%; max-width: 380px; margin: 0 auto; }
#radarChart { display: block; max-width: 100%; height: auto; }

/* ── OBJECTIVES ── */
.objectives-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.obj-card { background: var(--bg3); padding: 2rem 1.75rem; position: relative; overflow: hidden; transition: background 0.2s; }
.obj-card:hover { background: var(--bg2); }
.obj-num {
  font-family: var(--serif); font-size: 3rem; line-height: 1;
  color: color-mix(in srgb, var(--c-accent) var(--c-num-alpha), transparent);
  position: absolute; top: 1rem; right: 1.25rem;
}
/* Decorative numeral as generated content (not text), so it is not audited as text. */
.obj-num::before { content: attr(data-num); }
.obj-icon { font-size: 1.4rem; margin-bottom: 1rem; }
.obj-title { font-family: var(--serif); font-size: 1rem; line-height: 1.35; margin-bottom: 0.6rem; padding-right: 2.5rem; }
.obj-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.7; }

/* ── CURRICULUM (accordion; behaviour in course.js) ── */
.curriculum-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.curriculum-header .section-title { margin-bottom: 0; }
.curriculum-hint { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; }

.week-group { margin-bottom: 0.6rem; }
.week-btn {
  display: block; width: 100%;
  background: var(--bg3); border: 1px solid var(--line); box-shadow: var(--card-shadow);
  padding: 0; cursor: pointer; text-align: left;
  transition: border-color 0.2s;
}
.week-btn:hover { border-color: color-mix(in srgb, var(--c-accent) 30%, transparent); }
.week-btn.open { border-color: color-mix(in srgb, var(--c-accent) 40%, transparent); }
.week-btn-inner {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center; padding: 1.1rem 1.5rem; gap: 1.25rem;
}
.week-btn-inner > span, .week-title { display: block; min-width: 0; }
.week-num { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; color: var(--c-accent); text-transform: uppercase; }
.week-title { font-family: var(--serif); font-size: 1rem; color: var(--text); }
.week-lecture { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.week-tags-inline { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.25rem; }
.week-chevron { color: var(--muted); font-size: 0.8rem; font-family: var(--mono); transition: transform 0.25s var(--ease); }
.week-btn.open .week-chevron { transform: rotate(180deg); color: var(--c-accent); }

.week-body { border-top: 1px solid var(--line); }
.js .week-body {
  max-height: 0; overflow: hidden; opacity: 0;
  border-top-width: 0;
  transition: max-height 0.4s var(--ease), opacity 0.3s;
}
.js .week-body.open { opacity: 1; border-top-width: 1px; }  /* max-height set from scrollHeight in JS */
html:not(.js) .week-chevron, html:not(.js) .curriculum-hint { display: none; }
html:not(.js) .week-btn { cursor: default; }

.week-body-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.week-col { min-width: 0; padding: 1.5rem 1.75rem; border-right: 1px solid var(--line); overflow-wrap: break-word; }
.week-col:last-child { border-right: none; }
.week-col-label {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--c-collabel); margin-bottom: 0.75rem;
}
.week-col ul { list-style: none; }
.week-col ul li {
  font-size: 0.82rem; color: var(--muted); padding: 0.3rem 0;
  border-bottom: 1px solid var(--c-hairline);
  display: flex; align-items: flex-start; gap: 0.5rem;
}
.week-col ul li::before { content: '→'; color: var(--c-accent); flex-shrink: 0; font-family: var(--mono); font-size: 0.7rem; margin-top: 0.1rem; }
.week-col ul li:last-child { border-bottom: none; }
.week-col-reading { font-size: 0.8rem; color: var(--muted); line-height: 1.7; }
.week-col code, .timeline-deliverable code { overflow-wrap: anywhere; }

/* ── APPLICATIONS (NLP, LLM) ── */
.apps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.app-card {
  border: 1px solid var(--line); background: var(--bg3); box-shadow: var(--card-shadow);
  padding: 1.75rem; position: relative; overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.app-card:hover { border-color: var(--teal-line); transform: translateY(-3px); }
.app-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, var(--teal), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.app-card:hover::after { transform: scaleX(1); }
.app-icon { font-size: 1.8rem; margin-bottom: 1rem; }
.app-title { font-family: var(--serif); font-size: 1rem; margin-bottom: 0.6rem; }
.app-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.7; }

/* ── PROJECT TIMELINE (LTP) ── */
.project-intro { font-size: 0.95rem; color: var(--muted); max-width: 680px; line-height: 1.85; margin-bottom: 3rem; }
.timeline { display: flex; flex-direction: column; max-width: 900px; }
.timeline-item { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 2rem; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 2.4rem; top: 2.4rem; bottom: -1px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-left { display: flex; flex-direction: column; align-items: center; padding-top: 1.4rem; }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); flex-shrink: 0; }
.timeline-dot--teal { background: var(--teal); }
.timeline-week { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--muted); margin-top: 0.4rem; text-align: center; }
.timeline-right {
  min-width: 0; border: 1px solid var(--line); background: var(--bg3); box-shadow: var(--card-shadow);
  padding: 1.5rem 1.75rem; margin-bottom: 0.6rem; transition: border-color 0.2s;
}
.timeline-right:hover { border-color: var(--gold-line); }
.timeline-title { font-family: var(--serif); font-size: 1rem; margin-bottom: 0.4rem; }
.timeline-deliverable { font-size: 0.82rem; color: var(--muted); line-height: 1.65; }
.timeline-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* ── ETHICS ── */
.ethics-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; align-items: start; }
.ethics-intro { font-size: 0.95rem; color: var(--muted); line-height: 1.85; margin-bottom: 2rem; }
.ethics-items { display: flex; flex-direction: column; gap: 1px; }
.ethics-item {
  border: 1px solid var(--line); background: var(--bg3); box-shadow: var(--card-shadow);
  padding: 1.5rem 1.75rem; transition: border-color 0.2s;
}
.ethics-item + .ethics-item { margin-top: 1px; }
.ethics-item:hover { border-color: var(--red-line); }
.ethics-item-header { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 0.6rem; }
.ethics-icon { font-size: 1.2rem; flex-shrink: 0; }
.ethics-title { font-family: var(--serif); font-size: 1rem; }
.ethics-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.7; padding-left: 2.2rem; }

.ethics-visual {
  border: 1px solid var(--line); background: var(--c-bg4); padding: 2rem;
  position: sticky; top: calc(var(--header-h) + 1rem);
}
.ev-title { font-family: var(--serif); font-size: 1rem; margin-bottom: 1.5rem; color: var(--text); }
.ev-ring-wrap { display: flex; flex-direction: column; gap: 1rem; }
.ethics-visual > .ev-principle { margin-bottom: 0.75rem; }   /* LTP: no ring wrapper */
.ev-principle {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1rem; background: var(--bg3); border-left: 2px solid var(--c-accent);
}
.ev-principle-icon { font-size: 1rem; flex-shrink: 0; }
.ev-principle-text { min-width: 0; }
.ev-principle-title { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-accent); }
.ev-principle-desc { font-size: 0.75rem; color: var(--muted); margin-top: 0.1rem; }
.ev-principle--gold  { border-left-color: var(--gold); }
.ev-principle--teal  { border-left-color: var(--teal); }
.ev-principle--red   { border-left-color: var(--red); }
.ev-principle--muted { border-left-color: var(--muted); }
.ev-principle-title--gold { color: var(--gold); }
.ev-principle-title--teal { color: var(--teal); }
.ev-principle-title--red  { color: var(--red); }
.ev-principle-title--soft { color: var(--c-soft); }
.ev-footer { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.ev-footer-label {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem;
}
.ev-footer-text { font-size: 0.78rem; color: var(--muted); line-height: 1.8; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-inner, .prereqs-grid, .ethics-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { gap: 3rem; }
  .objectives-grid, .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-body-inner { grid-template-columns: minmax(0, 1fr); }
  .week-col { border-right: none; border-bottom: 1px solid var(--line); }
  .week-col:last-child { border-bottom: none; }
  .ethics-visual { position: static; }
  .course-facts-link { margin-left: 0; }
}
@media (max-width: 580px) {
  #hero { padding-top: 3rem; padding-bottom: 3rem; }
  .objectives-grid, .apps-grid { grid-template-columns: minmax(0, 1fr); }
  .timeline-item { grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; }
  .timeline-item::before { left: 1.45rem; }
  .timeline-right { padding: 1.25rem; }
  .week-btn-inner { grid-template-columns: 2.5rem minmax(0, 1fr) auto; padding: 1rem 1.1rem; gap: 0.9rem; }
  .week-col { padding: 1.25rem 1.1rem; }
  .ethics-visual { padding: 1.5rem 1.25rem; }
}
@media (max-width: 380px) {
  .course-facts { padding-left: 1rem; padding-right: 1rem; }
  .hero-stat { padding: 1rem 1.1rem; }
  .quick-nav { padding: 1.1rem 1.1rem; }
}

@media print {
  .js .week-body { max-height: none !important; opacity: 1 !important; border-top-width: 1px; }
  .js .skill-bar-fill { transform: scaleX(var(--w, 0.7)); }
  .hero-glow, .hero-glow2, .hero-grid-bg, .week-chevron, .curriculum-hint { display: none; }
  #hero { min-height: 0; }
  .ethics-visual { position: static; }
}
