/* ============================================================
   RapTB project page — custom styling on top of Bulma
   Palette: NYU violet, ink, and method accent colors
   ============================================================ */
:root {
  --nyu:        #57068C;   /* NYU violet */
  --nyu-deep:   #3d0463;
  --nyu-soft:   #f5eefb;
  --ink:        #1c1822;
  --muted:      #6b6478;
  --line:       #e7e1ee;
  --bg:         #ffffff;
  --bg-tint:    #faf8fd;

  --tb:     #2f6fdb;       /* TB blue */
  --subtb:  #e0992b;       /* SubTB amber */
  --raptb:  #d4582a;       /* RapTB / SubM orange-red */
  --good:   #2a9d63;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Newsreader', Georgia, serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  font-size: 18px;
}

h1, h2, h3, h4, .venue-badge, .link-pill, .stat-num, .badge,
.section-title, .method-h, .mono, table, .copy-btn, .tile-icon {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.mono, .eq .mono, pre, code { font-family: 'JetBrains Mono', ui-monospace, monospace; }

a { color: var(--nyu); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--raptb); }

/* ---------------------------------------------------------- HERO */
.hero-header {
  position: relative;
  overflow: hidden;
  padding: 4.4rem 1.2rem 3.2rem;
  text-align: center;
  background:
    radial-gradient(1100px 460px at 50% -8%, rgba(87,6,140,.13), transparent 70%),
    linear-gradient(180deg, #fbf9fe 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}
.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(520px 200px at 18% 12%, rgba(212,88,42,.10), transparent 60%),
    radial-gradient(520px 220px at 84% 8%, rgba(47,111,219,.10), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }

.venue-badge {
  display: inline-block;
  font-size: .8rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--nyu);
  background: var(--nyu-soft);
  border: 1px solid #e3d3f2;
  padding: .34rem .85rem;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}

.paper-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(1.9rem, 4.6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 auto 1.6rem;
  max-width: 980px;
}

.authors { font-size: 1.22rem; margin-bottom: .35rem; }
.authors .author { font-weight: 600; color: var(--ink); border-bottom: 2px solid transparent; }
.authors .author:hover { color: var(--nyu); border-color: var(--nyu); }
.authors sup { color: var(--muted); font-weight: 600; }
.corr { color: var(--raptb); font-size: .72em; vertical-align: super; }

.affil { color: var(--muted); font-size: 1.04rem; margin-bottom: .2rem; }
.corr-note { color: var(--muted); font-size: .92rem; margin-bottom: 1.7rem; }
.corr-note a { font-weight: 600; }

/* action buttons */
.buttons-row {
  display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center;
  margin-bottom: 2.2rem;
}
.link-pill {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 600; font-size: 1rem;
  color: #fff; background: var(--ink);
  padding: .68rem 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.link-pill:hover {
  color: #fff; background: var(--nyu); border-color: var(--nyu);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(87,6,140,.25);
}
.link-pill .icon { font-size: 1.05rem; }

.tldr {
  max-width: 820px; margin: 0 auto;
  font-size: 1.12rem; color: #2c2733;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--raptb);
  border-radius: 12px;
  padding: 1.05rem 1.35rem;
  text-align: left;
  box-shadow: 0 10px 30px rgba(28,24,34,.05);
}
.tldr strong { color: var(--ink); }

/* ---------------------------------------------------------- TEASER */
.teaser-section { padding: 2.6rem 1rem 1.4rem; }
.teaser-figure { margin: 0 auto; max-width: 1180px; text-align: center; }
.teaser-figure img {
  width: 100%; height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(28,24,34,.10);
}
.teaser-figure figcaption,
figure figcaption {
  font-size: .97rem; color: var(--muted);
  margin-top: 1rem; text-align: left;
  max-width: 1000px; margin-left: auto; margin-right: auto;
  line-height: 1.55;
}

.badge {
  display: inline-block; font-size: .74rem; font-weight: 800;
  letter-spacing: .03em; color: #fff; padding: .08rem .5rem;
  border-radius: 6px; vertical-align: middle;
}
.badge.tb { background: var(--tb); }
.badge.subtb { background: var(--subtb); }
.badge.raptb { background: var(--raptb); }

/* ---------------------------------------------------------- SECTIONS */
.section { padding: 3.2rem 1.2rem; }
.section-tint { background: var(--bg-tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800; letter-spacing: -0.01em;
  color: var(--ink);
  text-align: center;
  margin-bottom: 1.6rem;
  position: relative;
}
.section-title::after {
  content: ""; display: block; width: 52px; height: 4px;
  background: linear-gradient(90deg, var(--nyu), var(--raptb));
  border-radius: 4px; margin: .7rem auto 0;
}

.section-lead {
  max-width: 820px; margin: 0 auto 1.8rem;
  text-align: center; color: #38323f; font-size: 1.08rem;
}

.abstract-body {
  max-width: 820px; margin: 0 auto;
  font-size: 1.14rem; color: #2b2733;
}
.abstract-body p { text-align: justify; }

.content.note {
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: .85rem 1.15rem;
  font-size: 1rem; color: #3a3543; margin-top: 1.1rem;
}
.section-tint .content.note { background: #fff; }

/* ---------------------------------------------------------- PROBLEM CARDS */
.problem-cards { margin-top: .5rem; }
.card-tile {
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.7rem 1.6rem;
  box-shadow: 0 8px 28px rgba(28,24,34,.05);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(28,24,34,.10); }
.card-tile.tall { min-height: 100%; }
.tile-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 13px;
  background: linear-gradient(135deg, var(--nyu), var(--nyu-deep));
  color: #fff; font-size: 1.35rem; margin-bottom: 1rem;
}
.card-tile h3 {
  font-size: 1.28rem; font-weight: 700; color: var(--ink);
  margin-bottom: .55rem; letter-spacing: -.01em;
}
.card-tile h3 i { color: var(--nyu); }
.card-tile p { color: #423c4c; font-size: 1.02rem; }

/* ---------------------------------------------------------- METHOD */
.method-h {
  font-size: 1.35rem; font-weight: 700; color: var(--nyu-deep);
  margin: 2.2rem 0 .9rem; letter-spacing: -.01em;
}
.mech-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem;
  margin: 1.2rem 0 .4rem;
}
.mech-box {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 1.4rem 1.4rem 1rem;
  box-shadow: 0 6px 20px rgba(28,24,34,.04);
}
.mech-box h4 {
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.08rem;
  color: var(--ink); margin-bottom: .55rem; display: flex; align-items: center; gap: .6rem;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--raptb); color: #fff; font-weight: 800; font-size: .95rem;
}
.mech-box p { font-size: .99rem; color: #423c4c; }

.eq {
  overflow-x: auto; overflow-y: hidden;
  background: var(--nyu-soft);
  border: 1px solid #ecdffa;
  border-radius: 10px;
  padding: .65rem 1rem; margin: .85rem 0 .2rem;
  font-size: 1.02rem;
}
.eq-final { background: #fff; border: 1px dashed var(--nyu); }
.note .mono, .content .mono, p .mono, figcaption .mono, .stat-lbl .mono {
  background: #f0ecf6; padding: .04em .35em; border-radius: 5px;
  font-size: .9em; color: var(--nyu-deep);
}

/* ---------------------------------------------------------- STATS */
.stat-row { margin-bottom: 1.2rem; }
.stat {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 1.3rem 1rem; text-align: center;
  height: 100%;
  box-shadow: 0 8px 24px rgba(28,24,34,.05);
  transition: transform .18s ease;
}
.stat:hover { transform: translateY(-3px); }
.stat-num {
  font-size: 2.5rem; font-weight: 900; letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--nyu), var(--raptb));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--nyu);
  line-height: 1;
}
.stat-lbl { font-family: 'Inter', sans-serif; font-size: .9rem; color: var(--muted); margin-top: .5rem; }
.stat-lbl span { display: block; font-size: .8rem; color: #6b6478; margin-top: .15rem; }

/* ---------------------------------------------------------- TABLE */
.table-wrap { overflow-x: auto; margin: 0 auto; max-width: 760px; }
.result-table {
  width: 100%; border-collapse: collapse;
  font-family: 'Inter', sans-serif; font-size: 1rem;
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(28,24,34,.06);
}
.result-table thead th {
  background: var(--ink); color: #fff; font-weight: 600;
  padding: .8rem .7rem; text-align: center; font-size: .95rem;
}
.result-table thead th:first-child { text-align: left; padding-left: 1.2rem; }
.result-table td { padding: .62rem .7rem; text-align: center; border-bottom: 1px solid var(--line); }
.result-table td:first-child { text-align: left; padding-left: 1.2rem; font-weight: 600; }
.result-table tr.muted td { color: #6f6779; font-weight: 500; }
.result-table tr.muted td:first-child { font-weight: 600; }
.result-table tr.rule-top td { border-top: 2px solid var(--ink); }
.result-table tr.best { background: linear-gradient(90deg, rgba(212,88,42,.10), rgba(87,6,140,.07)); }
.result-table tr.best td:first-child { color: var(--raptb); }
.result-table tr:hover { background: var(--nyu-soft); }
.result-table tr.best:hover { background: linear-gradient(90deg, rgba(212,88,42,.16), rgba(87,6,140,.10)); }
.tbl-cap { text-align: center; font-size: .9rem; color: var(--muted); margin: .8rem auto 0; max-width: 760px; }

/* ---------------------------------------------------------- RESULT FIGURES */
.result-figs { margin-top: 2rem; }
.result-figs figure, .full-fig { margin: 0; text-align: center; }
.result-figs img, .full-fig img {
  width: 100%; height: auto; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
  box-shadow: 0 10px 30px rgba(28,24,34,.07);
}
.full-fig { margin: 2rem auto 0; max-width: 900px; }

/* ---------------------------------------------------------- TAKEAWAYS */
.takeaways { max-width: 860px; margin: 0 auto; list-style: none; padding: 0; }
.takeaways li {
  display: flex; gap: 1rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 1.05rem 1.25rem; margin-bottom: .85rem;
  font-size: 1.06rem; color: #2c2733;
  transition: transform .15s ease, box-shadow .15s ease;
}
.takeaways li:hover { transform: translateX(4px); box-shadow: 0 8px 22px rgba(28,24,34,.07); }
.check {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--good); color: #fff; font-size: .85rem; margin-top: .1rem;
}

/* ---------------------------------------------------------- BIBTEX */
.bibtex-wrap { position: relative; max-width: 820px; margin: 0 auto; }
.bibtex-wrap pre {
  background: var(--ink); color: #eae6f0;
  border-radius: 12px; padding: 1.5rem 1.4rem;
  font-size: .92rem; line-height: 1.6; overflow-x: auto;
  box-shadow: 0 12px 36px rgba(28,24,34,.18);
}
.copy-btn {
  position: absolute; top: .8rem; right: .8rem;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px; padding: .4rem .75rem; cursor: pointer;
  font-size: .82rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem;
  transition: background .15s ease;
}
.copy-btn:hover { background: rgba(255,255,255,.24); }
.copy-btn.copied { background: var(--good); border-color: var(--good); }

/* ---------------------------------------------------------- FOOTER */
.footer-section {
  background: #fff; border-top: 1px solid var(--line);
  padding: 2.4rem 1.2rem; text-align: center;
}
.footer-section p { color: var(--muted); font-size: .94rem; max-width: 760px; margin: 0 auto .6rem; }
.footer-section .credit { font-size: .86rem; color: #6b6478; }

/* ---------------------------------------------------------- RESPONSIVE */
/* Bulma keeps .columns side-by-side above 769px; on narrow tablets the 4 stat
   tiles get cramped, so let them wrap two-up and shrink the big numbers. */
@media (min-width: 769px) and (max-width: 960px) {
  .stat-row { flex-wrap: wrap; }
  .stat-row > .column { flex: 0 0 50%; max-width: 50%; }
  .stat-num { font-size: 2rem; }
}
@media (max-width: 768px) {
  body { font-size: 17px; }
  .mech-grid { grid-template-columns: 1fr; }
  .hero-header { padding: 3rem 1rem 2.4rem; }
  .tldr { font-size: 1.04rem; }
  .eq { font-size: .92rem; }
  .stat-num { font-size: 2.1rem; }
}

/* Respect users who prefer reduced motion: disable the reveal transitions. */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .card-tile, .stat, .full-fig, .result-figs figure, .takeaways li,
  .link-pill, .stat:hover, .card-tile:hover { transition: none !important; }
}
