/* =================================================================
   SymmDiff project page
   Aesthetic: editorial / clinical · serif headlines · symmetric layout
   ================================================================= */

:root {
  /* Palette — warm paper + ink, single coral accent (echoes anomaly heatmaps) */
  --paper:        #FAF7F2;
  --paper-2:      #F1ECE3;
  --ink:          #14181F;
  --ink-soft:     #2A2F38;
  --muted:        #6E6A60;
  --line:         #D9D2C2;
  --line-soft:    #E6DFD0;
  --accent:       #C04A3C;   /* clinical coral (heatmap red) */
  --accent-soft:  #E8B3AB;
  --teal:         #1F5862;   /* secondary, very sparing */
  --code-bg:      #1A1E26;
  --code-ink:     #E8E2D2;

  --radius:       2px;
  --maxw:         1180px;
  --maxw-narrow:  760px;

  --shadow-soft:  0 1px 0 rgba(20,24,31,.06), 0 18px 40px -24px rgba(20,24,31,.18);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); transition: color .2s ease, border-color .2s ease; }
a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}
.narrow { max-width: var(--maxw-narrow); }
.narrow-text { max-width: var(--maxw-narrow); color: var(--ink-soft); }

.section {
  padding: 96px 0;
  position: relative;
}
.section-alt {
  background: var(--paper-2);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 48px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.section-title .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 500;
  display: inline-block;
  border: 1px solid var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius);
  text-transform: uppercase;
  transform: translateY(-6px);
}
.subhead {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  margin: 56px 0 16px;
  letter-spacing: -0.01em;
}

/* =================================================================
   Decorative symmetry axis
   ================================================================= */
.symmetry-axis {
  position: fixed;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--line) 12%,
    var(--line) 88%,
    transparent 100%);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  transform: translateX(-0.5px);
}
.symmetry-axis::before,
.symmetry-axis::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateX(-50%);
}
.symmetry-axis::before { top: 14%; }
.symmetry-axis::after  { bottom: 14%; }

/* =================================================================
   HERO
   ================================================================= */
.hero {
  padding: 96px 0 64px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.venue-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 40px;
}
.venue-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,74,60,.45); }
  50%      { box-shadow: 0 0 0 8px rgba(192,74,60,0); }
}

.title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  margin: 0 0 32px;
  line-height: 1;
}
.title-mark {
  display: block;
  font-size: clamp(64px, 11vw, 144px);
  font-weight: 300;
  letter-spacing: -0.045em;
  font-style: italic;
  position: relative;
  line-height: 1;
}
.title-mark .mirror {
  display: inline-block;
  /* subtle nod to the symmetry idea — a vertical hairline through the "D" */
  position: relative;
}
.title-mark .mirror::before {
  content: '';
  position: absolute;
  top: 8%; bottom: 8%;
  left: 4px;
  width: 1px;
  background: var(--accent);
  opacity: 0.75;
}
.subtitle {
  display: block;
  font-style: normal;
  font-weight: 400;
  font-size: clamp(18px, 2.1vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink-soft);
  margin-top: 18px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.authors {
  margin: 32px auto 12px;
  max-width: 820px;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.8;
}
.authors .author { display: inline-block; }
.authors sup { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent); margin-left: 1px; }
.authors .sep, .affiliations .sep { color: var(--line); margin: 0 10px; }
.affiliations {
  font-size: 13px;
  color: var(--muted);
  max-width: 820px;
  margin: 0 auto 40px;
  line-height: 1.8;
}
.affiliations sup { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent); }

/* Action buttons */
.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 48px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.005em;
  transition: all .2s ease;
  cursor: pointer;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-1px);
}
.btn.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.btn .tag {
  background: var(--accent-soft);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  margin-left: 4px;
}
.btn:hover .tag { background: var(--paper); color: var(--ink); }

/* Teaser strip */
.teaser {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 28px 32px;
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  text-align: left;
}
.teaser-text {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}
.teaser em { color: var(--accent); font-style: italic; }

/* =================================================================
   Abstract
   ================================================================= */
#abstract p {
  font-size: 17.5px;
  margin: 0 0 22px;
  color: var(--ink-soft);
}
#abstract strong { color: var(--ink); }

/* =================================================================
   Contributions
   ================================================================= */
.contributions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.contribution {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
}
.contribution:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}
.contribution-num {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 14px;
}
.contribution h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 19px;
  margin: 0 0 12px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.contribution p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}
.contribution strong { color: var(--ink); font-weight: 600; }

/* =================================================================
   Method
   ================================================================= */
