:root {
  color-scheme: light;
  --bg: #fbfcfc;
  --paper: #ffffff;
  --soft: #eef8f6;
  --soft-2: #f8f2f7;
  --ink: #09122e;
  --muted: #586174;
  --faint: #d9e4e3;
  --line: #ccd9d8;
  --teal: #007a78;
  --teal-dark: #005e5c;
  --teal-soft: #d8f1ee;
  --magenta: #c71472;
  --magenta-soft: #f8dbea;
  --good: #06846f;
  --bad: #c71472;
  --shadow: 0 18px 45px rgba(16, 45, 57, 0.09);
  --radius: 8px;
  --max: 1380px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Arial, Helvetica, Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
select,
input {
  font: inherit;
}

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

img,
svg {
  display: block;
}

img {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

button,
select,
input {
  color: inherit;
}

button,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

button {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 122, 120, 0.25);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 252, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  gap: 1px;
  min-width: 0;
}

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

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.site-nav a {
  flex: 0 0 auto;
  border-radius: 6px;
  color: #26314d;
  font-size: 14px;
  font-weight: 680;
  padding: 8px 13px;
}

.site-nav a:hover {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.section-band {
  border-bottom: 1px solid var(--line);
  padding: 34px 32px;
}

.section-band > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.84fr) minmax(620px, 1.5fr);
  gap: 34px;
  align-items: start;
  min-height: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.72)),
    radial-gradient(circle at 72% 18%, rgba(199, 20, 114, 0.1), transparent 34%),
    linear-gradient(180deg, #ffffff, #f5fbfa);
}

.hero > * {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.hero-copy {
  max-width: 540px;
}

.hero-copy h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 820;
}

.hero-copy > p {
  margin: 20px 0 0;
  max-width: 480px;
  color: #2f3b56;
  font-size: 18px;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 44px;
}

.focus-grid article {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.focus-grid svg {
  width: 34px;
  height: 34px;
  color: var(--teal);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.focus-grid article:nth-child(even) svg {
  color: var(--magenta);
}

.focus-grid h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 780;
}

.focus-grid p {
  margin: 0;
  color: #3f4a60;
  font-size: 13px;
  line-height: 1.38;
}

.hero-lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
  min-width: 0;
}

.comparison-shell {
  min-width: 0;
}

.compare-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.92 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f2f5f4;
  box-shadow: var(--shadow);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.compare-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
  pointer-events: none;
  transform-origin: center;
  transition: transform 180ms ease;
}

.after-img {
  clip-path: inset(0 50% 0 0);
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-1px);
}

.compare-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(9, 18, 46, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(9, 18, 46, 0.18);
  transform: translate(-50%, -50%);
}

.compare-divider svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.image-tag {
  position: absolute;
  bottom: 14px;
  z-index: 3;
  border-radius: 5px;
  background: rgba(9, 18, 46, 0.8);
  color: white;
  font-size: 13px;
  font-weight: 760;
  padding: 7px 9px;
}

.image-tag-left {
  left: 14px;
}

.image-tag-right {
  right: 14px;
}

.hero-gallery {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hero-gallery button {
  display: grid;
  gap: 7px;
  padding: 8px;
  text-align: left;
}

.hero-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  object-fit: cover;
}

.hero-gallery span {
  font-size: 12px;
  font-weight: 720;
}

.comparison-shell.mode-gallery .compare-frame {
  display: none;
}

.comparison-shell.mode-gallery .hero-gallery {
  display: grid;
}

.control-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  padding: 18px;
  box-shadow: var(--shadow);
}

.control-panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.2;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f3f8f7;
  padding: 3px;
}

.segmented-btn,
.metric-btn {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #33405a;
  font-size: 13px;
  font-weight: 760;
}

.segmented-btn.is-active,
.metric-btn.is-active {
  background: var(--teal);
  color: white;
  box-shadow: 0 6px 14px rgba(0, 122, 120, 0.22);
}

.field-label,
.slider-label,
.denoise-toolbar label {
  display: grid;
  gap: 8px;
  color: #25304a;
  font-size: 13px;
  font-weight: 740;
}

.slider-label {
  grid-template-columns: 1fr auto;
}

select {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  color: #1e2a44;
  font-size: 14px;
  font-weight: 620;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

output {
  color: var(--muted);
  font-weight: 700;
}

.outline-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: #1e2a44;
  font-size: 14px;
  font-weight: 760;
  padding: 0 12px;
}

.outline-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.outline-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.workflow {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  background: var(--soft);
}

.workflow > * {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.section-intro h2 {
  margin: 0;
  color: var(--teal-dark);
  font-size: 26px;
  line-height: 1.05;
}

.denoise .section-intro h2,
.audit .section-intro h2 {
  color: var(--magenta);
}

.section-intro p {
  margin: 14px 0 0;
  color: #32405a;
  font-size: 16px;
}

.workflow-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-rail::before {
  position: absolute;
  top: 18px;
  left: 9%;
  right: 9%;
  height: 1px;
  border-top: 1px dashed rgba(0, 94, 92, 0.45);
  content: "";
}

.workflow-rail li {
  position: relative;
  display: grid;
  gap: 9px;
  min-width: 0;
  padding-top: 44px;
}

.step-index {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 13px;
  font-weight: 820;
}

.workflow-rail svg,
.audit-grid svg {
  width: 42px;
  height: 42px;
  color: var(--teal);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.workflow-rail h3,
.audit-grid h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 790;
}

.workflow-rail p,
.audit-grid p {
  margin: 0;
  color: #3f4a60;
  font-size: 13px;
}

.denoise {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  background: #ffffff;
}

.denoise > * {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.denoise-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 160px;
  gap: 14px;
  align-items: end;
  grid-column: 2;
  margin-bottom: 16px;
}

.denoise-toolbar label {
  color: #25304a;
}

.switch-label {
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  padding: 0 11px;
}

.switch-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: #cdd9d7;
  transition: background 160ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(9, 18, 46, 0.2);
  transition: transform 160ms ease;
  content: "";
}

