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

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/CormorantGaramond-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #d8dadd;
  --panel: #f4f4f3;
  --field: #e7e8e8;
  --ink: #242527;
  --muted: #66696d;
  --line: #c8cace;
  --accent: #6e909f;
  --accent-dark: #3b5a68;
  --danger: #984747;
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

button,
input,
textarea {
  font: inherit;
}

button,
textarea,
input {
  border-radius: var(--radius);
}

.survey-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(430px, 0.88fr) minmax(600px, 1.12fr);
}

.visual-pane {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 5vw, 76px);
  isolation: isolate;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.35), transparent 58%);
}

.visual-copy {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.brand,
.question-theme {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand {
  margin-bottom: 36px;
}

h1,
h2,
.form-step label {
  font-family: "Cormorant Garamond", Georgia, serif;
}

h1,
h2 {
  margin: 0;
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

h1 {
  max-width: 520px;
  font-size: clamp(60px, 5.3vw, 86px);
}

.lead {
  max-width: 490px;
  margin: 28px 0 0;
  color: #4e5155;
  font-size: clamp(16px, 1.35vw, 19px);
}

.privacy-note {
  margin: 24px 0 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 590;
}

.butterfly-visual {
  position: absolute;
  inset: 42% -42% -14% -3%;
  z-index: -1;
  margin: 0;
  opacity: 0.76;
  mix-blend-mode: multiply;
}

.wing-stage {
  width: 100%;
  transition: transform 920ms var(--ease), opacity 650ms ease, filter 920ms var(--ease);
  will-change: transform;
}

.butterfly-visual img {
  display: block;
  width: 100%;
  height: auto;
}

body[data-step="0"] .wing-stage { transform: translate3d(0, 0, 0) scale(1.04) rotate(-1deg); }
body[data-step="1"] .wing-stage { transform: translate3d(-4%, -2%, 0) scale(1.11) rotate(0.5deg); }
body[data-step="2"] .wing-stage { transform: translate3d(2%, 1%, 0) scale(1.18) rotate(-0.8deg); filter: contrast(1.04); }
body[data-step="3"] .wing-stage { transform: translate3d(-7%, -3%, 0) scale(1.24) rotate(1deg); }
body[data-step="4"] .wing-stage { transform: translate3d(3%, -5%, 0) scale(1.3) rotate(-1.3deg); filter: contrast(1.06); }
body[data-step="5"] .wing-stage { transform: translate3d(-3%, 2%, 0) scale(1.12) rotate(0deg); opacity: 0.65; }

.visual-word {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(51, 55, 59, 0.28);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 420;
  letter-spacing: -0.04em;
  line-height: 0.9;
  transition: opacity 240ms ease, transform 500ms var(--ease);
}

.visual-word.is-changing {
  opacity: 0;
  transform: translateY(18px);
}

.survey-pane {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 4.8vw, 76px) clamp(28px, 6.2vw, 96px);
  background: var(--panel);
  box-shadow: -22px 0 64px rgba(65, 68, 72, 0.07);
}

.progress-header {
  width: min(100%, 760px);
  margin: 0 auto;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.progress-copy p {
  margin: 0;
}

.progress-segments {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-top: 15px;
}

.progress-segments span {
  height: 2px;
  background: var(--line);
  transform-origin: left center;
  transition: background-color 360ms ease, transform 480ms var(--ease);
}

.progress-segments span.is-current {
  background: var(--accent-dark);
  transform: scaleY(2);
}

.progress-segments span.is-complete {
  background: var(--accent);
}

form {
  width: min(100%, 760px);
  min-height: 620px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: clamp(42px, 6vh, 82px) 0 18px;
}

.step-stage {
  position: relative;
}

.form-step[hidden] {
  display: none;
}

.question-theme {
  margin-bottom: 24px;
  color: var(--accent-dark);
}

.form-step label {
  display: block;
  max-width: 720px;
  margin: 0 0 30px;
  font-size: clamp(42px, 4.2vw, 62px);
  font-weight: 520;
  letter-spacing: -0.037em;
  line-height: 1.02;
}

textarea,
input {
  width: 100%;
  border: 1px solid transparent;
  outline: none;
  color: var(--ink);
  background: var(--field);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

textarea {
  min-height: 152px;
  max-height: 260px;
  padding: 19px 20px;
  resize: vertical;
  line-height: 1.55;
}

textarea::placeholder,
input::placeholder {
  color: #75787c;
  opacity: 1;
}

textarea:hover,
input:hover {
  background: #e2e3e3;
}

textarea:focus,
input:focus {
  border-color: var(--accent-dark);
  background: #efefee;
}

[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.field-hint {
  max-width: 540px;
  margin: -12px 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.input-wrap {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--field);
}

.input-wrap span {
  color: var(--muted);
  text-align: right;
}

.input-wrap input {
  min-height: 58px;
  padding: 16px 18px 16px 7px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-nav {
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr;
  gap: 12px;
  margin-top: 26px;
}

.form-nav button,
.text-button {
  min-height: 56px;
  border: 0;
  font-weight: 650;
  cursor: pointer;
}

.next-button,
.submit-button {
  grid-column: 2;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #f5f6f6;
  background: var(--ink);
  transition: background-color 220ms ease, transform 180ms ease;
}

.next-button::after,
.submit-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent-dark);
  transform: translateX(-101%);
  transition: transform 430ms var(--ease);
}

.next-button:hover::after,
.submit-button:hover::after {
  transform: translateX(0);
}

.back-button {
  grid-column: 1;
  grid-row: 1;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line) !important;
  transition: border-color 180ms ease, transform 180ms ease;
}

.back-button:hover {
  border-color: var(--accent-dark) !important;
}

.form-nav button:active {
  transform: translateY(1px);
}

.form-nav button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid rgba(59, 90, 104, 0.3);
  outline-offset: 3px;
}

.form-nav button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.form-status {
  min-height: 22px;
  margin: 11px 0 0;
  color: var(--danger);
  font-size: 12px;
  text-align: center;
}

.success {
  width: min(100%, 760px);
  min-height: calc(100dvh - clamp(68px, 9.6vw, 152px));
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.success[hidden] {
  display: none;
}

.success-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
}

.success h2 {
  font-size: clamp(62px, 7vw, 98px);
}

.success-copy > p:not(.brand) {
  max-width: 470px;
  margin: 28px 0;
  color: var(--muted);
  font-size: 17px;
}

.success img {
  position: absolute;
  left: -24%;
  bottom: -4%;
  width: 142%;
  max-width: none;
  opacity: 0.72;
  mix-blend-mode: multiply;
}

.text-button {
  min-height: auto;
  border-radius: 0;
  padding: 4px 0;
  color: var(--accent-dark);
  background: transparent;
  border-bottom: 1px solid currentColor;
}

@media (prefers-reduced-motion: no-preference) {
  .visual-copy,
  .butterfly-visual,
  .survey-pane {
    animation: enter 760ms var(--ease) both;
  }

  .butterfly-visual {
    animation-delay: 130ms;
  }

  .survey-pane {
    animation-delay: 80ms;
  }

  .butterfly-visual img {
    animation: breathe 8s ease-in-out infinite alternate;
  }

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

  @keyframes breathe {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(0, -1.3%, 0) scale(1.016); }
  }
}

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

@media (max-width: 1080px) {
  .survey-shell {
    grid-template-columns: minmax(360px, 0.76fr) minmax(540px, 1.24fr);
  }

  h1 {
    font-size: 64px;
  }

  .form-step label {
    font-size: clamp(40px, 5vw, 54px);
  }
}

@media (max-width: 920px) {
  .survey-shell {
    grid-template-columns: 1fr;
  }

  .visual-pane {
    min-height: 310px;
    padding: 28px 24px 32px;
  }

  .brand {
    margin-bottom: 18px;
  }

  h1 {
    max-width: 520px;
    font-size: clamp(50px, 10vw, 72px);
  }

  .lead {
    max-width: 460px;
    margin-top: 16px;
    font-size: 15px;
  }

  .privacy-note {
    margin-top: 12px;
  }

  .butterfly-visual {
    inset: 2% -22% -32% 42%;
    opacity: 0.55;
  }

  .visual-word {
    display: none;
  }

  .survey-pane {
    min-height: calc(100dvh - 310px);
    padding: 28px 24px 44px;
    box-shadow: 0 -20px 62px rgba(65, 68, 72, 0.08);
  }

  form {
    min-height: 540px;
    padding-top: 42px;
  }

}

@media (max-width: 560px) {
  .visual-pane {
    min-height: 196px;
    padding: 18px 18px 30px;
    justify-content: flex-start;
  }

  .brand {
    margin-bottom: 10px;
    font-size: 9px;
    letter-spacing: 0.22em;
  }

  h1 {
    max-width: 370px;
    font-size: 43px;
    line-height: 0.92;
  }

  .lead {
    max-width: 315px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.36;
  }

  .privacy-note {
    margin-top: 9px;
    font-size: 10px;
  }

  .butterfly-visual {
    inset: -12% -48% -22% 47%;
    opacity: 0.38;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 46%, #000 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 46%, #000 100%);
  }

  .survey-pane {
    z-index: 2;
    min-height: calc(100dvh - 178px);
    margin-top: -18px;
    padding: 22px 18px 30px;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 36px rgba(65, 68, 72, 0.08);
  }

  .progress-copy {
    align-items: baseline;
    flex-direction: row;
    gap: 12px;
    font-size: 10px;
  }

  #question-position {
    white-space: nowrap;
  }

  #answered-count {
    margin-left: auto;
    text-align: right;
  }

  .progress-segments {
    gap: 5px;
    margin-top: 10px;
  }

  form {
    min-height: 0;
    padding: 28px 0 8px;
    justify-content: flex-start;
  }

  .question-theme {
    margin-bottom: 13px;
    font-size: 9px;
  }

  .form-step label {
    margin-bottom: 18px;
    font-size: 32px;
    line-height: 0.98;
    letter-spacing: -0.032em;
  }

  textarea {
    min-height: 120px;
    max-height: 190px;
    padding: 16px;
  }

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

  .form-nav {
    grid-template-columns: 88px 1fr;
    margin-top: 15px;
  }

  .form-nav button {
    min-height: 52px;
  }

  .back-button[hidden] ~ .next-button {
    grid-column: 1 / -1;
  }

  .success {
    min-height: 510px;
  }

  .success h2 {
    font-size: 62px;
  }

  .success-copy > p:not(.brand) {
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 39px;
  }

  .form-step label {
    font-size: 29px;
  }

  .progress-copy {
    font-size: 9px;
  }
}
