:root {
  --bg: #f4f6f8;
  --paper: rgba(255, 255, 252, 0.92);
  --ink: #1f2328;
  --muted: #566579;
  --line: rgba(31, 79, 130, 0.16);
  --accent: #1f4f82;
  --accent-strong: #12345a;
  --shadow: 0 24px 60px rgba(20, 49, 82, 0.13);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(71, 111, 153, 0.08), transparent 30%),
    radial-gradient(circle at top right, rgba(116, 143, 168, 0.07), transparent 28%),
    linear-gradient(180deg, #fbfcfc 0%, var(--bg) 100%);
  font-family: "Google Sans", sans-serif;
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Crimson Text", serif;
}

h1 {
  margin: 0 auto;
  max-width: 920px;
  font-size: clamp(2.4rem, 3.2vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.authors,
.affiliation {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.affiliation {
  margin-top: 6px;
}

.links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 12px 18px;
  border: 1px solid rgba(31, 35, 40, 0.22);
  border-radius: 999px;
  background: #1f2328;
  color: #f8f4ec;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(31, 35, 40, 0.18);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.links a:hover {
  transform: translateY(-1px);
  background: #121519;
  border-color: rgba(31, 35, 40, 0.42);
}

.arxiv-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.arxiv-link::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: url("assets/arxiv.png") center / contain no-repeat;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.github-link::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82A7.6 7.6 0 0 1 8 3.87c.68 0 1.36.09 2 .26 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.huggingface {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.huggingface::before {
  content: "\1F917";
  line-height: 1;
}

main {
  display: grid;
  gap: 22px;
}

.stack {
  display: grid;
  gap: 22px;
}

.figure-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 26px 28px;
}

.abstract-card {
  padding-top: 24px;
}

.media-card {
  display: grid;
  gap: 18px;
}

.media-copy {
  display: grid;
  gap: 8px;
}

.section-kicker {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.figure-block {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(60, 52, 43, 0.08);
  padding: 14px;
}

.figure-block img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
}

.pipeline-figure {
  position: relative;
}

.pipeline-image-wrap {
  position: relative;
}

.pipeline-hotspot {
  position: absolute;
  z-index: 1;
  border: 0;
  border-radius: 12px;
  background: rgba(91, 169, 229, 0);
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.pipeline-hotspot:hover,
.pipeline-hotspot:focus-visible,
.pipeline-hotspot.is-active {
  outline: 0;
  background: rgba(91, 169, 229, 0.12);
  box-shadow: 0 0 0 2px rgba(91, 169, 229, 0.34);
}

.pipeline-hotspot-layout {
  left: 16.1%;
  top: 45.1%;
  width: 7.9%;
  height: 8.6%;
}

.pipeline-hotspot-straighten {
  left: 45.9%;
  top: 45.1%;
  width: 7.8%;
  height: 8.5%;
}

.pipeline-hotspot-semantic {
  left: 59.8%;
  top: 45.1%;
  width: 7.9%;
  height: 8.6%;
}

.pipeline-hotspot-mask {
  left: 59.8%;
  top: 61.3%;
  width: 7.9%;
  height: 8.6%;
}

.pipeline-hotspot-brackets {
  left: 31.0%;
  top: 23.1%;
  width: 7.8%;
  height: 8.5%;
}

.pipeline-bubbles {
  --pipeline-pointer-x: 20.1%;
  --pipeline-pointer-height: 28px;
  --pipeline-pointer-border-height: calc(var(--pipeline-pointer-height) + 2px);
  position: relative;
  min-height: 180px;
  margin-top: 26px;
}

.pipeline-bubble {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(0, 1.8fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(91, 169, 229, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(245, 250, 255, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 10px 24px rgba(35, 59, 84, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.pipeline-bubble::before,
.pipeline-bubble::after {
  content: "";
  position: absolute;
  left: var(--pipeline-pointer-x);
  width: 0;
  height: 0;
  transform: translateX(-50%);
}

.pipeline-bubble::before {
  top: calc(-1 * var(--pipeline-pointer-border-height));
  border-right: 18px solid transparent;
  border-bottom: var(--pipeline-pointer-border-height) solid rgba(91, 169, 229, 0.18);
  border-left: 18px solid transparent;
}

.pipeline-bubble::after {
  top: calc(-1 * var(--pipeline-pointer-height));
  border-right: 16px solid transparent;
  border-bottom: var(--pipeline-pointer-height) solid rgba(255, 255, 255, 0.92);
  border-left: 16px solid transparent;
}

.pipeline-bubble.is-active {
  opacity: 1;
  transform: translateY(0);
}

.pipeline-bubble-copy {
  display: grid;
  gap: 6px;
}

.pipeline-bubble-step {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pipeline-bubble-copy p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.pipeline-bubble-images {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.pipeline-bubble-images img {
  width: auto;
  max-width: 28%;
  max-height: 136px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(31, 35, 40, 0.12);
  object-fit: contain;
}

.pipeline-bubble-images img:only-child {
  max-width: 60%;
}

[data-pipeline-bubble="semantic"] .pipeline-bubble-images {
  gap: 72px;
}

[data-pipeline-bubble="semantic"] .pipeline-bubble-images img {
  clip-path: inset(20% 40% 20% 0);
  transform: scale(2);
  transform-origin: left center;
}

[data-pipeline-bubble="semantic"] .pipeline-bubble-images img:last-child {
  filter: invert(1);
}

[data-pipeline-bubble="straighten"] {
  grid-template-columns: minmax(240px, 1.1fr) minmax(0, 1.5fr);
}

[data-pipeline-bubble="straighten"] .pipeline-bubble-images {
  gap: 25px;
}

[data-pipeline-bubble="straighten"] .pipeline-bubble-images img {
  transform: scale(1.3);
}

.pipeline-example-arrow {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 900;
  line-height: 1;
}

.pipeline-bracket-crop,
.pipeline-token-output {
  flex: 1 1 0;
  max-width: 42%;
  height: 136px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(31, 35, 40, 0.12);
}

.pipeline-bracket-crop {
  position: relative;
  flex: 0 0 auto;
  width: calc(136px * 1804 / 780 * 0.12);
  overflow: hidden;
}

.pipeline-bracket-crop img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: auto;
  max-width: none !important;
  max-height: none;
  box-shadow: none;
  border-radius: 0;
}

.pipeline-token-output {
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: "Crimson Text", Georgia, serif;
  font-size: clamp(2.4rem, 3.2vw, 4.4rem);
  font-weight: 700;
}

.problem-figure img {
  max-width: 480px;
  margin: 0 auto;
}

.anim-narrow {
  max-width: 480px;
  margin: 0 auto;
}

.voice-target-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 18px 0;
}

.voice-target-item {
  flex: 1 1 0;
  margin: 0;
  text-align: center;
}

.voice-target-item img,
.voice-target-item iframe {
  display: block;
  width: 100%;
  height: 260px;
  border: 0;
  object-fit: contain;
}

.voice-target-item figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.voice-target-arrow {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
}

.solver-gallery {
  margin-top: 14px;
  text-align: center;
}

.solver-figure {
  display: inline-block;
  width: 40%;
  margin: 0 18px 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  vertical-align: top;
  text-align: left;
}

.solver-figure:nth-child(2n) {
  margin-right: 18px;
}

.solver-figure img {
  max-height: none;
}

.solver-figure figcaption {
  margin: 0 0 4px;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
}

.solver-player {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: outline-color 160ms ease, box-shadow 160ms ease;
}

.solver-player.is-playing {
  outline: 2px solid rgba(91, 169, 229, 0.58);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(91, 169, 229, 0.1);
}

.solver-player object {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.solver-play-button,
.solver-pause-button {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(91, 169, 229, 0.28);
  box-shadow: 0 4px 18px rgba(66, 132, 184, 0.26);
  backdrop-filter: blur(2px);
  opacity: 0.72;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.solver-play-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid rgba(255, 255, 255, 0.96);
  transform: translate(-50%, -50%);
}

.solver-pause-button {
  display: none;
  opacity: 0;
}

.solver-pause-button::before,
.solver-pause-button::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 24px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-50%);
}

.solver-pause-button::before {
  left: 18px;
}

.solver-pause-button::after {
  right: 18px;
}

.solver-player:hover .solver-play-button,
.solver-player:focus-visible .solver-play-button,
.solver-player:hover .solver-pause-button,
.solver-player:focus-visible .solver-pause-button {
  background: rgba(91, 169, 229, 0.46);
  box-shadow: 0 6px 22px rgba(66, 132, 184, 0.38);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08);
}

.solver-player:focus-visible {
  outline: 2px solid rgba(91, 169, 229, 0.8);
  outline-offset: 4px;
}

.solver-player.is-playing .solver-play-button {
  display: none;
}

.solver-player.is-playing:hover .solver-pause-button,
.solver-player.is-playing:focus-visible .solver-pause-button {
  display: block;
}

.score-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.score-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid rgba(31, 35, 40, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.score-tab:hover,
.score-tab:focus-visible {
  border-color: rgba(138, 59, 46, 0.38);
  color: var(--accent-strong);
  box-shadow: 0 6px 16px rgba(65, 43, 28, 0.1);
}

.score-tab.is-active {
  border-color: rgba(138, 59, 46, 0.52);
  background: var(--accent);
  color: #fffaf3;
}

.playground-embed {
  margin-top: 18px;
  border: 1px solid rgba(60, 52, 43, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.playground-embed iframe {
  display: block;
  width: 100%;
  height: min(78vh, 760px);
  min-height: 520px;
  border: 0;
}

.figure-block figcaption {
  margin-top: 12px;
  font-size: 0.98rem;
  line-height: 1.62;
  color: var(--muted);
}

.caption-title {
  color: var(--ink);
  font-weight: 700;
}

h2 {
  margin: 0 0 12px;
  font-size: 2rem;
}

p {
  margin: 0;
  line-height: 1.72;
  color: #2b2f34;
}

.card p + p {
  margin-top: 14px;
}

.text-link {
  color: var(--accent-strong);
  word-break: break-all;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 24px, 1120px);
    padding-top: 36px;
  }

  .voice-target-flow {
    flex-direction: column;
  }

  .voice-target-arrow {
    transform: rotate(90deg);
  }

  .voice-target-item {
    width: 100%;
  }

  .voice-target-item img,
  .voice-target-item iframe {
    height: auto;
    min-height: 220px;
  }

  .figure-pair {
    grid-template-columns: 1fr;
  }

  .pipeline-bubbles {
    min-height: 300px;
  }

  .pipeline-bubble {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .pipeline-bubble-images {
    flex-wrap: wrap;
  }

  .pipeline-bubble-images img {
    max-width: calc(50% - 5px);
    max-height: 112px;
  }

  .solver-figure {
    display: inline-block;
    width: 100%;
    margin-right: 0;
  }

  .card {
    padding: 22px 20px;
    border-radius: 20px;
  }
}
