@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,wght@0,400;0,500;1,400&family=Jost:wght@300;400;500;600&display=swap');

:root {
  --bg:          #0C0A09;
  --surface:     #141210;
  --card:        #1A1714;
  --card-hover:  #201D19;
  --border:      rgba(255,255,255,0.07);
  --border-hi:   rgba(255,255,255,0.12);
  --gold:        #CA8A04;
  --gold-light:  #FDE68A;
  --gold-deep:   #92400E;
  --gold-glow:   rgba(202,138,4,0.18);
  --gold-glass:  rgba(202,138,4,0.10);
  --text:        #F0EBE0;
  --text-muted:  #8A8070;
  --text-dim:    #4A4540;
  --mono:        'SF Mono','Fira Code','Consolas',monospace;

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Jost', system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Noise overlay ──────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.6;
  pointer-events: none;
}

/* ── Orb ambience ───────────────────────────────────────────────────── */
.orb {
  position: fixed; border-radius: 50%;
  filter: blur(80px); pointer-events: none; z-index: 0;
}
.orb-1 { width: 600px; height: 600px; top: -200px; right: -100px; background: radial-gradient(circle, rgba(202,138,4,0.12), transparent 65%); }
.orb-2 { width: 400px; height: 400px; bottom: 0; left: -100px; background: radial-gradient(circle, rgba(120,53,15,0.15), transparent 65%); }

/* ── Layout wrappers ────────────────────────────────────────────────── */
.page { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 0 24px 80px; }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12,10,9,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex; align-items: center; gap: 20px;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--gold-light); }
.back-link svg { flex-shrink: 0; }

.wordmark {
  font-family: 'Bodoni Moda', serif;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--text);
  flex: 1;
}
.wordmark span { color: var(--gold-light); }

/* ── Gold pill badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 500;
}
.badge-gold   { background: var(--gold-glass); border: 1px solid rgba(202,138,4,0.25); color: var(--gold-light); }
.badge-active { background: rgba(74,122,74,0.12); border: 1px solid rgba(74,122,74,0.2); color: #7BC47B; }
.badge-done   { background: rgba(74,122,74,0.08); border: 1px solid rgba(74,122,74,0.12); color: #5A9A5A; }
.badge-paused { background: rgba(90,90,58,0.12); border: 1px solid rgba(90,90,58,0.2); color: #9A9A6A; }

/* ── Section headers ────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; gap: 14px;
  margin: 48px 0 20px;
}
.section-header:first-of-type { margin-top: 40px; }
.section-line { flex: 1; height: 1px; background: linear-gradient(to right, var(--border), transparent); }
.section-title {
  font-family: 'Bodoni Moda', serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.section-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}

/* ── Card grid ──────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }

/* ── Card ───────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.25s, background 0.25s, transform 0.2s;
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(600px circle at var(--mx,50%) var(--my,0%), var(--gold-glow), transparent 40%);
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.card:hover { border-color: var(--border-hi); background: var(--card-hover); }
.card:hover::before { opacity: 1; }

/* Hub card variant */
.card-hub {
  border-color: rgba(202,138,4,0.2);
  background: linear-gradient(135deg, rgba(202,138,4,0.06), var(--card));
}
.card-hub:hover { border-color: rgba(202,138,4,0.4); }

.card-name {
  font-family: 'Bodoni Moda', serif;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Progress */
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress-bar { flex: 1; height: 2px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; background: linear-gradient(to right, var(--gold-deep), var(--gold)); }
.progress-pct { font-size: 0.75rem; color: var(--text-dim); font-family: var(--mono); width: 32px; text-align: right; }

/* Actions row */
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.05em;
  cursor: pointer; text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #0C0A09;
}
.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost {
  background: none;
  border-color: var(--border-hi);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-light); }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }

/* Dev info */
.dev-info {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.dev-row { display: flex; align-items: flex-start; gap: 8px; }
.dev-label {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); width: 56px; flex-shrink: 0; padding-top: 2px;
}
.dev-val {
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dev-val.wrap { white-space: normal; word-break: break-all; }

.session-row { display: flex; align-items: center; gap: 6px; }
.session-chip {
  font-family: var(--mono); font-size: 0.7rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 7px;
  color: var(--text-muted);
  cursor: help;
  white-space: nowrap;
}
.session-chip:hover { border-color: var(--gold); color: var(--gold-light); }
.session-lbl { font-size: 0.72rem; color: var(--text-dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Copy button */
.copy-btn {
  width: 24px; height: 24px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 5px;
  background: none; color: var(--text-dim);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-size: 0.75rem;
}
.copy-btn:hover { border-color: var(--border-hi); color: var(--text); }
.copy-btn.copied { border-color: rgba(74,122,74,0.4); color: #7BC47B; }

/* Tags */
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 0.67rem; padding: 2px 7px; border-radius: 4px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text-dim);
}

/* ── Search & filter ────────────────────────────────────────────────── */
.controls { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.search-input {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px 8px 34px; color: var(--text);
  font-family: 'Jost', sans-serif; font-size: 0.85rem;
  outline: none; width: 220px; transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--text-dim); }

.cat-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-pill {
  font-family: 'Jost', sans-serif; font-size: 0.75rem; font-weight: 500;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: none; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.cat-pill:hover { border-color: var(--border-hi); color: var(--text); }
.cat-pill.active { color: #0C0A09; border-color: transparent; }

/* ── Page hero ──────────────────────────────────────────────────────── */
.hero { padding: 56px 0 40px; }
.hero-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-light); font-weight: 500; margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.hero-eyebrow::after { content: ''; flex: 0 0 40px; height: 1px; background: var(--gold); }
.hero-title {
  font-family: 'Bodoni Moda', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.hero-title em { font-style: italic; color: var(--gold-light); }
.hero-sub { font-size: 1rem; color: var(--text-muted); max-width: 520px; }

/* ── Instructions page ──────────────────────────────────────────────── */
.prose { max-width: 760px; }
.prose h2 {
  font-family: 'Bodoni Moda', serif; font-size: 1.4rem;
  margin: 40px 0 14px; color: var(--text);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 0.95rem; font-weight: 600; letter-spacing: 0.04em; margin: 24px 0 8px; color: var(--text-muted); text-transform: uppercase; }
.prose p { margin-bottom: 14px; font-size: 0.95rem; color: var(--text-muted); }
.prose ul { padding-left: 20px; margin-bottom: 14px; }
.prose li { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 6px; }
.prose code {
  font-family: var(--mono); font-size: 0.82rem;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; color: var(--gold-light);
}
pre {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin: 14px 0; overflow-x: auto; position: relative;
}
pre code {
  background: none; border: none; padding: 0;
  font-size: 0.82rem; color: var(--text-muted); line-height: 1.7;
}
.pre-label {
  font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 6px; display: block;
}
.field-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.field-table th {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 600; text-align: left;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.field-table td {
  font-size: 0.85rem; padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top; color: var(--text-muted);
}
.field-table td:first-child { font-family: var(--mono); font-size: 0.78rem; color: var(--gold-light); }

/* ── Sub-page hub cards ─────────────────────────────────────────────── */
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.sub-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; display: flex; flex-direction: column; gap: 10px;
  transition: all 0.25s;
}
.sub-card:hover { border-color: rgba(202,138,4,0.3); background: var(--card-hover); }
.sub-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gold-glass); border: 1px solid rgba(202,138,4,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.sub-card-name { font-family: 'Bodoni Moda', serif; font-size: 1rem; }
.sub-card-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }
.sub-card-tbd { font-size: 0.75rem; color: var(--text-dim); font-style: italic; }
.placeholder-url {
  font-size: 0.75rem; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: 6px; padding: 6px 10px;
  font-family: var(--mono);
}

/* ── Toast ──────────────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 10px; padding: 10px 20px;
  font-size: 0.82rem; color: var(--text);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
  white-space: nowrap; z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#toast.show { opacity: 1; }

/* ── Count ──────────────────────────────────────────────────────────── */
.count-label { font-size: 0.75rem; color: var(--text-dim); margin-left: auto; white-space: nowrap; }

#empty-state { text-align: center; padding: 80px 0; color: var(--text-dim); font-size: 0.95rem; display: none; }

/* ── Mouse glow on cards (JS) ───────────────────────────────────────── */
.card { --mx: 50%; --my: 0%; }
