:root {
  --ink: #111;
  --rose: #d19793;
  --olive: #818263;
  --paper: #f4eeee;
  --heading: "Helvetica Now Display Condensed", "Cabinet Grotesk", "League Spartan", Arial, sans-serif;
  --body: Poppins, Arial, Helvetica, sans-serif;
  --scroll-progress: 0;
  --ambient-shift: 0px;
  --ambient-shift-reverse: 0px;
  --frame-x: 0px;
  --frame-y: 0px;
  --scene-shift: 0px;
  --scene-x: 0px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.55 var(--body);
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--olive));
  transform: scaleX(var(--scroll-progress));
  transform-origin: left center;
  will-change: transform;
}

main {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 7vw, 7rem);
  max-width: 1200px;
  margin: auto;
  padding: 3rem clamp(1.25rem, 5vw, 4rem);
}

main::before,
main::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

main::before {
  width: clamp(230px, 34vw, 430px);
  aspect-ratio: 1;
  left: clamp(-170px, -10vw, -80px);
  top: clamp(110px, 18vh, 190px);
  border: 1px solid rgba(129, 130, 99, 0.38);
  border-radius: 50%;
  box-shadow:
    0 0 0 18px rgba(129, 130, 99, 0.045),
    0 0 0 42px rgba(209, 151, 147, 0.035);
  transform: translate3d(0, var(--ambient-shift), 0);
  transition: transform 120ms linear;
}

main::after {
  width: 116px;
  height: 116px;
  right: 2%;
  top: 8%;
  opacity: 0.42;
  background-image: radial-gradient(circle, var(--rose) 1.5px, transparent 1.7px);
  background-size: 15px 15px;
  transform: translate3d(0, var(--ambient-shift-reverse), 0) rotate(8deg);
  transition: transform 120ms linear;
}

.intro,
.form-stage,
.form-card {
  position: relative;
}

.intro {
  z-index: 1;
}

.brand-mark {
  width: 100px;
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(17, 17, 17, 0.08));
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 2rem 0 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--rose);
}

.intro h1 {
  margin: 0 0 1.5rem;
  font: 400 clamp(2.4rem, 5vw, 4.8rem)/1.04 var(--heading);
  letter-spacing: -0.045em;
}

.intro h1 em {
  position: relative;
  display: inline-block;
  color: var(--olive);
}

.intro h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: -2%;
  bottom: -0.08em;
  height: 0.08em;
  min-height: 3px;
  border-radius: 99px;
  background: var(--rose);
  transform: scaleX(0);
  transform-origin: left;
}

.intro.is-visible h1 em::after {
  animation: draw-line 700ms 480ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro > p:not(.eyebrow):not(.scroll-cue) {
  max-width: 420px;
}

.scroll-cue {
  display: none;
}

.form-stage {
  z-index: 2;
}

.form-backdrop {
  display: none;
}

.form-card {
  z-index: 1;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border-top: 5px solid var(--olive);
  background: #fff;
  box-shadow: 0 22px 60px rgba(17, 17, 17, 0.1);
}

.form-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 11px -11px -11px 11px;
  border: 1px solid rgba(209, 151, 147, 0.78);
  pointer-events: none;
  transform: translate3d(var(--frame-x), var(--frame-y), 0);
  transition: transform 100ms linear;
}

h2 {
  margin: 0 0 0.5rem;
  font: 400 1.8rem/1.15 var(--heading);
}

.form-card > p {
  margin: 0 0 1.5rem;
  color: #555;
}

.field {
  margin: 0 0 1rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  transition: color 180ms ease, transform 180ms ease;
}

.field:focus-within label {
  color: #5f6048;
  transform: translateX(3px);
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid #777;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:hover {
  border-color: var(--olive);
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid var(--olive);
  outline-offset: 3px;
}

input:focus-visible {
  border-color: var(--olive);
  box-shadow: 5px 5px 0 rgba(209, 151, 147, 0.2);
  transform: translate(-1px, -1px);
}

input[aria-invalid="true"] {
  border-color: #a32828;
}

.field-error {
  display: block;
  margin-top: 0.25rem;
  color: #a32828;
  font-size: 0.875rem;
}

.field-error:empty {
  display: none;
}

.note {
  margin: 1.25rem 0;
  color: #555;
  font-size: 0.875rem;
}

button {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 48px;
  padding: 0.9rem 1.2rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.16);
  cursor: pointer;
  font: 700 0.875rem/1.4 var(--body);
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -4px;
  border: 1px solid rgba(209, 151, 147, 0.9);
  border-radius: inherit;
  opacity: 0.72;
  animation: button-breathe 2.8s ease-in-out infinite;
}

