:root {
  --background: #f6f5f1;
  --surface: #fff;
  --surface-soft: #efeee9;
  --text: #17211d;
  --text-soft: #5e6862;
  --line: #d9dcd7;
  --green: #214d3a;
  --green-soft: #e7efe9;
  --accent: #dff5a2;
  --navy: #1d4870;
  --navy-soft: #eaf0f6;
  --terra: #b5583a;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--background);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--accent);
}

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

button {
  color: inherit;
  font: inherit;
}

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.page-width {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

.section {
  padding-block: 105px;
}

/* HEADER */
.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 70px;
  padding: 0 max(32px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid transparent;
  transition:
    background 0.25s ease,
    border-color 0.25s ease;
}

.site-header.scrolled {
  border-color: rgba(23, 33, 29, 0.1);
  background: rgba(246, 245, 241, 0.92);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wordmark-mark {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 4px solid var(--green);
  border-radius: 4px;
  transform: rotate(12deg);
}

.site-header nav {
  display: flex;
  gap: 28px;
}

.site-header nav a {
  position: relative;
  color: var(--text-soft);
  font-size: 13px;
}

.site-header nav a::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: var(--green);
  content: "";
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: var(--text);
}

.site-header nav a:hover::after,
.site-header nav a.active::after {
  transform: scaleX(1);
}

.header-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.menu-button,
.mobile-menu {
  display: none;
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: 0.98fr 1.02fr;
  gap: clamp(44px, 5.5vw, 80px);
  align-items: center;
  min-height: 100vh;
  padding-block: 112px 70px;
}

.paper-label,
.section-label {
  margin: 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero h1 {
  max-width: 660px;
  margin: 16px 0 22px;
  font-size: clamp(38px, 4.4vw, 60px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.hero h1 span {
  display: block;
  color: var(--green);
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}

.hero-summary {
  max-width: 610px;
  margin: 0 0 22px;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.6;
}

.hero-summary strong {
  color: var(--text);
  font-weight: 600;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 17px;
  max-width: 620px;
  margin-bottom: 8px;
}

.affiliation {
  margin: 0 0 24px;
  color: #7d8580;
  font-size: 13px;
}

.authors span {
  position: relative;
  color: #46514b;
  font-size: 14px;
}

.authors span:not(:last-child)::after {
  position: absolute;
  right: -11px;
  color: #9ca39f;
  content: "·";
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #bfc5c1;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.button:hover {
  border-color: var(--green);
  background: var(--surface);
  transform: translateY(-1px);
}

.button.primary {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.button.primary:hover {
  background: #163b2c;
}

.availability {
  margin-left: 6px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  border-bottom: 1px dashed rgba(33, 77, 58, 0.4);
}

.availability:hover {
  border-bottom-style: solid;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.hero-stats strong {
  display: block;
  color: var(--green);
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}

.hero-stats span {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.35;
}

.hero-demo {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 22px 60px rgba(33, 47, 40, 0.1);
}

.demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 2px 11px 6px;
  flex-wrap: wrap;
}

.demo-toolbar > span {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 10px;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented-control button {
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  color: #747d77;
  cursor: pointer;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
}

.segmented-control button.active {
  color: var(--text);
  background: white;
  box-shadow: 0 1px 4px rgba(23, 33, 29, 0.09);
}

.hero-video-frame {
  overflow: hidden;
  aspect-ratio: 968 / 728;
  border-radius: 14px;
  background: #17211d;
}

.hero-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.hero-video-frame.switching video {
  opacity: 0;
}

.demo-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 5px 2px;
}

.demo-caption strong {
  font-size: 12.5px;
  font-weight: 600;
}

.demo-caption span {
  color: #7a827d;
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

/* OVERVIEW */
.overview {
  border-top: 1px solid var(--line);
}

.overview-content {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 9%;
  margin-top: 22px;
  margin-bottom: 56px;
}

.overview h2,
.section-heading h2,
.citation h2 {
  margin: 0;
  font-size: clamp(34px, 4.2vw, 52px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.overview-text {
  color: #4f5a54;
  font-size: 15.5px;
  line-height: 1.72;
}

.overview-text p {
  margin: 0 0 18px;
}

.overview-text strong {
  color: var(--text);
}

.teaser-figure {
  margin-top: 16px;
}

/* DEMOS & RESULTS SECTIONS */
.demos,
.results {
  border-block: 1px solid var(--line);
  background: var(--surface-soft);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 8%;
  align-items: end;
  margin-bottom: 46px;
}

.section-heading h2 {
  margin-top: 10px;
}

.section-heading > p {
  max-width: 520px;
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.65;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.filter-tabs,
.result-tabs,
.view-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.55);
}

.filter-tabs button,
.result-tabs button,
.view-mode-tabs button {
  padding: 8px 13px;
  border: 0;
  border-radius: 6px;
  color: #69726d;
  cursor: pointer;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.filter-tabs button.active,
.result-tabs button.active {
  color: white;
  background: var(--green);
}

.view-mode-tabs button.active {
  color: var(--text);
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.text-button {
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid #9ba39e;
  cursor: pointer;
  background: transparent;
  font-size: 12px;
}

.text-button:hover {
  border-color: var(--green);
  color: var(--green);
}

/* GALLERY */
.video-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  cursor: zoom-in;
  background: #17211d;
  border: 1px solid rgba(23, 33, 29, 0.1);
  animation: item-in 0.4s both;
  animation-delay: calc(var(--index, 0) * 35ms);
}

.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.35s ease,
    filter 0.35s ease;
}

.gallery-item:hover video,
.gallery-item:focus video {
  filter: brightness(0.88);
  transform: scale(1.02);
}

.gallery-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(16, 23, 20, 0.72);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--mono);
  font-size: 9.5px;
  pointer-events: none;
}

.gallery-item-meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 40px 14px 12px;
  color: white;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(8, 15, 11, 0.86));
  transition: opacity 0.25s ease;
}

.gallery-item-meta div {
  display: grid;
  gap: 2px;
}

.gallery-item-meta span {
  opacity: 0.78;
  font-family: var(--mono);
  font-size: 9.5px;
}

.gallery-item-meta strong {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-item-meta i {
  font-style: normal;
  flex-shrink: 0;
  opacity: 0.85;
}

.gallery-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  margin-top: 32px;
}

.gallery-footer > span {
  color: #6e7772;
  font-family: var(--mono);
  font-size: 10.5px;
}

/* 3x3 GRIDS VIEW */
.grids-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.grids-list.single-grid {
  grid-template-columns: 1fr;
  max-width: 920px;
  margin-inline: auto;
}

.grid-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 33, 29, 0.05);
}

.grid-card video {
  width: 100%;
  aspect-ratio: 968 / 728;
  border-radius: 10px;
  background: #17211d;
}

.grid-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 2px;
}