.method-intro {
  margin: 0 auto 56px;
  color: var(--ink-soft);
  font-size: 17px;
}
.method-intro p { margin: 0; }
.method-intro strong { color: var(--ink); }

.figure {
  margin: 24px auto 32px;
}
.figure-wide {
  max-width: 100%;
}
.figure img {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px;
}
.figure figcaption {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.figure figcaption strong { color: var(--ink); font-weight: 600; }

.method-steps {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.step {
  position: relative;
  padding: 28px 28px 28px 32px;
  border-left: 1px solid var(--line);
}
.step-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 8px;
}
.step h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 20px;
  margin: 4px 0 10px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.65;
}
.step em { font-style: italic; color: var(--ink); }
.step strong { color: var(--ink); font-weight: 600; }

/* =================================================================
   Results — tables
   ================================================================= */
.table-wrap {
  margin: 24px 0 32px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.results-table thead th {
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  font-family: 'Manrope', sans-serif;
}
.results-table thead tr:first-child th { border-bottom: 1px solid var(--line-soft); }
.results-table tbody td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.results-table tbody td:first-child {
  text-align: left;
  color: var(--ink);
  font-weight: 500;
}
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table tbody tr.best {
  background: linear-gradient(90deg, rgba(192,74,60,0.06), rgba(192,74,60,0.02));
}
.results-table tbody tr.best td {
  color: var(--ink);
  font-weight: 500;
}
.results-table tbody tr.best td:first-child {
  position: relative;
  padding-left: 24px;
}
.results-table tbody tr.best td:first-child::before {
  content: '';
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 1px;
}
.results-table .ref {
  color: var(--muted);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  margin-left: 4px;
}

/* =================================================================
   Takeaways
   ================================================================= */
.takeaways {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 8px;
}
.takeaway {
  display: flex;
  gap: 20px;
  padding: 32px 32px;
  border-top: 1px solid var(--line-soft);
}
.takeaway:nth-child(1), .takeaway:nth-child(2) { border-top: none; }
.takeaway:nth-child(odd) { border-right: 1px solid var(--line-soft); padding-left: 0; }
.takeaway:nth-child(even) { padding-right: 0; padding-left: 32px; }
.t-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  flex-shrink: 0;
  padding-top: 4px;
}
.takeaway p {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.takeaway em { color: var(--accent); font-style: italic; }

/* =================================================================
   BibTeX block
   ================================================================= */
.bibtex-wrap {
  position: relative;
  margin: 24px 0 16px;
}
.bibtex-wrap pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 28px 32px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.6;
  border: 1px solid var(--ink);
}
.bibtex-wrap code {
  font-family: inherit;
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: 14px; right: 14px;
  background: transparent;
  color: var(--code-ink);
  border: 1px solid rgba(232, 226, 210, 0.25);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s ease;
}
.copy-btn:hover {
  background: var(--code-ink);
  color: var(--code-bg);
  border-color: var(--code-ink);
}
.copy-btn.copied { background: var(--accent); color: var(--paper); border-color: var(--accent); }

.note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}

/* =================================================================
   Footer
   ================================================================= */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 56px 0;
  border-top: 1px solid var(--ink);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 26px;
  letter-spacing: -0.015em;
}
.footer-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-top: 4px;
}
.footer-right {
  text-align: right;
  font-size: 13px;
  color: var(--paper-2);
  max-width: 480px;
  line-height: 1.6;
}
.footer-right p { margin: 0 0 8px; }
.footer-right a {
  color: var(--paper);
  border-bottom-color: rgba(250, 247, 242, 0.3);
}
.footer-right a:hover {
  color: var(--accent-soft);
  border-bottom-color: var(--accent-soft);
}
.footer-right .cc {
  font-size: 11.5px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 900px) {
  .contributions-grid { grid-template-columns: 1fr; }
  .method-steps { grid-template-columns: 1fr; }
  .takeaways { grid-template-columns: 1fr; }
  .takeaway { border-right: none !important; padding: 24px 0 !important; }
  .takeaway + .takeaway { border-top: 1px solid var(--line-soft); }
  .symmetry-axis { display: none; }
  .section { padding: 72px 0; }
  .hero { padding: 64px 0 40px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 22px; }
  .section-title { gap: 12px; flex-wrap: wrap; }
  .actions .btn { padding: 10px 14px; font-size: 13px; }
  .teaser { padding: 22px 24px; }
  .teaser-text { font-size: 16px; }
  .figure img { padding: 12px; }
  .results-table { font-size: 13px; }
  .results-table thead th, .results-table tbody td { padding: 10px 10px; }
  .footer-row { flex-direction: column; }
  .footer-right { text-align: left; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
