/* Shared styles for the logbook sections (/logbook, /til, /datasets, ...).
   Same tokens and chrome as roadmaps/index.html. */
:root {
  --font-ui:   'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter:    max(40px, calc((100vw - 1200px) / 2));
  --void:    #0D0D0D;
  --ember:   #FF6B1A;
  --glow:    #FF9A3C;
  --text:    #F0EDE6;
  --muted:   #A8A49E;
  --dim:     #3a3835;
  --border:  #1f1f1f;
  --surface: #111111;
  --green:   #3D9B6E;
  --green-dim: #1e4d37;
  --accent:  var(--ember);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
[hidden] { display: none !important; }
main { flex: 1; }

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  height: 56px;
}
.logo { font-family: var(--font-mono); font-weight: 700; font-size: 18px; color: var(--ember); letter-spacing: 0.5px; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--glow); }
.nav-links a.active { color: var(--text); }

/* ── HERO ── */
.hero {
  position: relative;
  padding: 64px var(--gutter) 48px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.3;
  pointer-events: none;
}
.hero-content { position: relative; max-width: 680px; }
.eyebrow {
  font-size: 12px; color: var(--accent); letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 16px;
}
h1 {
  font-size: clamp(32px, 5vw, 48px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
  margin-bottom: 14px;
}
/* Marker highlight: an ember stroke under the last phrase (same as the home hero). */
h1 em {
  color: var(--glow); font-style: normal;
  background: linear-gradient(transparent 58%, rgba(255,107,26,0.28) 58%, rgba(255,107,26,0.28) 90%, transparent 90%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding: 0 0.06em;
}
.hero-desc { font-size: 17px; color: var(--muted); max-width: 600px; }
.hero-desc + .hero-desc { margin-top: 12px; }
.hero-desc a { color: var(--glow); }
.hero-desc a:hover { color: var(--ember); }
.hero-meta { margin-top: 18px; font-family: var(--font-mono); font-size: 12px; color: var(--dim); }

/* ── SECTION HEADER ── */
.section-header {
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.section-label { font-size: 13px; font-weight: inherit; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
.section-line { flex: 1; height: 1px; background: var(--border); }

/* ── FILTER ── */
.filter-bar {
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.filter-bar input {
  flex: 1 1 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 3px;
  color: var(--text); font: 14px var(--font-mono); padding: 8px 12px;
}
.filter-bar input:focus { outline: none; border-color: var(--accent); }
.chip {
  background: transparent; border: 1px solid var(--border); border-radius: 2px;
  color: var(--muted); font: 11px var(--font-ui); letter-spacing: 0.8px; text-transform: uppercase;
  padding: 5px 10px; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.on { border-color: var(--accent); color: var(--accent); }
.no-results { padding: 32px var(--gutter); color: var(--dim); font-family: var(--font-mono); font-size: 13px; }

/* ── CARD GRID ── */
.grid {
  padding: 0 calc(var(--gutter) - 32px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  border-bottom: 1px solid var(--border);
}
.card {
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 32px;
  position: relative;
  display: flex; flex-direction: column;
  transition: background 0.2s;
}
a.card:hover { background: #141414; }
.card-accent { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); }
.card-num { font-size: 12px; letter-spacing: 1.5px; color: var(--dim); margin-bottom: 10px; text-transform: uppercase; }
.card h2, .card h3 { font-size: 19px; font-weight: 700; line-height: 1.25; margin-bottom: 8px; }
.card p { font-size: 15px; color: var(--muted); }
.card .go { margin-top: auto; padding-top: 18px; font-size: 12px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--accent); }

/* ── ENTRY LIST (til, radar, decisions, lab) ── */
.entries { border-bottom: 1px solid var(--border); }
.entry {
  padding: 28px var(--gutter);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 24px;
}
.entry:last-child { border-bottom: none; }
.entry-side { font-family: var(--font-mono); font-size: 12px; color: var(--dim); padding-top: 4px; }
.entry h2, .entry h3 { font-size: 19px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.entry h2 a:hover, .entry h3 a:hover { color: var(--glow); }
.entry p, .entry li { font-size: 15px; color: var(--muted); }
.entry p + p { margin-top: 8px; }
.entry ul { padding-left: 18px; margin-top: 6px; }
.entry a.link { color: var(--glow); }
.entry a.link:hover { text-decoration: underline; }
.entry strong { color: var(--text); font-weight: 600; }

/* key/value facts (datasets, lab, decisions) */
dl.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 16px; margin-top: 10px; font-size: 14px; }
dl.facts dt { color: var(--dim); font-family: var(--font-mono); font-size: 12px; padding-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
dl.facts dd { color: var(--muted); }

/* tags & status */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag {
  font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 2px; border: 1px solid var(--border); color: var(--muted);
}
.status { border-color: var(--dim); }
.status-running, .status-accepted, .status-active { border-color: var(--green-dim); color: var(--green); }
.status-shipped { border-color: #4a2a10; color: var(--glow); }
.status-abandoned, .status-superseded { color: var(--dim); }
.status-draft { border-style: dashed; color: var(--dim); }

/* ── CODE ── */
code, pre { font-family: var(--font-mono); font-size: 13px; font-variant-ligatures: none; }
.entry h3 code { overflow-wrap: anywhere; }
:not(pre) > code { background: #1a1a1a; border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; color: var(--text); }
pre {
  background: #0a0a0a; border: 1px solid var(--border); border-radius: 4px;
  padding: 12px 14px; margin-top: 10px; overflow-x: auto; color: var(--text); line-height: 1.6;
}

/* ── PROSE (now, uses) ── */
.prose { padding: 40px var(--gutter); border-bottom: 1px solid var(--border); max-width: calc(760px + 2 * var(--gutter)); }
.prose h2 { font-size: 13px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); margin: 32px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--muted); font-size: 16px; }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 4px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--glow); }
.prose a:hover { text-decoration: underline; }

.todo { color: var(--dim); font-style: italic; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px var(--gutter);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.foot-left { font-size: 12px; color: #555; letter-spacing: 0.5px; }
.foot-left a:hover { color: var(--ember); }
.foot-right { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: #2a2a2a; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  nav { padding: 0 16px; }
  .nav-links { gap: 16px; }
  .hero { padding: 48px 16px 36px; }
  .section-header, .filter-bar, .no-results { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr; padding: 0; }
  .card { border-right: none; padding: 24px 16px; }
  .entry { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 24px 16px; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: 6px; }
  .prose { padding: 32px 16px; }
  footer { padding: 20px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── GROUP HOMES (/journal, /experiments, /reference; markup from scripts/build-groups.mjs) ── */
.gp-hero { padding-bottom: 40px; }
.gp-lcols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.gp-lcol { position: relative; border-right: 1px solid var(--border); }
.gp-lcol:last-child { border-right: none; }
.gp-lcol::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--c); }
.gp-lcol-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 22px var(--gutter) 14px; border-bottom: 1px solid var(--border); }
.gp-lcol:not(:first-child) .gp-lcol-h, .gp-lcol:not(:first-child) .gp-li { padding-left: 24px; }
.gp-lcol:not(:last-child) .gp-lcol-h, .gp-lcol:not(:last-child) .gp-li { padding-right: 24px; }
.gp-lcol-k { font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text); }
.gp-lcol-h:hover .gp-lcol-k { color: var(--glow); }
.gp-lcol-n { font-size: 13px; color: var(--muted); }
.gp-lcol-n b { font-size: 22px; font-weight: 700; color: var(--text); margin-right: 2px; }
.gp-figrow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px; padding: 8px var(--gutter) 28px; }
.gp-figrow b { font-size: clamp(56px, 8vw, 96px); font-weight: 700; line-height: 0.9; letter-spacing: -3px; color: var(--text); }
.gp-figrow span { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.gp-block { border-top: 1px solid var(--border); padding: 24px 0 28px; }
.gp-block-h { padding: 0 var(--gutter); margin-bottom: 8px; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text); }
.gp-block .gp-note { margin: 0 0 16px; }
.gp-block .gp-flow { border-top: none; }
.gp-insights { border-top: 1px solid var(--border); }
.gp-panel { border-bottom: 1px solid var(--border); padding-bottom: 32px; }
.gp-note { padding: 0 var(--gutter); margin: -4px 0 18px; font-size: 15px; color: var(--muted); max-width: calc(760px + var(--gutter)); }
.gp-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 var(--gutter) 10px; font-size: 13px; color: var(--muted); }
.gp-legend span { display: inline-flex; align-items: center; gap: 7px; }
.gp-legend b { color: var(--text); font-weight: 600; }
.gp-key { display: inline-block; background: var(--c); }
.gp-key-rect { width: 10px; height: 10px; border-radius: 2px; }
.gp-key-dot { width: 10px; height: 10px; border-radius: 50%; }
.gp-key-line { width: 16px; height: 2px; }
.gp-scroll { margin: 0 var(--gutter); overflow-x: auto; }
.gp-svg { display: block; width: 100%; height: auto; overflow: visible; }
.gp-grid { stroke: #1c1c1c; stroke-width: 1; }
.gp-axis { stroke: #2e2e2e; stroke-width: 1; }
.gp-tick { font: 11px var(--font-mono); fill: var(--dim); }
.gp-hit { fill: transparent; cursor: pointer; outline: none; }
.gp-hit:hover, .gp-hit:focus-visible { fill: rgba(255, 255, 255, 0.04); }
.gp-dot { stroke: var(--surface); stroke-width: 2; }
.gp-dot-hit:hover, .gp-dot-hit:focus-visible { fill: transparent; stroke: var(--text); stroke-width: 1; }
.gp-arc { fill: none; stroke: #5a5650; stroke-width: 1.5; stroke-linecap: round; opacity: 0.55; transition: opacity 0.15s, stroke 0.15s; }
.gp-timeline.tracing .gp-arc { opacity: 0.12; }
.gp-timeline.tracing .gp-arc.on { opacity: 1; stroke: var(--glow); }
.gp-lbl { font: 11px var(--font-ui); fill: var(--muted); pointer-events: none; }
.gp-lane { font: 10px var(--font-mono); fill: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.gp-table { margin: 14px var(--gutter) 0; }
.gp-table summary { display: inline-block; cursor: pointer; font: 11px var(--font-mono); color: var(--dim); text-transform: uppercase; letter-spacing: 0.8px; }
.gp-table summary:hover { color: var(--glow); }
.gp-table table { margin-top: 10px; border-collapse: collapse; font-size: 13px; color: var(--muted); }
.gp-table th, .gp-table td { padding: 4px 18px 4px 0; text-align: left; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.gp-table th { font-weight: 500; color: var(--dim); }
.gp-table a { color: var(--muted); }
.gp-table a:hover { color: var(--glow); }
.gp-tip { position: fixed; z-index: 60; pointer-events: none; min-width: 140px; max-width: 280px; padding: 10px 12px; background: #181818; border: 1px solid #2a2a2a; border-radius: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); font-size: 13px; color: var(--muted); }
.gp-tip[hidden] { display: none; }
.gp-tip-h { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.gp-tip-r { display: flex; align-items: center; gap: 8px; }
.gp-tip-r i { width: 12px; height: 2px; background: var(--c); flex: none; }
.gp-tip-r b { color: var(--text); font-weight: 600; min-width: 24px; }

.gp-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.gp-insight { padding: 28px var(--gutter) 30px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.gp-insight:last-child { border-right: none; }
.gp-insights:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gp-insights:has(> :nth-child(4)) .gp-insight:nth-child(2n) { border-right: none; }
.gp-insights:has(> :nth-child(4)) .gp-insight:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
.gp-insight-v { font-size: 48px; font-weight: 700; line-height: 1; color: var(--accent); letter-spacing: -1px; }
.gp-insight h3 { font-size: 16px; font-weight: 500; line-height: 1.4; color: var(--text); margin-bottom: 8px; }
.gp-foot { font-size: 13px; color: var(--muted); margin-top: 4px; }
.gp-foot a, .gp-insight a { color: var(--muted); }
.gp-foot a:hover, .gp-insight a:hover { color: var(--glow); }
.gp-ranked { display: grid; gap: 7px; }
.gp-rk { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13px; }
.gp-rk-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-rk-bar { display: flex; align-items: center; gap: 8px; }
.gp-rk-bar i { height: 10px; min-width: 2px; background: var(--c); border-radius: 0 4px 4px 0; }
.gp-rk-bar b { font: 500 12px var(--font-mono); color: var(--text); }
.gp-seg { display: flex; gap: 2px; height: 28px; margin-bottom: 10px; }
.gp-seg-part { display: flex; align-items: center; padding-left: 8px; min-width: 4px; background: var(--c); border-radius: 4px; font: 600 12px var(--font-mono); color: var(--void); cursor: default; outline: none; }
.gp-seg-part:hover, .gp-seg-part:focus-visible { filter: brightness(1.12); }
.gp-seg + .gp-legend { padding: 0; }
.gp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-chip { display: inline-flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--border); border-left: 3px solid var(--c); border-radius: 2px; color: var(--text) !important; font-size: 14px; }
.gp-chip small { font: 11px var(--font-mono); color: var(--dim); }
.gp-chip:hover { border-color: var(--c); }
.gp-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gp-chain a { display: inline-flex; flex-direction: column; padding: 6px 10px; border: 1px solid var(--border); border-top: 2px solid var(--c); border-radius: 2px; color: var(--text) !important; font-size: 13px; }
.gp-chain a b { font: 500 11px var(--font-mono); color: var(--dim); }
.gp-chain span { color: var(--dim); }

.gp-flow { display: grid; gap: 0; border-top: 1px solid var(--border); }
.gp-flow-row { display: grid; grid-template-columns: minmax(0, 260px) 40px minmax(0, 1fr); align-items: center; padding: 12px var(--gutter); border-bottom: 1px solid var(--border); }
.gp-flow-row:last-child { border-bottom: none; }
.gp-flow-src { justify-self: start; padding: 5px 10px; border-left: 3px solid var(--c); background: #131313; font-weight: 600; font-size: 14px; }
.gp-flow-src:hover { color: var(--glow); }
.gp-flow-arrow { color: var(--dim); text-align: center; }
.gp-flow-to { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.gp-flow-to a { color: var(--muted); }
.gp-flow-to a:hover { color: var(--glow); }
.gp-flow-to a.gp-product { color: #B07CC6; }

.gp-li { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: baseline; gap: 14px; padding: 12px var(--gutter); border-bottom: 1px solid var(--border); transition: background 0.15s; }
.gp-li:last-child { border-bottom: none; }
.gp-li:hover { background: #121212; }
.gp-li time { font: 12px var(--font-mono); color: var(--dim); }
.gp-li-t { font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--text); }
.gp-li:hover .gp-li-t { color: var(--glow); }
.section-label a { color: inherit; }
.section-label a:hover { color: var(--glow); }

@media (max-width: 900px) {
  .gp-lcols { grid-template-columns: minmax(0, 1fr); }
  .gp-lcol { border-right: none; }
  .gp-lcol:not(:first-child) .gp-lcol-h, .gp-lcol:not(:first-child) .gp-li { padding-left: var(--gutter); }
  .gp-lcol:not(:last-child) .gp-lcol-h, .gp-lcol:not(:last-child) .gp-li { padding-right: var(--gutter); }
}
@media (max-width: 700px) {
  .gp-lcol .gp-lcol-h, .gp-lcol .gp-li { padding-left: 16px !important; padding-right: 16px !important; }
  .gp-figrow, .gp-block-h { padding-left: 16px; padding-right: 16px; }
  .gp-note, .gp-legend { padding-left: 16px; padding-right: 16px; }
  .gp-scroll { margin: 0 16px; }
  .gp-svg { min-width: 760px; }
  .gp-table { margin: 14px 16px 0; overflow-x: auto; }
  .gp-insights, .gp-insights:has(> :nth-child(4)) { grid-template-columns: minmax(0, 1fr); }
  .gp-insight { padding: 24px 16px; border-right: none; border-bottom: 1px solid var(--border); }
  .gp-insight:last-child { border-bottom: none; }
  .gp-flow-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 16px; }
  .gp-flow-arrow { display: none; }
  .gp-li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