.grid-card-meta strong {
  font-size: 14px;
}

.grid-card-meta span {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
}

/* FIGURES */
.paper-figure {
  margin: 0;
}

.paper-figure > button {
  position: relative;
  display: block;
  width: 100%;
  padding: clamp(14px, 2.4vw, 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: zoom-in;
  background: white;
}

.paper-figure > button img {
  width: 100%;
  transition: transform 0.25s ease;
}

.paper-figure > button:hover img {
  transform: scale(1.005);
}

.paper-figure > button span {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.92);
  font-family: var(--mono);
  font-size: 9px;
}

.paper-figure figcaption {
  max-width: 1020px;
  margin: 14px auto 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

.paper-figure figcaption strong {
  color: var(--text);
}

/* METHOD SECTION */
.equation-banner {
  padding: 26px 32px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.eq-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--serif);
  font-size: 24px;
}

.eq-lhs,
.eq-plus {
  color: var(--text-soft);
  font-weight: 500;
}

.eq-term {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--background);
}

.eq-term strong {
  color: var(--green);
  font-size: 22px;
}

.eq-term small {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-soft);
}

.eq-note {
  max-width: 780px;
  margin: 16px auto 0;
  color: var(--text-soft);
  font-size: 13.5px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.method-card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.method-badge {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
}

.method-card h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.method-card p {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.method-equation {
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 12.5px;
  text-align: center;
  color: var(--text);
}

.method-highlight {
  margin-top: auto !important;
  margin-bottom: 0 !important;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px !important;
}

.method-highlight strong {
  color: var(--text);
}

.method-bottom {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 20px;
}

.code-panel,
.comparison-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.panel-tag {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
}

.code-panel pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.62;
  color: #26322d;
}

.c-comment {
  color: #3a8080;
}

.c-fn {
  color: #cc257c;
  font-weight: 500;
}

/* TABLES */
.table-scroll {
  overflow-x: auto;
}

.comparison-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.comparison-table th,
.comparison-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.comparison-table thead th {
  background: rgba(239, 238, 233, 0.5);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.comparison-table .col-ours {
  background: var(--green-soft);
  color: var(--text);
}

.mark-yes {
  color: var(--green);
  font-weight: 700;
}

.mark-no {
  color: #9ba39e;
}

/* RESULTS VIEWER */
.result-viewer {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.result-viewer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.result-tabs {
  width: fit-content;
  background: rgba(255, 255, 255, 0.7);
}

.result-pane {
  padding: 28px;
}

.pane-intro {
  margin-bottom: 20px;
}

.pane-intro h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
}

.pane-intro p {
  max-width: 880px;
  margin: 0;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.65;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.data-table thead th {
  border-bottom: 2px solid var(--line);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  background: rgba(246, 245, 241, 0.6);
}

.data-table .group-row td {
  padding-top: 14px;
  padding-bottom: 6px;
  background: #f4f7f5;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table .gt-row td {
  color: #7d8580;
  font-size: 12.5px;
}

.data-table .ours-row td {
  background: var(--green-soft);
  color: var(--text);
}

/* METHOD NOTES / ANALYSIS NOTES */
.method-notes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 46px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.method-notes p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

.method-notes strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14.5px;
}

/* CITATION & FOOTER */
.citation {
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.citation-copy {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.citation h2 {
  margin-top: 7px;
  font-size: 36px;
}

.citation pre {
  overflow-x: auto;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #3f4b45;
  background: var(--surface-soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}

footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding-block: 45px;
  border-top: 1px solid var(--line);
}

footer p {
  margin: 8px 0 0;
  color: #7a827d;
  font-size: 12px;
}

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 12.5px;
}

.footer-links a:hover {
  color: var(--green);
  text-decoration: underline;
}

/* MODALS */
.media-modal,
.figure-modal {
  position: fixed;
  width: min(1020px, calc(100% - 50px));
  max-width: none;
  max-height: calc(100vh - 50px);
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 14px;
  color: white;
  background: #101714;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.45);
}

.media-modal[open],
.figure-modal[open] {
  animation: modal-in 0.25s ease both;
}

.media-modal::backdrop,
.figure-modal::backdrop {
  background: rgba(10, 15, 13, 0.82);
  backdrop-filter: blur(9px);
}

.media-modal video {
  width: 100%;
  max-height: calc(100vh - 110px);
  border-radius: 14px 14px 0 0;
  background: #0b100e;
}

.modal-close,
.modal-nav {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  background: #1c2822;
}

.modal-close {
  top: -14px;
  right: -14px;
  font-size: 22px;
}

.modal-nav {
  top: 50%;
  transform: translateY(-50%);
}

.modal-nav.previous {
  left: -56px;
}

.modal-nav.next {
  right: -56px;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #141d19;
  border-radius: 0 0 14px 14px;
}

.modal-meta span {
  color: #9ca8a2;
  font-family: var(--mono);
  font-size: 11px;
}

.modal-meta strong {
  font-size: 13.5px;
  font-weight: 500;
}

.figure-modal {
  width: min(1380px, calc(100% - 60px));
  padding: 20px;
  background: white;
}

.figure-modal img {
  width: 100%;
  max-height: calc(100vh - 90px);
  object-fit: contain;
}

.toast {
  position: fixed;
  z-index: 1000;
  bottom: 24px;
  left: 50%;
  padding: 10px 16px;
  border-radius: 6px;
  color: white;
  background: var(--text);
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
  transition-delay: calc(var(--delay, 0) * 90ms);
}

.reveal[data-delay="1"] {
  --delay: 1;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes item-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}

/* RESPONSIVE */
@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: auto;
  }

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

  .method-bottom {
    grid-template-columns: 1fr;
  }

  .method-notes {
    grid-template-columns: repeat(2, 1fr);
  }

  .grids-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .page-width {
    width: min(680px, calc(100% - 36px));
  }

  .section {
    padding-block: 80px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    padding-inline: 18px;
  }

  .site-header nav,
  .header-link {
    display: none;
  }

  .menu-button {
    display: grid;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 11px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    background: var(--surface);
  }

  .menu-button span {
    display: block;
    height: 1px;
    background: var(--text);
    transition: transform 0.2s ease;
  }

  .menu-button[aria-expanded="true"] span:first-child {
    transform: translateY(3px) rotate(45deg);
  }

  .menu-button[aria-expanded="true"] span:last-child {
    transform: translateY(-3px) rotate(-45deg);
  }

  .mobile-menu {
    position: fixed;
    z-index: 90;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 85px 20px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(246, 245, 241, 0.98);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease;
    backdrop-filter: blur(12px);
  }

  .mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .mobile-menu a {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .overview-content,
  .section-heading {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .video-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .method-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .page-width {
    width: calc(100% - 24px);
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .video-gallery {
    grid-template-columns: 1fr;
  }

  .modal-nav {
    top: auto;
    bottom: -53px;
  }

  .modal-nav.previous {
    left: calc(50% - 49px);
  }

  .modal-nav.next {
    right: calc(50% - 49px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

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