:root {
  --bg-dark: #0b0c10;
  --bg-shadow: #12131a;
  --text-primary: #f5f5f7;
  --text-muted: #a1a1a6;
  --accent-gold: #d4af37;
  --stone: rgba(245, 245, 247, .055);
  --stone-strong: rgba(245, 245, 247, .12);
  --panel: rgba(11, 12, 16, .72);
  --panel-solid: rgba(18, 19, 26, .92);
  --border-weight: 1px;
  --ease-cinematic: cubic-bezier(.25, 1, .5, 1);
  --duration-fast: 180ms;
  --duration-question: 260ms;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-primary);
}

button {
  font: inherit;
}

.experience-bg {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 0% 50%, rgba(245, 245, 247, .22) 0%, rgba(18, 19, 26, .74) 36%, var(--bg-dark) 100%),
    linear-gradient(115deg, var(--bg-shadow), var(--bg-dark) 68%);
  transition: background 700ms var(--ease-cinematic);
}

.experience-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, .08), transparent 28%),
    radial-gradient(circle at 50% 115%, rgba(212, 175, 55, .08), transparent 35%);
}

.texture-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .18;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.58'/%3E%3C/svg%3E"),
    linear-gradient(90deg, rgba(245, 245, 247, .035) 1px, transparent 1px);
  background-size: 180px 180px, 72px 100%;
  mix-blend-mode: screen;
}

.hidden {
  display: none !important;
}

.language-switcher {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  display: flex;
  gap: 5px;
  border: var(--border-weight) solid var(--stone-strong);
  background: rgba(11, 12, 16, .76);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
  backdrop-filter: blur(14px);
  padding: 5px;
}

.language-switcher button {
  display: grid;
  width: 36px;
  height: 32px;
  place-items: center;
  border: var(--border-weight) solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.05rem;
  filter: grayscale(.5);
  transition:
    border-color var(--duration-fast) ease,
    background var(--duration-fast) ease,
    filter var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-cinematic);
}

.language-switcher button:hover,
.language-switcher button.active {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, .11);
  filter: grayscale(0);
  transform: translateY(-1px);
}

.language-switcher button:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.start-screen,
.assessment,
.result-screen {
  width: min(1040px, calc(100vw - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
}

.start-screen,
.result-screen {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 28px;
}

.brand-row,
.topbar,
.assessment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-row {
  width: min(820px, 100%);
}

.brand-mark,
.stage-kicker,
.question-index,
.dv-line {
  display: inline-block;
  margin: 0;
  border: var(--border-weight) solid rgba(212, 175, 55, .7);
  background: rgba(11, 12, 16, .44);
  color: var(--accent-gold);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 7px 10px;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 700;
  text-transform: uppercase;
}

.start-copy,
.result-panel {
  width: min(820px, 100%);
  border: var(--border-weight) solid var(--stone-strong);
  background:
    linear-gradient(135deg, rgba(245, 245, 247, .06), transparent 42%),
    var(--panel);
  box-shadow: 0 34px 110px rgba(0, 0, 0, .52);
  backdrop-filter: blur(20px);
  padding: clamp(28px, 6vw, 64px);
}

.start-copy h1,
.result-panel h1 {
  max-width: 760px;
  margin: 22px 0 16px;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.55rem, 7vw, 6rem);
  font-weight: 500;
  line-height: .96;
  letter-spacing: 0;
}

.start-copy > p:not(.dv-line) {
  max-width: 660px;
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 500;
  line-height: 1.62;
}

.intake-form {
  display: grid;
  gap: 22px;
}

.intake-form h1 {
  margin-bottom: 0;
}

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

.intake-field {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.intake-field-wide {
  grid-column: 1 / -1;
}

.intake-field small {
  font-size: .68rem;
  font-weight: 600;
  text-transform: none;
}

.intake-field input {
  width: 100%;
  border: var(--border-weight) solid var(--stone-strong);
  border-radius: 0;
  outline: none;
  background: rgba(245, 245, 247, .055);
  color: var(--text-primary);
  font: inherit;
  font-size: .96rem;
  font-weight: 500;
  text-transform: none;
  padding: 13px 14px;
}

.intake-field input:focus {
  border-color: var(--accent-gold);
}

.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-muted);
  font-size: .86rem;
  line-height: 1.5;
}

