/* =========================================================
   ASTARVAA — the Sankat Mochan waitlist (sankat-mochan.html #contact, js/waitlist.js)
   Quiet and minimal: a night gradient, the watch on its own in the middle with a soft glow in its metal,
   the story on the left, the reservation card on the right — one screen on desktops.
   ========================================================= */
.waitlist {
  --wl-ink: #f4eadb;
  --wl-ink-2: #c4b399;
  --wl-ink-3: #988870;
  --wl-gold: #dcbd8e;
  --wl-line: rgba(255, 244, 226, .1);
  --glow: 214, 140, 84;                          /* the watch's metal, lit: rose gold */
  --stage: clamp(240px, min(36vw, 54vh), 470px);
  position: relative; isolation: isolate; overflow: hidden;
  display: grid;
  background: #120e0b; color: var(--wl-ink);
}
.waitlist[data-variant="steel-black"] { --glow: 176, 186, 198; }
.waitlist[data-variant="rose-orange"] { --glow: 232, 128, 56; }

.waitlist__bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(30% 44% at 50% 46%, rgba(var(--glow), .2), transparent 72%),
    radial-gradient(70% 50% at 50% 100%, rgba(var(--glow), .06), transparent 70%),
    linear-gradient(180deg, #1b1612 0%, #130f0c 52%, #0d0b09 100%);
}

/* ---------- layout ---------- */
.waitlist__inner {
  width: 100%; max-width: var(--sec-max); margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stage) minmax(330px, 360px);
  grid-template-areas: "story stage card";
  gap: clamp(28px, 3.6vw, 64px);
  align-items: center;
}
.waitlist__story { grid-area: story; }
.waitlist__stage { grid-area: stage; }
.waitlist__card { grid-area: card; }

/* ---------- the story ---------- */
.waitlist .eyebrow { color: var(--wl-gold); letter-spacing: .32em; }
.waitlist .display { font-size: clamp(40px, min(3.9vw, 6.6vh), 60px); line-height: 1.04; color: var(--wl-ink); text-wrap: balance; }
.waitlist .display em { color: #e2ab7c; }
.waitlist__lede { max-width: 380px; margin: 0; color: var(--wl-ink-2); font-size: 16px; line-height: 1.7; }

.waitlist__count { margin: clamp(26px, 4vh, 40px) 0 0; }
.waitlist__count-label { margin: 0 0 10px; font-size: 11px; font-weight: 400; letter-spacing: .28em; text-transform: uppercase; color: var(--wl-ink-3); }
.waitlist__clock { display: flex; gap: clamp(20px, 2.2vw, 32px); }
.waitlist__clock span { display: grid; gap: 4px; min-width: 2.1ch; }
.waitlist__clock b {
  display: block; overflow: hidden;
  font-family: var(--serif); font-weight: 300; font-size: clamp(38px, min(3.4vw, 5.6vh), 52px); line-height: 1;
  color: var(--wl-ink); font-variant-numeric: tabular-nums lining-nums;
}
.waitlist__clock b.is-roll { animation: wl-roll .5s var(--ease); }
@keyframes wl-roll { from { transform: translateY(-30%); opacity: 0; } }
.waitlist__clock small { font-size: 10px; font-weight: 400; letter-spacing: .24em; text-transform: uppercase; color: var(--wl-ink-3); }
.waitlist__count-note { margin: 12px 0 0; font-size: 13px; color: var(--wl-ink-3); }
.waitlist.is-open .waitlist__clock { display: none; }

.waitlist__perks { list-style: none; margin: clamp(24px, 3.6vh, 36px) 0 0; padding: 0; max-width: 380px; }
.waitlist__perks li { display: grid; grid-template-columns: 30px 1fr; align-items: baseline; padding: clamp(9px, 1.4vh, 12px) 0; border-top: 1px solid var(--wl-line); }
.waitlist__perks i { font-style: normal; font-size: 11px; letter-spacing: .1em; color: var(--wl-gold); }
.waitlist__perks p { margin: 0; display: grid; gap: 1px; }
.waitlist__perks strong { font-weight: 400; font-size: 15px; color: var(--wl-ink); }
.waitlist__perks span { font-size: 14px; color: var(--wl-ink-3); }

/* ---------- the watch, on its own ---------- */
.waitlist__stage { --tx: 0; --ty: 0; position: relative; width: var(--stage); justify-self: center; }
.waitlist__watch { position: relative; z-index: 1; margin: 0; animation: wl-float 7s ease-in-out infinite; }
.waitlist__watch img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .55));
  transform: translate3d(calc(var(--tx) * 10px), calc(var(--ty) * 8px), 0) rotate(calc(var(--tx) * 2deg));
  transition: opacity .35s ease, transform .9s var(--ease);
}
.waitlist__watch.is-swapping img { opacity: 0; transform: translateY(10px) scale(.97); }
@keyframes wl-float { 50% { transform: translateY(-8px); } }
.waitlist__floor {   /* the soft shadow it hovers over */
  position: absolute; left: 14%; right: 14%; bottom: -6%; height: 12%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
  animation: wl-floor 7s ease-in-out infinite;
}
@keyframes wl-floor { 50% { transform: scaleX(.92); opacity: .75; } }

