:root {
  color-scheme: dark;
  --bg: #080b14;
  --surface: #101522;
  --surface-2: #161d2d;
  --border: #283249;
  --text: #f7f8fc;
  --muted: #aab4c7;
  --purple: #8b5cf6;
  --cyan: #22d3ee;
  --danger: #fb7185;
  --purple-light: #a78bfa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 4%, rgb(124 58 237 / 20%), transparent 30rem),
    radial-gradient(circle at 88% 15%, rgb(6 182 212 / 13%), transparent 28rem),
    var(--bg);
  background-attachment: fixed;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.17;
  pointer-events: none;
  background-image: linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 18px;
  background: rgb(10 14 26 / 72%);
  box-shadow: 0 14px 50px rgb(0 0 0 / 22%);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 8px 16px rgb(124 58 237 / 28%));
}
.brand-name { font-size: 1.08rem; letter-spacing: -0.025em; }
.brand-name span { color: var(--cyan); }

.research-label, .step-label, .eyebrow {
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-actions { display: flex; align-items: center; gap: 10px; }
.auth-status { max-width: 240px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  position: relative;
  max-width: none;
  padding: 110px 0 72px;
}

.hero::after {
  position: absolute;
  z-index: -1;
  top: 46px;
  right: 4%;
  width: min(33vw, 390px);
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgb(34 211 238 / 16%);
  border-radius: 46% 54% 63% 37% / 48% 42% 58% 52%;
  background: radial-gradient(circle at 38% 38%, rgb(167 139 250 / 25%), rgb(34 211 238 / 5%) 48%, transparent 70%);
  filter: blur(1px);
  transform: rotate(12deg);
}

.hero h1 {
  max-width: 940px;
  margin: 16px 0 38px;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.93;
  letter-spacing: -0.06em;
}
.hero h1 em {
  display: block;
  overflow: visible;
  padding-bottom: .18em;
  color: transparent;
  font-style: normal;
  line-height: 1.16;
  background: linear-gradient(95deg, var(--purple-light), var(--cyan) 72%);
  background-clip: text;
  -webkit-background-clip: text;
}
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 30px; height: 1px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

.hero-copy {
  max-width: 700px;
  margin-top: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.65;
}

.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 30px; }
.hero-button { display: inline-flex; align-items: center; gap: 18px; margin: 0; text-decoration: none; }
.hero-note { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .88rem; }
.hero-note i { width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); }
.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 850px;
  margin: 74px auto 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.feature-strip div { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 19px 22px; text-align: center; border-right: 1px solid var(--border); }
.feature-strip div:first-child { padding-left: 22px; }
.feature-strip div:last-child { border-right: 0; }
.feature-strip strong { margin-bottom: 2px; color: var(--cyan); font-size: .72rem; letter-spacing: .1em; }
.feature-strip span { font-weight: 750; }
.feature-strip small { font-size: .78rem; }

.example-case {
  margin: 0 0 70px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgb(34 211 238 / 18%);
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 8%, rgb(34 211 238 / 9%), transparent 25rem),
    linear-gradient(145deg, rgb(18 24 40 / 96%), rgb(12 17 30 / 96%));
  box-shadow: 0 36px 100px rgb(0 0 0 / 25%), inset 0 1px rgb(255 255 255 / 4%);
}

.example-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.example-heading h2 { margin-bottom: 0; }
.example-heading > p { max-width: 420px; margin: 0 0 3px; color: var(--muted); line-height: 1.65; }
.example-image-frame {
  overflow: hidden;
  margin: 0;
  border: 1px solid rgb(89 108 143 / 65%);
  border-radius: 18px;
  background: #05070c;
  box-shadow: 0 18px 50px rgb(0 0 0 / 24%);
}
.example-image-frame img { display: block; width: 100%; height: auto; }
.example-image-crop { position: relative; aspect-ratio: 3.55 / 1; }
.example-image-crop img { position: absolute; top: -18%; left: 0; }

.example-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px 18px;
  margin-top: 22px;
  padding: 17px 20px;
  border: 1px solid rgb(139 92 246 / 25%);
  border-radius: 16px;
  background: rgb(8 12 22 / 52%);
}

