:root {
  --ink: #182230;
  --muted: #667085;
  --paper: #ffffff;
  --surface: #ffffff;
  --line: #e1e6ec;
  --blue: #214f91;
  --green: #214f91;
  --red: #c34132;
  --gold: #c68a19;
  --shadow: 0 8px 24px rgba(24, 34, 48, 0.055);
  --shadow-lift: 0 18px 44px rgba(24, 34, 48, 0.12);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-emph: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 11px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(24, 34, 48, 0.08);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand,
nav,
.actions,
footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
}

.brand img {
  width: 116px;
  height: 44px;
  object-fit: contain;
}

nav {
  gap: 24px;
  font-size: 14.5px;
  font-weight: 700;
}

nav a {
  color: #526071;
}

nav a,
footer a,
.button,
.inline-paper-link {
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

nav a:hover,
footer a:hover {
  color: var(--blue);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 520px);
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  padding: clamp(64px, 8vw, 108px) clamp(18px, 5vw, 72px) clamp(52px, 6vw, 78px);
}

.hero-heading {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
}

.hero-copy {
  max-width: 760px;
  padding-top: 2px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: none;
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 18px 0 8px;
  font-size: 20px;
  line-height: 1.2;
}

.subtitle {
  max-width: 760px;
  margin: 20px 0 0;
  color: #25303f;
  font-size: clamp(18px, 2vw, 22px);
}

.subtitle-brand {
  color: #1d6fae;
  font-weight: 800;
}

.subtitle strong {
  color: #101924;
  font-weight: 800;
}

.authors {
  max-width: 820px;
  margin: 18px 0 0;
  color: #2a3340;
  font-size: 14.5px;
  font-weight: 500;
}

.affiliation {
  max-width: 820px;
  margin: 7px 0 0;
  color: #2f3a49;
  font-size: 14.5px;
  font-weight: 750;
}

.actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  max-width: 760px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  min-width: 156px;
  padding: 0 20px;
  border: 1px solid #cbd3dd;
  border-radius: 10px;
  background: #ffffff;
  color: #263445 !important;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1px;
  box-shadow: 0 1px 2px rgba(24, 34, 48, 0.06);
  transition:
    color 200ms var(--ease-out),
    border-color 200ms var(--ease-out),
    background-color 200ms var(--ease-out),
    box-shadow 240ms var(--ease-out),
    transform 240ms var(--ease-spring);
}

.button .btn-icon {
  width: 19px;
  height: 19px;
  flex: none;
  display: block;
}

.button .btn-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.button .btn-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0.72;
}

.button.primary {
  border-color: #1f3f70;
  background-image: linear-gradient(135deg, #275089 0%, #1c3a68 100%);
  background-color: #1f3f70;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(31, 63, 112, 0.24);
}

.button.hf {
  border-color: #f3cf6a;
  background: #fff9e9;
  color: #7a5a08 !important;
}

.button:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(33, 79, 145, 0.16);
}

.button.primary:hover {
  border-color: #17345e;
  background-color: #17345e;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(31, 63, 112, 0.32);
}

.button.hf:hover {
  border-color: #e9b53d;
  color: #6a4e07 !important;
  background: #fff4d6;
  box-shadow: 0 12px 26px rgba(233, 181, 61, 0.32);
}

.project-name {
  max-width: none;
  margin: 0 0 14px;
  color: #1d4a87;
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 800;
  line-height: 1.02;
}

@media (min-width: 900px) {
  .project-name,
  .hero-heading h1 {
    white-space: nowrap;
  }
}

.section {
  padding: clamp(68px, 8vw, 96px) clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
}

#audio-examples > *,
#method > *,
#results > *,
#citation > * {
  width: 100%;
  max-width: 1380px;
  margin-left: auto;
  margin-right: auto;
}

.demo-comparison,
#method,
.split,
#results,
#citation {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

.split > div > p:not(.section-subtitle) {
  max-width: 980px;
  margin: 16px 0 0;
  color: #39434f;
  font-size: 17px;
}

.core-panel {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(24, 34, 48, 0.04);
}

.core-panel h2 {
  font-size: 26px;
}

.core-panel ul {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.core-panel li {
  color: #39434f;
  font-size: 14.5px;
}

.core-panel strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 14.5px;
}

.section-head {
  max-width: 1380px;
  margin: 0 auto 32px;
}

.section-subtitle {
  margin: 10px 0 0;
  color: #344054;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 820;
  line-height: 1.12;
  letter-spacing: 0;
}

h2.section-subtitle {
  margin-top: 4px;
}

