:root {
  color-scheme: light;
  --page: #f7f8f6;
  --paper: #ffffff;
  --soft: #eef3f1;
  --ink: #15201d;
  --muted: #64706b;
  --line: #dce3df;
  --line-strong: #b8c4be;
  --accent: #b83c2d;
  --teal: #176e73;
  --moss: #4f6b3b;
  --amber: #bf7b2c;
  --teaser-cycle: 4000ms;
  --shadow: 0 20px 46px rgba(25, 39, 34, 0.13);
  --shadow-soft: 0 10px 24px rgba(25, 39, 34, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  line-height: 1.58;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

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

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

p {
  margin: 0;
  color: var(--muted);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 max(22px, calc((100vw - 1160px) / 2));
  background: rgba(247, 248, 246, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  font-size: 18px;
  font-weight: 850;
}

nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

nav a:hover {
  color: var(--accent);
}

main {
  overflow: hidden;
}

.hero,
.motion-teaser,
.section,
.gallery-shell,
footer {
  width: min(1160px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.hero {
  max-width: 980px;
  padding: 54px 0 26px;
  text-align: center;
}

.venue,
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  max-width: 100%;
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h1 {
  margin-top: 10px;
  font-size: clamp(46px, 7vw, 82px);
  font-weight: 900;
}

h2 {
  margin-top: 10px;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 850;
}

h3 {
  font-size: 18px;
  font-weight: 850;
}

.subtitle {
  max-width: 860px;
  margin: 18px auto 0;
  color: var(--ink);
  font-size: clamp(19px, 2.2vw, 25px);
  font-weight: 800;
}

.hero-text {
  max-width: 820px;
  margin: 20px auto 0;
  font-size: 17px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 4px 0 rgba(21, 32, 29, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 7px 16px rgba(21, 32, 29, 0.1);
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.button.disabled {
  border-color: rgba(184, 60, 45, 0.32);
  color: var(--accent);
  background: rgba(184, 60, 45, 0.08);
  box-shadow: none;
  cursor: default;
}

.button.disabled:hover {
  transform: none;
  box-shadow: none;
}

.motion-teaser {
  padding: 10px 0 46px;
}

.motion-copy {
  max-width: 850px;
  margin: 0 auto 22px;
  text-align: center;
}

.motion-copy p:last-child,
.section-head p,
.release-panel p {
  margin-top: 14px;
  font-size: 16px;
}

.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: clamp(72px, 5.8vw, 92px);
  gap: 12px;
  align-items: stretch;
}

.mosaic-tile {
  position: relative;
  grid-column: span 4;
  grid-row: span 3;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(21, 32, 29, 0.12);
  border-radius: 8px;
  background: #f0f3f1;
  box-shadow: var(--shadow-soft);
  opacity: 1;
  transform: none;
}

.mosaic-tile.tile-half {
  grid-column: span 6;
}

.mosaic-tile.tile-third,
.mosaic-tile.tile-wide,
.mosaic-tile.tile-tall {
  grid-column: span 4;
}

.tile-stack {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(23, 110, 115, 0.08), rgba(184, 60, 45, 0.06)),
    #f2f5f3;
}

.tile-stack::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  width: 10px;
  background: linear-gradient(
    90deg,
    rgba(21, 32, 29, 0),
    rgba(21, 32, 29, 0.2) 18%,
    rgba(255, 255, 255, 0.96) 44%,
    rgba(255, 255, 255, 0.96) 56%,
    rgba(21, 32, 29, 0.18) 82%,
    rgba(21, 32, 29, 0)
  );
  box-shadow:
    -10px 0 18px rgba(21, 32, 29, 0.13),
    10px 0 18px rgba(255, 255, 255, 0.78);
  opacity: 0;
  transform: translateX(-50%);
  will-change: left, opacity;
  animation: wipe-line var(--teaser-cycle) cubic-bezier(0.45, 0, 0.2, 1) var(--delay) infinite;
}

.tile-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  will-change: clip-path, transform;
}

.tile-content {
  opacity: 1;
}

.tile-result {
  z-index: 2;
  opacity: 1;
  clip-path: inset(0 100% 0 0);
}

.mosaic-tile .tile-result {
  animation: result-wipe var(--teaser-cycle) cubic-bezier(0.45, 0, 0.2, 1) var(--delay) infinite;
}

.tile-reference {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 4;
  width: clamp(92px, 34%, 156px);
  aspect-ratio: 1 / 1;
  border: 4px solid #ffffff;
  border-radius: 0;
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(15, 22, 20, 0.24);
  object-fit: cover;
  opacity: 0;
  transform: translate(-28%, 28%) scale(0.72);
  transform-origin: left bottom;
  will-change: transform, opacity;
  animation: reference-pop var(--teaser-cycle) cubic-bezier(0.24, 0.78, 0.22, 1) var(--delay) infinite;
}

.tile-half .tile-reference {
  width: clamp(118px, 26%, 176px);
}

.tile-third .tile-reference,
.tile-wide .tile-reference {
  width: clamp(102px, 34%, 158px);
}

.mosaic-tile figcaption,
.feature-case figcaption,
.triplet-board figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.mosaic-tile figcaption {
  display: none;
}

.section {
  padding: 54px 0;
  border-top: 1px solid var(--line);
}

.abstract-band {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-right: max(20px, calc((100vw - 1160px) / 2));
  padding-left: max(20px, calc((100vw - 1160px) / 2));
  background: var(--soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 820px;
  margin-bottom: 26px;
}

.section-head.centered {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.contribution-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.contribution-grid article,
.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.contribution-grid article {
  min-height: 210px;
  padding: 22px;
}

.contribution-grid span {
  display: inline-flex;
  margin-bottom: 38px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.contribution-grid p {
  margin-top: 10px;
  font-size: 15px;
}

.image-story {
  padding-top: 34px;
}

.feature-wall {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.feature-case {
  display: grid;
  gap: 12px;
  align-items: stretch;
  margin: 0;
}

.feature-case figure {
  margin: 0;
}

.feature-result,
.feature-inputs figure,
.input-card,
.output-card,
.paper-figure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.feature-result img,
.feature-inputs img,
.triplet-board img {
  width: 100%;
  background: #f3f5f4;
  object-fit: contain;
}

.feature-case figcaption,
.triplet-board figcaption {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.feature-inputs {
  display: grid;
  gap: 12px;
}

.main-case {
  grid-column: span 8;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.34fr);
}

.main-case .feature-result img {
  aspect-ratio: 3 / 2;
}

.main-case .feature-inputs img {
  aspect-ratio: 4 / 3;
}

.portrait-case,
.landscape-case {
  grid-column: span 4;
}

.portrait-case {
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.38fr);
}

.portrait-case .feature-result img {
  aspect-ratio: 9 / 16;
}

.portrait-case .feature-inputs img {
  aspect-ratio: 3 / 4;
}

.landscape-case {
  grid-template-columns: minmax(0, 1fr);
}

.landscape-case .feature-result img {
  aspect-ratio: 3 / 2;
}

.landscape-case .feature-inputs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landscape-case .feature-inputs img {
  aspect-ratio: 4 / 3;
}

.gallery-shell {
  margin-bottom: 54px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8f6 100%);
  box-shadow: var(--shadow);
}

.gallery-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.gallery-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.gallery-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c9d2ce;
  cursor: pointer;
}

.gallery-dot.is-active {
  background: var(--accent);
  transform: scale(1.15);
}

.gallery-carousel {
  outline: none;
}

.gallery-carousel:focus-visible .gallery-viewport {
  outline: 3px solid rgba(23, 110, 115, 0.22);
  outline-offset: 4px;
}

.gallery-viewport {
  overflow: hidden;
  border-radius: 8px;
}

.gallery-track {
  display: flex;
  transition: transform 440ms ease;
  will-change: transform;
}

.gallery-slide {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 0;
}

.triplet-board {
  display: grid;
  grid-template-columns: minmax(210px, 0.34fr) minmax(0, 0.66fr);
  gap: 14px;
  align-items: start;
}

.input-card,
.output-card {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.input-card:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.input-card:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.output-card {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.input-card img {
  height: 248px;
  object-fit: contain;
}

.output-card img {
  height: 560px;
  min-height: 0;
  object-fit: contain;
}

.gallery-slide h3 {
  margin-top: 18px;
}

.gallery-slide p {
  max-width: 860px;
  margin-top: 6px;
  font-size: 15px;
}

.stacked-section,
.results-section {
  width: 100%;
  max-width: none;
  padding-right: max(20px, calc((100vw - 1160px) / 2));
  padding-left: max(20px, calc((100vw - 1160px) / 2));
}

.stacked-section {
  background: #ffffff;
}

.paper-figure {
  margin: 0;
}

.paper-figure img {
  width: 100%;
  background: #ffffff;
}

.paper-figure figcaption {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.metrics div {
  padding: 18px;
}

.metrics strong {
  display: block;
  font-size: 36px;
  line-height: 1;
}

.metrics span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.metrics div:nth-child(1) strong,
.metrics div:nth-child(4) strong {
  color: var(--accent);
}

.metrics div:nth-child(2) strong {
  color: var(--teal);
}

.metrics div:nth-child(3) strong {
  color: var(--moss);
}

.release-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
}

pre {
  margin: 22px 0 0;
  overflow-x: auto;
  border: 1px solid #222826;
  border-radius: 8px;
  background: #101514;
}

code {
  display: block;
  padding: 18px;
  color: #f5f7f6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 44px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

@keyframes result-wipe {
  0%,
  22% {
    clip-path: inset(0 100% 0 0);
  }

  40%,
  78% {
    clip-path: inset(0 0 0 0);
  }

  92%,
  100% {
    clip-path: inset(0 100% 0 0);
  }
}

@keyframes wipe-line {
  0%,
  18% {
    left: 0;
    opacity: 0;
  }

  23% {
    left: 0;
    opacity: 1;
  }

  40% {
    left: 100%;
    opacity: 1;
  }

  45%,
  76% {
    left: 100%;
    opacity: 0;
  }

  79% {
    left: 100%;
    opacity: 1;
  }

  92% {
    left: 0;
    opacity: 1;
  }

  96%,
  100% {
    left: 0;
    opacity: 0;
  }
}

@keyframes reference-pop {
  0%,
  12% {
    opacity: 0;
    transform: translate(-28%, 28%) scale(0.72);
  }

  18% {
    opacity: 1;
    transform: translate(0, 0) scale(1.08);
  }

  24% {
    opacity: 1;
    transform: translate(0, 0) scale(0.96);
  }

  30%,
  82% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  92%,
  100% {
    opacity: 0;
    transform: translate(-18%, 18%) scale(0.78);
  }
}

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

  .mosaic-tile,
  .mosaic-tile .tile-stack::after,
  .mosaic-tile .tile-result,
  .mosaic-tile .tile-reference,
  .gallery-track {
    animation: none;
    transition: none;
  }

  .mosaic-tile {
    opacity: 1;
    transform: none;
  }

  .tile-result {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }

  .tile-reference {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .mosaic-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: clamp(94px, 12vw, 132px);
  }

  .mosaic-tile,
  .mosaic-tile.tile-half,
  .mosaic-tile.tile-third,
  .mosaic-tile.tile-wide,
  .mosaic-tile.tile-tall {
    grid-column: span 2;
    grid-row: span 2;
  }

  .contribution-grid,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-case,
  .portrait-case,
  .landscape-case {
    grid-column: 1 / -1;
  }

  .triplet-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .input-card:nth-child(1),
  .input-card:nth-child(2),
  .output-card {
    grid-row: auto;
  }

  .input-card:nth-child(1),
  .input-card:nth-child(2) {
    grid-column: auto;
  }

  .output-card {
    grid-column: 1 / -1;
    order: -1;
  }

  .input-card img,
  .output-card img {
    height: auto;
    aspect-ratio: 3 / 4;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 18px;
  }

  nav {
    gap: 12px;
    font-size: 11px;
  }

  .hero,
  .motion-teaser,
  .section,
  .gallery-shell,
  footer {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
  }

  .abstract-band,
  .stacked-section,
  .results-section {
    width: 100vw;
    max-width: 100vw;
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero {
    padding-top: 48px;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 29px;
  }

  .subtitle {
    font-size: 18px;
    max-width: 330px;
  }

  .hero-text,
  .motion-copy {
    max-width: 330px;
    margin-right: auto;
    margin-left: auto;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
    width: min(100%, 330px);
    margin-right: auto;
    margin-left: auto;
  }

  .actions .button {
    width: 100%;
  }

  .gallery-header,
  .release-panel {
    display: block;
  }

  .gallery-controls {
    justify-content: space-between;
    margin-top: 14px;
  }

  .main-case,
  .portrait-case {
    grid-template-columns: 1fr;
  }

  .feature-inputs,
  .portrait-case .feature-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .release-panel .button {
    width: 100%;
    margin-top: 18px;
  }

  footer {
    display: block;
  }

  footer span {
    display: block;
  }

  footer span + span {
    margin-top: 8px;
  }
}

@media (max-width: 560px) {
  nav {
    display: none;
  }

  .venue,
  .eyebrow {
    font-size: 11px;
  }

  .hero-text,
  .motion-copy p:last-child,
  .section-head p,
  .release-panel p {
    font-size: 15px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 25px;
  }

  .subtitle {
    font-size: 17px;
  }

  .mosaic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 138px;
    gap: 10px;
  }

  .mosaic-tile,
  .mosaic-tile.tile-half,
  .mosaic-tile.tile-third,
  .mosaic-tile.tile-wide,
  .mosaic-tile.tile-tall {
    grid-column: span 2;
    grid-row: span 2;
  }

  .contribution-grid,
  .metrics,
  .triplet-board {
    grid-template-columns: 1fr;
  }

  .input-card:nth-child(1),
  .input-card:nth-child(2),
  .output-card {
    grid-column: 1;
  }

  .gallery-shell {
    padding: 14px;
  }

  .feature-inputs,
  .landscape-case .feature-inputs,
  .portrait-case .feature-inputs {
    grid-template-columns: 1fr;
  }

  .input-card img,
  .output-card img {
    height: auto;
    aspect-ratio: 3 / 4;
  }
}
