/* =====================================================
   Divide & Learn — 3-color system
   • Charcoal:  text architecture (headings, body)
   • Indigo:    structural accent (buttons, badges, borders, links, underlines)
   • Green:     RESERVED for inline <strong> emphasis only
   ===================================================== */

:root {
  /* charcoal scale */
  --ink:         #111827;   /* headings */
  --ink-body:    #1F2937;   /* body text */
  --muted:       #4B5563;   /* secondary */
  --muted-2:     #6B7280;   /* tertiary, captions */
  --line:        #E5E7EB;   /* hairline borders */
  --line-soft:   #F3F4F6;   /* very subtle dividers */
  --bg-soft:     #F9FAFB;   /* card backgrounds */
  --bg-rhythm:   #FAFAFA;   /* section rhythm */

  /* indigo accent (structural) */
  --indigo-ink:   #312E81;
  --indigo-deep:  #4338CA;
  --indigo:       #4F46E5;
  --indigo-mid:   #6366F1;
  --indigo-soft:  #A5B4FC;
  --indigo-pale:  #C7D2FE;
  --indigo-wash:  #EEF2FF;

  /* green — ONLY for <strong> */
  --emph:         #2E7D52;
  --emph-soft:    #B5E5C7;
}

/* ---------- base ---------- */
body {
  font-family: 'Inter', 'Noto Sans', sans-serif;
  background: #ffffff;
  color: var(--ink-body);
  line-height: 1.65;
}

/* widen the body content container (Bulma's is-max-desktop is 960px; we want a bit more breathing room) */
.section .container.is-max-desktop {
  max-width: 1080px;
}

/* THE rule the user asked for: green is for inline bold only */
strong, b { color: var(--emph); font-weight: 700; }

a { color: var(--indigo); }
a:hover { color: var(--indigo-deep); text-decoration: underline; }

em { color: var(--ink-body); font-style: italic; }

/* ---------- HERO ---------- */
.hero-main {
  background: #ffffff;
  padding: 4rem 1.5rem 2.5rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.hero-main .container {
  max-width: 1180px;
  margin: 0 auto;
}

.publication-title {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 1.5rem !important;
  line-height: 1.2;
}
.publication-title .amp {
  color: var(--indigo);
  font-style: italic;
  font-weight: 500;
}

.publication-authors {
  font-family: 'Google Sans', sans-serif;
  margin-bottom: 0.5rem;
  color: var(--ink-body);
}
.publication-authors a { color: var(--indigo); font-weight: 500; }
.publication-authors .author-block { display: inline-block; margin: 0 0.3rem; }

.publication-affiliations {
  color: var(--muted);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.publication-affiliations .dot { margin: 0 0.5rem; color: var(--line); }

.publication-venue {
  font-family: 'Google Sans', sans-serif;
  color: var(--emph);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}
.publication-venue strong { color: var(--emph); font-weight: 700; }

/* ---------- link buttons ---------- */
.publication-links { margin-top: 0.5rem; }

.publication-links .button {
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
  background: var(--ink);
  color: white;
  border: 1px solid var(--ink);
  margin: 0.25rem;
  transition: all 0.15s ease;
  border-radius: 8px;
}
.publication-links .button:hover {
  background: var(--indigo-deep);
  border-color: var(--indigo-deep);
  color: white;
  transform: translateY(-1px);
  text-decoration: none;
}
.publication-links .button .icon { color: var(--indigo-soft); }
.publication-links .button:hover .icon { color: white; }

/* ---------- TEASER GIF ---------- */
.teaser-gif {
  padding: 2rem 1rem 1.5rem;
  background: #ffffff;
}
.gif-wrap {
  max-width: 820px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
  background: white;
}
.teaser-img { width: 100%; display: block; }
.teaser-caption {
  text-align: center;
  font-family: 'Google Sans', sans-serif;
  color: var(--muted);
  margin-top: 1rem;
  font-size: 1.02rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- TAGLINE (two-line summary, lives inside the hero) ---------- */
.hero-tagline-inner {
  max-width: 1000px;
  margin: 2.25rem auto 0;
  font-family: 'Google Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink-body);
  letter-spacing: -0.005em;
  text-align: center;
}
.hero-tagline-inner .accent-rule {
  display: block;
  width: 36px;
  height: 3px;
  background: var(--emph);
  border-radius: 2px;
  margin: 0 auto 1rem;
}

/* ---------- sections (shared) ---------- */
.section {
  padding: 4rem 1.5rem;
}
.section-title {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--ink);
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}
.section-title::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  background: var(--indigo);
  border-radius: 2px;
  margin-top: 0.75rem;
}
.section-lede {
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 2.25rem;
  line-height: 1.65;
}

/* sub-section headings inside Results */
.subsection-title {
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
  margin: 2.5rem 0 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--indigo-mid);
}
.subsection-lede {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* ---------- D&L wordmark ---------- */
.dnl {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* ---------- OVERVIEW ---------- */
.section-overview { background: white; }
.overview-content p { font-size: 1.05rem; }

.overview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.stat {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}
.stat-num {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 2.1rem;
  color: var(--indigo-deep);
  line-height: 1.1;
}
.stat-unit { font-size: 1.3rem; color: var(--indigo-mid); }
.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
@media (max-width: 768px) {
  .overview-stats { grid-template-columns: 1fr; }
}

/* ---------- KEY IDEA / ARCHITECTURE ---------- */
.section-key-idea { background: white; }

.architecture-figure {
  margin: 2rem 0;
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}
.architecture-figure img { width: 100%; display: block; border-radius: 6px; }

.step-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
.step-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  border-top: 3px solid var(--indigo);
}
.step-tag {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--indigo-deep);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.step-card p {
  font-size: 0.92rem;
  color: var(--ink-body);
  margin: 0;
  line-height: 1.55;
}
@media (max-width: 900px) {
  .step-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .step-cards { grid-template-columns: 1fr; }
}

/* ---------- WHAT YOU CAN DO ---------- */
.section-uses { background: var(--bg-rhythm); }

.use-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.use-row {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 1.5rem;
  align-items: stretch;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  transition: all 0.2s ease;
}
.use-row:hover {
  border-color: var(--indigo-soft);
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.08);
  transform: translateY(-2px);
}

