:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #161616;
  --panel-2: #202020;
  --panel-3: #2b2b2b;
  --text: #f8f8f8;
  --muted: #a8a8a8;
  --line: #303030;
  --line-strong: #565656;
  --green: #00f0b5;
  --orange: #ff7a00;
  --danger: #ff4f4f;
  --radius: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.08), transparent 28rem),
    var(--bg);
}

.prototype-nav {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 40;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(18px);
}

.prototype-nav button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.prototype-nav button.is-active {
  background: #fff;
  color: #000;
}

.questionnaire {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.q-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 38px;
  height: 42px;
  object-fit: contain;
}

.brand-link {
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.brand-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 6px;
}

.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: transparent;
}

.progress span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--accent, var(--green));
  transition: width 520ms var(--ease), background 260ms ease;
}

.q-stage {
  width: min(calc(100% - 40px), 960px);
  min-height: calc(100vh - 60px);
  margin: 0 auto;
  padding: 48px 0 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: stage-in 520ms var(--ease) both;
}

.no-stage-animation .q-stage {
  animation: none;
}

.q-stage.is-tall {
  justify-content: flex-start;
}

.step-kicker {
  margin: 0 0 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.q-title {
  max-width: 760px;
  margin: 0 auto 40px;
  text-align: center;
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1.08;
  font-weight: 800;
}

.q-title .positive {
  color: var(--green);
}

.q-title .negative {
  color: var(--orange);
}

.intro-copy,
.finish-copy {
  max-width: 390px;
  margin: 0 auto 36px;
  color: #ededed;
  text-align: center;
  font-size: 17px;
  line-height: 1.42;
}

.center-actions {
  display: flex;
  justify-content: center;
}

.choice-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 16px;
  max-width: 960px;
  margin: 0 auto;
}

.chip,
.pill-choice {
  min-height: 48px;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  transition: transform 220ms var(--ease), border-color 220ms ease, background 220ms ease;
}

.chip {
  padding: 0 28px;
}

.chip:hover,
.pill-choice:hover,
.logo-card:hover {
  transform: translateY(-2px);
}

.chip.is-positive {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.chip.is-negative {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 1px var(--orange);
}

.chip:disabled {
  opacity: 0.24;
  cursor: not-allowed;
  transform: none;
}

.remaining {
  margin: 42px 0 0;
  text-align: center;
  color: var(--muted);
}

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

.logo-card {
  aspect-ratio: 1;
  border: 0;
  outline: 0;
  border-radius: 3px;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 260ms var(--ease), opacity 220ms ease;
}

.logo-card:focus,
.logo-card:focus-visible {
  outline: 0;
}

.logo-card img {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
}

.logo-card.is-muted {
  display: none;
}

.selection-tray {
  position: fixed;
  left: 50%;
  bottom: 72px;
  z-index: 18;
  width: min(calc(100% - 40px), 960px);
  min-height: 80px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: rgba(38, 38, 38, 0.94);
  backdrop-filter: blur(16px);
  animation: tray-in 360ms var(--ease) both;
}

.selection-tray span {
  color: var(--muted);
}

.selection-thumb {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
}

.rating-logo {
  width: min(250px, 74vw);
  aspect-ratio: 1;
  margin: 0 auto 40px;
  border-radius: 3px;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
}

.explain-logo {
  width: min(250px, 74vw);
  aspect-ratio: 1;
  margin: 0 auto 40px;
  border-radius: 3px;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
}

.rating-layout {
  display: grid;
  gap: 28px;
}

.rating-logo img,
.explain-logo img {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
}

.slider-list {
  display: grid;
  gap: 22px;
}

.slider-row {
  display: grid;
  gap: 10px;
}

.slider-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
}

.slider-value {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.range-wrap {
  position: relative;
}

.range-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: #777;
  font-size: 12px;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 0;
  accent-color: var(--slider-color);
  cursor: pointer;
}

.text-entry {
  width: 100%;
  min-height: 150px;
  padding: 18px;
  resize: none;
  border: 2px solid var(--line-strong);
  border-radius: 4px;
  background: #151515;
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
  outline: none;
  transition: border-color 220ms ease, background 220ms ease;
}

.text-entry:focus {
  border-color: #ddd;
  background: #191919;
}

.counter {
  margin-top: 12px;
  color: var(--muted);
  text-align: center;
}

.pill-stack {
  display: grid;
  gap: 20px;
}

.pill-choice {
  width: 100%;
  padding: 0 18px;
}