button span {
  display: inline-block;
  margin-left: 0.5rem;
  transition: transform 180ms ease;
}

.minimal-arrow {
  position: relative;
  width: 0.72rem;
  height: 0.72rem;
  vertical-align: -0.02rem;
}

.minimal-arrow::before {
  content: "";
  position: absolute;
  top: 0.03rem;
  right: 0.03rem;
  width: 0.4rem;
  height: 0.4rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.minimal-arrow::after {
  content: "";
  position: absolute;
  left: 0.07rem;
  bottom: 0.08rem;
  width: 0.7rem;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-45deg);
  transform-origin: left center;
}

button:hover {
  background: #343526;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.2);
  transform: translateY(-2px);
}

button:hover span {
  transform: translate(2px, -2px);
}

button:active {
  transform: translateY(1px) scale(0.988);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

#form-status {
  margin: 1rem 0 0;
  font-size: 0.875rem;
}

#form-status:empty {
  display: none;
}

#form-status[data-state="error"] {
  color: #a32828;
}

#form-status[data-state="success"] {
  color: #3f5429;
}

body.motion-enabled [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 620ms ease,
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.motion-enabled [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.scroll-pulse main::before {
  animation: ambient-tick 220ms ease-out;
}

body.scroll-pulse .form-card::after {
  animation: frame-tick 220ms ease-out;
}

@keyframes draw-line {
  to { transform: scaleX(1); }
}

@keyframes button-breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.99); }
  50% { opacity: 0.85; transform: scale(1.025, 1.12); }
}

@keyframes ambient-tick {
  0%, 100% { margin-left: 0; }
  28% { margin-left: -3px; }
  58% { margin-left: 3px; }
}

@keyframes frame-tick {
  0%, 100% { translate: 0; }
  30% { translate: -3px 1px; }
  62% { translate: 3px -1px; }
}

@keyframes float-rose {
  0%, 100% { transform: translate3d(0, 2px, 0) rotate(-12deg); }
  50% { transform: translate3d(9px, -11px, 0) rotate(-3deg); }
}

@keyframes float-olive {
  0%, 100% { transform: translate3d(0, -4px, 0) rotate(8deg); }
  50% { transform: translate3d(-8px, 10px, 0) rotate(-4deg); }
}

@keyframes float-ring {
  0%, 100% { transform: translate3d(-2px, 7px, 0) scale(0.94); }
  50% { transform: translate3d(8px, -8px, 0) scale(1.04); }
}

@keyframes float-dot {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.9); }
  50% { transform: translate3d(-8px, -12px, 0) scale(1.08); }
}

@keyframes backdrop-mark-float {
  0%, 100% { transform: translate3d(0, -5px, 0) rotate(-5deg); }
  50% { transform: translate3d(-11px, 8px, 0) rotate(3deg); }
}

@keyframes tactile-button {
  0%, 100% { transform: translateX(0) scale(1); }
  22% { transform: translateX(-3px) scale(0.985); }
  48% { transform: translateX(3px) scale(1.012); }
  72% { transform: translateX(-1px) scale(0.995); }
}

@keyframes tactile-card {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-2px); }
  62% { transform: translateX(2px); }
}

@keyframes tactile-error {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-4px); }
  38% { transform: translateX(4px); }
  58% { transform: translateX(-3px); }
  78% { transform: translateX(2px); }
}

@keyframes tactile-success {
  0% { transform: scale(1); box-shadow: 0 18px 44px rgba(17, 17, 17, 0.14); }
  42% { transform: scale(1.012); box-shadow: 0 20px 52px rgba(129, 130, 99, 0.3); }
  100% { transform: scale(1); box-shadow: 0 18px 44px rgba(17, 17, 17, 0.14); }
}

