/* DogLM results — Design 2: "Lab notebook"
   Cool neutrals, IBM Plex, dense data tables. */

:root {
  --bg: oklch(0.995 0.002 250);
  --bg-2: oklch(0.972 0.004 250);
  --ink: oklch(0.26 0.015 255);
  --ink-soft: oklch(0.52 0.015 255);
  --rule: oklch(0.9 0.006 255);
  --rule-strong: oklch(0.78 0.008 255);
  --accent: oklch(0.52 0.11 250);
  --measure: 42rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  text-wrap: pretty;
}

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.75rem; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in oklch, var(--accent) 40%, transparent); }
a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklch, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 0;
  margin-bottom: 3rem;
}
.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.wordmark {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.wordmark span { color: var(--ink-soft); font-weight: 400; }
.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  margin-right: auto;
}
.topnav a {
  font-size: 0.78rem;
  color: var(--ink-soft);
  border: 0;
  letter-spacing: 0.01em;
}
.topnav a:hover { color: var(--accent); }
.kicker {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  color: var(--ink-soft);
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  white-space: nowrap;
}

/* Head matter */
h1 {
  max-width: 34rem;
  margin: 0 0 1.75rem;
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.lede { max-width: var(--measure); }
.lede p { margin: 0 0 1rem; }
.lede p:first-child { font-size: 1.1rem; color: var(--ink); }
.lede p:last-child { margin-bottom: 0; font-size: 0.92rem; color: var(--ink-soft); }

/* Sections */
.sec { margin-top: 4rem; }
.sec h2 {
  margin: 0 0 0.2rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.sub { margin: 0.4rem 0 0.1rem; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.meta { margin: 0 0 1.3rem; font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; color: var(--ink-soft); }
.sec h2 + .tablewrap { margin-top: 1.2rem; }
.body { max-width: var(--measure); margin: 1.6rem 0 0; font-size: 0.94rem; }

/* Tables */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }

thead th {
  position: sticky;
  top: 0;
  background: var(--bg-2);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: right;
  vertical-align: bottom;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
thead th.text { text-align: left; }

th.is-sortable { cursor: pointer; user-select: none; }
th.is-sortable:hover, th.is-sortable:focus-visible { color: var(--accent); outline: none; }
th.is-sortable::after { content: "↕"; margin-left: 0.35em; opacity: 0.4; }
th.is-sortable[data-dir="asc"]::after { content: "↑"; opacity: 1; color: var(--accent); }
th.is-sortable[data-dir="desc"]::after { content: "↓"; opacity: 1; color: var(--accent); }

tbody td {
  padding: 0.42rem 0.75rem;
  text-align: right;
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
tbody td.text { text-align: left; font-family: "IBM Plex Sans", sans-serif; white-space: normal; }
tbody tr:nth-child(even) td { background: color-mix(in oklch, var(--bg-2) 55%, #fff); }
tbody tr:hover td { background: color-mix(in oklch, var(--accent) 7%, #fff); }
tbody tr:last-child td { border-bottom: 0; }

/* Video */
.video {
  max-width: 46rem;
  margin-top: 1.1rem;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-2);
}
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Notes */
.notes {
  max-width: var(--measure);
  margin-top: 1.5rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule-strong);
  padding-left: 1rem;
}
.notes p { margin: 0 0 0.6rem; }
.notes p:last-child { margin-bottom: 0; }

/* Examples */
.examples { max-width: var(--measure); margin: 1.2rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.55rem; font-size: 0.94rem; }
.examples li { padding-left: 1.5rem; position: relative; }
.examples li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8em;
  top: 0.15em;
}

/* Footer */
footer { margin: 7rem 0 3.5rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: 0.88rem; color: var(--ink-soft); }
footer p { margin: 0; }

@media (max-width: 760px) {
  .masthead { position: static; }
  .topnav { display: none; }
  .wrap { padding: 0 1.15rem; }
  table { font-size: 0.8rem; }
  thead th, tbody td { padding-left: 0.5rem; padding-right: 0.5rem; }
}
