/* ============================================================
   LLM Evaluation — Course Site
   Design: "Lab Console" — a scorecard/instrumentation aesthetic
   fitting a subject literally about scoring, pass/fail, metrics.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --ink:        #0E1418;
  --panel:      #141C22;
  --panel-2:    #182129;
  --line:       #26343D;
  --line-soft:  #1D2830;
  --text:       #DCE4E8;
  --text-dim:   #8FA1AA;
  --text-faint: #5C6E77;
  --amber:      #E8A33D;
  --amber-dim:  #7A5A2A;
  --teal:       #4FD1C5;
  --rose:       #E5707A;
  --radius:     3px;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a{ color: var(--amber); text-decoration: none; }
a:hover{ text-decoration: underline; }

::selection{ background: var(--amber-dim); color: #fff; }

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Top bar ---------- */
.topbar{
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(14,20,24,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__brand{
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: var(--text);
}
.topbar__brand .dot{
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(232,163,61,0.18);
}
.topbar__meta{
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint);
  display: flex; gap: 1rem; align-items: center;
}
.topbar__meta a{ color: var(--text-dim); }
.menu-btn{
  display: none;
  background: none; border: 1px solid var(--line); color: var(--text);
  padding: 0.4rem 0.6rem; border-radius: var(--radius); cursor: pointer;
  font-family: var(--font-mono); font-size: 0.85rem;
}

/* ---------- Layout shell for content pages ---------- */
.shell{
  display: grid;
  grid-template-columns: 268px minmax(0,1fr) 220px;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
}
.shell.no-toc{ grid-template-columns: 268px minmax(0,1fr); }

.sidebar{
  border-right: 1px solid var(--line-soft);
  padding: 1.5rem 1.1rem 3rem;
  align-self: start;
  position: sticky; top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
}
.sidebar__home{
  display: block; font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 1.1rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line-soft);
}
.sidebar__home:hover{ color: var(--amber); text-decoration: none; }
.nav-group{ margin-bottom: 1.3rem; }
.nav-group__title{
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-faint); margin: 0 0 0.5rem 0.1rem;
}
.nav-item{
  display: flex; gap: 0.55rem; align-items: baseline;
  padding: 0.4rem 0.5rem; border-radius: var(--radius);
  color: var(--text-dim); font-size: 0.87rem; line-height: 1.35;
}
.nav-item:hover{ background: var(--panel-2); text-decoration: none; color: var(--text); }
.nav-item.active{ background: rgba(232,163,61,0.10); color: var(--amber); }
.nav-item .num{ font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); flex-shrink: 0; }
.nav-item.active .num{ color: var(--amber); }

.content{
  padding: 2.6rem 3rem 6rem;
  min-width: 0;
}
.content h1{
  font-family: var(--font-display); font-size: 2.1rem; font-weight: 700;
  color: #fff; margin: 2.2rem 0 1rem; letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}
.content h1:first-child{ margin-top: 0; }
.content h2{
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 600;
  color: var(--text); margin: 2rem 0 0.9rem; scroll-margin-top: 80px;
  padding-top: 0.3rem;
}
.content h3{
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;
  color: var(--text); margin: 1.5rem 0 0.7rem; scroll-margin-top: 80px;
}
.content p{ color: var(--text); margin: 0 0 1rem; }
.content ul, .content ol{ margin: 0 0 1.1rem; padding-left: 1.4rem; color: var(--text); }
.content li{ margin-bottom: 0.35rem; }
.content li::marker{ color: var(--amber); }
.content strong{ color: #fff; font-weight: 600; }
.content hr{ border: none; border-top: 1px solid var(--line-soft); margin: 2.4rem 0; }
.content blockquote{
  margin: 1.2rem 0; padding: 0.9rem 1.2rem;
  border-left: 3px solid var(--amber);
  background: var(--panel);
  color: var(--text-dim); border-radius: 0 var(--radius) var(--radius) 0;
}
.content blockquote p:last-child{ margin-bottom: 0; }
.content code{
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--panel-2); color: var(--teal);
  padding: 0.15em 0.4em; border-radius: var(--radius);
}
.content pre{
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1rem 1.2rem; overflow-x: auto;
  margin: 0 0 1.2rem;
}
.content pre code{ background: none; padding: 0; color: var(--text-dim); font-size: 0.85rem; line-height: 1.6; }
.content table{
  width: 100%; border-collapse: collapse; margin: 0 0 1.4rem;
  font-size: 0.9rem;
}
.content th{
  text-align: left; font-family: var(--font-mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--amber);
  border-bottom: 1px solid var(--line); padding: 0.55rem 0.8rem;
  background: var(--panel);
}
.content td{
  padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim); vertical-align: top;
}
.content tr:hover td{ background: rgba(255,255,255,0.015); color: var(--text); }

/* in-page TOC (right rail) */
.toc{
  padding: 2.6rem 1.3rem 3rem 0.5rem;
  position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto;
}
.toc__title{
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.8rem;
}
.toc a{
  display: block; font-size: 0.82rem; color: var(--text-dim);
  padding: 0.28rem 0; border-left: 2px solid transparent; padding-left: 0.7rem;
  margin-left: -0.9rem;
}
.toc a.toc-h2{ padding-left: 1.3rem; font-size: 0.79rem; color: var(--text-faint); }
.toc a:hover{ color: var(--amber); text-decoration: none; }

