/* Deep Breath — Publications (fact-dense, citable)
   Extends styles.css. Light/dark rhythm, no scroll theatre. */

.page-publications {
  background: var(--bg);
  color: var(--text);
}

.page-publications .nav a[aria-current="page"] {
  color: #fff;
}

/* ---------- Shared width ---------- */
.pub-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.pub-narrow {
  width: min(760px, 100%);
  margin: 0 auto;
}

/* ---------- Hero ---------- */
.pub-hero {
  position: relative;
  padding:
    calc(var(--header-h) + 3.25rem)
    clamp(1.25rem, 4vw, 2.75rem)
    clamp(2.75rem, 6vh, 4rem);
  overflow: hidden;
}

.pub-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 45% at 72% 28%, rgba(86, 204, 242, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 18% 82%, rgba(242, 86, 236, 0.07) 0%, transparent 50%);
  pointer-events: none;
}

.pub-hero-inner {
  position: relative;
  z-index: 1;
}

.pub-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 1rem;
}

.pub-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 1.15rem;
  max-width: 16ch;
}

.pub-hero h1 .grad {
  background: linear-gradient(100deg, var(--cyan) 0%, #9b7cff 48%, var(--magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pub-hero-lead {
  font-size: clamp(1rem, 1.4vw, 1.14rem);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 40rem;
  margin: 0 0 1.5rem;
}

.pub-quote {
  max-width: 44rem;
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.pub-quote p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #e5e7eb;
}

.pub-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

/* ---------- Type chips ---------- */
.pub-type {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pub-type--paper {
  color: #93c5fd;
  background: rgba(47, 128, 237, 0.18);
}

.pub-type--project {
  color: #c4b5fd;
  background: rgba(124, 92, 252, 0.18);
}

.pub-type--talk {
  color: #f0abfc;
  background: rgba(226, 29, 140, 0.16);
}

.pub-type--role {
  color: #67e8f9;
  background: rgba(86, 204, 242, 0.14);
}

/* ---------- Light sections ---------- */
.pub-section {
  padding: clamp(3rem, 6vh, 4.5rem) clamp(1.25rem, 4vw, 2.75rem);
}

.pub-section--light {
  background: #f4f7fb;
  color: #0f172a;
}

.pub-section--dark {
  background: #000;
  color: #fff;
}

.pub-section--muted {
  background: #eef2f7;
  color: #0f172a;
}

.pub-section .pub-kicker {
  color: #2f80ed;
}

.pub-section--dark .pub-kicker {
  color: var(--cyan);
}

.pub-section h2 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.pub-intro {
  font-size: 1.02rem;
  line-height: 1.65;
  color: #64748b;
  max-width: 42rem;
  margin: 0 0 1.75rem;
}

.pub-section--dark .pub-intro {
  color: var(--text-muted);
}

/* ---------- Paper cards ---------- */
.pub-cards {
  display: grid;
  gap: 1rem;
}

.pub-card {
  display: grid;
  gap: 0.85rem;
  padding: 1.35rem 1.4rem 1.25rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  text-decoration: none;
  color: #0f172a;
}

a.pub-card {
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

a.pub-card:hover {
  border-color: rgba(47, 128, 237, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.pub-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  font-size: 0.82rem;
  color: #64748b;
}

.pub-card h3 {
  font-size: clamp(1.12rem, 2vw, 1.32rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin: 0;
}

.pub-card-authors {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #334155;
}

.pub-role {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #f1f5f9;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #334155;
}

.pub-role strong {
  color: #0f172a;
}

.pub-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.pub-card-links a {
  color: #2f80ed;
  text-decoration: none;
}

.pub-card-links a:hover {
  text-decoration: underline;
}

.pub-more {
  display: inline-flex;
  margin-top: 0.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #2f80ed;
}

/* ---------- Fact tables ---------- */
.pub-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.pub-section--dark .pub-table-wrap {
  border-color: rgba(255, 255, 255, 0.1);
  background: #0a0a0a;
}

.pub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.pub-table th,
.pub-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.pub-table th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  background: #f8fafc;
}

.pub-table tr:last-child td {
  border-bottom: 0;
}

.pub-table a {
  color: #2f80ed;
  font-weight: 600;
  text-decoration: none;
}

.pub-table a:hover {
  text-decoration: underline;
}

.pub-section--dark .pub-table th {
  background: #111;
  color: #9ca3af;
}

.pub-section--dark .pub-table td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
}

.pub-section--dark .pub-table a {
  color: var(--cyan);
}

/* ---------- FAQ ---------- */
.pub-faq {
  display: grid;
  gap: 0.85rem;
}

.pub-faq-item {
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.pub-faq-item h3 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
}

.pub-faq-item p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #475569;
}

.pub-faq-item a {
  color: #2f80ed;
}

/* ---------- Detail page ---------- */
.pub-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.pub-back:hover {
  color: #fff;
}

.pub-detail-hero h1 {
  max-width: 22ch;
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
}

.pub-cite {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 44rem;
}

.pub-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.55rem 1.25rem;
  margin: 0;
}

.pub-facts dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding-top: 0.15rem;
}

.pub-facts dd {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #0f172a;
}

.pub-facts a {
  color: #2f80ed;
}

.pub-body {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #334155;
}

.pub-body p {
  margin: 0 0 1rem;
}

.pub-body h2 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.7rem;
}

.pub-body ul {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
}

.pub-body li {
  margin: 0.3rem 0;
}

.pub-body a {
  color: #2f80ed;
}

.pub-note {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.92rem;
  line-height: 1.55;
  color: #475569;
}

/* ---------- Related ---------- */
.pub-related {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .pub-related {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pub-related a {
  display: block;
  padding: 1.05rem 1.15rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: inherit;
}

.pub-related a:hover {
  border-color: rgba(47, 128, 237, 0.35);
}

.pub-related h3 {
  font-size: 1rem;
  margin: 0.4rem 0 0.35rem;
}

.pub-related p {
  margin: 0;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .pub-facts {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .pub-facts dt {
    margin-top: 0.55rem;
  }

  .pub-table th,
  .pub-table td {
    padding: 0.7rem 0.75rem;
  }
}