@media (max-width: 700px) {
  main {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0.75rem;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.85rem calc(1.25rem + env(safe-area-inset-bottom));
  }

  main::before {
    width: 220px;
    left: -150px;
    top: 76px;
  }

  main::after {
    width: 76px;
    height: 76px;
    right: -22px;
    top: 20px;
  }

  .brand-mark {
    width: 52px;
  }

  .eyebrow {
    gap: 0.5rem;
    margin: 0.55rem 0 0.45rem;
    font-size: 0.75rem;
  }

  .eyebrow::before {
    width: 20px;
  }

  .intro h1 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.9rem, 8.8vw, 2.3rem);
    line-height: 1;
  }

  .intro > p:not(.eyebrow):not(.scroll-cue) {
    margin-bottom: 0;
  }

  .scroll-cue {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0.65rem 0 0;
    color: #5c5d4a;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .scroll-cue span {
    width: 22px;
    height: 1px;
    background: var(--olive);
    transform-origin: left;
    animation: cue-line 1.8s ease-in-out infinite;
  }

  .form-card {
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
    padding: 0.9rem 0.85rem 0.85rem;
    border-top-width: 3px;
    background: rgba(255, 255, 255, 0.985);
    box-shadow:
      0 14px 34px rgba(17, 17, 17, 0.12),
      0 0 0 1px rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(8px) saturate(0.94);
    backdrop-filter: blur(8px) saturate(0.94);
  }

  .form-card::after {
    inset: 5px -5px -5px 5px;
  }

  h2 {
    font-size: 1.4rem;
  }

  .form-card > p {
    margin: 0.1rem 0 0.8rem;
    font-size: 1rem;
    line-height: 1.4;
  }

  .field {
    margin-bottom: 0.55rem;
  }

  label {
    margin-bottom: 0.25rem;
  }

  input {
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    font-size: 1rem;
  }

  button {
    min-height: 46px;
    margin-top: 0.15rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
  }

  #form-status {
    margin-top: 0.75rem;
  }

  .form-stage {
    isolation: isolate;
    margin: 0.1rem 0 0.25rem;
    padding: 0.35rem 0.45rem 0.45rem;
  }

  .form-backdrop {
    display: block;
    position: absolute;
    z-index: 0;
    inset: -0.55rem -0.65rem -0.7rem;
    overflow: hidden;
    border-radius: 20px;
    pointer-events: none;
    transform: translate3d(var(--scene-x), var(--scene-shift), 0);
    transition: transform 100ms linear, filter 260ms ease;
    will-change: transform;
  }

  .float-shape {
    position: absolute;
    display: block;
    box-shadow: 0 8px 20px rgba(17, 17, 17, 0.11);
    will-change: transform;
  }

  .float-shape--rose {
    top: 9%;
    left: -22px;
    width: 70px;
    height: 25px;
    border-radius: 999px;
    background: rgba(209, 151, 147, 0.82);
    animation: float-rose 5.2s ease-in-out infinite;
  }

  .float-shape--olive {
    top: 30%;
    right: -20px;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: rgba(129, 130, 99, 0.75);
    animation: float-olive 6.1s ease-in-out infinite;
  }

  .float-shape--ring {
    bottom: 21%;
    left: -37px;
    width: 84px;
    aspect-ratio: 1;
    border: 1.5px solid rgba(129, 130, 99, 0.72);
    border-radius: 50%;
    background: rgba(244, 238, 238, 0.28);
    box-shadow:
      0 0 0 10px rgba(129, 130, 99, 0.06),
      0 8px 22px rgba(17, 17, 17, 0.07);
    animation: float-ring 7s ease-in-out infinite;
  }

  .float-shape--dot {
    right: 4px;
    bottom: 7%;
    width: 20px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--rose);
    box-shadow:
      -18px 10px 0 rgba(209, 151, 147, 0.3),
      0 7px 18px rgba(17, 17, 17, 0.1);
    animation: float-dot 4.7s ease-in-out infinite;
  }

  .backdrop-mark {
    position: absolute;
    top: 52%;
    right: -34px;
    width: 96px;
    height: auto;
    opacity: 0.2;
    filter: saturate(0.72);
    animation: backdrop-mark-float 6.4s ease-in-out infinite;
  }

  .form-stage:focus-within .form-backdrop {
    filter: saturate(1.14);
  }

  .form-stage:focus-within .backdrop-mark {
    opacity: 0.28;
  }

  body.scroll-pulse .form-backdrop {
    animation: frame-tick 220ms ease-out;
  }

  body.submit-tap button {
    animation: tactile-button 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  body.submit-tap .form-card {
    animation: tactile-card 360ms ease-out;
  }

  body.submit-error .form-card {
    animation: tactile-error 430ms ease-out;
  }

  body.submit-success .form-card {
    animation: tactile-success 680ms ease-out;
  }

  body.submit-success .float-shape {
    filter: saturate(1.3) brightness(1.04);
  }

  @keyframes cue-line {
    0%, 100% { opacity: 0.45; transform: scaleX(0.45); }
    50% { opacity: 1; transform: scaleX(1); }
  }
}

@media (max-width: 380px) {
  main {
    gap: 0.6rem;
    padding-inline: 0.75rem;
  }

  .brand-mark {
    width: 48px;
  }

  .intro h1 {
    font-size: 1.85rem;
  }

  .form-card {
    padding: 0.8rem 0.75rem 0.75rem;
  }

  h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 700px) and (max-height: 680px) {
  .scroll-cue {
    display: none;
  }

  .brand-mark {
    width: 54px;
  }

  .intro h1 {
    margin-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body.motion-enabled [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
