:root {
  --bg-0: #050912;
  --bg-1: #07111d;
  --bg-2: #091624;
  --panel: rgba(10, 18, 33, 0.84);
  --panel-strong: rgba(12, 20, 36, 0.96);
  --stroke: rgba(155, 187, 255, 0.16);
  --stroke-strong: rgba(155, 187, 255, 0.28);
  --text: #edf4ff;
  --muted: rgba(237, 244, 255, 0.68);
  --soft: rgba(237, 244, 255, 0.08);
  --accent: #74e9ff;
  --accent-2: #ffba6a;
  --good: #6ceeb4;
  --warn: #ffd86b;
  --bad: #ff7d8d;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.46);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(116, 233, 255, 0.12), transparent 22%),
    radial-gradient(circle at 86% 10%, rgba(255, 186, 106, 0.12), transparent 20%),
    radial-gradient(circle at 78% 82%, rgba(108, 238, 180, 0.08), transparent 18%),
    linear-gradient(165deg, var(--bg-0) 0%, var(--bg-1) 42%, var(--bg-2) 100%);
}

*, *::before, *::after {
  box-sizing: border-box;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input {
  border: 0;
  outline: none;
}

::selection {
  background: rgba(116, 233, 255, 0.26);
}

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(26px);
  opacity: 0.8;
  z-index: 0;
  animation: float 14s ease-in-out infinite;
}

.ambient--one {
  top: 10%;
  left: -6%;
  width: 24rem;
  height: 24rem;
  background: rgba(116, 233, 255, 0.12);
}

.ambient--two {
  top: 22%;
  right: -8%;
  width: 28rem;
  height: 28rem;
  background: rgba(255, 186, 106, 0.10);
  animation-delay: -5s;
}

.ambient--three {
  bottom: -6%;
  left: 22%;
  width: 20rem;
  height: 20rem;
  background: rgba(108, 238, 180, 0.08);
  animation-delay: -9s;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
  display: grid;
  gap: 18px;
}

.panel,
.hero {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(12, 22, 42, 0.90), rgba(8, 14, 28, 0.84));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  padding: clamp(18px, 3vw, 30px);
}

.hero__copy {
  display: grid;
  align-content: start;
  gap: 14px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(116, 233, 255, 0.06);
  color: var(--accent);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow--compact {
  padding: 6px 10px;
  font-size: 0.82rem;
}

h1,
h2,
h3,
p,
dl,
ol,
figure {
  margin: 0;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.lede {
  max-width: 68ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.7;
}

.note-card,
.fact,
.dropzone,
.preview-card,
.upload-actions,
.progress-shell {
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(14, 23, 41, 0.94), rgba(9, 16, 30, 0.96));
}

.preview-card__label,
.fact dt,
.note-card h3 {
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.84rem;
}

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

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.upload-panel,
.preview-panel,
.notes-panel {
  min-height: 100%;
}

.dropzone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 16% 20%, rgba(116, 233, 255, 0.12), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 186, 106, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(13, 22, 39, 0.92), rgba(8, 14, 27, 0.96));
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  user-select: none;
  cursor: pointer;
}

.dropzone:hover {
  transform: translateY(-1px);
  border-color: var(--stroke-strong);
}

.dropzone.is-dragover {
  border-color: rgba(116, 233, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(116, 233, 255, 0.12), var(--shadow);
  transform: translateY(-1px) scale(1.01);
}

.dropzone__icon {
  width: 4.1rem;
  height: 4.1rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(116, 233, 255, 0.08);
  border: 1px solid rgba(116, 233, 255, 0.14);
}

.dropzone__icon svg {
  width: 2.45rem;
  height: 2.45rem;
}

.dropzone__copy {
  display: grid;
  gap: 8px;
}

.dropzone__copy h2 {
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  letter-spacing: -0.03em;
}

.dropzone__copy p {
  color: var(--muted);
  line-height: 1.6;
}

.dropzone__cta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--accent-2);
  text-align: right;
}

.dropzone__cta-label {
  font-weight: 700;
}

.dropzone__cta-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.upload-options {
  margin-bottom: 14px;
  display: grid;
  gap: 12px;
}

.mask-select,
.refine-toggle {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: rgba(237, 244, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mask-select:hover,
.refine-toggle:hover {
  border-color: var(--stroke-strong);
  transform: translateY(-1px);
}

.mask-select:focus-within,
.refine-toggle:focus-within {
  border-color: rgba(116, 233, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(116, 233, 255, 0.12);
}

.mask-select__copy,
.refine-toggle__copy {
  display: grid;
  gap: 5px;
}

.mask-select__label,
.refine-toggle__label {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mask-select__hint,
.refine-toggle__hint {
  color: var(--muted);
  line-height: 1.5;
}

.mask-select__field,
.refine-toggle__switch {
  flex: 0 0 auto;
}

.mask-select__input {
  appearance: none;
  min-width: 200px;
  padding: 12px 42px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(155, 187, 255, 0.2);
  color: var(--text);
  background:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%),
    rgba(237, 244, 255, 0.08);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px transparent;
}

.mask-select__input:hover {
  border-color: rgba(116, 233, 255, 0.32);
}

.mask-select__input:focus {
  outline: none;
  border-color: rgba(116, 233, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(116, 233, 255, 0.12);
}

.refine-toggle__track {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(155, 187, 255, 0.2);
  background: rgba(237, 244, 255, 0.08);
  transition: border-color 160ms ease, background 160ms ease;
}

.refine-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 10px 24px rgba(116, 233, 255, 0.18);
  transition: transform 160ms ease;
}

.refine-toggle__input:checked + .refine-toggle__track {
  border-color: rgba(116, 233, 255, 0.38);
  background: rgba(116, 233, 255, 0.12);
}

.refine-toggle__input:checked + .refine-toggle__track .refine-toggle__thumb {
  transform: translateX(26px);
}

.refine-toggle__input:focus-visible + .refine-toggle__track {
  outline: 2px solid rgba(116, 233, 255, 0.62);
  outline-offset: 2px;
}

.progress-shell {
  margin-top: 14px;
  border-radius: 24px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.progress-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(237, 244, 255, 0.09);
  overflow: hidden;
  border: 1px solid rgba(155, 187, 255, 0.12);
}

.progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  transition: width 180ms ease;
}

.progress-fill.is-uploading::after,
.progress-fill.is-processing::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.20) 25%,
    rgba(255, 255, 255, 0) 25%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, 0.20) 50%,
    rgba(255, 255, 255, 0.20) 75%,
    rgba(255, 255, 255, 0) 75%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 26px 26px;
  animation: stripes 1.1s linear infinite;
  mix-blend-mode: soft-light;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.status-text {
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--stroke);
  background: rgba(237, 244, 255, 0.05);
}

