/* =====================================================================
   Thornbury Lab — shared stylesheet for every /lab page.

   Deliberately ONE stylesheet for the whole Lab tree rather than a
   per-page copy: unlike templates/ and portfolio/ (each a standalone
   fake-client product), every Lab page belongs to the same internal
   system, so sharing one file here is the right call, not a violation
   of the "self-contained" convention. It costs nothing extra to load —
   still a single relative-path <link>, no build step, no bundler.

   Tokens below mirror the root gallery's own palette (see index.html's
   :root) so Settings → Lab feels like the same product, not a fork.
   ===================================================================== */

:root {
  --bg: #0a0a0c;
  --surface: #121215;
  --surface-2: #17181c;
  --border: #26272c;
  --text: #f2f1ec;
  --muted: #86868f;
  --accent: #b6935f;
  --accent-soft: rgba(182, 147, 95, 0.12);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --status-experimental: #7ea6ff;
  --status-active: #7fd68a;
  --status-paused: #e0b45c;
  --status-archived: #86868f;
  --status-complete: #6fc9c1;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- topbar ---------- */
.lab-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.lab-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.lab-back:hover { color: var(--text); }
.lab-back svg { width: 16px; height: 16px; }

.lab-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.lab-mark .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- hero / header block ---------- */
.lab-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}
.lab-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.lab-hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  max-width: 20ch;
  margin-bottom: 14px;
}
.lab-hero p {
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.6;
  font-size: 0.98rem;
}

/* ---------- section ---------- */
.lab-section { padding: 48px 0; }
.lab-section + .lab-section { border-top: 1px solid var(--border); }
.lab-section-header { margin-bottom: 28px; }
.lab-section-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.lab-section-header p { color: var(--muted); font-size: 0.92rem; max-width: 60ch; }

/* ---------- hub grid (Lab home) ---------- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.hub-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.hub-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hub-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.hub-card__icon svg { width: 18px; height: 18px; }

.hub-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.08rem;
}

.hub-card p {
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.55;
  flex: 1;
}

.hub-card__count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- status pill ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--experimental { color: var(--status-experimental); }
.status--active { color: var(--status-active); }
.status--paused { color: var(--status-paused); }
.status--archived { color: var(--status-archived); }
.status--complete { color: var(--status-complete); }

/* ---------- experiment card ---------- */
.experiment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.experiment-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.experiment-card--live:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.experiment-card--placeholder {
  cursor: default;
  opacity: 0.85;
  border-style: dashed;
}

.experiment-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.experiment-id {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.experiment-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  margin-top: 2px;
}

.experiment-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }

.experiment-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.experiment-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text);
}
.experiment-card__link svg { width: 15px; height: 15px; transition: transform 0.15s ease; }
.experiment-card--live:hover .experiment-card__link svg { transform: translateX(3px); }

/* ---------- empty state ---------- */
.lab-empty {
  padding: 32px 22px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- footer ---------- */
.lab-footer {
  padding: 28px 24px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .lab-topbar { padding: 16px; }
  .lab-hero { padding: 40px 0 32px; }
  .lab-section { padding: 36px 0; }
  .hub-grid, .experiment-grid { grid-template-columns: 1fr; }
}