.section-subtitle-small {
  font-size: clamp(19px, 2vw, 28px);
  font-weight: 780;
}

.evaluation-note {
  width: 100%;
  max-width: 1380px;
  margin: 14px 0 0;
  color: #39434f;
  font-size: 16px;
  line-height: 1.55;
  text-align: left;
}

.evaluation-tldr {
  width: 100%;
  max-width: 1380px;
  margin: 10px 0 0;
  color: #263445;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.55;
  text-align: left;
}

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

.figure-card,
.results-layout,
.table-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.figure-card {
  display: flex;
  min-height: 520px;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}

.figure-card img {
  width: 100%;
  height: clamp(260px, 28vw, 390px);
  min-height: 0;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.figure-card p,
.result-list span {
  margin: 0;
  color: #39434f;
  font-size: 15.5px;
}

.method-note {
  width: 100%;
  max-width: none;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #344054;
  font-size: 16px;
  font-weight: 680;
  line-height: 1.55;
  text-align: left;
}

.inline-paper-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin-left: 6px;
  padding: 0 11px;
  border: 1px solid #aeb9c7;
  border-radius: 7px;
  color: #263445;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  vertical-align: -4px;
  transition:
    color 200ms var(--ease-out),
    border-color 200ms var(--ease-out),
    box-shadow 200ms var(--ease-out),
    transform 200ms var(--ease-spring);
}

.inline-paper-link .btn-icon {
  width: 15px;
  height: 15px;
  flex: none;
}

.inline-paper-link:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(33, 79, 145, 0.14);
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 620px));
  justify-content: center;
  gap: clamp(40px, 6vw, 84px);
  background: #ffffff;
}

/* In-section divider: a line spanning the width of the two columns below
   (instead of the full-width section rule), since this block continues the
   Method section above. The ::before is a grid item spanning both columns.
   Top padding here and Method's bottom padding are trimmed so the note above
   sits close to this continuation block. */
#method {
  padding-bottom: clamp(28px, 3.5vw, 44px);
}

.section.is-subsection {
  border-top: 0;
  padding-top: clamp(28px, 3.5vw, 44px);
}

.section.is-subsection::before {
  content: "";
  grid-column: 1 / -1;
  height: 1px;
  background: #d7dde5;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: center;
  padding: 20px;
}

.results-layout > img {
  width: 100%;
  border-radius: 8px;
}

.result-list {
  display: grid;
  gap: 14px;
}

.result-list div {
  padding: 14px 0;
  border-bottom: 1px solid #edf0ed;
}

.result-list div:last-child {
  border-bottom: 0;
}

.result-list strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.table-card {
  margin-top: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.table-card h3 {
  margin: 0 0 14px;
  color: #263445;
  font-size: 19px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(24, 34, 48, 0.035);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.eval-table {
  min-width: 1276px;
  table-layout: fixed;
  font-size: 13px;
}

.eval-table th,
.eval-table td {
  font-weight: 800;
}

.eval-table th:first-child,
.eval-table td:first-child {
  width: 236px;
}

.eval-table th:nth-child(n + 2):nth-child(-n + 7),
.eval-table td:nth-child(n + 2):nth-child(-n + 7) {
  width: 132px;
}

.eval-table th:nth-child(8),
.eval-table td:nth-child(8),
.eval-table th:nth-child(9),
.eval-table td:nth-child(9) {
  width: 124px;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid #e8ecf1;
  text-align: center;
  vertical-align: top;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #f7f9fb;
  color: #1f2a38;
  font-weight: 850;
  vertical-align: middle;
}

th span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

td:first-child,
th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  font-weight: 800;
  text-align: center;
}

th:first-child {
  z-index: 2;
  background: #f7f9fb;
  text-align: left;
  vertical-align: middle;
}

.category-row td {
  background: #f0f4f9;
  color: #244c82;
  font-weight: 850;
  text-align: left;
  text-transform: uppercase;
}

.table-card:not(.demo-card) tbody td:first-child {
  text-align: left;
}

.nim-col {
  border-left: 2px solid #91a9cc;
}

.small-table-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
}

.demo-subsection {
  margin-top: 72px;
}

.section-head + .demo-subsection {
  margin-top: 0;
}

.demo-subsection > h3 {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 22px;
  color: #2d3a4b;
  font-size: clamp(19px, 1.8vw, 26px);
  font-weight: 820;
  line-height: 1.2;
  text-align: center;
}

.demo-subsection > h3::before,
.demo-subsection > h3::after {
  content: "";
  flex: 1 1 48px;
  min-width: 28px;
  height: 1px;
  background: #d7dde5;
}

