@font-face {
  font-family: "Inter";
  src: url("assets/brand/Inter.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Unbounded";
  src: url("assets/brand/Unbounded.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/brand/JetBrainsMono.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --blue: #001189;
  --milk: #e2e2e0;
  --ink: #0b0f1a;
  --mist: #c9cee3;
  --deep-teal: #0e7d6d;
  --white: #fafafa;
  --line: rgba(0, 17, 137, 0.16);
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--milk);
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.shell {
  width: min(100% - 64px, 1480px);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 250, 0.68);
}

.site-header__inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 22px; }

.brand__logo { display: block; width: 104px; height: 60px; object-fit: contain; }

.brand__divider { width: 1px; height: 24px; background: var(--mist); }

.brand__client { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; }

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--blue);
  background: white;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--deep-teal); }

.intro { padding: clamp(42px, 5.6vw, 84px) 0 clamp(30px, 3.3vw, 52px); }

.eyebrow, .section-label, .viewer-heading__counter, .scene-card__number,
.material-card__index, .material-card__caption, .page-footer span {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow { margin: 0 0 26px; color: var(--blue); }
.eyebrow span { padding-inline: 10px; color: var(--deep-teal); }

.intro__row { display: flex; align-items: end; justify-content: space-between; gap: 40px; }

.intro h1 {
  max-width: 800px;
  margin: 0;
  font-family: "Unbounded", "Inter", sans-serif;
  font-size: clamp(38px, 4.1vw, 64px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.055em;
}

.intro__aside { width: min(30%, 340px); }

.intro__lead {
  margin: 0 0 6px;
  color: #383d47;
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.55;
}

.upload-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  margin-top: 22px;
  padding: 15px 18px;
  border-radius: 9px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition: background .18s ease, transform .18s ease;
}

.upload-button:hover { background: #1429a3; transform: translateY(-2px); }
.intro__aside:has(#photo-input:focus-visible) .upload-button { outline: 3px solid var(--deep-teal); outline-offset: 3px; }
.upload-button span { font-size: 20px; line-height: 1; }
.test-photo-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
  padding: 12px 18px;
  border: 1px solid var(--blue);
  border-radius: 9px;
  background: transparent;
  color: var(--blue);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: background .18s ease, transform .18s ease;
}
.test-photo-button:hover { background: rgba(0, 17, 137, .06); transform: translateY(-2px); }
.test-photo-button:focus-visible { outline: 3px solid var(--deep-teal); outline-offset: 3px; }
.test-photo-button span { font-size: 18px; line-height: 1; }
.upload-note { display: block; margin-top: 9px; color: #5c6370; font-size: 11px; line-height: 1.4; }

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

.workspace__main { min-width: 0; }

.viewer-heading {
  min-height: 82px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 2px 18px;
}

.viewer-heading__counter { display: block; margin-bottom: 7px; color: var(--deep-teal); }

.viewer-heading h2 {
  margin: 0;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.viewer-heading__hint { margin: 0 0 3px; color: #4f5560; font-size: 13px; }

.comparison {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #b9b8b2;
  box-shadow: 0 12px 40px rgba(11, 15, 26, 0.12);
  isolation: isolate;
}

.comparison.is-portrait { width: min(100%, 620px); margin-inline: auto; }

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

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

.editor-overlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.comparison[data-mode="edit"] .editor-overlay { display: block; }
.comparison[data-mode="edit"] .comparison__after,
.comparison[data-mode="edit"] .comparison__range,
.comparison[data-mode="edit"] .comparison__line,
.comparison[data-mode="edit"] .comparison__handle,
.comparison[data-mode="edit"] .comparison__tag { display: none; }

.editor-overlay__area { fill: rgba(0, 17, 137, 0.18); stroke: #25d3b8; stroke-width: 3; stroke-dasharray: 12 8; }
.editor-overlay__handle { fill: var(--blue); stroke: white; stroke-width: 4; }
.editor-overlay__hit { fill: transparent; cursor: grab; }
.editor-overlay__hit:active { cursor: grabbing; }
.editor-overlay__number { fill: white; font-family: "JetBrains Mono", monospace; font-weight: 700; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.editor-overlay__drawing-surface { fill: transparent; pointer-events: none; }
.editor-overlay.is-drawing-exclusion { cursor: crosshair; }
.editor-overlay.is-drawing-exclusion .editor-overlay__drawing-surface { pointer-events: all; }
.editor-overlay.is-drawing-exclusion .editor-overlay__hit { pointer-events: none; }
.editor-overlay__exclusion { fill: rgba(255, 180, 47, 0.28); stroke: #f6a10d; stroke-width: 3; }
.editor-overlay__draft { fill: rgba(255, 180, 47, 0.14); stroke: #f6a10d; stroke-width: 3; stroke-dasharray: 11 7; pointer-events: none; }
.editor-overlay__draft-point { fill: #f6a10d; stroke: white; stroke-width: 2; pointer-events: none; }

.comparison[data-status="loading"] .comparison__after,
.comparison[data-status="missing"] .comparison__after { opacity: 0; }

.comparison__tag {
  position: absolute;
  z-index: 2;
  top: 18px;
  min-width: 66px;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(11, 15, 26, 0.78);
  color: white;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

.comparison__tag--before { left: 18px; }
.comparison__tag--after { right: 18px; background: var(--blue); }

.comparison__line {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  background: white;
  transform: translateX(-50%);
  box-shadow: 0 0 14px rgba(11, 15, 26, 0.3);
  pointer-events: none;
}

.comparison__handle {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: var(--split);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 48px;
  height: 48px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  color: white;
  font-size: 29px;
  font-weight: 400;
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.comparison__handle span { margin-top: -5px; }

.comparison__range {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.comparison:has(.comparison__range:focus-visible) { outline: 3px solid var(--deep-teal); outline-offset: 4px; }

.comparison__state {
  display: none;
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  max-width: calc(100% - 36px);
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(11, 15, 26, 0.82);
  color: white;
  font-size: 12px;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.comparison[data-status="loading"] .comparison__state,
.comparison[data-status="missing"] .comparison__state { display: block; }

.comparison[data-status="loading"] .comparison__line,
.comparison[data-status="loading"] .comparison__handle,
.comparison[data-status="missing"] .comparison__line,
.comparison[data-status="missing"] .comparison__handle,
.comparison[data-status="loading"] .comparison__tag--after,
.comparison[data-status="missing"] .comparison__tag--after { display: none; }

.viewer-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 15px 2px 0;
  color: #4d5561;
  font-size: 12px;
  line-height: 1.5;
}

.viewer-disclaimer__mark {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--deep-teal);
}

.editor-panel {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
}

.editor-panel[hidden] { display: none; }
.editor-panel__intro strong { font-size: 16px; font-weight: 700; }
.editor-panel__intro p { max-width: 700px; margin: 7px 0 0; color: #535965; font-size: 12px; line-height: 1.5; }
.editor-panel__controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 18px; }
.editor-panel__controls label { display: grid; gap: 5px; color: #424a56; font-size: 11px; font-weight: 650; }
.editor-panel__controls input {
  width: 112px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--mist);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-size: 14px;
}
.editor-panel__controls input:focus-visible { outline: 2px solid var(--deep-teal); outline-offset: 1px; }
.editor-panel__controls button,
.editor-panel__controls a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.editor-panel__controls button[hidden],
.editor-panel__controls a[hidden] { display: none; }
.editor-panel__controls .editor-panel__primary { background: var(--blue); color: white; }
.editor-panel__controls .editor-panel__secondary { background: white; color: var(--blue); }
.editor-panel__controls button:hover,
.editor-panel__controls a:hover { background: #e7eaff; color: var(--blue); }
.editor-panel__controls button:disabled { cursor: wait; opacity: .55; }
.editor-panel__controls button:focus-visible,
.editor-panel__controls a:focus-visible { outline: 2px solid var(--deep-teal); outline-offset: 2px; }
.editor-panel__status { margin: 12px 0 0; color: #535965; font-size: 12px; line-height: 1.5; }
.editor-panel__status.is-error { color: #a52f28; }

.exclusion-tools { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.exclusion-tools summary { color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700; line-height: 1.5; }
.exclusion-tools summary:focus-visible { outline: 2px solid var(--deep-teal); outline-offset: 4px; }
.exclusion-tools p { max-width: 700px; margin: 10px 0 12px; color: #535965; font-size: 12px; line-height: 1.5; }
.exclusion-tools__draft { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.exclusion-tools__draft[hidden] { display: none; }
.exclusion-tools__button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--mist);
  border-radius: 7px;
  background: white;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}
.exclusion-tools__button:hover { border-color: var(--blue); background: #eef0fc; }
.exclusion-tools__button:focus-visible { outline: 2px solid var(--deep-teal); outline-offset: 2px; }
.exclusion-tools__button:disabled { cursor: default; opacity: .45; }
.exclusion-tools__button--primary { border-color: var(--blue); background: var(--blue); color: white; }
.exclusion-tools__button--primary:hover { background: #1429a3; color: white; }
.exclusion-tools__list { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.exclusion-tools__list:empty { display: none; }
.exclusion-tools__list li { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: #424a56; font-size: 12px; }
.exclusion-tools__list button { padding: 2px 4px; border: 0; background: transparent; color: var(--blue); cursor: pointer; font: inherit; font-weight: 700; }
.exclusion-tools__list button:hover { text-decoration: underline; }

.scenes-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 30px 0 12px;
}

.section-label { margin: 0; color: var(--blue); }
.scenes-heading__count { color: #6e7480; font-size: 12px; }

.scenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.scenes:has([data-scene="uploaded"]) { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.scene-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.scene-card:hover { border-color: var(--blue); background: white; transform: translateY(-2px); }
.scene-card:focus-visible { outline: 3px solid var(--deep-teal); outline-offset: 2px; }
.scene-card.is-active { border-color: var(--blue); background: white; box-shadow: inset 0 0 0 1px var(--blue); }

.scene-card img {
  flex: 0 0 72px;
  width: 72px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}

.scene-card__copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.scene-card__number { color: var(--deep-teal); font-size: 10px; }
.scene-card strong { font-size: 12px; font-weight: 650; line-height: 1.25; }
.scene-card__arrow { margin-left: auto; align-self: flex-start; color: var(--blue); font-size: 17px; line-height: 1; }

.side-panel { display: grid; gap: 14px; padding-top: 82px; }

.material-card {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 27px;
  border-radius: 16px;
  background: var(--blue);
  color: var(--milk);
}

.material-card::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -116px;
  bottom: -170px;
  border: 1px solid rgba(37, 211, 184, 0.45);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(37, 211, 184, 0.06), 0 0 0 90px rgba(37, 211, 184, 0.04);
  pointer-events: none;
}

.material-card .section-label { color: #25d3b8; }
.material-card__index { display: block; margin-top: 58px; color: #25d3b8; }

.material-card h2 {
  position: relative;
  z-index: 1;
  margin: 8px 0 17px;
  font-family: "Unbounded", "Inter", sans-serif;
  font-size: clamp(30px, 2.2vw, 38px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.material-card > p:not(.section-label) {
  position: relative;
  z-index: 1;
  max-width: 240px;
  margin: 0;
  color: #d8ddf5;
  font-size: 14px;
  line-height: 1.55;
}

.material-card__source {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: 18px;
  color: var(--milk);
  font-size: 13px;
  font-weight: 650;
  text-decoration-color: #25d3b8;
  text-underline-offset: 5px;
}

.material-card__source:hover { color: #25d3b8; }
.material-card__source:focus-visible { outline: 2px solid #25d3b8; outline-offset: 4px; }

.material-card__rule { margin-top: auto; border-top: 1px solid rgba(226, 226, 224, 0.28); }
.material-card__caption { position: relative; z-index: 1; margin-top: 17px; color: #cdd3ed; font-size: 10px; }

.detail-card { padding: 24px 27px 27px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.62); }
.detail-card ol { display: grid; gap: 15px; margin: 24px 0 0; padding: 0; list-style: none; }
.detail-card li { display: flex; align-items: baseline; gap: 13px; font-size: 13px; line-height: 1.4; }
.detail-card li span { flex: 0 0 auto; color: var(--deep-teal); font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 700; }

.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 30px;
  margin-top: clamp(44px, 5vw, 74px);
  padding: 19px 0 32px;
  border-top: 1px solid var(--line);
  color: #535965;
}

.page-footer p { margin: 0; font-size: 12px; line-height: 1.5; }
.page-footer span { flex: 0 0 auto; color: var(--blue); }

@media (min-width: 1181px) {
  .scenes:has([data-scene="uploaded"]) .scene-card { gap: 8px; }
  .scenes:has([data-scene="uploaded"]) .scene-card img { flex: 0 0 56px; width: 56px; height: 48px; }
  .scenes:has([data-scene="uploaded"]) .scene-card__arrow { display: none; }
}

@media (max-width: 1180px) {
  .scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scenes:has([data-scene="uploaded"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
  .side-panel { padding-top: 82px; }
  .material-card { min-height: 330px; padding: 23px; }
  .detail-card { padding: 22px 23px; }
  .scene-card { gap: 8px; }
  .scene-card img { flex-basis: 58px; width: 58px; height: 50px; }
  .scene-card__arrow { display: none; }
}

@media (max-width: 840px) {
  .intro__row { display: block; }
  .intro__aside { width: min(100%, 560px); margin-top: 23px; }
  .upload-button { max-width: 340px; }
  .workspace { grid-template-columns: 1fr; }
  .side-panel { grid-template-columns: 1fr 1fr; padding-top: 0; }
  .material-card { min-height: 230px; }
  .material-card__index { margin-top: 18px; }
  .detail-card { min-height: 230px; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 32px, 1480px); }
  .site-header__inner { min-height: 70px; }
  .brand { gap: 12px; }
  .brand__logo { width: 78px; height: 46px; }
  .brand__divider { height: 20px; }
  .brand__client { font-size: 13px; }
  .demo-badge { padding: 8px 10px; font-size: 10px; }
  .intro { padding: 40px 0 24px; }
  .eyebrow { margin-bottom: 18px; font-size: 10px; }
  .intro h1 { font-size: clamp(30px, 8vw, 42px); line-height: 1.17; }
  .intro__aside { margin-top: 18px; }
  .intro__lead { font-size: 14px; }
  .upload-button { margin-top: 18px; }
  .viewer-heading { min-height: 68px; padding-bottom: 13px; }
  .viewer-heading__hint { display: none; }
  .viewer-heading h2 { font-size: 20px; }
  .comparison { border-radius: 12px; }
  .comparison__tag { top: 10px; min-width: 52px; padding: 7px 8px; font-size: 9px; }
  .comparison__tag--before { left: 10px; }
  .comparison__tag--after { right: 10px; }
  .comparison__handle { width: 38px; height: 38px; font-size: 24px; }
  .comparison__state { bottom: 8px; font-size: 10px; }
  .viewer-disclaimer { font-size: 11px; }
  .editor-panel { padding: 16px; }
  .editor-panel__controls label { flex: 1 1 120px; }
  .editor-panel__controls input { width: 100%; }
  .editor-panel__controls .editor-panel__primary { width: 100%; }
  .scenes-heading { margin-top: 24px; }
  .scenes { grid-template-columns: 1fr; gap: 8px; }
  .scenes:has([data-scene="uploaded"]) { grid-template-columns: 1fr; }
  .scene-card { padding: 7px; }
  .scene-card img { flex-basis: 78px; width: 78px; height: 48px; }
  .scene-card strong { font-size: 13px; }
  .scene-card__arrow { display: block; }
  .side-panel { grid-template-columns: 1fr; gap: 10px; }
  .material-card { min-height: 250px; }
  .detail-card { min-height: unset; }
  .page-footer { display: block; margin-top: 40px; }
  .page-footer span { display: block; margin-top: 15px; }
}

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