/* pagination */
.pager{
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line-soft);
}
.pager a{
  flex: 1; max-width: 48%;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1.1rem; color: var(--text);
}
.pager a:hover{ border-color: var(--amber); text-decoration: none; background: var(--panel); }
.pager .lbl{ display: block; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.25rem; }
.pager .next{ text-align: right; margin-left: auto; }

.progress-strip{
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint);
  margin-bottom: 1.6rem; display: flex; align-items: center; gap: 0.6rem;
}
.progress-strip .bar{ flex: 1; height: 3px; background: var(--line-soft); position: relative; border-radius: 2px; overflow: hidden; }
.progress-strip .bar > span{ position: absolute; inset: 0; background: var(--amber); border-radius: 2px; }

/* ============ DASHBOARD (index) ============ */
.hero{
  padding: 4.5rem 1.5rem 3rem; max-width: 1080px; margin: 0 auto; text-align: left;
}
.hero__eyebrow{
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 1.1rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.hero__eyebrow::before{ content: ''; width: 24px; height: 1px; background: var(--amber); }
.hero h1{
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(2.3rem, 5vw, 3.6rem); color: #fff; margin: 0 0 1.1rem; line-height: 1.05;
}
.hero h1 em{ font-style: normal; color: var(--amber); }
.hero p.lede{
  font-size: 1.12rem; color: var(--text-dim); max-width: 640px; margin: 0 0 2.2rem;
}
.hero__stats{ display: flex; gap: 2.2rem; flex-wrap: wrap; }
.stat .n{ font-family: var(--font-mono); font-size: 1.7rem; color: #fff; font-weight: 600; }
.stat .l{ font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }

/* scorecard strip — signature element: pipeline as a running eval trace */
.trace{
  max-width: 1080px; margin: 0 auto 3.5rem; padding: 0 1.5rem;
}
.trace__rail{
  display: flex; align-items: stretch; border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden; background: var(--panel);
}
.trace__step{
  flex: 1; padding: 1rem 1.1rem; border-right: 1px solid var(--line-soft);
  position: relative;
}
.trace__step:last-child{ border-right: none; }
.trace__step .k{ font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.trace__step .v{ font-family: var(--font-display); font-size: 0.98rem; color: var(--text); margin-top: 0.25rem; font-weight: 600; }
.trace__step.pass::after{
  content: '✓ pass'; position: absolute; right: 0.8rem; top: 0.9rem;
  font-family: var(--font-mono); font-size: 0.66rem; color: var(--teal);
}
.trace__step.risk::after{
  content: '△ risk'; position: absolute; right: 0.8rem; top: 0.9rem;
  font-family: var(--font-mono); font-size: 0.66rem; color: var(--rose);
}

.modules{ max-width: 1080px; margin: 0 auto; padding: 0 1.5rem 6rem; }
.module-group{ margin-bottom: 3rem; }
.module-group__head{
  display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 1.1rem;
  padding-bottom: 0.7rem; border-bottom: 1px solid var(--line-soft);
}
.module-group__head h2{
  font-family: var(--font-display); font-size: 1.25rem; color: #fff; margin: 0; font-weight: 600;
}
.module-group__head p{
  font-size: 0.85rem; color: var(--text-faint); margin: 0;
}
.card-grid{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
}
.card{
  display: block; border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; background: var(--panel);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover{ border-color: var(--amber); text-decoration: none; transform: translateY(-1px); }
.card__num{ font-family: var(--font-mono); font-size: 0.72rem; color: var(--amber); }
.card__title{
  font-family: var(--font-display); font-size: 1.02rem; font-weight: 600;
  color: var(--text); margin: 0.35rem 0 0.5rem; line-height: 1.3;
}
.card__desc{ font-size: 0.83rem; color: var(--text-faint); line-height: 1.5; margin: 0 0 0.9rem; }
.card__meta{
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-faint);
  display: flex; gap: 0.7rem; align-items: center;
}
.chip{
  display: inline-block; font-family: var(--font-mono); font-size: 0.66rem;
  padding: 0.15rem 0.5rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text-dim);
}

footer.site{
  border-top: 1px solid var(--line-soft); padding: 1.8rem 1.5rem;
  text-align: center; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px){
  .shell{ grid-template-columns: 240px minmax(0,1fr); }
  .toc{ display: none; }
}
@media (max-width: 880px){
  .menu-btn{ display: inline-block; }
  .shell{ grid-template-columns: 1fr; }
  .sidebar{
    position: fixed; left: 0; top: 57px; bottom: 0; width: 78%; max-width: 300px;
    background: var(--ink); z-index: 50; transform: translateX(-100%);
    transition: transform 0.2s ease; box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }
  .sidebar.open{ transform: translateX(0); }
  .content{ padding: 1.8rem 1.3rem 4rem; }
  .hero{ padding: 2.8rem 1.2rem 2rem; }
  .trace__rail{ flex-direction: column; }
  .trace__step{ border-right: none; border-bottom: 1px solid var(--line-soft); }
  .trace__step:last-child{ border-bottom: none; }
}