.pill-choice.is-selected {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  width: min(100%, 960px);
  min-height: 72px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.btn {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 5px;
  background: #444;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 220ms var(--ease), background 220ms ease, opacity 220ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: #555;
}

.btn.link {
  padding: 0;
  background: transparent;
  color: #bdbdbd;
}

.btn.link:hover {
  color: #fff;
  background: transparent;
}

.btn.primary {
  background: #ededed;
  color: #000;
}

.btn.danger {
  background: rgba(255, 79, 79, 0.18);
  color: #ffb2b2;
}

.btn.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(12px);
  animation: fade-in 240ms ease both;
}

.overlay-panel {
  width: min(320px, 100%);
  display: grid;
  justify-items: center;
  gap: 26px;
}

.overlay-logo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  background: transparent;
  padding: 0;
  object-fit: cover;
  animation: zoom-in 360ms var(--ease) both;
}

.overlay-close {
  position: absolute;
  top: 24px;
  right: 28px;
  border: 0;
  background: transparent;
  color: #ddd;
  font-size: 32px;
  cursor: pointer;
}

.finish-screen {
  min-height: 100vh;
}

.finish-screen .q-stage {
  padding-top: 120px;
}

.surface {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 96px 0 64px;
}

.surface-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.surface-title {
  margin: 0;
  font-size: clamp(34px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

.surface-copy {
  max-width: 460px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.quiet-mark {
  width: 46px;
  height: 52px;
}

.result-layout,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 20, 20, 0.74);
  overflow: hidden;
  animation: stage-in 520ms var(--ease) both;
}

.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.panel-body {
  padding: 20px;
}

.answer-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.answer-row:first-child {
  padding-top: 0;
}

.answer-row:last-child {
  border-bottom: 0;
}

.answer-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 700;
}

.tag.positive {
  border-color: var(--green);
}

.tag.negative {
  border-color: var(--orange);
}

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

.mini-logo {
  aspect-ratio: 1;
  border-radius: 3px;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
}

.mini-logo img {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
}

.score-list {
  display: grid;
  gap: 14px;
}

.score-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  align-items: center;
}

.score-thumb {
  width: 70px;
  aspect-ratio: 1;
  border-radius: 3px;
  background: transparent;
  padding: 0;
  object-fit: cover;
}

.score-bars {
  display: grid;
  gap: 8px;
}

.score-bar {
  display: grid;
  grid-template-columns: 86px 1fr 42px;
  gap: 10px;
  align-items: center;
  color: #d8d8d8;
  font-size: 13px;
}

.bar-track {
  height: 4px;
  border-radius: 999px;
  background: #3a3a3a;
  overflow: hidden;
}

.bar-fill {
  display: block;
  width: var(--score);
  height: 100%;
  background: var(--score-color);
}

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

.project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.project-row.is-active,
.project-row:hover {
  border-color: var(--line-strong);
  background: #171717;
}

.project-name {
  margin: 0 0 5px;
  font-weight: 800;
}

.project-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 240, 181, 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

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

.input,
.select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #101010;
  color: #fff;
}

.mock-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mock-upload-grid.is-empty {
  min-height: 112px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 5px;
}

.mock-upload-grid.is-empty p,
.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.mock-upload-grid img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  background: transparent;
  object-fit: cover;
  padding: 0;
}

.field-hint {
  margin-top: 8px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.login-panel {
  width: min(100%, 360px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.form-error {
  margin: 0;
  color: #ffb2b2;
  font-size: 14px;
  line-height: 1.4;
}

@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoom-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tray-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (min-width: 760px) {
  .q-header {
    height: 84px;
  }

  .q-stage {
    min-height: calc(100vh - 84px);
    padding-inline: 0;
  }

  .q-title {
    max-width: 960px;
  }

  .logo-grid {
    max-width: 760px;
    margin: 0 auto;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .selection-tray,
  .bottom-bar {
    width: min(calc(100% - 40px), 960px);
  }

  .rating-logo {
    width: 340px;
    margin: 0;
  }

  .explain-logo {
    width: 280px;
  }

  .rating-layout {
    width: min(100%, 860px);
    margin: 0 auto;
    grid-template-columns: 340px minmax(0, 480px);
    align-items: center;
    justify-content: center;
    gap: 40px;
  }

  .slider-list {
    width: 100%;
    max-width: 480px;
    margin: 0;
  }

  .text-entry {
    max-width: 680px;
    min-height: 180px;
    margin: 0 auto;
  }

  .counter {
    text-align: center;
  }

  .pill-stack {
    width: min(620px, 100%);
    margin: 0 auto;
  }

  .intro-copy {
    max-width: 680px;
    font-size: 18px;
    line-height: 1.75em;
  }
}

@media (max-width: 860px) {
  .prototype-nav {
    top: auto;
    right: 50%;
    bottom: 84px;
    transform: translateX(50%);
  }

  .surface {
    padding-top: 84px;
  }

  .surface-header,
  .result-layout,
  .admin-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quiet-mark {
    order: -1;
  }

  .surface-title {
    font-size: 44px;
  }
}

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