/* The Publications library (publications.html). The site is dark-only, like its other pages. */
:root {
  --brand-cyan: #06b6d4;
  --brand-purple: #d946ef;
  --bg-void: #030712;
  --bg-surface: #0b1222;
  --bg-surface-2: #131c31;
  --text-primary: #f8fafc;
  --text-secondary: #a3b1c6;
  --text-tertiary: #6b7a90;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.18);
  --lock: #fbbf24;
  --nav-height: 64px;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

body {
  min-height: 100vh;
  padding-top: var(--nav-height);
  background:
    radial-gradient(circle at 15% 0%, rgba(6, 182, 212, 0.10), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(217, 70, 239, 0.08), transparent 28%),
    var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
button { font: inherit; color: inherit; }

.pub { max-width: 1180px; margin: 0 auto; padding: 40px 24px 72px; }

/* Hero */
.pub-hero { max-width: 820px; padding: 24px 0 8px; }
.pub-eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brand-cyan);
}
.pub-hero h1 { margin-top: 14px; font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; }
.pub-lede { margin-top: 16px; font-size: 1.08rem; color: var(--text-secondary); max-width: 720px; }
.pub-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pub-jump a {
  padding: 7px 14px; border: 1px solid var(--border-subtle); border-radius: 999px;
  font-size: 0.85rem; color: var(--text-secondary); text-decoration: none; background: rgba(255, 255, 255, 0.02);
}
.pub-jump a:hover { color: var(--text-primary); border-color: var(--border-active); }

/* Sections */
.pub-section { margin-top: 56px; scroll-margin-top: calc(var(--nav-height) + 16px); }
.pub-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.pub-section-head h2, .pub-card-head h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.pub-loading, .pub-empty { padding: 20px 0; color: var(--text-tertiary); font-size: 0.92rem; list-style: none; }
.pub-error { padding: 20px 0; color: #fca5a5; font-size: 0.92rem; list-style: none; }

.pub-filters { display: flex; gap: 6px; }
.pub-filters button {
  padding: 6px 14px; border: 1px solid var(--border-subtle); border-radius: 999px; cursor: pointer;
  font-size: 0.82rem; color: var(--text-secondary); background: transparent;
}
.pub-filters button[aria-pressed="true"] { color: var(--bg-void); background: var(--text-primary); border-color: var(--text-primary); }

/* Op-eds and research */
.pub-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pub-item {
  display: grid; gap: 8px; align-content: start; padding: 20px 22px;
  border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-surface);
  text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
.pub-item:hover { border-color: rgba(6, 182, 212, 0.4); transform: translateY(-1px); }
.pub-item-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-tertiary); letter-spacing: 0.02em;
}
.pub-type { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; color: var(--brand-cyan); }
.pub-type--research { color: #c084fc; }
.pub-outlet { color: var(--text-secondary); font-weight: 600; }
.pub-item-title { font-size: 1.08rem; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.pub-item-summary { color: var(--text-secondary); font-size: 0.9rem; }
.pub-item-authors { font-size: 0.82rem; color: var(--text-tertiary); }
.pub-item-out { font-size: 0.8rem; color: var(--brand-cyan); }

/* The editions */
.pub-editions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 56px; }
.pub-editions .pub-section { margin-top: 0; }
.pub-card {
  display: flex; flex-direction: column; gap: 14px; padding: 26px 28px;
  border: 1px solid var(--border-subtle); border-radius: 18px;
  background: linear-gradient(160deg, rgba(6, 182, 212, 0.08), transparent 55%), var(--bg-surface);
}
.pub-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pub-card-desc { color: var(--text-secondary); font-size: 0.95rem; }
.pub-lock {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--lock); border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08);
}
.pub-lock::before {
  content: ""; width: 9px; height: 9px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 10V7a6 6 0 1 1 12 0v3h1a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1h1zm2 0h8V7a4 4 0 1 0-8 0v3z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 10V7a6 6 0 1 1 12 0v3h1a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1h1zm2 0h8V7a4 4 0 1 0-8 0v3z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pub-lock--open { color: #4ade80; border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); }
.pub-lock--open::before { display: none; }

.pub-editions-list {
  list-style: none; display: grid; max-height: 340px; overflow-y: auto; border-top: 1px solid var(--border-subtle);
  padding-right: 6px;
  /* A slim dark scrollbar, so the list doesn't show the browser's bright default. */
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}
.pub-editions-list::-webkit-scrollbar { width: 6px; }
.pub-editions-list::-webkit-scrollbar-track { background: transparent; }
.pub-editions-list::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 999px; }
.pub-editions-list::-webkit-scrollbar-thumb:hover { background: rgba(6, 182, 212, 0.6); }
.pub-editions-list::-webkit-scrollbar-button { display: none; height: 0; }
.pub-editions-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px;
  border-bottom: 1px solid var(--border-subtle); text-decoration: none; font-size: 0.93rem; color: var(--text-secondary);
}
.pub-editions-list a:hover { color: var(--text-primary); }
.pub-editions-list a::after { content: "→"; color: var(--text-tertiary); }
.pub-editions-list .pub-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-tertiary); }

.pub-cta {
  align-self: flex-start; margin-top: auto; padding: 10px 18px; border-radius: 10px;
  font-weight: 600; font-size: 0.9rem; text-decoration: none; color: var(--bg-void);
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-purple));
}
.pub-cta:hover { filter: brightness(1.1); }

@media (max-width: 860px) {
  .pub-list, .pub-editions { grid-template-columns: minmax(0, 1fr); }
  .pub-card { padding: 22px 20px; }
}
