:root {
  color-scheme: light dark;
  --ink: #172026;
  --line: #d3dbe1;
  --panel: #ffffff;
  --page: #eef2f4;
  --accent: #0f766e;
  --accent-strong: #0a5d57;
  --accent-soft: #e4f7f3;
  --accent-ink: #ffffff;
  --shadow: 0 18px 42px rgba(23, 32, 38, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #edf3f2;
    --line: #35424a;
    --panel: #151b1f;
    --page: #0d1114;
    --accent: #45c7b7;
    --accent-strong: #8be7dc;
    --accent-soft: #163a37;
    --accent-ink: #06201d;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
  }
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--accent-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

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

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.05;
}

h2 {
  font-size: 20px;
}

.docs-link {
  font-weight: 800;
  text-decoration: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  align-items: start;
}

.viewer,
.library {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.viewer {
  overflow: hidden;
}

.viewer-head {
  min-height: 56px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.comparison {
  --split: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 360px;
  overflow: hidden;
  background: #0d1114;
  cursor: col-resize;
  touch-action: none;
}

.comparison img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.comparison .denoised {
  clip-path: inset(0 0 0 var(--split));
}

.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 44px;
  padding: 0;
  border: 0;
  transform: translateX(-50%);
  background: transparent;
  cursor: col-resize;
}

.divider::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28), 0 0 24px rgba(0, 0, 0, 0.34);
  content: "";
}

.divider::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--accent-ink);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
  content: "";
}

.divider:focus-visible::after {
  outline: 3px solid var(--accent-ink);
  outline-offset: 3px;
}

.library {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.scene-button {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}

.scene-button:hover,
.scene-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.scene-button img {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.scene-button span {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 880px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .library {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scene-button {
    grid-template-columns: 1fr;
  }

  .scene-button img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 24px, 680px);
    padding-top: 16px;
  }

  header {
    display: grid;
    align-items: start;
  }

  h1 {
    font-size: 28px;
  }

  .comparison {
    min-height: 220px;
  }

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