.demo-subsection-description {
  width: 100%;
  max-width: 1250px;
  margin: -4px auto 20px;
  color: #39434f;
  font-size: 14.5px;
  line-height: 1.55;
  text-align: left;
}

.demo-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 1250px;
  margin: 0 auto;
  gap: 22px;
}

.demo-video-card {
  width: 100%;
  margin: 0;
}

.demo-video {
  display: block;
  width: 100%;
  aspect-ratio: 41 / 24;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f3f5f7;
  object-fit: contain;
  box-shadow: 0 6px 18px rgba(24, 34, 48, 0.06);
}

.demo-video-card figcaption {
  margin-top: 9px;
  color: #465365;
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
}

.demo-table {
  min-width: 1420px;
  table-layout: fixed;
  font-size: 12.5px;
}

.demo-table th:first-child,
.demo-table td:first-child {
  width: 190px;
}

.demo-table th:nth-child(n + 2),
.demo-table td:nth-child(n + 2) {
  width: 175px;
}

.demo-table span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.demo-table td {
  white-space: normal;
  min-width: 180px;
  text-align: left;
}

.demo-table td:first-child,
.demo-table th:first-child {
  text-align: left;
}

.demo-table td:first-child strong,
.demo-table td:first-child .challenge-source {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audio-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px dashed #aeb7c2;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.challenge-source {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.demo-audio {
  display: block;
  width: 100%;
  height: 34px;
  margin-top: 10px;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 9px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #ae6262;
  background: #b96b6b;
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: none;
}

.metric.best {
  border-color: #3e8c7a;
  background: #4b9987;
  color: #ffffff;
}

.transcript-cell {
  font-size: 13.5px;
  font-weight: 800;
}

.demo-table tbody td:nth-child(2) {
  font-size: 13.5px;
  font-weight: 800;
  /* Align Ground Truth text with the transcript text in metric-bearing
     columns, whose CER/WER pill pushes their first line ~33px down. */
  padding-top: 41px;
}

.transcript-cell .diff-text {
  font-size: inherit;
}

.transcript-cell .metric {
  font-size: 11.5px;
}

.demo-table .diff-text {
  color: #c72d2d;
  font-weight: 950;
}

.demo-table .omission-mark {
  letter-spacing: 0;
  white-space: nowrap;
}

.demo-table .cer-error,
.demo-table .cer-0769,
.demo-table .cer-0185,
.demo-table .cer-0370,
.demo-table .cer-0556,
.demo-table .cer-1538,
.demo-table .cer-2308,
.demo-table .cer-2963,
.demo-table .cer-3333,
.demo-table .cer-3750,
.demo-table .cer-5000,
.demo-table .cer-6000,
.demo-table .cer-10000,
.demo-table .cer-14000 {
  border-color: #ae6262;
  background: #b96b6b;
  color: #ffffff;
}

.demo-table .metric.best {
  border-color: #3e8c7a;
  background: #4b9987;
  color: #ffffff;
}

.best-value {
  color: #b13a3a;
  font-weight: 900;
}


.citation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.citation-block {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #21314a;
  border-radius: 12px;
  background: #111d31;
  box-shadow: 0 14px 34px rgba(17, 29, 49, 0.18);
  transition:
    transform 280ms var(--ease-out),
    box-shadow 280ms var(--ease-out);
}

.citation-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(17, 29, 49, 0.26);
}

.citation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px 11px 18px;
  background: #0d1727;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.citation-label {
  color: #aebfd6;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.3px;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #d7e2f2;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease-out),
    border-color 200ms var(--ease-out),
    color 200ms var(--ease-out),
    transform 200ms var(--ease-spring);
}

.copy-button .copy-icon {
  width: 15px;
  height: 15px;
  flex: none;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
}

.copy-button.copied {
  border-color: #4b9987;
  background: rgba(75, 153, 135, 0.22);
  color: #c8f0e5;
}

pre {
  overflow-x: auto;
  margin: 0;
  padding: 20px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #eef3fb;
  font-size: 13.5px;
  line-height: 1.7;
  flex: 1;
}

footer {
  display: block;
  padding: 40px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14.5px;
}

.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto;
}

