:root {
  --bg: #0a0f1e;
  --bg-deep: #060912;
  --panel: rgba(18, 26, 48, 0.55);
  --panel-strong: rgba(22, 32, 58, 0.75);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --ink: #e6edf7;
  --ink-soft: #a9b4c8;
  --ink-faint: #6b7690;
  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, 0.18);

  --role-gemini: #22d3ee;
  --role-codex: #f59e0b;
  --role-code: #818cf8;
  --role-gpt: #f87171;
  --role-web: #34d399;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 211, 238, 0.10), transparent 70%),
    radial-gradient(ellipse 60% 40% at 85% 20%, rgba(129, 140, 248, 0.06), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

/* ===== NAV ===== */
nav.site {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

nav.site .brand {
  margin-right: auto;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-size: 1rem;
}

nav.site .brand a { color: inherit; text-decoration: none; }

nav.site a.pill {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

nav.site a.pill:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--panel-strong);
}

/* ===== LAYOUT ===== */
.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.wrap.wide { max-width: 56rem; }

/* ===== TYPE ===== */
h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  color: #fff;
}

h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

p { margin: 0 0 1.15rem; color: var(--ink-soft); }

.lede {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 2rem;
  max-width: 38rem;
}

.meta {
  display: inline-block;
  color: var(--ink-faint);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.status {
  font-size: 0.95rem;
  color: var(--ink-faint);
  margin: 0 0 2.5rem;
  font-style: italic;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(34, 211, 238, 0.3); }
a:hover { border-bottom-color: var(--accent); }

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid rgba(34, 211, 238, 0.12);
}

/* ===== PIPELINE STRIP (entry pages) ===== */
.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin: 2rem 0 3rem;
  font-size: 0.7rem;
}

.pipeline .stage {
  padding: 0.6rem 0.6rem 0.7rem;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
  border-top: 2px solid var(--stage-color, var(--ink-faint));
}

.pipeline .stage .num {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--stage-color);
  margin-bottom: 0.25rem;
}

.pipeline .stage .label {
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  font-size: 0.7rem;
  display: block;
  line-height: 1.3;
}

.pipeline .stage .role {
  font-size: 0.68rem;
  color: var(--ink-faint);
  display: block;
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
  font-style: italic;
}

.stage-1 { --stage-color: var(--role-gemini); }
.stage-2 { --stage-color: var(--role-codex); }
.stage-3 { --stage-color: var(--role-code); }
.stage-4 { --stage-color: var(--role-gpt); }
.stage-5 { --stage-color: var(--role-web); }

/* ===== ROLE PANELS ===== */
.role {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--role-color, var(--accent));
  border-radius: 10px;
  padding: 1.75rem 1.75rem 0.75rem;
  margin: 1.5rem 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.role-gemini { --role-color: var(--role-gemini); }
.role-codex  { --role-color: var(--role-codex); }
.role-code   { --role-color: var(--role-code); }
.role-gpt    { --role-color: var(--role-gpt); }
.role-web    { --role-color: var(--role-web); }

.role-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--role-color);
  margin: 0 0 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--role-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--role-color) 25%, transparent);
}

.role-name {
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 0.75rem 0 1rem;
  font-weight: 600;
}

.role p { color: var(--ink-soft); }

/* ===== STANDING SECTIONS ===== */
.standing {
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.standing h3 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.standing p {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.standing + .standing { margin-top: 0.75rem; }

/* ===== ENTRY CARDS (homepage / receipts) ===== */
.entry-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 1rem 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.15s, transform 0.15s;
  text-decoration: none;
  color: inherit;
}

a.entry-card { border-bottom: none; }

.entry-card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}

.entry-card .meta { margin-bottom: 0.5rem; color: var(--ink-faint); }
.entry-card h3 { color: var(--ink); margin-bottom: 0.75rem; }
.entry-card h3 a { color: var(--ink); border-bottom: none; }
.entry-card h3 a:hover { color: var(--accent); }
.entry-card p { margin-bottom: 0.75rem; color: var(--ink-soft); font-size: 0.95rem; }
.entry-card .read {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  border-bottom: none;
  padding-top: 0.25rem;
}

/* ===== FOOTER ===== */
footer.site {
  max-width: 72rem;
  margin: 4rem auto 0;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--ink-faint);
  font-size: 0.88rem;
  line-height: 1.6;
}

footer.site p { margin: 0; color: var(--ink-faint); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .pipeline { grid-template-columns: repeat(5, 1fr); gap: 0.25rem; }
  .pipeline .stage { padding: 0.5rem 0.25rem; }
  .pipeline .stage .label { font-size: 0.6rem; }
  .pipeline .stage .role { display: none; }
  .role { padding: 1.25rem 1.25rem 0.25rem; }
  nav.site { flex-wrap: wrap; gap: 0.4rem; }
  nav.site .brand { width: 100%; margin-bottom: 0.5rem; }
}