.example-note > span { color: var(--cyan); font-size: 1.12rem; }
.example-note p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.example-note strong { color: var(--text); }
.example-note a { color: var(--cyan); font-size: .9rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.example-note a:hover { text-decoration: underline; }

.workspace, .results {
  margin-bottom: 70px;
  padding: clamp(20px, 4vw, 42px);
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 28px;
  background: linear-gradient(145deg, rgb(18 24 40 / 96%), rgb(12 17 30 / 96%));
  box-shadow: 0 36px 100px rgb(0 0 0 / 30%), inset 0 1px rgb(255 255 255 / 4%);
}

.section-heading, .control-row, .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

h2 { margin: 6px 0 24px; font-size: clamp(1.6rem, 3vw, 2.4rem); }

.drop-zone {
  display: grid;
  min-height: 340px;
  place-items: center;
  align-content: center;
  padding: 40px;
  text-align: center;
  border: 1px dashed #586887;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 20%, rgb(139 92 246 / 12%), transparent 48%), rgb(8 12 22 / 50%);
  transition: border-color 160ms ease, background 160ms ease;
}

.drop-zone.is-dragging {
  border-color: var(--cyan);
  background: rgb(34 211 238 / 9%);
}

.drop-zone h3 { margin: 14px 0 5px; }
.drop-zone p, small, .status { color: var(--muted); }

.drop-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  border: 1px solid rgb(255 255 255 / 18%);
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  box-shadow: 0 14px 40px rgb(124 58 237 / 35%);
}

.button {
  padding: 11px 18px;
  border: 0;
  border-radius: 11px;
  color: white;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.button:not(:disabled):hover { transform: translateY(-2px); }

.button-primary {
  margin-top: 18px;
  background: linear-gradient(135deg, #8b5cf6, #6558e8 58%, #297da2);
  box-shadow: 0 12px 34px rgb(124 58 237 / 28%);
}

.button-ghost { border: 1px solid var(--border); background: var(--surface-2); }

.editor, .result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.panel-title { margin-bottom: 12px; }
.panel-title div { display: flex; align-items: center; gap: 9px; }
.number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--cyan);
  background: rgb(34 211 238 / 12%);
}

.canvas-wrap, figure {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #05070c;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 2%);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

.zoomable-canvas { cursor: zoom-in; transition: filter 160ms ease, transform 160ms ease; }
.zoomable-canvas:hover, .zoomable-canvas:focus-visible { filter: brightness(1.08); transform: scale(1.008); }
.zoomable-canvas:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }

.image-preview-dialog {
  width: min(94vw, 1280px);
  max-height: 92vh;
  padding: 16px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #0b101c;
  box-shadow: 0 35px 120px rgb(0 0 0 / 72%);
}
.image-preview-dialog::backdrop { background: rgb(2 5 12 / 86%); backdrop-filter: blur(8px); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 12px; }
.preview-heading strong { font-size: 1.05rem; }
.preview-canvas-wrap { display: grid; max-height: calc(92vh - 105px); place-items: center; overflow: auto; border-radius: 12px; background: #03050a; }
.preview-canvas-wrap canvas { width: auto; max-width: 100%; max-height: calc(92vh - 105px); object-fit: contain; }
.image-preview-dialog > small { display: block; padding: 11px 4px 0; text-align: center; }

.controls { margin-top: 24px; }
.controls label { display: grid; gap: 9px; font-weight: 700; }
textarea {
  width: 100%;
  resize: vertical;
  padding: 14px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #0b101c;
}
textarea:focus, input:focus { border-color: var(--purple); }
.status.error { color: var(--danger); }

.access-panel {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b101c;
}

.generation-progress {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  overflow: hidden;
  margin-top: 22px;
  padding: 18px 20px 22px;
  border: 1px solid rgb(34 211 238 / 24%);
  border-radius: 16px;
  background: linear-gradient(120deg, rgb(139 92 246 / 13%), rgb(34 211 238 / 8%));
}
.generation-progress p { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.reconstruction-orbit {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid rgb(167 139 250 / 35%);
  border-radius: 50%;
  animation: orbit-spin 1.8s linear infinite;
}
.reconstruction-orbit::before, .reconstruction-orbit::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}
.reconstruction-orbit::before { inset: 9px; border: 2px solid var(--cyan); box-shadow: 0 0 13px rgb(34 211 238 / 60%); }
.reconstruction-orbit::after { top: -3px; left: 17px; width: 7px; height: 7px; background: var(--purple-light); box-shadow: 0 0 12px var(--purple); }
.progress-track { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: rgb(255 255 255 / 6%); }
.progress-track span { display: block; width: 35%; height: 100%; background: linear-gradient(90deg, transparent, var(--cyan), var(--purple-light), transparent); animation: progress-scan 1.6s ease-in-out infinite; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes progress-scan { from { transform: translateX(-110%); } to { transform: translateX(300%); } }

input {
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #080c15;
}

.auth-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgb(0 0 0 / 60%);
}
.auth-dialog::backdrop { background: rgb(2 5 12 / 75%); backdrop-filter: blur(4px); }
.auth-dialog form { display: grid; gap: 16px; padding: 26px; }
.auth-dialog label { display: grid; gap: 8px; font-weight: 700; }
.registration-fields { display: grid; gap: 16px; padding-top: 4px; }
.turnstile-container { min-height: 66px; color: var(--muted); font-size: .88rem; }
.turnstile-container.captcha-error { display: grid; place-items: center; padding: 12px; color: var(--danger); border: 1px solid rgb(251 113 133 / 28%); border-radius: 10px; }
.consent-row { display: grid !important; grid-template-columns: auto 1fr; gap: 10px !important; align-items: start; color: var(--muted); font-size: .88rem; font-weight: 500 !important; line-height: 1.5; }
.consent-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--purple); }
.consent-row a { color: var(--cyan); }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin-bottom: 0; }
.dialog-actions .button { flex: 1; margin-top: 0; }
.icon-button { color: var(--muted); border: 0; background: transparent; font-size: 2rem; }
.text-button {
  justify-self: start;
  padding: 0;
  color: var(--cyan);
  border: 0;
  background: transparent;
}
.text-button:hover { text-decoration: underline; }
.account-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.account-summary article { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.account-summary span { color: var(--cyan); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.account-summary strong { font-size: 1.4rem; }
.account-summary small, .account-meta { margin: 0; color: var(--muted); font-size: .78rem; }
.account-password { display: grid; gap: 13px; padding-top: 18px; border-top: 1px solid var(--border); }
.account-password > div { display: grid; gap: 4px; }
.account-password > div small { color: var(--muted); }
.account-password .button { justify-self: start; margin-top: 0; }
.account-danger-zone { display: grid; gap: 13px; padding-top: 18px; border-top: 1px solid rgb(251 113 133 / 28%); }
.account-danger-zone > div:first-child { display: grid; gap: 4px; }
.account-danger-zone small { color: var(--muted); }
.button-danger { justify-self: start; margin-top: 0; color: #fff; background: linear-gradient(135deg, #e34e6e, #be3452); box-shadow: 0 10px 26px rgb(225 50 84 / 20%); }
.delete-account-confirmation { display: grid; gap: 12px; padding: 15px; border: 1px solid rgb(251 113 133 / 35%); border-radius: 12px; background: rgb(251 113 133 / 6%); }
.delete-account-confirmation label { color: var(--muted); font-weight: 500; }
.delete-account-confirmation label strong { color: var(--text); }

.result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
figure { margin: 0; }
figcaption { padding: 12px 14px; font-weight: 750; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.metric-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.metric-section-accent { padding: 24px; border: 1px solid rgb(34 211 238 / 18%); border-radius: 18px; background: rgb(34 211 238 / 3%); }
.metric-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.metric-heading span { color: var(--cyan); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.metric-heading h3 { margin: 5px 0 0; font-size: 1.25rem; }
.metric-heading > small { max-width: 390px; text-align: right; }

.metrics article {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 1px rgb(255 255 255 / 4%);
}
.metrics span { color: var(--muted); }
.metrics strong { font-size: 1.5rem; }

.experiment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 18px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgb(8 12 22 / 45%);
}
.experiment-meta strong { margin-right: 22px; color: var(--text); }

.result-conclusion {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid rgb(139 92 246 / 35%);
  border-radius: 16px;
  background: linear-gradient(135deg, rgb(139 92 246 / 10%), rgb(34 211 238 / 5%));
}
.conclusion-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.conclusion-heading span { color: var(--cyan); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.conclusion-heading strong { font-size: 1.1rem; }
.result-conclusion p { margin: 0; line-height: 1.65; }
.result-conclusion small { color: var(--muted); line-height: 1.5; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 50px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
footer a { color: var(--cyan); }

.legal-back { color: var(--text); text-decoration: none; }
.legal-page { max-width: 850px; padding: 86px 0 100px; }
.legal-page > h1 { margin: 14px 0 8px; font-size: clamp(2.7rem, 7vw, 5.2rem); line-height: 1; letter-spacing: -.055em; }
.legal-updated { margin-bottom: 50px; color: var(--muted); }
.legal-page section { padding: 26px 0; border-top: 1px solid var(--border); }
.legal-page section h2 { margin: 0 0 12px; font-size: 1.22rem; }
.legal-page section p { margin: 0; color: var(--muted); line-height: 1.75; }

@media (max-width: 760px) {
  .auth-status { display: none; }
  .site-header { width: min(100% - 24px, 1180px); margin-top: 10px; }
  .brand-name { display: none; }
  .hero { padding-top: 72px; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .feature-strip { grid-template-columns: 1fr; }
  .feature-strip div, .feature-strip div:first-child { padding: 15px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .feature-strip div:last-child { border-bottom: 0; }
  .editor, .result-grid, .metrics { grid-template-columns: 1fr; }
  .account-summary { grid-template-columns: 1fr; }
  .example-heading, .example-note { align-items: flex-start; flex-direction: column; }
  .example-image-crop { aspect-ratio: auto; }
  .example-image-crop img { position: static; }
  .metric-heading { align-items: flex-start; flex-direction: column; }
  .metric-heading > small { text-align: left; }
  .experiment-meta { align-items: flex-start; flex-direction: column; }
  .section-heading, .control-row, .panel-title, footer { align-items: flex-start; flex-direction: column; }
  .control-row .button { width: 100%; }
}