.consent-field input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent-gold);
}

.consent-field a {
  color: var(--accent-gold);
}

.required-marker {
  color: var(--accent-gold);
  font-weight: 800;
}

.result-intro,
.result-delivery,
.submission-status {
  max-width: 720px;
  color: var(--text-muted);
  line-height: 1.6;
}

.result-intro {
  margin: 20px 0 0;
  color: var(--text-primary);
  font-size: 1.08rem;
}

.result-delivery {
  margin: 8px 0 0;
}

.submission-status {
  margin: 0 0 22px;
  font-size: .84rem;
}

.primary-action,
.ghost-action {
  position: relative;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: var(--border-weight) solid var(--stone-strong);
  background: rgba(245, 245, 247, .055);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
  padding: 13px 18px;
  transform: translateZ(0);
  transition:
    transform var(--duration-fast) var(--ease-cinematic),
    border-color var(--duration-fast) var(--ease-cinematic),
    background var(--duration-fast) ease,
    box-shadow var(--duration-fast) var(--ease-cinematic);
}

.primary-action:hover,
.ghost-action:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, .11);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .34);
  transform: translate3d(0, -2px, 0);
}

.primary-action:active,
.ghost-action:active {
  transform: translate3d(0, 0, 0) scale(.97);
}

.primary-action:focus-visible,
.ghost-action:focus-visible,
.answer-button:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
}

.action-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: var(--border-weight) solid rgba(212, 175, 55, .55);
  color: var(--accent-gold);
  line-height: 1;
}

.assessment {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
}

.topbar {
  color: var(--text-primary);
}

.stage-kicker {
  margin-bottom: 9px;
}

.stage-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1;
}

.progress-wrap {
  display: grid;
  min-width: min(260px, 42vw);
  gap: 9px;
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 800;
  text-align: right;
}

.progress-rail {
  height: 2px;
  overflow: hidden;
  background: rgba(245, 245, 247, .14);
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--accent-gold);
  transition: width 300ms var(--ease-cinematic);
}

.question-frame {
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 24px 0;
}

.question-card {
  position: relative;
  width: min(900px, 100%);
  border: var(--border-weight) solid var(--stone-strong);
  background:
    linear-gradient(140deg, rgba(245, 245, 247, .07), transparent 48%),
    var(--panel);
  box-shadow: 0 36px 120px rgba(0, 0, 0, .56);
  backdrop-filter: blur(18px);
  padding: clamp(24px, 4vw, 44px);
  animation: paneIn var(--duration-question) var(--ease-cinematic) both;
}

.question-card.exit {
  animation: paneOut var(--duration-fast) var(--ease-cinematic) both;
}

.question-card.shock {
  animation: impactPulse 160ms linear;
}

.question-card h1 {
  max-width: 780px;
  margin: 18px 0 12px;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.05rem, 5.6vw, 4.35rem);
  font-weight: 500;
  line-height: .98;
  letter-spacing: 0;
  text-transform: none;
}

.question-subtitle {
  max-width: 680px;
  margin: 0 0 30px;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
}

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

.reflection-form {
  grid-template-columns: 1fr;
}

.reflection-prompt {
  display: grid;
  gap: 14px;
  color: var(--text-primary);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 600;
  line-height: 1.45;
}

.reflection-textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: var(--border-weight) solid rgba(245, 245, 247, .2);
  border-radius: 0;
  background: rgba(245, 245, 247, .045);
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  padding: 18px;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.reflection-textarea:focus {
  border-color: var(--accent-gold);
  background: rgba(245, 245, 247, .07);
  outline: 1px solid var(--accent-gold);
}

.reflection-textarea::placeholder {
  color: var(--text-muted);
}

.reflection-submit {
  margin-top: 8px;
}