.switch-label input:checked + .switch {
  background: var(--teal);
}

.switch-label input:checked + .switch::after {
  transform: translateX(18px);
}

.denoise-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(126px, 1fr));
  gap: 14px;
  grid-column: 2;
}

.method-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 13px;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.method-card:hover,
.method-card.is-active {
  border-color: rgba(199, 20, 114, 0.75);
  box-shadow: 0 12px 28px rgba(199, 20, 114, 0.12);
  transform: translateY(-1px);
}

.method-card h3 {
  margin: 0;
  min-height: 36px;
  color: #17233e;
  font-size: 13px;
  line-height: 1.25;
}

.method-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  object-fit: cover;
}

.method-stat {
  display: grid;
  gap: 7px;
}

.method-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #39445b;
  font-size: 12px;
  font-weight: 720;
}

.meter {
  overflow: hidden;
  height: 8px;
  border-radius: 99px;
  background: #edf2f1;
}

.meter span {
  display: block;
  width: var(--meter, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--magenta);
}

.models {
  background: linear-gradient(180deg, #f9fcfc, #ffffff);
}

.models .section-intro,
.model-controls,
.model-grid {
  max-width: var(--max);
}

.models .section-intro {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 24px;
  align-items: end;
}

.models .section-intro p {
  margin-top: 0;
  max-width: 670px;
}

.model-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 18px;
  color: #25304a;
  font-size: 13px;
  font-weight: 760;
}

.model-controls .segmented {
  width: 220px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.model-card {
  display: grid;
  grid-template-columns: 150px minmax(240px, 1fr) 190px;
  gap: 18px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(9, 18, 46, 0.05);
}

.model-card h3 {
  margin: 0 0 16px;
  color: var(--teal-dark);
  font-size: 18px;
  line-height: 1.1;
}

.model-card:nth-child(2) h3 {
  color: var(--magenta);
}

.accuracy-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.accuracy-value {
  display: block;
  margin-top: 4px;
  font-size: 34px;
  line-height: 1;
  font-weight: 760;
}

.matrix {
  display: grid;
  gap: 6px;
}

.matrix-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.matrix-table {
  display: grid;
  grid-template-columns: 98px repeat(3, minmax(56px, 1fr));
  border: 1px solid #e0e8e7;
  border-radius: 6px;
  overflow: hidden;
}

.matrix-cell {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.matrix-cell.header,
.matrix-cell.label {
  background: #f4f8f7;
  color: #3c4658;
  font-size: 10px;
  line-height: 1.2;
  padding: 5px;
}

.class-bars {
  display: grid;
  gap: 12px;
}

.class-bars h4 {
  margin: 0;
  color: #202b43;
  font-size: 13px;
}

.class-bar {
  display: grid;
  gap: 5px;
}

.class-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #3b465d;
  font-size: 11px;
  font-weight: 740;
}

.class-bar .meter span {
  background: var(--teal);
}

.audit {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  background: #ffffff;
}

.audit > * {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.audit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-left: 1px solid var(--line);
}

.audit-grid article {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 0 22px;
}

.audit-grid article:nth-child(odd) svg {
  color: var(--magenta);
}

.site-footer {
  padding: 24px 32px 34px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1200px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy {
    max-width: 920px;
  }

  .hero-lab {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

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

  .denoise-toolbar,
  .denoise-grid {
    grid-column: auto;
  }

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

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

  .model-card {
    grid-template-columns: 150px minmax(260px, 1fr) 220px;
  }

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

  .audit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-left: 0;
    gap: 18px;
  }

  .audit-grid article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
  }
}

@media (max-width: 880px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    padding: 14px 18px;
  }

  .site-nav {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .section-band {
    padding: 30px 18px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .hero-copy > p {
    font-size: 16px;
  }

  .focus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 30px;
  }

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

  .compare-frame {
    aspect-ratio: 1.35 / 1;
  }

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

  .workflow-rail {
    grid-template-columns: 1fr;
  }

  .workflow-rail::before {
    display: none;
  }

  .workflow-rail li {
    min-height: 112px;
    border-bottom: 1px solid rgba(0, 94, 92, 0.18);
    padding-top: 0;
    padding-left: 48px;
  }

  .workflow-rail li:last-child {
    border-bottom: 0;
  }

  .denoise-toolbar {
    grid-template-columns: 1fr;
  }

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

  .models .section-intro {
    grid-template-columns: 1fr;
  }

  .model-controls {
    justify-content: flex-start;
  }

  .model-card {
    grid-template-columns: 1fr;
  }

  .matrix-table {
    grid-template-columns: 86px repeat(3, minmax(54px, 1fr));
  }

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

@media (max-width: 540px) {
  .hero-copy h1 {
    font-size: 28px;
  }

  .focus-grid,
  .denoise-grid,
  .hero-gallery {
    grid-template-columns: 1fr;
  }

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

  .compare-frame {
    aspect-ratio: 1.22 / 1;
  }

  .control-panel {
    padding: 14px;
  }

  .model-controls {
    display: grid;
    justify-content: stretch;
  }

  .model-controls .segmented {
    width: 100%;
  }

  .matrix-cell {
    min-height: 34px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
