:root {
  --ink: #16151a;
  --muted: #68646f;
  --line: #e6e1e9;
  --paper: #ffffff;
  --wash: #faf8fb;
  --magenta: #a42a86;
  --magenta-dark: #762063;
  --green: #2e7d4b;
  --shadow: 0 18px 50px rgba(49, 35, 52, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: var(--magenta-dark); text-decoration: none; }
a:hover { color: var(--magenta); }

.shell { width: min(980px, calc(100% - 40px)); margin-inline: auto; }
.shell.wide { width: min(1180px, calc(100% - 32px)); }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 62px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(230, 225, 233, 0.86);
  background: rgba(255, 255, 255, 0.91);
  backdrop-filter: blur(14px);
}

.wordmark { color: var(--ink); font-weight: 700; }
.nav-links { display: flex; gap: 24px; font-size: 0.9rem; }
.nav-links a { color: var(--muted); }

.hero { padding: 72px 0 44px; text-align: center; }

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--magenta);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 940px;
  margin: 0 auto 30px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2.25rem, 4vw, 3.8rem);
  line-height: 1.07;
  letter-spacing: -0.038em;
}

h2 {
  margin-bottom: 22px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

h3 { margin-bottom: 8px; font-size: 1.15rem; }

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 17px;
  font-size: 1.05rem;
}

.authors a { font-weight: 600; }
.affiliations { margin: 11px 0 0; color: var(--muted); font-size: 0.94rem; }

