@font-face {
  font-family: "Jost";
  src: url("../fonts/Jost-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("../fonts/Jost-Italic-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-VariableFont_wdth-wght.ttf") format("truetype-variations");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --violet-900: #2e0a78;
  --violet-700: #4811bf;
  --violet-500: #6b35e8;
  --violet-300: #9b7df2;
  --near-black: #0d0d0d;
  --panel: #191919;
  --graphite: #2a2a2a;
  --off-white: #f2f0f0;
  --text-secondary: rgba(242, 240, 240, 0.68);
  --text-muted: rgba(242, 240, 240, 0.48);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --danger: #f2685f;
  --danger-bg: rgba(242, 104, 95, 0.12);
  --font-display: "Jost", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;
  --radius-panel: 24px;
  --radius-nested: 16px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--near-black);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--off-white);
  background:
    radial-gradient(circle at 90% 4%, rgba(72, 17, 191, 0.22), transparent 32rem),
    radial-gradient(circle at 4% 94%, rgba(72, 17, 191, 0.1), transparent 28rem),
    var(--near-black);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button,
label,
input,
textarea {
  -webkit-tap-highlight-color: rgba(107, 53, 232, 0.18);
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  color: white;
  background: var(--violet-700);
  transform: translateY(-150%);
  transition: transform 160ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer {
  width: min(100% - 40px, 960px);
  margin-inline: auto;
}

.site-header {
  padding-block: 24px;
}

body.survey-active .site-header {
  display: none;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: block;
  width: 132px;
  height: 54px;
  background: var(--off-white);
  -webkit-mask: url("../images/logo-horizontal.svg") center / contain no-repeat;
  mask: url("../images/logo-horizontal.svg") center / contain no-repeat;
}

.brand-icon {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: var(--violet-300);
  -webkit-mask: url("../images/icon.svg") center / contain no-repeat;
  mask: url("../images/icon.svg") center / contain no-repeat;
}

.header-context {
  padding-left: 16px;
  border-left: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 14px;
}

.app-shell {
  width: min(100% - 40px, 820px);
  min-height: calc(100vh - 190px);
  margin-inline: auto;
  padding: clamp(30px, 6vh, 72px) 0 72px;
}

body.survey-active .app-shell {
  min-height: calc(100vh - 80px);
  min-height: calc(100dvh - 80px);
  padding-top: clamp(20px, 4vh, 40px);
}

.view {
  animation: view-in 220ms var(--ease) both;
}

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

.intro-view {
  display: grid;
  gap: clamp(32px, 7vw, 64px);
}

.intro-copy {
  max-width: 720px;
}

.quiet-label {
  margin: 0 0 10px;
  color: var(--violet-300);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

h1,
.question-title {
  font-family: var(--font-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1 {
  max-width: 14ch;
  margin: 0 0 24px;
  font-size: clamp(42px, 8.5vw, 74px);
  font-weight: 900;
  line-height: 1.02;
}

.intro-copy h1 {
  max-width: 20ch;
  font-size: clamp(38px, 7.2vw, 68px);
}

h1 em {
  font-style: italic;
}

.intro-copy p:not(.quiet-label),
.confirmation-view > p:not(.quiet-label) {
  max-width: 62ch;
  margin: 0;
  color: var(--text-secondary);
}

.intro-copy p + p {
  margin-top: 12px;
}

.intro-lead {
  font-size: clamp(17px, 2.5vw, 20px);
}

.intro-panel {
  display: grid;
  gap: 24px;
  padding: clamp(24px, 5vw, 36px);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.eligibility-control,
.choice {
  position: relative;
  cursor: pointer;
}

.eligibility-control {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  color: var(--off-white);
}

.eligibility-control input,
.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.control-mark {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  transition:
    border-color 160ms var(--ease),
    background-color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.eligibility-control .control-mark {
  border-radius: 7px;
}

.eligibility-control input:checked + .control-mark,
.choice.is-selected .control-mark {
  border-color: var(--violet-500);
  background: var(--violet-700);
}

.eligibility-control input:checked + .control-mark::after,
.choice input[type="checkbox"]:checked + .control-mark::after {
  width: 9px;
  height: 5px;
  border-bottom: 2px solid white;
  border-left: 2px solid white;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: white;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 180ms var(--ease),
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    transform 140ms var(--ease),
    opacity 180ms var(--ease);
}

.button:hover {
  border-color: var(--violet-500);
}

.button:active {
  transform: scale(0.98);
}

.button:focus-visible,
.choice:has(input:focus-visible),
.eligibility-control:has(input:focus-visible),
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--violet-300);
  outline-offset: 3px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button-primary {
  background: var(--violet-700);
}

.button-primary:hover {
  background: var(--violet-500);
  box-shadow: 0 0 44px rgba(72, 17, 191, 0.34);
}

.button-secondary {
  border-color: var(--border-strong);
  color: var(--off-white);
}

.button-large {
  min-height: 58px;
  justify-self: start;
  padding-inline: 34px;
  font-size: 17px;
}

.button.is-loading::before {
  width: 16px;
  height: 16px;
  margin-right: 9px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  content: "";
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.survey-view {
  max-width: 760px;
  margin-inline: auto;
}

.survey-top {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(24px, 5vw, 40px);
  white-space: nowrap;
}

.survey-top .brand-icon {
  width: 28px;
  height: 28px;
  background: var(--off-white);
}

.survey-section {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--off-white);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.progress-text {
  flex: 0 0 auto;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.2;
}

.survey-divider {
  width: 1px;
  height: 18px;
  flex: 0 0 auto;
  background: var(--border-strong);
}

.progress-track {
  width: clamp(48px, 8vw, 64px);
  height: 14px;
  flex: 0 0 auto;
  margin: 0;
  overflow: hidden;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--violet-500);
  transition: width 220ms var(--ease);
}

.question-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.question-title {
  display: block;
  width: 100%;
  max-width: 22ch;
  margin: 0 0 12px;
  color: var(--off-white);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  line-height: 1.08;
}

.question-title:focus {
  outline: 0;
}

.question-helper {
  max-width: 58ch;
  margin: 0 0 20px;
  color: var(--text-secondary);
}

.choice-list {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.choice {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 13px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-nested);
  background: rgba(255, 255, 255, 0.035);
  color: var(--off-white);
  transition:
    border-color 180ms var(--ease),
    background-color 180ms var(--ease),
    transform 140ms var(--ease);
}

.choice:hover {
  border-color: rgba(107, 53, 232, 0.58);
}

.choice:active {
  transform: scale(0.995);
}

.choice.is-selected {
  border-color: var(--violet-500);
  background: rgba(72, 17, 191, 0.18);
}

.choice input[type="radio"] + .control-mark {
  border-radius: 50%;
}

.choice input[type="radio"]:checked + .control-mark::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  content: "";
}

.choice-text {
  line-height: 1.42;
}

.scale-list {
  grid-template-columns: repeat(5, 1fr);
}

.scale-list .choice {
  min-width: 0;
  justify-content: center;
  padding-inline: 8px;
}

.scale-list .choice .control-mark {
  display: none;
}

.scale-list .choice-wide {
  grid-column: 1 / -1;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.scale-labels span:last-child {
  text-align: right;
}

.text-field,
.other-field {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.other-field {
  padding: 20px;
  border: 1px solid rgba(107, 53, 232, 0.35);
  border-radius: var(--radius-nested);
  background: rgba(72, 17, 191, 0.08);
}

.other-field label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  color: var(--off-white);
  background: rgba(255, 255, 255, 0.04);
  transition:
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

input[type="text"] {
  min-height: 54px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
}

textarea {
  min-height: 148px;
  resize: vertical;
  padding: 16px 18px 36px;
  border-radius: var(--radius-nested);
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.character-count {
  justify-self: end;
  color: var(--text-muted);
  font-size: 12px;
}

.text-field .character-count {
  position: absolute;
  right: 16px;
  bottom: 10px;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.question-error {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(242, 104, 95, 0.36);
  border-radius: 12px;
  background: var(--danger-bg);
}

.status-message {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.status-message[data-tone="error"] {
  border-color: rgba(242, 104, 95, 0.36);
  color: var(--danger);
  background: var(--danger-bg);
}

.survey-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding: 16px 0 max(16px, env(safe-area-inset-bottom));
}

.confirmation-view {
  display: grid;
  max-width: 680px;
  min-height: 58vh;
  align-content: center;
  justify-items: start;
}

.confirmation-mark {
  width: 62px;
  height: 62px;
  margin-bottom: 24px;
  background: var(--off-white);
}

.confirmation-view h1 {
  max-width: 12ch;
}

.site-footer {
  display: flex;
  min-height: 80px;
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}

.site-footer p {
  max-width: 760px;
  margin: 0;
  padding-block: 20px;
  line-height: 1.5;
}

.noscript-message {
  padding: 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-nested);
  color: var(--off-white);
  background: var(--panel);
}

@media (max-width: 600px) {
  .site-header,
  .site-footer,
  .app-shell {
    width: min(100% - 70px, 820px);
  }

  .site-header {
    padding-block: 16px;
  }

  .brand-logo {
    width: 112px;
    height: 46px;
  }

  .app-shell {
    padding: 22px 0 48px;
  }

  body.survey-active .app-shell {
    padding-top: 16px;
  }

  .intro-view {
    gap: 24px;
  }

  .intro-copy h1 {
    margin-bottom: 18px;
    font-size: clamp(34px, 10vw, 42px);
  }

  .intro-lead {
    font-size: 16px;
    line-height: 1.55;
  }

  .intro-panel {
    gap: 18px;
    padding: 20px;
  }

  .button-large {
    width: 100%;
  }

  .question-title {
    font-size: clamp(27px, 8vw, 34px);
  }

  .survey-top {
    gap: 6px;
    margin-bottom: 22px;
  }

  .survey-top .brand-icon {
    width: 24px;
    height: 24px;
  }

  .survey-section,
  .progress-text {
    font-size: 11.5px;
  }

  .survey-divider {
    height: 15px;
  }

  .progress-track {
    width: 48px;
    height: 12px;
    padding: 2px;
  }

  .choice-list {
    margin-top: 18px;
  }

  .choice {
    min-height: 48px;
    padding: 10px 14px;
  }

  .scale-labels {
    gap: 12px;
    font-size: 13px;
  }

  .survey-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 24px;
    padding-top: 14px;
  }

  .survey-actions .button {
    width: 100%;
    padding-inline: 16px;
  }

  .survey-actions .button-primary {
    grid-column: 2;
  }

  .survey-actions .button-secondary {
    grid-column: 1;
    grid-row: 1;
  }

  .site-footer {
    min-height: 0;
  }
}

@media (max-width: 380px) {
  .survey-top .brand-icon {
    width: 22px;
    height: 22px;
  }

  .survey-section,
  .progress-text {
    font-size: 11px;
  }

  .progress-track {
    width: 42px;
  }
}

@media (hover: none) {
  .button:hover,
  .choice:hover {
    box-shadow: none;
  }
}

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