.use-left h3 {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0.5rem 0 0;
  line-height: 1.2;
}
.use-tag {
  display: inline-block;
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo-deep);
  background: var(--indigo-wash);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.use-mid {
  border-left: 2px solid var(--line);
  padding-left: 1.5rem;
  display: flex;
  align-items: center;
}
.use-scenario {
  font-size: 0.98rem;
  color: var(--ink-body);
  margin: 0;
  line-height: 1.6;
}

.use-mapping {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--line);
  font-size: 0.85rem;
}
.use-mapping > div {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
}
.use-mapping > div:last-child { border-bottom: none; }
.m-key {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  color: var(--indigo-deep);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  align-self: center;
}
.m-val {
  color: var(--ink-body);
  font-size: 0.88rem;
  line-height: 1.4;
}

.use-footer {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--indigo);
  border-radius: 4px;
  font-size: 1rem;
  color: var(--ink-body);
}

@media (max-width: 900px) {
  .use-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .use-mid {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 1rem;
  }
}

/* ---------- METHOD ---------- */
.section-method { background: white; }

.mechanism {
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}
.mech-title {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mech-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--indigo);
  color: white;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
}
.mechanism p { color: var(--ink-body); margin-bottom: 0.75rem; }
.mechanism p:last-child { margin-bottom: 0; }

.bound-box {
  margin-top: 2rem;
  background: white;
  border: 2px solid var(--indigo);
  border-radius: 14px;
  padding: 1.75rem;
}
.bound-label {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo-deep);
  margin-bottom: 0.75rem;
}
.bound-eq {
  font-size: 1.15rem;
  overflow-x: auto;
  margin: 0.5rem 0 1.25rem;
}
.bound-step-label {
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  margin: 1.25rem 0 0.35rem;
  letter-spacing: -0.005em;
}
.bound-step-label:first-of-type { margin-top: 0.75rem; }
.bound-final {
  background: var(--indigo-wash);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 1.2rem;
}
.bound-note {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--muted);
}

/* ---------- RESULTS ---------- */
.section-results { background: var(--bg-rhythm); }