/* ---------- the reservation card ---------- */
.waitlist__card {
  padding: clamp(22px, 3.2vh, 32px) clamp(22px, 2vw, 30px);
  background: rgba(255, 244, 226, .035);
  border: 1px solid var(--wl-line); border-radius: 16px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.waitlist__card-title { margin: 0 0 clamp(16px, 2.6vh, 22px); font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 2vw, 28px); line-height: 1.1; color: var(--wl-ink); }

/* the variant choice */
.wl-variants { border: 0; margin: 0 0 clamp(14px, 2.4vh, 20px); padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wl-variants legend { padding: 0; margin-bottom: 10px; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--wl-ink-3); }
.wl-variant { position: relative; cursor: pointer; }
.wl-variant input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wl-variant > span {
  display: grid; justify-items: center; gap: 1px; padding: 11px 4px 9px; height: 100%;
  border: 1px solid var(--wl-line); border-radius: 10px; text-align: center; font-size: 13px; line-height: 1.3; color: var(--wl-ink);
  transition: border-color .25s, background .25s;
}
.wl-sw { display: flex; margin-bottom: 7px; }
.wl-sw .sw { width: 15px; height: 15px; }
.wl-sw .sw + .sw { margin-left: -4px; }
.wl-variant b { font-weight: 400; }
.wl-variant small { font-size: 11px; color: var(--wl-ink-3); }
.wl-variant:hover > span { border-color: rgba(255, 244, 226, .24); }
.wl-variant input:checked + span { border-color: var(--wl-gold); background: rgba(220, 189, 142, .08); }
.wl-variant input:focus-visible + span { outline: 1.5px solid var(--wl-gold); outline-offset: 3px; }
.wl-variant--quiet { grid-column: 1 / -1; }
.wl-variant--quiet > span { padding: 7px; font-size: 12.5px; color: var(--wl-ink-2); }

