/* Shared by aicd/ and thesis/ — the two mini-pages are copies of one stylesheet,
   so re-theme them together. Same palette and heading font as the main site. */
:root {
  --bg: #0f1115;
  --bg-alt: #161a21;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-strong: rgba(255, 255, 255, 0.045);
  --text: #eaecef;
  --text-soft: #c5c9d1;
  --text-muted: #9aa0aa;
  --text-faint: #6b717c;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --teal: #2dd4bf;
  --border: #2a2f3a;
  --border-soft: rgba(255, 255, 255, 0.07);
  --radius: 18px;
  --max-width: 880px;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2rem) 2rem;
}

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

.page-header {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem clamp(1.1rem, 4vw, 2rem) clamp(2.5rem, 7vw, 4rem);
  isolation: isolate;
}

/* Same grid + glow as the main site's hero, full-bleed behind the header. */
.page-header::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background:
    radial-gradient(600px 360px at 70% 10%, rgba(91, 140, 255, 0.18), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: clamp(2rem, 6vw, 3.5rem);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.back-link:hover {
  color: var(--text);
  border-color: rgba(91, 140, 255, 0.45);
}

.page-kicker {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.page-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6.5vw, 4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.page-header > p:last-child {
  max-width: 44rem;
  margin: 1.1rem 0 0;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-muted);
}

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

.intro {
  margin: 0 0 2rem;
}

.intro p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.75;
}

/* Every lab / step is a panel. */
.highlight,
.brief {
  position: relative;
  margin: 0 0 1.25rem;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
}

/* The headline results get a lit edge. */
.highlight {
  border-color: rgba(91, 140, 255, 0.28);
  box-shadow: 0 30px 80px -40px rgba(91, 140, 255, 0.45);
}

.highlight::before {
  content: "";
  position: absolute;
  left: 2rem;
  right: 2rem;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--teal), transparent);
}

.brief h2,
.highlight h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-weight: 600;
  line-height: 1.25;
}

.brief p,
.highlight p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.97rem;
}

.brief em {
  color: var(--text);
  font-style: normal;
}

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

.kicker {
  display: inline-block;
  margin: 0 0 0.9rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* ---------- Figures ---------- */

figure {
  margin: 0;
}

/* White-background plots sit on a light mat inside a rounded frame. */
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 50px -25px rgba(0, 0, 0, 0.9);
}

figure.single {
  max-width: 620px;
  margin: 1.75rem auto;
}

figure.single.small {
  max-width: 500px;
}

.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.tag {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-align: center;
}

/* ---------- Measured values ---------- */

.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
  margin: 1.5rem 0 0;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(15, 17, 21, 0.55);
}

.mini-stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.mini-stat-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}

.highlight .mini-stat-value {
  color: var(--accent);
}

/* ---------- Lab 03 interactive ---------- */

.interactive {
  margin: 1.75rem 0;
  padding: 1.4rem 1.5rem 1.5rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background:
    radial-gradient(400px 200px at 50% 0%, rgba(91, 140, 255, 0.12), transparent 70%),
    rgba(15, 17, 21, 0.65);
  text-align: center;
}

.interactive .tag {
  margin-bottom: 1rem;
  color: var(--accent);
}

.interactive svg {
  width: 100%;
  max-width: 500px;
  height: auto;
}

.interactive .grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.interactive .axis-line {
  stroke: var(--text-muted);
  stroke-width: 1;
}

.interactive .axis-label {
  fill: var(--text-muted);
  font-size: 8px;
}

#step-path {
  stroke: var(--accent);
  stroke-width: 2.2;
  filter: drop-shadow(0 0 4px rgba(91, 140, 255, 0.6));
}

.slider {
  width: 100%;
  max-width: 500px;
  margin: 0.9rem 0 1.2rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.interactive-readout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.interactive-readout .mini-stat {
  min-width: 150px;
  align-items: center;
}

.interactive-readout .mini-stat-value {
  color: var(--accent);
}

.interactive-note {
  margin: 1rem 0 0;
  font-size: 0.74rem;
  color: var(--text-faint);
}

/* ---------- Closing call-to-action ---------- */

.report-link {
  margin: 2rem 0 0;
  padding: clamp(1.6rem, 4vw, 2.4rem);
  border-radius: var(--radius);
  border: 1px solid rgba(91, 140, 255, 0.3);
  background:
    radial-gradient(500px 220px at 50% 0%, rgba(91, 140, 255, 0.18), transparent 70%),
    var(--surface);
  text-align: center;
}

/* Several reports in one closing block (Microwave has four): a short title
   and the buttons in a grid, two across, one per row on phones. */
.report-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.report-grid .btn {
  justify-content: center;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
}

@media (max-width: 560px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent);
  color: #fff;
  padding: 0.85rem 1.6rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 12px 34px -10px rgba(91, 140, 255, 0.75);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -10px rgba(91, 140, 255, 0.9);
}

.page-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem clamp(1.1rem, 4vw, 2rem) 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 0.82rem;
}

.page-footer a {
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
}

.page-footer a:hover {
  color: var(--accent);
}

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

@media (max-width: 640px) {
  .before-after {
    grid-template-columns: 1fr;
  }

  /* Three values fit on one row; four go 2 × 2 — never a lone orphan. */
  .mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .mini-stats:has(> :nth-child(4)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-stat {
    padding: 0.7rem 0.75rem;
  }

  .mini-stat-value {
    font-size: 1.05rem;
  }

  .highlight::before {
    left: 1rem;
    right: 1rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  .btn,
  .back-link {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}
