/* ---------- RSW coming soon, India: what differs from ../styles.css ---------- */
:root {
  --mincho: "Noto Serif Devanagari", serif; /* the labels' script word */
}

/* Hindi, sized like the Gujarati in styles.css was */
[lang="hi"] {
  font-family: "Noto Serif Devanagari", var(--serif);
}

.soon [lang="hi"] {
  font-size: 1.25em;
  line-height: 0; /* its taller letters don't push the line down */
  letter-spacing: 0.08em;
  text-transform: none;
}

.place [lang="hi"] {
  font-size: 1.15em;
  letter-spacing: 0.06em;
}

.label .k {
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- The RSW logo, the Core Block Monogram ---------- */
/* Its shapes never touch, so no stroke: it draws exactly as designed */
svg use {
  stroke-width: 0;
}

.gate-mark {
  height: clamp(10rem, 30vh, 28rem); /* the first thing anyone sees: big on a big screen too */
  width: auto;
  aspect-ratio: 480.43 / 629.73;
  margin-right: 0;
  fill: var(--red);
  stroke: var(--red);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  font-size: 1.3em; /* the name: bigger and brighter than the rest of the small print */
  color: var(--cream);
}

.bug {
  height: 3.2em;
  width: auto;
  aspect-ratio: 480.43 / 629.73;
  fill: currentColor;
  stroke: currentColor;
}

/* A phone: the name a little smaller and tighter, so it and the sound button share the row */
@media (max-width: 30rem) {
  .brand {
    font-size: 1.1em;
    letter-spacing: 0.1em;
  }
}

@media (max-width: 22.5rem) {
  .brand {
    display: none;
  }
}

/* The core: the dot at the monogram's heart lights in saffron on the drop (ink.js adds is-lit), then burns brighter on every beat (--b) */
.eye {
  position: absolute;
  top: var(--eye-y, 50%);
  left: var(--eye-x, 50%);
  width: var(--eye-w, 4rem);
  height: var(--eye-h, 3rem);
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff6d6, #ffc53a 42%, #ff7a00 82%, rgb(255 122 0 / 0));
  box-shadow: 0 0 calc(var(--eye-w, 4rem) * (0.22 + var(--b, 0) * 0.3)) calc(var(--eye-w, 4rem) * (0.04 + var(--b, 0) * 0.08)) rgb(255 165 30 / 0.55);
  filter: brightness(calc(1 + var(--b, 0) * 0.4));
  opacity: 0;
  scale: 0;
  pointer-events: none;
}

.is-lit .eye {
  opacity: 1;
  scale: 0.9;
  animation: eye 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

/* A ring of light thrown off as it opens, gone before it reaches the words */
.eye::after {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  border: 2px solid rgb(255 205 110 / 0.9);
  opacity: 0;
}

.is-lit .eye::after {
  animation: eye-ring 0.9s cubic-bezier(0.1, 0.7, 0.3, 1) 0.05s both;
}

.is-leaving .eye {
  opacity: 0 !important;
  transition: opacity 0.9s ease;
}

@keyframes eye {
  from {
    opacity: 0;
    scale: 0;
  }
}

@keyframes eye-ring {
  from {
    opacity: 1;
    scale: 0.6;
  }

  to {
    opacity: 0;
    scale: 3;
  }
}

/* ---------- Readable on every screen ---------- */
/* The words grow with the screen (a 2560px laptop got 10px small print) and the small print is brighter */
.line {
  font-size: clamp(1rem, 0.4rem + 2.4vmin, 2.75rem);
  font-weight: 600; /* Cormorant's 500 is hairline-thin at phone sizes */
}

.label {
  font-size: clamp(0.78rem, 0.4rem + 0.8vmin, 1.15rem);
  letter-spacing: 0.35em;
  color: rgb(246 236 220 / 0.82);
}

.soon {
  font-size: clamp(0.8rem, 0.45rem + 0.9vmin, 1.2rem);
  letter-spacing: 0.42em;
  color: #ff5a6a; /* the brand red, lighter: the dark red sank into the black at this size */
}

.ui {
  font-size: clamp(0.72rem, 0.45rem + 0.55vmin, 0.95rem);
  color: rgb(246 236 220 / 0.78);
}

.presents {
  font-size: clamp(0.95rem, 0.5rem + 1.3vmin, 1.6rem);
  letter-spacing: 0.42em;
  color: rgb(246 236 220 / 0.8);
}

.gate-cta {
  font-size: clamp(0.85rem, 0.5rem + 0.9vmin, 1.2rem);
  letter-spacing: 0.4em;
}

.gate-note {
  font-size: clamp(1rem, 0.7rem + 0.8vmin, 1.4rem);
  color: rgb(246 236 220 / 0.8);
}

/* styles.css tightens these on phones; the rules above come later, so say it again */
@media (max-width: 30rem) {
  .soon,
  .presents {
    letter-spacing: 0.3em;
  }
}

@media (max-width: 22.5rem) {
  .soon {
    letter-spacing: 0.2em;
  }
}

@media (max-height: 32.5rem) and (min-aspect-ratio: 1/1) {
  .line {
    font-size: 0.95rem;
  }
}

/* ---------- Quick: the card, then each shot's words, readable within a second ---------- */
.is-open .presents {
  animation-duration: 1.2s;
}

.is-written .label {
  animation-duration: 1s;
  animation-delay: 0.1s;
}

.is-written .line {
  animation-duration: 1.5s;
  animation-delay: 0.2s;
}

.is-written .soon {
  animation-duration: 1s;
  animation-delay: 0.7s;
}

/* ---------- The end: "soon" and the waiting list ---------- */
/* Over the scene (the petals and the red light go on behind it), under the small print; it scrolls if the screen is short */
.finale {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
  padding: max(5.25rem, calc(env(safe-area-inset-top) + 4.25rem)) var(--gutter) max(4.75rem, calc(env(safe-area-inset-bottom) + 3.75rem));
}

.finale[hidden],
.waitlist[hidden],
.waitlist-done[hidden] {
  display: none;
}

.finale-in {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(0.9rem, 2.4vmin, 1.6rem);
  width: min(100%, 38rem);
  margin: auto;
  text-align: center;
}

.finale-mark {
  height: clamp(4.25rem, 11vmin, 7.5rem);
  width: auto;
  aspect-ratio: 480.43 / 629.73;
  fill: var(--red);
  filter: drop-shadow(0 0 1.4rem rgb(208 26 44 / 0.5));
}

.finale-title {
  font: 600 clamp(0.95rem, 0.35rem + 2.2vmin, 2.1rem) / 1.35 var(--serif);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream);
}

.finale-title b {
  display: block;
  margin: 0.12em -0.14em 0 0; /* the last letter's spacing, so the word sits in the middle */
  font-size: clamp(4.25rem, 1rem + 15vmin, 11rem);
  line-height: 1;
  letter-spacing: 0.14em;
  text-shadow: 0 0 1.5rem rgb(255 90 106 / 0.25);
}

.finale-hindi {
  font-size: clamp(1.2rem, 0.7rem + 1.8vmin, 2rem);
  color: #ff5a6a;
}

.waitlist-head {
  font: 600 clamp(0.75rem, 0.45rem + 0.8vmin, 1.1rem) / 1.4 var(--sans);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: #ff5a6a;
}

/* The waiting list: name and email side by side where there's room */
.waitlist {
  display: grid;
  gap: 0.85rem;
  width: min(100%, 32rem);
  margin-top: clamp(0.6rem, 2.4vmin, 1.6rem);
  text-align: left;
}

.waitlist-head {
  text-align: center;
  color: var(--cream);
}

.waitlist-head [lang="hi"],
.waitlist-yes + [lang="hi"] {
  letter-spacing: 0.04em;
}

.field {
  display: grid;
  gap: 0.45rem;
  font: 600 0.72rem/1 var(--sans);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgb(246 236 220 / 0.75);
}

.field input {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid rgb(246 236 220 / 0.38);
  border-radius: 3px;
  background: rgb(7 6 6 / 0.62);
  color: var(--cream);
  font: 500 1rem/1.3 var(--sans); /* 16px, so a phone doesn't zoom in when it's tapped */
  letter-spacing: 0.02em;
  text-transform: none;
}

.field input:focus {
  outline: 2px solid #ff5a6a;
  outline-offset: 2px;
}

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

/* Off screen, for the bots that fill in every field */
.trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.waitlist button {
  min-height: 3.4rem;
  margin-top: 0.2rem;
  border: 0;
  border-radius: 3px;
  background: var(--red);
  color: var(--cream);
  font: 600 0.86rem/1 var(--sans);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0.6rem 2rem rgb(208 26 44 / 0.35);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.waitlist button:hover {
  background: #e4223a;
}

.waitlist button:active {
  transform: translateY(1px);
}

.waitlist button:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.waitlist button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.waitlist-msg {
  text-align: center;
  font: 600 0.88rem/1.4 var(--sans);
  color: #ff5a6a;
}

.waitlist-msg:empty {
  margin-top: -0.85rem; /* takes no room until there's something to say */
}

.waitlist-note {
  text-align: center;
  font: 500 0.8rem/1.5 var(--sans);
  color: rgb(246 236 220 / 0.62);
}

.waitlist-done {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  margin-top: clamp(0.6rem, 2.4vmin, 1.6rem);
}

.waitlist-done:focus {
  outline: none;
}

.waitlist-yes {
  font: 600 clamp(1.05rem, 0.5rem + 2.2vmin, 2rem) / 1.35 var(--serif);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
}

.waitlist-yes + [lang="hi"] {
  font-size: clamp(1.1rem, 0.7rem + 1.4vmin, 1.5rem);
  color: #ff5a6a;
}

@media (min-width: 40rem) {
  .waitlist {
    grid-template-columns: 1fr 1.35fr;
  }

  .waitlist > :not(.field) {
    grid-column: 1 / -1;
  }
}

/* A phone on its side: the words on the left, the form on the right */
@media (max-height: 32.5rem) and (min-aspect-ratio: 1/1) {
  .finale {
    padding-top: max(3.6rem, calc(env(safe-area-inset-top) + 2.8rem));
    padding-bottom: max(3.4rem, calc(env(safe-area-inset-bottom) + 2.6rem));
  }

  .finale-in:has(.waitlist:not([hidden])) {
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
    width: min(100%, 54rem);
  }

  .finale-in:has(.waitlist:not([hidden])) .finale-mark {
    display: none;
  }

  .finale-title,
  .finale-hindi {
    grid-column: 1;
  }

  .waitlist {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    margin: 0;
  }
}

/* A short phone: no logo above the form, everything a little closer */
@media (max-height: 40rem) and (max-aspect-ratio: 1/1) {
  .finale-in:has(.waitlist:not([hidden])) .finale-mark {
    display: none;
  }

  .finale-in,
  .waitlist {
    gap: 0.6rem;
  }

  .waitlist,
  .waitlist-done {
    margin-top: 0.3rem;
  }

  .field input {
    min-height: 2.75rem;
    padding-block: 0.55rem;
  }

  .waitlist button {
    min-height: 3rem;
  }
}

/* The smallest phones: tighter letters so each line stays one line; the corner name is hidden, so less room at the top */
@media (max-width: 22.5rem) {
  .finale {
    padding-top: max(3.4rem, calc(env(safe-area-inset-top) + 2.6rem));
    padding-bottom: max(3.2rem, calc(env(safe-area-inset-bottom) + 2.4rem));
  }

  .finale-title {
    letter-spacing: 0.16em;
  }

  .waitlist-head {
    letter-spacing: 0.18em;
  }
}

/* A big screen (a 2560px laptop): the whole end a size up */
@media (min-width: 110rem) and (min-height: 70rem) {
  .finale-in {
    width: min(100%, 46rem);
    zoom: 1.3;
  }
}

/* It lifts away like the shots do, when the teaser goes round again */
.finale-in {
  transition: opacity 1.2s ease, filter 1.2s ease, transform 1.3s var(--ease);
}

.is-leaving .finale-in {
  opacity: 0;
  filter: blur(14px);
  transform: scale(1.03) translateY(-1.2%);
}

/* It comes up one line after another */
.is-finale .finale-in > * {
  animation: rise 1.1s var(--ease) both;
}

.is-finale .finale-in > :nth-child(2) { animation-delay: 0.08s; }
.is-finale .finale-in > :nth-child(3) { animation-delay: 0.16s; }
.is-finale .finale-in > :nth-child(4) { animation-delay: 0.24s; }
.is-finale .finale-in > :nth-child(n + 5) { animation-delay: 0.34s; }