/* HW-SW headline card */
.headline-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  margin: 1rem 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}
.headline-narrative h4 {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--indigo-deep);
  margin: 0 0 0.75rem;
  letter-spacing: -0.005em;
}
.headline-narrative p {
  color: var(--ink-body);
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
}
.headline-narrative p:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
  .headline-card { grid-template-columns: 1fr; }
}

/* result tables */
.result-table-wrap {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  overflow-x: auto;
}
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
}
.result-table caption {
  caption-side: bottom;
  text-align: left;
  padding-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}
.result-table th, .result-table td {
  padding: 0.6rem 0.75rem;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}
.result-table thead th {
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--line);
}
.result-table tbody th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-body);
  background: var(--bg-soft);
}
.result-table tbody tr:last-child td,
.result-table tbody tr:last-child th { border-bottom: none; }
/* Best overall (★) — green like inline strong */
.result-table .best { color: var(--emph); font-weight: 700; }
/* Best general-purpose (underline) */
.result-table .gen-best { text-decoration: underline; text-decoration-color: var(--indigo-mid); text-underline-offset: 3px; font-weight: 600; }
/* Highlight D&L columns/rows */
.result-table .dnl-row {
  background: var(--indigo-wash);
}
.result-table .dnl-row th {
  background: var(--indigo-wash);
  color: var(--indigo-deep);
  font-weight: 700;
}
.result-table .group-sep { border-left: 2px dashed var(--line); }

/* Plot figures */
.result-figure {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}
.result-figure img { width: 100%; display: block; }
.result-figure figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
}

.result-takeaways {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.result-takeaways li {
  padding: 0.5rem 0;
  font-size: 0.98rem;
  color: var(--ink-body);
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.result-takeaways i { color: var(--indigo); flex-shrink: 0; margin-top: 0.3rem; }

/* ---------- BIBTEX ---------- */
.section-bibtex { background: var(--ink); padding: 3.5rem 1.5rem; }
.section-bibtex .section-title { color: white; }
.section-bibtex .section-title::after { background: var(--indigo-mid); }

.bibtex-block {
  background: rgba(255, 255, 255, 0.04);
  color: #E5E7EB;
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  overflow-x: auto;
  line-height: 1.65;
}

/* ---------- FOOTER ---------- */
.footer {
  background: #FAFAFA;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--line);
}
.footer-text {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}
.footer-text a { color: var(--indigo); font-weight: 500; }

/* ---------- prose paragraphs (normal flowing text in a section) ---------- */
.prose-para {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-body);
  margin: 0 0 1.25rem;
}

/* ---------- STICKY RIGHT-SIDE TOC ---------- */
.page-toc {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 180px;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.88rem;
  z-index: 50;
}
.page-toc .toc-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.75rem;
  padding-left: 0.85rem;
}
.page-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}
.page-toc li { margin: 0; }
.page-toc .toc-sub {
  border-left: none;
  padding-left: 0.5rem;
  margin: 0;
}
.page-toc .toc-sub a {
  font-size: 0.82rem;
  padding: 0.3rem 0.85rem;
  color: var(--muted-2);
}
.page-toc a {
  display: block;
  padding: 0.45rem 0.85rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.35;
}
.page-toc a:hover {
  color: var(--ink);
  text-decoration: none;
}
.page-toc a.active {
  color: var(--indigo-deep);
  border-left-color: var(--indigo);
  font-weight: 600;
}
/* Hide TOC on narrower viewports (where it would overlap content) */
@media (max-width: 1500px) {
  .page-toc { display: none; }
}

/* ---------- small screen polish ---------- */
@media (max-width: 768px) {
  .publication-title { font-size: 2.1rem; }
  .publication-subtitle { font-size: 1.6rem; }
  .publication-venue { font-size: 1.2rem; }
  .hero-tagline-inner { font-size: 1.05rem; }
}
@media (max-width: 480px) {
  .publication-title { font-size: 1.8rem; }
  .publication-subtitle { font-size: 1.3rem; }
  .section-title { font-size: 1.6rem; }
  .section { padding: 2.5rem 1rem; }
  .hero-main { padding: 2.5rem 1rem 2rem; }
}