.actions { display: flex; justify-content: center; gap: 10px; margin-top: 29px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 21px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 650;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button.primary { color: white; background: var(--ink); }
.button.primary:hover { color: white; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(22, 21, 26, .18); }
.button.disabled { border-color: var(--line); color: #8d8991; background: #f6f4f7; cursor: not-allowed; }
.button-icon { flex: 0 0 18px; width: 18px; height: 18px; margin-right: 8px; fill: currentColor; }

.teaser { padding: 34px 0 86px; text-align: center; }

.teaser-demo {
  padding: 40px 28px 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(164, 42, 134, 0.08), transparent 36%),
    linear-gradient(160deg, #fff, #faf8fb);
  box-shadow: var(--shadow);
}

.teaser-demo > .section-kicker { margin-bottom: 8px; }
.teaser-question { margin-bottom: 10px; font-size: clamp(1.85rem, 3.4vw, 2.8rem); }
.teaser-instruction { max-width: 790px; margin: 0 auto 28px; color: var(--muted); font-size: 1.02rem; }

.teaser-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 900px;
  margin-inline: auto;
}

.teaser-card {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  perspective: 1000px;
}

.teaser-card-inner {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 15px;
  box-shadow: 0 12px 28px rgba(38, 24, 42, 0.14);
  transition: transform 680ms cubic-bezier(.2, .72, .2, 1), box-shadow 180ms ease;
  transform-style: preserve-3d;
}

.teaser-card:hover .teaser-card-inner { box-shadow: 0 18px 34px rgba(59, 31, 57, 0.22); }
.teaser-card:focus-visible { outline: 3px solid rgba(164, 42, 134, 0.4); outline-offset: 5px; }
.teaser-card[aria-pressed="true"] .teaser-card-inner { transform: rotateY(180deg); }

.teaser-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.teaser-card-front { border: 1px solid rgba(22, 21, 26, 0.12); background: #ece8ee; }
.teaser-card-front img { display: block; width: 100%; height: 100%; object-fit: cover; }

.fold-corner {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: 48px;
  height: 48px;
  padding: 5px 8px 0 0;
  align-items: flex-start;
  justify-content: flex-end;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  color: var(--magenta-dark);
  background: linear-gradient(225deg, #fff 0 47%, #d8bed2 48% 51%, rgba(255,255,255,.12) 52%);
  font-size: 0.78rem;
  font-weight: 800;
  filter: drop-shadow(-3px 4px 4px rgba(39, 25, 40, .18));
}

.reveal-label {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  color: white;
  background: rgba(22, 21, 26, .72);
  backdrop-filter: blur(7px);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.teaser-card-back {
  color: white;
  background: #211d23;
  transform: rotateY(180deg);
}

.teaser-card-back img { display: block; width: 100%; height: 100%; object-fit: cover; }
.final-image-label { position: absolute; top: 9px; left: 9px; padding: 4px 8px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; color: white; background: rgba(22,21,26,.64); backdrop-filter: blur(7px); font-size: 0.58rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.answer-overlay { position: absolute; right: 8px; bottom: 8px; left: 8px; padding: 8px 10px 9px; border: 1px solid rgba(255,255,255,.36); border-radius: 10px; color: white; background: rgba(40, 18, 36, .78); backdrop-filter: blur(8px); text-align: left; }
.answer-kicker { display: block; color: rgba(255,255,255,.72); font-size: 0.52rem; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; }
.answer-overlay strong { display: block; margin-top: 2px; font-family: "Source Serif 4", Georgia, serif; font-size: clamp(0.92rem, 1.3vw, 1.18rem); line-height: 1.08; }

.tldr-summary-block { max-width: 980px; margin: 0 auto 54px; }
.tldr-summary-block > .section-kicker { margin-bottom: 12px; }
.teaser .tldr-summary { max-width: 900px; margin: 0 auto; color: var(--ink); font-family: "Source Serif 4", Georgia, serif; font-size: clamp(1.24rem, 2.3vw, 1.58rem); font-weight: 600; line-height: 1.5; }
.tldr { max-width: 980px; margin: 64px auto 0; text-align: left; }
.tldr > .section-kicker { text-align: center; }
.tldr > h2 { max-width: 850px; margin-inline: auto; text-align: center; }
.tldr-intro { max-width: 800px; margin: 0 auto 34px !important; color: var(--muted) !important; font-size: 1.08rem !important; text-align: center; }
.overview-section { padding-top: 0; }
.overview-section > .section-kicker { text-align: center; }
.overview-section > h2 { max-width: 850px; margin-inline: auto; text-align: center; }

.architecture-visual { margin: 34px 0 24px; }
.token-flow-scroll { overflow-x: auto; padding: 4px 4px 12px; scrollbar-color: #c9c2cc transparent; }
.token-flow-diagram { width: 680px; min-width: 680px; margin-inline: auto; padding: 16px 22px; border: 1px solid var(--line); border-radius: 20px; background: #fbfafc; box-shadow: 0 14px 38px rgba(40, 25, 45, 0.08); }
.flow-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 50px; }
.flow-token-group { text-align: center; }
.flow-label { display: block; margin-bottom: 11px; font-family: "Source Serif 4", Georgia, serif; font-size: 1.2rem; font-weight: 600; line-height: 1.08; }
.prompt-group .flow-label, .contextual-group .flow-label { color: #6178ef; }
.image-group .flow-label { color: #f18b53; }
.flow-token-grid { display: grid; grid-template-columns: repeat(4, 58px); justify-content: center; gap: 9px; }
.flow-token-grid i { display: grid; width: 58px; height: 58px; place-items: center; border: 7px solid; font-size: 0.68rem; font-style: normal; font-weight: 650; }
.prompt-tokens i { border-color: #6178ef; color: #4259ca; background: #aab8f6; }
.image-tokens i { border-color: #ff9862; background: #f9b993; }
.image-tokens i:nth-child(2) { background: #e9a77e; }
.image-tokens i:nth-child(3) { background: #ffd0af; }
.image-tokens i:nth-child(4) { background: #eda06f; }

.attention-mixing { position: relative; min-height: 108px; margin-block: 0; }
.attention-mixing > span { position: absolute; z-index: 2; top: 50%; left: 50%; padding: 7px 12px; border: 1px solid rgba(255,255,255,.62); border-radius: 999px; color: white; background: rgba(39, 34, 47, .78); backdrop-filter: blur(7px); font-size: 0.7rem; font-weight: 750; letter-spacing: 0.04em; transform: translate(-50%, -50%); white-space: nowrap; }
.attention-mixing svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.attention-mixing line { stroke-width: 1.75; opacity: .18; vector-effect: non-scaling-stroke; }
.attention-mixing .prompt-connection { stroke: #5e78ee; }
.attention-mixing .image-connection { stroke: #ff9862; }

.contextual-tokens i { border-color: #6178ef; color: #253990; background: #aab8f6; font-family: "Noto Sans Cuneiform", "Segoe UI Historic", serif; font-size: 1.45rem; font-weight: 400; }
.contextual-group small { display: block; margin-top: 8px; color: var(--muted); font-size: 0.7rem; }
.updated-image-tokens i { background: linear-gradient(135deg, #ffd0af, #e99468); }

.contribution-intro { max-width: 820px; margin: 34px auto 16px !important; color: var(--ink) !important; font-family: "Source Serif 4", Georgia, serif; font-size: 1.3rem !important; font-weight: 600; text-align: center; }
.contribution-flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 820px; margin-inline: auto; }
.contribution { display: flex; min-height: 210px; gap: 16px; padding: 26px 23px; border-radius: 16px; color: white; text-align: left; }
.contribution.read { background: linear-gradient(135deg, #87246f, #ad3b90); }
.contribution.supervise { background: linear-gradient(135deg, #25673f, #388c56); }
.contribution-number { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.52); border-radius: 50%; font-weight: 750; }
.contribution h3 { margin: 0 0 4px; font-family: "Source Serif 4", Georgia, serif; font-size: 1.35rem; }
.contribution p { margin: 0; color: rgba(255,255,255,.86); font-size: 0.91rem; }
.contribution .contribution-conclusion { display: flex; margin-top: 14px; padding-top: 13px; align-items: flex-start; gap: 8px; border-top: 1px solid rgba(255,255,255,.28); color: white; }
.contribution-conclusion .insight-icon { flex: 0 0 auto; font-size: 1.5rem; line-height: 1; }
.contribution-conclusion strong { font-size: 0.9rem; line-height: 1.45; }

.section { padding: 88px 0; }
.tinted { border-block: 1px solid var(--line); background: var(--wash); }
.prose { max-width: 820px; }
.prose p { color: #3d3941; }
.section-intro { max-width: 780px; margin-bottom: 34px; color: var(--muted); font-size: 1.06rem; }

.paper-figure {
  margin: 32px 0 50px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 36px rgba(40, 25, 45, 0.07);
}

.paper-figure.compact { max-width: 820px; margin-inline: auto; }
.paper-figure img { display: block; width: 100%; height: auto; }

.reading-result { max-width: 820px; margin: 58px auto 20px; text-align: center; }
.reading-result h3, .readability-copy h3, .quantitative-results h3 { margin-bottom: 8px; font-family: "Source Serif 4", Georgia, serif; font-size: 1.65rem; }
.reading-result p, .readability-copy p, .quantitative-results > p { margin-bottom: 0; color: var(--muted); }

.readability-block {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(420px, 1.22fr);
  align-items: center;
  gap: 46px;
  margin: 66px 0 10px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 36px rgba(40, 25, 45, 0.07);
}

.readability-copy p + p { margin-top: 12px; }
.readability-chart img { display: block; width: 100%; height: auto; }
.plot-legend { display: grid; grid-template-columns: repeat(2, max-content); justify-content: center; gap: 7px 24px; width: 82%; margin: 0 0 12px 18%; color: var(--muted); font-size: 0.74rem; }
.legend-item { position: relative; padding-left: 37px; }
.legend-item::before { position: absolute; top: 50%; left: 0; width: 28px; border-top: 3px solid; content: ""; transform: translateY(-50%); }
.legend-item.blue::before { border-color: #327da8; }
.legend-item.gold::before { border-color: #dda713; }
.legend-item.dashed::before { border-top-style: dashed; }

.quantitative-results { margin-top: 76px; }
.quantitative-results > .section-kicker { margin-bottom: 8px; }
.table-scroll { overflow-x: auto; margin-top: 22px; }
.results-table { width: 100%; min-width: 690px; border-collapse: collapse; font-size: 0.9rem; }
.results-table th, .results-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: right; }
.results-table th:first-child, .results-table td:first-child { text-align: left; }
.results-table th { color: var(--muted); background: var(--wash); font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; }
.results-table tbody tr:hover { background: #fbf9fc; }
.results-table .coal-row { background: #f4edf3; }
.results-table .coal-row td:first-child { color: var(--magenta-dark); font-weight: 700; }

.result-section { margin-top: 24px; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 12px 36px rgba(40, 25, 45, 0.07); }
.result-section + .result-section { margin-top: 36px; }
.result-heading { display: grid; grid-template-columns: minmax(240px, .72fr) minmax(360px, 1.28fr); align-items: end; gap: 30px; }
.result-heading h3 { margin: 0; }
.result-heading p { margin: 0; color: var(--muted); }
.fine-table { min-width: 520px; }
.fine-table .best-row { background: var(--magenta-dark); color: white; }
.fine-table .best-row:hover { background: var(--magenta-dark); color: white; }
.fine-table .best-row td:first-child { font-weight: 750; }

#alignment { padding-bottom: 52px; }
.comparison-section { padding-top: 52px; background: #fff; }
.scroll-hint { margin: 0 0 28px; color: var(--muted); font-size: 0.82rem; }

.comparison-card {
  margin: 0 0 30px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--wash);
}

.comparison-card h3 {
  margin-bottom: 16px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 500;
}

.comparison-scroll { overflow-x: auto; padding-bottom: 5px; scrollbar-color: #c9c2cc transparent; }
.comparison-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 8px; min-width: 840px; }
.comparison-item { margin: 0; }

.comparison-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid #ded8e1;
  border-radius: 8px;
  background: #eee;
  cursor: zoom-in;
}

.comparison-item figcaption { padding-top: 7px; color: var(--muted); font-size: 0.8rem; text-align: center; }
.comparison-item.ours img { border: 3px solid var(--magenta); }
.comparison-item.ours figcaption { color: var(--magenta-dark); font-weight: 750; }

.image-lightbox {
  width: min(820px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: white;
  box-shadow: 0 30px 90px rgba(12, 9, 14, 0.4);
}

.image-lightbox::backdrop { background: rgba(15, 12, 17, 0.78); backdrop-filter: blur(4px); }
.image-lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 120px); margin: auto; border-radius: 10px; }
.image-lightbox p { margin: 12px 40px 0; color: var(--muted); text-align: center; }
.lightbox-close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: white; background: rgba(22, 21, 26, 0.82); font-size: 1.45rem; cursor: pointer; }

pre {
  overflow-x: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #f5f1f6;
  background: #211d23;
  font-size: 0.88rem;
  line-height: 1.55;
}

footer { padding: 34px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.84rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; }

@media (max-width: 980px) {
  .teaser-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 760px) {
  .site-nav { position: static; justify-content: center; }
  .nav-links { display: none; }
  .hero { padding-top: 58px; }
  h1 { font-size: clamp(2.15rem, 10vw, 3.2rem); }
  .section { padding: 64px 0; }
  .teaser-demo { margin-inline: -4px; padding: 30px 14px 24px; border-radius: 18px; }
  .teaser-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .contribution-flow, .readability-block, .result-heading { grid-template-columns: 1fr; }
  .token-flow-scroll { margin-inline: -8px; padding-inline: 0; }
  .paper-figure { margin-inline: -8px; padding: 8px; border-radius: 10px; }
  .readability-block { margin-inline: -8px; padding: 22px 14px; }
  .result-section { margin-inline: -8px; padding: 22px 14px; }
  .comparison-card { margin-inline: -8px; padding: 16px 12px; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .teaser-card-inner { transition-duration: 1ms; }
}
