/* Incantation project page */

:root {
  --bg: #fbfaf6;
  --bg-soft: #f2efe7;
  --ink: #181715;
  --ink-soft: #4d4a43;
  --muted: #797266;
  --line: #ded8ca;
  --line-strong: #c8bda9;
  --panel: #ffffff;
  --panel-dark: #171614;
  --accent: #007c72;
  --accent-2: #c45a1b;
  --accent-3: #3157a4;
  --accent-soft: #e4f4f1;
  --warm-soft: #f8eadb;
  --max: 1120px;
  --radius: 8px;
  --shadow: 0 18px 55px rgba(30, 23, 12, 0.12);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { color: var(--accent-2); }

img,
video {
  display: block;
  width: 100%;
  height: auto;
}

button,
a.btn {
  font: inherit;
}

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

section {
  padding: 68px 0;
  border-top: 1px solid var(--line);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.17;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  text-align: center;
}

h3 { font-size: 20px; }

p { margin: 0; }

.section-sub {
  max-width: 760px;
  margin: 12px auto 34px;
  text-align: center;
  color: var(--ink-soft);
}

.section-kicker,
.block-kicker {
  margin: 0 auto 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.dark-band .section-kicker,
.dark-band .block-kicker {
  color: #8de0d5;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 250, 246, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}

.topbar-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--ink);
  font-weight: 750;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.brand-mark {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px rgba(0, 124, 114, 0.12);
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.topbar nav a {
  color: var(--ink-soft);
  font-weight: 550;
}

.topbar nav a:hover { color: var(--ink); }

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: #0f1424;
  color: white;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid #1f253b;
  transition: transform 0.15s ease;
}

.team-chip:hover {
  transform: translateY(-1px);
  color: white;
}

.team-chip img {
  width: 18px;
  height: 18px;
  display: block;
  filter: brightness(0) invert(1);
}

.hero {
  padding: 80px 0 58px;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(780px 360px at 18% 0%, rgba(0, 124, 114, 0.14), transparent 66%),
    radial-gradient(760px 380px at 85% 8%, rgba(196, 90, 27, 0.13), transparent 64%),
    linear-gradient(180deg, #fffdf8 0%, var(--bg) 100%);
  border-top: 0;
  text-align: center;
}

.hero::after {
  content: none;
  position: absolute;
  inset: auto 0 0;
  height: 130px;
  background: linear-gradient(180deg, rgba(251, 250, 246, 0), var(--bg));
}

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

.venue {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 13px;
  border: 1px solid #b9dcd7;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.hero h1 {
  max-width: 980px;
  margin: 0 auto;
  font-size: clamp(58px, 9vw, 112px);
  font-weight: 820;
  line-height: 0.95;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.paper-title {
  max-width: 780px;
  margin: 0 auto 12px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.hero-lines {
  max-width: 820px;
  margin: 26px auto 0;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.18;
  font-weight: 780;
}

.hero-lines p + p {
  margin-top: 6px;
}

.hero-lines p:nth-child(2) {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-weight: 500;
}

.hero-lines p:nth-child(3) {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.9vw, 22px);
  font-family: var(--sans);
  font-weight: 600;
}

.hero-lines strong {
  color: var(--accent);
}

.presented-by {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 22px auto 0;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 400;
  box-shadow: 0 10px 30px rgba(30, 23, 12, 0.08);
}

.presented-by .pb-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0f1424;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 22px;
}

.presented-by .pb-logo img {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
}

.presented-by strong {
  color: var(--ink);
}

.news-list {
  max-width: 720px;
  margin: 28px auto 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--line);
}

.news-list li {
  position: relative;
  padding: 8px 0 18px 22px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

.news-list li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--accent);
}

.news-list li:first-child::before {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(0, 124, 114, 0.14);
}

.news-list .date {
  display: inline-block;
  margin-right: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.news-list strong {
  color: var(--ink);
}

.news-list .pill-new {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  vertical-align: 2px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 9px 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.70);
  font-size: 14px;
  font-weight: 720;
}

.btn:hover {
  color: var(--accent);
  border-color: #7abeb6;
}

.btn.primary {
  color: #092c2a;
  background: #93ded4;
  border-color: #93ded4;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.btn.disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.hero-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 1px 0 rgba(30, 23, 12, 0.04);
}

.hero-stat strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  color: var(--ink);
}

.hero-stat span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.hero-teaser {
  max-width: 980px;
  margin: 26px auto 0;
}

.hero-teaser .figure-shell {
  box-shadow: var(--shadow);
}

.hero-teaser .caption {
  max-width: 880px;
  margin: 10px auto 0;
  padding: 0;
  border-top: 0;
  text-align: center;
  color: var(--ink-soft);
}

.authors-block {
  margin-bottom: 42px;
}

.authors-block h2 {
  margin-bottom: 10px;
}

.authors-block p {
  text-align: center;
  color: var(--ink-soft);
}

.tldr-grid,
.problem-grid,
.metric-grid,
.asset-grid,
.demo-grid,
.data-grid,
.related-grid {
  display: grid;
  gap: 18px;
}

.tldr-grid {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: start;
}

.text-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 0 rgba(30, 23, 12, 0.03);
}

.text-panel p + p { margin-top: 16px; }

.callout {
  border-left: 4px solid var(--accent);
  padding-left: 18px;
  color: var(--ink-soft);
}