/* fields: a single line each */
.wl-field { margin-bottom: clamp(10px, 1.8vh, 16px); }
.wl-field > label { display: block; margin-bottom: 2px; font-size: 12px; letter-spacing: .04em; color: var(--wl-ink-3); }
.wl-optional { margin-left: 6px; font-size: 11px; letter-spacing: .1em; color: var(--wl-ink-3); opacity: .8; }
.wl-field input, .wl-phone select {
  width: 100%; min-height: 42px; padding: 0 2px;
  font: inherit; font-size: 16px; font-weight: 400; color: var(--wl-ink);
  background: transparent; border: 0; border-bottom: 1px solid rgba(255, 244, 226, .2); border-radius: 0;
  transition: border-color .25s;
}
.wl-field input:hover, .wl-phone select:hover { border-bottom-color: rgba(255, 244, 226, .36); }
.wl-field input:focus, .wl-phone select:focus { outline: none; border-bottom-color: var(--wl-gold); }
.wl-field input[aria-invalid="true"] { border-bottom-color: #ec9478; }
.wl-phone { display: grid; grid-template-columns: 92px 1fr; gap: 14px; }
.wl-phone select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--wl-ink-3) 50%), linear-gradient(135deg, var(--wl-ink-3) 50%, transparent 50%);
  background-position: calc(100% - 12px) 19px, calc(100% - 7px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.wl-phone select option { color: var(--ink); background: var(--white); }
.wl-field__err { min-height: 0; margin: 6px 0 0; font-size: 13px; color: #f0a185; }
.wl-field__err:empty { display: none; }
.wl-field__err button { color: var(--wl-gold); text-decoration: underline; text-underline-offset: 3px; }
.wl-field > .wl-check { display: flex; margin-bottom: 0; gap: 10px; align-items: center; margin-top: 10px; font-size: 14px; color: var(--wl-ink-2); cursor: pointer; }
.wl-field > .wl-check[hidden] { display: none; }
.wl-field .wl-check input { flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--wl-gold); }
.wl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* buttons in the night */
.waitlist .btn--dark { background: var(--wl-ink); color: #18120c; font-weight: 500; box-shadow: none; }
.waitlist .btn--dark:hover { background: var(--wl-gold); color: #18120c; }
.waitlist .btn--ghost { color: var(--wl-ink); border-color: rgba(255, 244, 226, .24); }
.waitlist .btn--ghost:hover { color: var(--wl-gold); border-color: var(--wl-gold); }

.wl-submit { width: 100%; justify-content: center; margin-top: 8px; min-height: 50px; }
.wl-spin { display: none; width: 16px; height: 16px; margin-left: 10px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: wl-spin .8s linear infinite; }
.wl-form.is-busy .wl-spin { display: inline-block; }
.wl-form.is-busy .wl-submit { pointer-events: none; opacity: .85; }
@keyframes wl-spin { to { transform: rotate(360deg); } }
.wl-error { margin: 12px 0 0; font-size: 14px; color: #f0a185; text-align: center; }
.wl-error:empty { display: none; }
.wl-fine { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--wl-ink-3); text-align: center; }

/* done */
.wl-done { text-align: center; padding: 8px 0 4px; animation: wl-in .6s var(--ease) both; }
.wl-done:focus { outline: none; }
.wl-done__mark { width: 52px; height: 52px; margin: 0 auto 16px; display: block; fill: none; stroke: var(--wl-gold); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.wl-done__mark path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: wl-tick .7s .25s var(--ease) forwards; }
.wl-done .eyebrow { margin-bottom: 8px; }
.wl-done__title { margin: 0 0 12px; font-family: var(--serif); font-weight: 300; font-size: clamp(36px, 3.4vw, 46px); line-height: 1; color: var(--wl-ink); }
.wl-done__title b { font-weight: 400; color: var(--wl-gold); }
.wl-done__text { max-width: 300px; margin: 0 auto 22px; color: var(--wl-ink-2); font-size: 15px; }
.wl-done__text b { font-weight: 400; color: var(--wl-ink); }
.wl-done__actions { display: grid; gap: 10px; }
.wl-done__actions .btn { justify-content: center; }
.wl-again { margin-top: 16px; font-size: 13px; color: var(--wl-ink-3); text-decoration: underline; text-underline-offset: 4px; }
.wl-again:hover { color: var(--wl-gold); }
@keyframes wl-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes wl-tick { to { stroke-dashoffset: 0; } }

/* ---------- smaller screens ---------- */
/* narrower or shorter desktops: the headline beside the watch, the countdown and perks beneath, the card alongside */
@media (min-width: 861px) and (max-width: 1180px), (min-width: 861px) and (max-height: 820px) {
  .waitlist { --stage: clamp(190px, min(26vw, 36vh), 300px); }
  .waitlist__inner {
    grid-template-columns: minmax(0, 1fr) var(--stage) minmax(310px, 350px);
    grid-template-areas:
      "eye   stage card"
      "head  stage card"
      "lede  stage card"
      "count stage card"
      "perks perks card";
    grid-template-rows: auto auto auto 1fr auto;   /* spare height goes under the countdown, not between the lines */
    column-gap: clamp(24px, 3vw, 48px); row-gap: 0;
    align-items: start;
  }
  .waitlist__story { display: contents; }
  .waitlist__story > .eyebrow { grid-area: eye; }
  .waitlist__story > .display { grid-area: head; }
  .waitlist__story > .waitlist__lede { grid-area: lede; }
  .waitlist__count { grid-area: count; }
  .waitlist__perks { grid-area: perks; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; max-width: none; }
  .waitlist__perks li { grid-template-columns: 1fr; gap: 4px; }
  .waitlist__stage { grid-row: 1 / 5; align-self: center; }
  .waitlist__card { grid-row: 1 / -1; align-self: center; }
}
/* short screens: a slightly tighter card */
@media (min-width: 861px) and (max-height: 820px) {
  .waitlist__card { padding: 18px 22px; }
  .waitlist__card-title { font-size: 23px; margin-bottom: 12px; }
  .wl-variants { margin-bottom: 10px; }
  .wl-variants legend { margin-bottom: 8px; }
  .wl-variant > span { padding: 8px 4px 7px; }
  .wl-sw { margin-bottom: 5px; }
  .wl-field { margin-bottom: 8px; }
  .wl-field input, .wl-phone select { min-height: 38px; }
  .wl-phone select { background-position: calc(100% - 12px) 17px, calc(100% - 7px) 17px; }
  .wl-submit { min-height: 46px; }
  .wl-fine { margin-top: 8px; }
}
/* phones: one column — the watch, the story, then the card */
@media (max-width: 860px) {
  .waitlist { --stage: min(68vw, 320px); }
  .waitlist__inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "story" "card"; }
  .waitlist__stage { margin-bottom: 16px; }
  .waitlist__card { max-width: 520px; width: 100%; justify-self: center; }
}
@media (max-width: 420px) {
  .wl-variant > span { font-size: 12px; }
  .waitlist__clock { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .wl-done, .wl-done__mark path { animation: none; stroke-dashoffset: 0; }
  .waitlist__watch, .waitlist__floor, .waitlist__clock b.is-roll { animation: none; }
}
.waitlist .nowrap { white-space: nowrap; }
