:root {
  color-scheme: dark;
  --cream: #e8d0c2;
  --white: #fff;
  --rose: #77484f;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #080503; }
body { color: var(--white); font-family: 'DM Sans', Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }

.stage {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #080503;
}
.background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity .65s ease, transform 1.1s ease;
  pointer-events: none;
}
.background-one { background-image: url('1.webp'); }
.background-two { background-image: url('2.webp'); }
.background-three { background-image: url('3.webp'); }
.background-four { background-image: url('4.webp'); }
.stage[data-step="1"] .background-one,
.stage[data-step="2"] .background-two,
.stage[data-step="3"] .background-three,
.stage[data-step="4"] .background-four { opacity: 1; transform: scale(1); }

.screen { display: none; position: relative; z-index: 2; min-height: 100svh; }
.screen.is-active { display: block; }
.screen.is-leaving { display: block; position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.content-panel {
  width: 43%;
  min-height: 100svh;
  padding: 4.5vh 0 3.55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  row-gap: 10px;
}
.brand { display: block; width: 33.5%; height: auto; flex: none; }
.intro-group { width: 100%; display: flex; flex-direction: column; align-items: center; }
.screen-one .intro-group { margin-top: 5.7vh; }
.screen-two .intro-group { margin-top: -.5vh; }
.intro-heading {
  margin: 0;
  color: var(--cream);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(48px, 3.5vw, 94px);
  font-weight: 400;
  line-height: 1;
}
.intro-heading strong {
    display: block;
    color: #fff;
    font-size: 1.85em;
    font-weight: 400;
}
.separator { width: 7.3vw; height: 2px; flex: none; background: #fff; margin: 3.2vh 0 3.3vh; }
.intro-copy {
  width: 100%;
  margin: 0;
  color: var(--cream);
  font-family: Montserrat, Arial, sans-serif;
  font-size: clamp(16px, 1.3vw, 31px);
  font-weight: 400;
  line-height: 1.35;
}

.form-fields { width: 87%; text-align: left; }
.screen-one .form-fields { margin-top: 6.9vh; }
.screen-two .form-fields { margin-top: 3.2vh; }
.field { display: block; }
.field + .field { margin-top: 2.5vh; }
.field span { display: block; margin-bottom: 1.25vh; color: #fff; font-size: clamp(16px, 1.25vw, 27px); line-height: 1.2; }
.screen-one .field span { margin-bottom: 2.5vh; }
.field input {
  display: block;
  width: 100%;
  height: 6.4vh;
  min-height: 44px;
  padding: 0 0 5px;
  border: 0;
  border-bottom: 2px solid rgba(255,255,255,.88);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: clamp(18px, 1.65vw, 36px);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.screen-one .field input { height: 6.5vh; font-size: clamp(19px, 1.85vw, 38px); }
.field input::placeholder { color: #999; opacity: 1; }
.field input:focus { border-bottom-color: var(--cream); box-shadow: 0 2px 0 rgba(232,208,194,.18); }
.field input[aria-invalid="true"] { border-bottom-color: #e5a3a3; }
.field .phone-input {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 6.4vh;
  min-height: 44px;
  margin-bottom: 0;
  border-bottom: 2px solid rgba(255,255,255,.88);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.field .phone-prefix {
  display: inline;
  flex: none;
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 1.65vw, 36px);
}
.phone-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding-bottom: 5px;
  border: 0;
}
.phone-input input:focus { box-shadow: none; }
.phone-input:focus-within { border-bottom-color: var(--cream); box-shadow: 0 2px 0 rgba(232,208,194,.18); }
.phone-input:has(input[aria-invalid="true"]) { border-bottom-color: #e5a3a3; }

.panel-footer { width: 100%; margin-top: auto; display: flex; flex-direction: column; align-items: center; }
.error { margin: 0 0 10px; color: #ffd5d0; font: 14px Arial, sans-serif; text-shadow: 0 1px 3px #000; }
.error:empty { display: none; }
.actions { display: flex; align-items: center; justify-content: center; gap: 5.2vw; }
.back {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--cream);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: clamp(16px, 1.5vw, 32px);
  font-weight: 700;
  transition: color .25s ease, transform .25s ease;
}
.back[aria-disabled="true"] { cursor: default; }
.next {
  min-width: 11.2vw;
  min-height: 5.8vh;
  padding: 6px 1.8vw;
  border: 3px solid var(--cream);
  border-radius: 0;
  background: rgba(0,0,0,.08);
  color: var(--cream);
  font-size: clamp(17px, 1.5vw, 32px);
  font-weight: 700;
  transition: background-color .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.next:hover, .next:focus-visible { background: var(--cream); color: #24120f; transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.back:not([aria-disabled="true"]):hover, .back:not([aria-disabled="true"]):focus-visible { color: #fff; transform: translateX(-3px); }
.next:disabled { opacity: .65; cursor: wait; }
.dots { display: flex; justify-content: center; gap: .85vw; margin-top: 6vh; }
.dots i { display: block; width: 13px; height: 13px; border-radius: 50%; background: #e8dfd2; }
.dots i.current { background: var(--rose); }

.screen-three .brand { width: 32.5%; }
.screen-three .intro-heading { font-size: clamp(34px, 3vw, 66px); }
.screen-three .intro-heading strong { font-size: 1.65em; }
.screen-three .separator { width: 6.1vw; margin: 2.3vh 0 2vh; }
.screen-three .intro-copy { font-size: clamp(15px, 1.2vw, 26px); line-height: 1.38; }
.ritual-content { width: 100%; display: flex; flex-direction: column; align-items: center; }
.ritual-question {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(27px, 1.75vw, 39px);
  font-weight: 400;
  white-space: nowrap;
  transform-origin: top center;
}
.choices { width: 65%; margin-top: 3vh; display: grid; gap: 1.8vh; }
.choice {
  width: 100%;
  min-height: 4.4vh;
  padding: 5px 10px;
  border: 2px solid var(--cream);
  border-radius: 0;
  background: rgba(0,0,0,.1);
  color: #fff;
  font-family: Montserrat, Arial, sans-serif;
  font-size: clamp(14px, 1vw, 27px);
  font-weight: 300;
  transition: background-color .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.choice:hover, .choice:focus-visible { background: rgba(232,208,194,.2); transform: translateX(5px); }
.choice[aria-pressed="true"] { background: var(--cream); color: #281714; box-shadow: 0 0 0 2px rgba(232,208,194,.25); }
.screen-three .next { min-width: 17.1vw; }
.screen-three .dots { margin-top: 5.3vh; }

.screen-four .content-panel { width: 50%; margin-left: 5%; padding-top: 15vh; }
.screen-four .brand { width: 35%; }
.reveal-content { width: 100%; margin-top: 4.35vh; text-align: center; }
.reveal-title { margin: 0; color: #fff; font-family: 'Playfair Display', Georgia, serif; font-size: clamp(30px, 2.48vw, 53px); font-weight: 400; }
.reveal-title span { display: block; }
.reveal-rule { width: 23%; height: 2px; margin: 2.8vh auto 2.5vh; background: #fff; }
.reveal-copy { margin: 0; color: var(--cream); font-family: Montserrat, Arial, sans-serif; font-size: clamp(18px, 1.74vw, 38px); }
.code-box { display: flex; align-items: center; justify-content: space-between; width: 77%; min-height: 8.1vh; margin: 6.1vh auto 0; padding: 1.1vh 1.1vw 1.1vh 1.7vw; border: 3px dashed #fff; gap: 1vw; }
.code-value { color: var(--cream); font-family: Montserrat, Arial, sans-serif; font-size: clamp(21px, 2.1vw, 45px); font-weight: 600; letter-spacing: .24em; white-space: nowrap; }
.copy-code { min-width: 31%; padding: .45vh .8vw; border: 0; border-radius: 0; background: var(--cream); color: #4d2826; font: 700 clamp(20px, 2.1vw, 45px) 'DM Sans', Arial, sans-serif; transition: background-color .25s ease, transform .25s ease; }
.copy-code:hover, .copy-code:focus-visible { background: #fff; transform: translateY(-2px); }
.reveal-foot { max-width: 86%; margin: 5.4vh auto 0; color: #fff; font-family: 'Playfair Display', Georgia, serif; font-size: clamp(20px, 1.5vw, 32px); transform-origin: top center; }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

@media (max-width: 900px) {
  .desktop-break { display: none; }
  .background { background-position: 70% center; }
  .background-three { background-position: 70% center; }
  .background-four { background-position: right; }
  .stage::before { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.42)); pointer-events: none; }
  .content-panel, .screen-three .content-panel, .screen-four .content-panel {
    width: 100%;
    min-height: 100svh;
    margin: 0;
    padding: 24px 22px 28px;
  }
  .brand, .screen-three .brand, .screen-four .brand { width: clamp(170px, 44vw, 215px); }
  .intro-group, .screen-one .intro-group, .screen-two .intro-group, .screen-three .intro-group { margin-top: 22px; }
  .intro-heading, .screen-three .intro-heading { font-size: clamp(31px, 7.6vw, 56px); line-height: 1.06; }
  .intro-heading span, .intro-heading strong { transform: none; white-space: normal; }
  .intro-heading strong, .screen-three .intro-heading strong { margin-top: 0; font-size: 1.55em; line-height: 1.02; }
  .separator, .screen-three .separator { width: 92px; margin: 18px 0; }
  .intro-copy, .screen-three .intro-copy { max-width: 540px; font-size: 16px; line-height: 1.45; }
  .form-fields, .screen-one .form-fields, .screen-two .form-fields { width: 100%; max-width: 540px; margin-top: 28px; }
  .field span, .screen-one .field span { margin-bottom: 7px; font-size: 17px; }
  .field + .field { margin-top: 18px; }
  .field input, .screen-one .field input { height: 48px; font-size: 22px; }
  .field .phone-input { height: 48px; }
  .field .phone-prefix { font-size: 22px; }
  .phone-input input { height: 100%; }
  .panel-footer { padding-top: 22px; }
  .actions { gap: clamp(24px, 8vw, 42px); }
  .back { font-size: 20px; }
  .next, .screen-three .next { min-width: 150px; min-height: 47px; padding: 6px 14px; font-size: 20px; }
  .dots, .screen-three .dots { gap: 10px; margin-top: 20px; }
  .dots i { width: 10px; height: 10px; }
  .screen-three .brand { width: 170px; }
  .screen-three .intro-group { margin-top: 14px; }
  .screen-three .intro-heading { font-size: clamp(28px, 6.6vw, 39px); }
  .screen-three .separator { margin: 12px 0; }
  .screen-three .intro-copy { margin: 0; }
  .ritual-content { margin-top: 16px; }
  .ritual-question { max-width: 100%; font-size: clamp(25px, 6vw, 34px); line-height: 1.1; white-space: normal; transform: none; }
  .choices { width: 100%; max-width: 540px; margin-top: 16px; gap: 8px; }
  .choice { min-height: 44px; font-size: 15px; }
  .choice span { transform: none; }
  .screen-three .panel-footer { padding-top: 18px; }
  .screen-three .dots { margin-top: 16px; }
  .screen-four .content-panel { justify-content: center; }
  .screen-four .brand { width: 190px; }
  .reveal-content { margin-top: 30px; }
  .reveal-title { font-size: clamp(27px, 6vw, 40px); line-height: 1.1; }
  .reveal-title span { white-space: normal; transform: none !important; }
  .reveal-rule { width: 95px; margin: 21px auto; }
  .reveal-copy { font-size: 18px; }
  .code-box { width: 100%; max-width: 540px; min-height: 66px; margin-top: 30px; padding: 9px 10px; gap: 5px; }
  .code-value { font-size: clamp(17px, 4.6vw, 25px); letter-spacing: .12em; }
  .copy-code { font-size: 18px; padding: 8px 9px; }
  .reveal-foot { max-width: 100%; margin-top: 26px; font-size: 22px; transform: none; }
}
@media (max-width: 380px) {
  .content-panel, .screen-three .content-panel, .screen-four .content-panel { padding-left: 16px; padding-right: 16px; }
  .screen-three .intro-heading { font-size: 28px; }
  .choice { font-size: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  .screen.is-active { animation: screen-in .48s cubic-bezier(.2,.7,.2,1) both; }
  .screen.is-leaving { animation: screen-out .3s ease both; }
  .screen.is-active .intro-group, .screen.is-active .reveal-content { animation: content-in .6s cubic-bezier(.2,.7,.2,1) both; }
  .screen.is-active .form-fields, .screen.is-active .ritual-content { animation: content-in .6s .08s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes screen-out { from { opacity: 1; } to { opacity: 0; } }
  @keyframes content-in { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  .background, .field input, .back, .next, .choice, .copy-code { transition: none !important; }
  .screen, .screen * { animation: none !important; }
}
