:root {
  color-scheme: light;
  --ink: #151511;
  --muted: #706f66;
  --paper: #f1f0ea;
  --surface: #f8f7f2;
  --line: #d8d6cc;
  --accent: #f25524;
  --viewer: #11110f;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -12%, rgb(242 85 36 / 9%), transparent 32rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 32px;
  border-bottom: 1px solid rgb(23 23 19 / 12%);
  background: rgb(241 240 234 / 84%);
  backdrop-filter: blur(22px) saturate(1.25);
}

.brand {
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.brand span,
.hero h1 span {
  color: var(--accent);
}

nav {
  display: flex;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

nav a {
  padding: 8px 10px;
  border-radius: 999px;
  transition: color 160ms ease, background-color 160ms ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--ink);
  background: rgb(21 21 17 / 6%);
}

main {
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(720px, calc(100vh - 94px));
  margin-top: 24px;
  align-content: center;
  justify-items: center;
  padding: 96px 0 80px;
  overflow: hidden;
  border: 1px solid rgb(21 21 17 / 9%);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 49%, rgb(242 85 36 / 16%), transparent 27%),
    linear-gradient(145deg, rgb(255 255 255 / 72%), rgb(248 247 242 / 38%));
  box-shadow: 0 28px 90px rgb(42 38 27 / 6%);
  text-align: center;
  isolation: isolate;
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  background: linear-gradient(90deg, transparent, rgb(21 21 17 / 8%), transparent);
  content: "";
}

.hero::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(transparent, rgb(21 21 17 / 8%), transparent);
}

.hero::after {
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
}

.model-specs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.model-specs span {
  padding: 12px 18px;
  border: 1px solid rgb(21 21 17 / 12%);
  border-radius: 999px;
  background: rgb(255 255 255 / 58%);
  color: var(--ink);
  box-shadow: 0 8px 24px rgb(42 38 27 / 5%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.025em;
  backdrop-filter: blur(10px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(72px, 12vw, 174px);
  font-weight: 820;
  letter-spacing: -0.082em;
  line-height: 0.88;
}

.hero-copy {
  max-width: 980px;
  margin: 44px 0 0;
  color: #4f4e47;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 480;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.result-case {
  position: relative;
  padding: 132px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 70px;
}

.case-heading {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  max-width: 880px;
  margin-bottom: 42px;
}

.case-index {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.case-index::after {
  width: 20px;
  height: 1px;
  background: currentColor;
  content: "";
}

.case-heading h2 {
  margin: 0;
  font-size: clamp(40px, 5vw, 68px);
  font-weight: 780;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.case-heading p:last-child {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.comparison {
  width: 100%;
  margin-inline: auto;
  padding: 8px 8px 0;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 17px;
  background: #181816;
  box-shadow:
    0 36px 90px rgb(21 21 17 / 16%),
    0 2px 8px rgb(21 21 17 / 9%);
}

.comparison[data-layout="portrait"] {
  max-width: 680px;
}

.comparison[data-layout="compact"] {
  max-width: 1040px;
}

.viewport {
  --split: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: var(--media-ratio);
  overflow: hidden;
  border-radius: 10px 10px 5px 5px;
  background: var(--viewer);
  cursor: default;
  isolation: isolate;
  touch-action: none;
  user-select: none;
}

.viewport.is-zoomed {
  cursor: grab;
}

.viewport.is-panning {
  cursor: grabbing;
}

.image-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.image-layer.output {
  clip-path: inset(0 0 0 var(--split));
}

.image-layer img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
  user-select: none;
}

.image-label {
  position: absolute;
  top: 16px;
  z-index: 20;
  padding: 8px 11px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 999px;
  background: rgb(10 10 9 / 76%);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.1em;
  line-height: 1;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.image-label.input {
  left: 16px;
}

.image-label.output {
  right: 16px;
  border-color: rgb(255 255 255 / 18%);
  background: rgb(242 85 36 / 86%);
  color: #fff;
}

.divider {
  position: absolute;
  top: 0;
  left: var(--split);
  z-index: 30;
  width: 44px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: ew-resize;
  transform: translateX(-50%);
  touch-action: none;
}

.divider::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 12%);
  content: "";
  transform: translateX(-50%);
}

.divider-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgb(17 17 15 / 86%);
  box-shadow: 0 6px 22px rgb(0 0 0 / 34%);
  font-size: 16px;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(8px);
}

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

.viewer-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 54px;
  padding: 8px 4px 10px;
}

.viewer-controls::before {
  margin-right: auto;
  padding-left: 8px;
  color: rgb(255 255 255 / 42%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  content: "Scroll to zoom · Drag to pan";
}

.viewer-controls button {
  min-width: 38px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 7px;
  background: rgb(255 255 255 / 6%);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    background-color 150ms ease,
    border-color 150ms ease;
}

.viewer-controls button:focus-visible {
  border-color: rgb(255 255 255 / 30%);
  background: rgb(255 255 255 / 12%);
}

.viewer-controls button:active {
  transform: scale(0.96);
}

@media (hover: hover) and (pointer: fine) {
  .viewer-controls button:hover {
    border-color: rgb(255 255 255 / 26%);
    background: rgb(255 255 255 / 11%);
  }
}

.zoom-value {
  min-width: 54px;
  color: rgb(255 255 255 / 52%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
  padding: 42px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 780px) {
  .site-header {
    padding: 0 20px;
  }

  nav {
    display: none;
  }

  main {
    width: min(100% - 24px, 1320px);
  }

  .hero {
    min-height: 570px;
    margin-top: 12px;
    padding: 72px 18px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: clamp(64px, 23vw, 108px);
  }

  .model-specs {
    gap: 8px;
  }

  .model-specs span {
    padding: 9px 12px;
    font-size: 14px;
  }

  .result-case {
    padding: 92px 0;
  }

  .case-heading {
    grid-template-columns: 38px 1fr;
    gap: 10px;
    margin-bottom: 28px;
  }

  .viewport {
    border-radius: 7px 7px 4px 4px;
  }

  .image-label {
    top: 10px;
  }

  .image-label.input {
    left: 10px;
  }

  .image-label.output {
    right: 10px;
  }

  .viewer-controls::before {
    display: none;
  }

  footer {
    width: min(100% - 24px, 1360px);
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