.footer-org {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-group {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0.1px;
}

.footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.footer-copy a {
  color: var(--blue);
  font-weight: 800;
}

.footer-copy a:hover {
  text-decoration: underline;
}

.footer-top {
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .hero,
  .figure-grid,
  .split,
  .results-layout,
  .demo-video-grid,
  .small-table-grid {
    grid-template-columns: 1fr;
  }

  .hero-heading {
    grid-column: auto;
  }

  nav {
    display: none;
  }

  .actions {
    flex-wrap: wrap;
  }

  .demo-video-grid,
  .demo-subsection-description {
    max-width: 680px;
  }
}

@media (max-width: 560px) {
  .topbar,
  .hero,
  .section,
  footer {
    padding-inline: 16px;
  }

  .brand img {
    width: 92px;
    height: 34px;
  }

  .brand {
    font-size: 18px;
  }

  h1 {
    font-size: 30px;
  }

  .project-name {
    font-size: 34px;
  }

  .button {
    width: 100%;
  }

  .demo-subsection {
    margin-top: 54px;
  }

  .demo-subsection > h3 {
    gap: 10px;
    font-size: 19px;
  }

  .demo-subsection > h3::before,
  .demo-subsection > h3::after {
    min-width: 14px;
  }

  .figure-card {
    min-height: 0;
  }

  .citation-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* ---------- High-end motion & micro-interactions ---------- */

/* Sticky header: subtle elevation once scrolled */
.topbar {
  transition:
    box-shadow 260ms var(--ease-out),
    background-color 260ms var(--ease-out),
    border-color 260ms var(--ease-out);
}

.topbar.scrolled {
  box-shadow: 0 8px 28px rgba(24, 34, 48, 0.1);
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: rgba(24, 34, 48, 0.06);
}

.brand img {
  transition: transform 360ms var(--ease-spring);
}

.brand:hover img {
  transform: scale(1.04);
}

/* Animated nav underline */
nav a {
  position: relative;
  padding-bottom: 3px;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--ease-out);
}

nav a:hover::after {
  transform: scaleX(1);
}

/* Card hover lift */
.figure-card,
.table-scroll,
.core-panel,
.demo-video {
  transition:
    transform 300ms var(--ease-out),
    box-shadow 300ms var(--ease-out),
    border-color 300ms var(--ease-out);
}

.figure-card:hover,
.core-panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.table-scroll:hover {
  box-shadow: 0 12px 30px rgba(24, 34, 48, 0.09);
}

.demo-video-card:hover .demo-video {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(24, 34, 48, 0.14);
  border-color: #c8d2de;
}

/* Audio/video controls feel snappier */
.demo-audio,
.demo-video {
  transition: transform 240ms var(--ease-out), box-shadow 240ms var(--ease-out);
}

/* ---------- Scroll-reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 760ms var(--ease-emph),
    transform 760ms var(--ease-emph);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js .reveal.revealed {
  opacity: 1;
  transform: none;
}

/* ---------- Zoom affordance on media ---------- */
.figure-card,
.demo-video-card {
  position: relative;
}

.zoomable img {
  cursor: zoom-in;
}

.zoom-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  background: rgba(23, 34, 53, 0.62);
  color: #ffffff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition:
    opacity 220ms var(--ease-out),
    transform 220ms var(--ease-spring),
    background-color 220ms var(--ease-out);
}

.zoom-btn svg {
  width: 19px;
  height: 19px;
}

.figure-card:hover .zoom-btn,
.demo-video-card:hover .zoom-btn,
.zoom-btn:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.zoom-btn:hover {
  background: rgba(23, 34, 53, 0.85);
}

@media (hover: none) {
  .zoom-btn {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Lightbox ---------- */
html.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 56px);
  background: rgba(13, 20, 33, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 260ms var(--ease-out),
    visibility 0s linear 260ms;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 260ms var(--ease-out),
    visibility 0s;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  transform: scale(0.94);
  opacity: 0;
  transition:
    transform 320ms var(--ease-spring),
    opacity 320ms var(--ease-out);
}

.lightbox.open .lightbox-stage {
  transform: scale(1);
  opacity: 1;
}

.lightbox-img,
.lightbox-video {
  display: block;
  max-width: min(1280px, 94vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  background: #0d1421;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: clamp(14px, 3vw, 28px);
  right: clamp(14px, 3vw, 28px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease-out),
    transform 220ms var(--ease-spring);
}

.lightbox-close svg {
  width: 22px;
  height: 22px;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: rotate(90deg);
}

/* Crisp, modern keyboard focus rings */
a:focus-visible,
button:focus-visible,
.button:focus-visible,
.copy-button:focus-visible,
.zoom-btn:focus-visible,
.lightbox-close:focus-visible {
  outline: 2.5px solid var(--blue);
  outline-offset: 2px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .lightbox-close:hover {
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}