.status-badge--idle {
  color: var(--muted);
}

.status-badge--uploading {
  color: var(--warn);
  border-color: rgba(255, 216, 107, 0.24);
}

.status-badge--processing {
  color: var(--accent);
  border-color: rgba(116, 233, 255, 0.24);
}

.status-badge--complete {
  color: var(--good);
  border-color: rgba(108, 238, 180, 0.24);
}

.status-badge--error {
  color: var(--bad);
  border-color: rgba(255, 125, 141, 0.24);
}

.step-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.step {
  border-radius: 18px;
  border: 1px solid rgba(155, 187, 255, 0.12);
  background: rgba(237, 244, 255, 0.04);
  padding: 12px 13px;
  display: grid;
  gap: 5px;
  min-height: 76px;
}

.step__name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.step__detail {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.step.is-current {
  border-color: rgba(116, 233, 255, 0.38);
  background: rgba(116, 233, 255, 0.08);
}

.step.is-done {
  border-color: rgba(108, 238, 180, 0.26);
  background: rgba(108, 238, 180, 0.07);
}

.step.is-error {
  border-color: rgba(255, 125, 141, 0.28);
  background: rgba(255, 125, 141, 0.08);
}

.upload-actions,
.panel-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.upload-actions {
  margin-top: 14px;
  padding: 14px;
  justify-content: flex-end;
  border-radius: 20px;
  background: rgba(237, 244, 255, 0.03);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--accent {
  color: #08111d;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 16px 40px rgba(116, 233, 255, 0.14);
}

.button--ghost {
  border-color: rgba(155, 187, 255, 0.18);
  background: rgba(237, 244, 255, 0.04);
}

.button:disabled {
  opacity: 0.5;
  cursor: progress;
  transform: none;
}

.preview-panel {
  display: grid;
  gap: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.panel-head--stacked {
  align-items: stretch;
}

.panel-head h2 {
  margin-top: 10px;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  letter-spacing: -0.04em;
}

.panel-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

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

.preview-card {
  border-radius: 24px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.preview-card__stage {
  position: relative;
  min-height: 360px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(155, 187, 255, 0.12);
}

.preview-card__stage--photo {
  background: linear-gradient(180deg, rgba(7, 13, 24, 0.98), rgba(10, 17, 30, 0.94));
}

.preview-card__stage--checker {
  background:
    linear-gradient(45deg, rgba(237, 244, 255, 0.09) 25%, transparent 25%, transparent 75%, rgba(237, 244, 255, 0.09) 75%, rgba(237, 244, 255, 0.09)),
    linear-gradient(45deg, rgba(237, 244, 255, 0.09) 25%, transparent 25%, transparent 75%, rgba(237, 244, 255, 0.09) 75%, rgba(237, 244, 255, 0.09));
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
}

.preview-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: rgba(237, 244, 255, 0.54);
  line-height: 1.55;
  z-index: 0;
}

.preview-placeholder.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.preview-card__meta {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
  min-height: 1.6em;
}

.notes-panel {
  display: grid;
  gap: 16px;
}

.notes-panel__body {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}

.fact-list {
  display: grid;
  gap: 10px;
}

.fact {
  border-radius: 18px;
  padding: 14px 15px;
  display: grid;
  gap: 5px;
}

.fact dt {
  font-size: 0.82rem;
}

.fact dd {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

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

.note-card {
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.note-card h3 {
  margin: 0;
}

.note-card ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.note-card p {
  color: var(--muted);
  line-height: 1.65;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes stripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 26px 0;
  }
}

@keyframes float {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -14px, 0) scale(1.03);
  }
}

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

  .notes-panel__body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 18px, 100%);
    padding-top: 12px;
  }

  .hero,
  .panel {
    border-radius: 24px;
  }

  .dropzone {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .dropzone__cta {
    justify-items: start;
    text-align: left;
  }

  .refine-toggle {
    align-items: flex-start;
  }

  .refine-toggle__switch {
    margin-top: 2px;
  }

  .mask-select {
    flex-direction: column;
    align-items: stretch;
  }

  .mask-select__field {
    width: 100%;
  }

  .mask-select__input {
    min-width: 0;
    width: 100%;
  }

  .step-list,
  .preview-grid {
    grid-template-columns: 1fr;
  }

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

  .panel-head,
  .progress-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-card__stage {
    min-height: 280px;
  }
}

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