.answer-button {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  border: var(--border-weight) solid rgba(245, 245, 247, .14);
  background: rgba(245, 245, 247, .045);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  padding: 19px;
  transform: translateZ(0);
  transition:
    transform var(--duration-fast) var(--ease-cinematic),
    border-color var(--duration-fast) var(--ease-cinematic),
    background var(--duration-fast) ease,
    box-shadow var(--duration-fast) var(--ease-cinematic);
}

.answer-button::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(212, 175, 55, .16), transparent 42%);
  transition: opacity var(--duration-fast) ease;
}

.answer-button:hover {
  border-color: var(--accent-gold);
  background: rgba(245, 245, 247, .07);
  box-shadow: 0 20px 56px rgba(0, 0, 0, .36);
  transform: translate3d(0, -4px, 0);
}

.answer-button:hover::before,
.answer-button.selected::before {
  opacity: 1;
}

.answer-button:active,
.answer-button.selected {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, .095);
  transform: translate3d(0, 0, 0) scale(.98);
}

.answer-letter,
.answer-title,
.answer-kicker,
.answer-body {
  position: relative;
  z-index: 1;
}

.answer-letter {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-bottom: 12px;
  border: var(--border-weight) solid rgba(212, 175, 55, .55);
  color: var(--accent-gold);
  font-weight: 800;
}

.answer-title {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.1;
  text-transform: uppercase;
  font-weight: 780;
}

.answer-kicker {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 700;
}

.answer-body {
  margin: 0;
  color: rgba(245, 245, 247, .82);
  font-size: .94rem;
  font-weight: 460;
  line-height: 1.45;
}

.assessment-footer {
  min-height: 42px;
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 700;
}

.ghost-action {
  padding: 8px 12px;
  font-size: .8rem;
}

.ghost-action:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}

.impact-particle {
  position: fixed;
  z-index: 6;
  width: 4px;
  height: 4px;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(245, 245, 247, .96);
  box-shadow: 0 0 16px rgba(245, 245, 247, .7);
  animation: particlePop 360ms var(--ease-cinematic) forwards;
}

.impact-particle.gold {
  background: var(--accent-gold);
  box-shadow: 0 0 18px rgba(212, 175, 55, .62);
}

.result-panel {
  width: min(920px, 100%);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 30px 0;
}

.result-card {
  border: var(--border-weight) solid rgba(245, 245, 247, .13);
  background: rgba(245, 245, 247, .045);
  padding: 18px;
  animation: resultIn 320ms var(--ease-cinematic) both;
}

.result-card.primary {
  border-color: rgba(212, 175, 55, .7);
  background: linear-gradient(90deg, rgba(212, 175, 55, .14), rgba(245, 245, 247, .045));
}

.result-label {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 780;
  text-transform: uppercase;
}

.result-value {
  margin: 0;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.32rem, 3vw, 2rem);
  line-height: 1.05;
  font-weight: 500;
}

.result-note {
  margin: 10px 0 0;
  color: rgba(245, 245, 247, .78);
  font-weight: 460;
  line-height: 1.48;
}

.char {
  display: inline-block;
  animation: focusReveal 200ms var(--ease-cinematic) both;
}

@keyframes paneIn {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translate3d(0, 14px, 0) scale(.985);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes paneOut {
  from {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    filter: blur(5px);
    transform: translate3d(0, -8px, 0) scale(.985);
  }
}

@keyframes impactPulse {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -1px, 0); }
}

@keyframes particlePop {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) scale(.3);
  }
}

@keyframes focusReveal {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes resultIn {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .language-switcher {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .start-screen,
  .assessment,
  .result-screen {
    width: min(100vw - 24px, 1040px);
    padding: 64px 0 20px;
  }

  .brand-row,
  .topbar,
  .assessment-footer {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .progress-wrap {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .question-frame {
    padding: 8px 0;
  }

  .question-card,
  .start-copy,
  .result-panel {
    padding: 22px;
  }

  .answers-grid,
  .intake-grid {
    grid-template-columns: 1fr;
  }

  .intake-field-wide {
    grid-column: auto;
  }

  .answer-button {
    min-height: 0;
  }

  #keyboardHint {
    display: none;
  }
}

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

  .impact-particle {
    display: none;
  }
}