.prompt-line {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
}

.evidence-panel {
  display: grid;
  gap: 14px;
}

.evidence-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.evidence-row:last-child { border-bottom: 0; }

.evidence-row span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.evidence-row strong {
  font-size: 18px;
  line-height: 1.28;
}

.figure-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.caption {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.problem-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.metric,
.data-card,
.link-card,
.demo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
}

.feature-card .eyebrow,
.metric .eyebrow,
.data-card .eyebrow {
  display: inline-flex;
  margin-bottom: 13px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.feature-card p,
.metric p,
.data-card p,
.link-card p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.56;
}

.dark-band {
  color: #fffaf0;
  background: #171614;
  border-top-color: #171614;
}

.dark-band h2,
.dark-band h3 { color: #fffaf0; }

.dark-band .section-sub { color: rgba(255, 250, 240, 0.70); }

.method-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
  align-items: center;
}

.method-steps {
  display: grid;
  gap: 14px;
}

.method-step {
  border: 1px solid rgba(255, 250, 240, 0.18);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 250, 240, 0.06);
}

.step-index {
  display: inline-flex;
  margin-bottom: 9px;
  color: #8de0d5;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.method-step p {
  margin-top: 8px;
  color: rgba(255, 250, 240, 0.72);
  font-size: 15px;
}

.method-step code {
  color: #fffaf0;
  font-family: var(--mono);
  font-size: 13px;
}

.dark-figure {
  border-color: rgba(255, 250, 240, 0.20);
  background: #fff;
  box-shadow: none;
}

.method-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.method-evidence {
  border: 1px solid rgba(255, 250, 240, 0.18);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255, 250, 240, 0.06);
}

.method-evidence p {
  margin-top: 10px;
  color: rgba(255, 250, 240, 0.72);
  font-size: 15px;
  line-height: 1.56;
}

.mini-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: var(--radius);
  background: #fff;
}

.mini-table {
  min-width: 0;
}

.mini-table th,
.mini-table td {
  padding: 10px 12px;
  font-size: 13px;
}

.mini-table th {
  color: var(--muted);
}

.mini-table td {
  color: var(--ink-soft);
}

.mini-table td strong {
  color: var(--accent);
}

.method-evidence .evidence-note {
  color: #f1e7d7;
}

.logic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.proof-thesis {
  max-width: 900px;
  margin: 0 auto 24px;
}

.logic-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
}

.logic-card .eyebrow {
  display: inline-flex;
  margin-bottom: 13px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.logic-card p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.56;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric strong {
  display: block;
  color: var(--accent-2);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 15px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

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

td strong { color: var(--accent); }

.asset-grid {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.demo-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.demo-card {
  padding: 0;
  overflow: hidden;
}

.demo-card video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111;
}

.demo-card h3 {
  padding: 16px 18px 0;
  color: var(--ink);
}

.demo-card p {
  padding: 8px 18px 18px;
  color: var(--ink-soft);
  font-size: 15px;
}

.evidence-block {
  margin-top: 34px;
}

.evidence-block > h3 {
  text-align: center;
}

.block-sub {
  max-width: 760px;
  margin: 10px auto 22px;
  color: var(--ink-soft);
  text-align: center;
}

.evidence-block .asset-grid,
.evidence-block .demo-grid {
  margin-top: 18px;
}

.data-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.credibility-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.credibility-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
}

.credibility-card .eyebrow {
  display: inline-flex;
  margin-bottom: 13px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.credibility-card p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.56;
}

.code-sample {
  margin-top: 20px;
  overflow: auto;
  max-height: 230px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
}

pre {
  margin: 0;
  padding: 18px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.related-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.link-card {
  display: block;
  color: var(--ink);
}

.bibtex-wrap {
  position: relative;
  margin-top: 26px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--ink);
  background: var(--bg-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

footer {
  padding: 34px 0 46px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  border-top: 1px solid var(--line);
}

@media (max-width: 920px) {
  .hero { min-height: auto; padding-top: 92px; }

  .topbar nav { display: none; }

  .hero-stats,
  .problem-grid,
  .metric-grid,
  .data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tldr-grid,
  .method-grid,
  .method-evidence-grid,
  .asset-grid,
  .demo-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .credibility-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .team-chip .text { display: none; }
  .team-chip { padding: 5px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }

  .container { width: min(100% - 28px, var(--max)); }

  section { padding: 52px 0; }

  .hero {
    padding: 60px 0 42px;
    background-position: center top;
  }

  .cta-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .btn { width: 100%; justify-content: center; }

  .btn.primary {
    grid-column: 1 / -1;
  }

  .hero h1 {
    font-size: clamp(54px, 16vw, 68px);
  }

  .paper-title {
    font-size: 15px;
  }

  .hero-lines {
    margin-top: 22px;
    font-size: 24px;
  }

  .hero-lines p:nth-child(3) {
    font-size: 16px;
  }

  .presented-by {
    margin-top: 18px;
  }

  .presented-by {
    max-width: 100%;
    text-align: left;
  }

  .hero-stats {
    display: none;
  }

  .problem-grid,
  .metric-grid,
  .data-grid,
  .credibility-grid {
    grid-template-columns: 1fr;
  }

  .text-panel,
  .feature-card,
  .metric,
  .data-card,
  .credibility-card,
  .link-card {
    padding: 20px;
  }
}
