/*
 * Arihant Multicars: launching soon page.
 * Palette and type mirror config/brand.json and packages/ui/src/tokens.css.
 * Only transform and opacity animate. Reduced motion turns every animation off.
 */

@font-face {
  font-family: 'Archivo Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/archivo-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --hour: #13213f;
  --dusk: #263b6a;
  --mist: #aebad6;
  --amber: #f6b65a;
  --pearl: #f2f5fb;
  --brand-red: #870e0e;
  /* Velvet shades built around brand red. */
  --velvet-deep: #3f0505;
  --velvet-shadow: #5c0909;
  --velvet: #870e0e;
  --velvet-light: #b12a22;
  --font: 'Archivo Variable', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pad: 1rem;
  --valance-h: clamp(3.75rem, 9vh, 5.5rem);
}
@media (min-width: 768px) {
  :root {
    --pad: 2.5rem;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--hour);
  color: #fff;
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--hour);
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* ---- Stage --------------------------------------------------------------- */

.stage {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.stage__photo,
.stage__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage__photo {
  z-index: -3;
}
.stage__photo img {
  object-fit: cover;
  /* Keep the dome centred in the gap between the curtains. */
  object-position: 50% 42%;
}

/* Navy scrim under the copy: white text always sits on at least 65% navy. */
.stage::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 62%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgb(13 25 50 / 0.94) 0%,
    rgb(13 25 50 / 0.86) 38%,
    rgb(13 25 50 / 0.55) 62%,
    rgb(13 25 50 / 0) 100%
  );
}

/* ---- Curtains -------------------------------------------------------------- */

.curtains {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.curtain {
  /* Closed until launch: the panels overlap at the centre so no photo shows. */
  position: absolute;
  top: 0;
  bottom: 0;
  width: 51%;
  /* Opening gathers each panel towards its side, compressing the folds like real cloth. */
  transition: transform 2.6s cubic-bezier(0.55, 0, 0.25, 1);
  will-change: transform;
}
.curtain--left {
  left: 0;
  transform-origin: left center;
}
.curtain--right {
  right: 0;
  transform-origin: right center;
}

.curtain__fabric {
  position: absolute;
  /* Extra cloth on every free side so the sway never shows the photo at the edges or hem. */
  inset: 0 -4% -2%;
  transform-origin: 50% 0;
  /* Clip the sheen layer to the cloth. */
  overflow: hidden;
  background:
    /* Gold hem. */
    linear-gradient(to top, #7a4a12 0, var(--amber) 0.35rem, #c98a35 0.6rem, rgb(0 0 0 / 0.5) 0.65rem, transparent 1.6rem),
    /* Light from above, shadow pooling at the floor. */
    linear-gradient(
      to bottom,
      rgb(0 0 0 / 0.55) 0,
      rgb(0 0 0 / 0.15) 14%,
      transparent 30%,
      transparent 70%,
      rgb(0 0 0 / 0.35) 100%
    ),
    /* Velvet folds: deep valley, rising face, highlight ridge, falling face. */
    repeating-linear-gradient(
      90deg,
      var(--velvet-deep) 0,
      var(--velvet-shadow) 1.6%,
      var(--velvet) 4%,
      var(--velvet-light) 6.2%,
      #c5372c 6.8%,
      var(--velvet) 8.6%,
      var(--velvet-shadow) 10.6%,
      var(--velvet-deep) 12%
    );
  animation: sway-left 6.5s ease-in-out infinite;
}
.curtain--right .curtain__fabric {
  animation-name: sway-right;
  animation-duration: 7.3s;
  animation-delay: -2.4s;
}

/* Light rolling across the folds, so the velvet reads as cloth moving in a draught. */
.curtain__fabric::after {
  content: '';
  position: absolute;
  inset: 0 -40%;
  background: linear-gradient(
    90deg,
    transparent 0,
    rgb(255 190 170 / 0.1) 18%,
    transparent 34%,
    transparent 60%,
    rgb(255 190 170 / 0.07) 74%,
    transparent 88%
  );
  animation: sheen 9s ease-in-out infinite alternate;
}
.curtain--right .curtain__fabric::after {
  animation-duration: 11s;
  animation-direction: alternate-reverse;
}

/* Depth on the leading edge, where the panels meet the photo. */
.curtain::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  pointer-events: none;
}
.curtain--left::after {
  right: 0;
  background: linear-gradient(to left, rgb(0 0 0 / 0.45), transparent);
}
.curtain--right::after {
  left: 0;
  background: linear-gradient(to right, rgb(0 0 0 / 0.45), transparent);
}

@keyframes sway-left {
  0%,
  100% {
    transform: skewX(0deg);
  }
  35% {
    transform: skewX(1.1deg);
  }
  70% {
    transform: skewX(-0.6deg);
  }
}
@keyframes sway-right {
  0%,
  100% {
    transform: skewX(0deg);
  }
  35% {
    transform: skewX(-1.1deg);
  }
  70% {
    transform: skewX(0.6deg);
  }
}

@keyframes sheen {
  from {
    transform: translateX(-12%);
  }
  to {
    transform: translateX(12%);
  }
}

/* Pelmet across the top: swags of velvet over a gold rail. */
.valance {
  position: absolute;
  inset: 0 0 auto;
  height: var(--valance-h);
  background:
    linear-gradient(to bottom, transparent calc(100% - 0.3rem), var(--amber) calc(100% - 0.3rem), #a9661a 100%),
    radial-gradient(ellipse 52% 120% at 50% -20%, var(--velvet-light) 0, var(--velvet) 55%, var(--velvet-shadow) 80%, var(--velvet-deep) 100%)
      0 0 / 9rem 100% repeat-x;
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.45);
}

/* ---- Cord, reveal and fireworks ----------------------------------------------
 * launch.js draws the gold cord and bow in .cord, sized to the screen, and runs the
 * pull. .is-opening gathers the curtains; .is-launched is the resting, opened state.
 */

.cord {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Same layer as the curtains but later in the DOM, so it sits in front of them. */
  z-index: -2;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 3px 2px rgb(0 0 0 / 0.55));
}
.cord path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cord .strand__shade {
  stroke: #5a3209;
}
.cord .strand__body {
  stroke: #d9a441;
}
.cord .strand__shine {
  stroke: #fff1c1;
  opacity: 0.8;
}
.cord__knot {
  fill: #e2b04e;
  stroke: #6b3f0c;
  stroke-width: 1.5;
}

.is-opening .curtain--left,
.is-launched .curtain--left {
  transform: scaleX(0.11);
}
.is-opening .curtain--right,
.is-launched .curtain--right {
  transform: scaleX(0.11);
}
.is-pulling .panel__soon {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.is-launched .cord {
  display: none;
}

.fireworks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* Copy and header above the fireworks. */
.masthead,
.panel,
.foot {
  position: relative;
  z-index: 1;
}

.panel__open:not([hidden]) {
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
}

/* ---- Masthead -------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--valance-h);
  padding: 0.5rem var(--pad) 0.8rem;
}
.masthead__logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 0.35);
}
.masthead__name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}
.masthead__since {
  padding-left: 0.75rem;
  border-left: 1px solid rgb(246 182 90 / 0.6);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--amber);
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}
@media (min-width: 768px) {
  .masthead__logo {
    width: 2.75rem;
    height: 2.75rem;
  }
  .masthead__name {
    font-size: 1.25rem;
  }
}

/* ---- Copy panel -------------------------------------------------------------- */

.panel {
  grid-row: 3;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 var(--pad);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--pearl);
}
.eyebrow__bar {
  display: inline-block;
  width: 24px;
  height: 2px;
  border-radius: 1px;
  background: var(--amber);
}

.headline {
  margin: 0;
  font-size: clamp(2.125rem, 1.35rem + 3.4vw, 4.25rem);
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.35);
}

.lede {
  margin: 1rem auto 0;
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--pearl);
  text-wrap: pretty;
}
.lede time {
  color: #fff;
  font-weight: 650;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .lede {
    font-size: 1.1875rem;
  }
}

.noscript {
  margin: 1.5rem 0 0;
  font-size: 1.125rem;
  font-weight: 650;
}

/* ---- Countdown -------------------------------------------------------------- */

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  max-width: 30rem;
  margin: 1.5rem auto 0;
}
.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.25rem 0.625rem;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 12px;
  background: rgb(19 33 63 / 0.72);
}
.countdown__num {
  display: block;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.countdown__num.is-ticking {
  animation: tick 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.countdown__label {
  font-size: 0.8125rem;
  color: var(--mist);
}
@media (min-width: 768px) {
  .countdown {
    gap: 0.75rem;
    margin-top: 2rem;
  }
  .countdown__unit {
    padding: 1rem 0.5rem 0.875rem;
  }
  .countdown__label {
    font-size: 0.875rem;
  }
}

@keyframes tick {
  from {
    opacity: 0.25;
    transform: translateY(-0.18em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Short landscape phones: tighten so the copy fits without much scrolling. */
@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --valance-h: 3.25rem;
  }
  .masthead__logo {
    width: 2rem;
    height: 2rem;
  }
  .eyebrow {
    display: none;
  }
  .headline {
    font-size: 2rem;
  }
  .lede {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
  }
  .countdown {
    margin-top: 0.75rem;
  }
  .countdown__unit {
    padding: 0.5rem 0.25rem;
  }
  .countdown__num {
    font-size: 1.5rem;
  }
  .foot {
    padding-top: 0.5rem;
  }
}

/* ---- Footer -------------------------------------------------------------- */

.foot {
  grid-row: 4;
  padding: 1.25rem var(--pad) calc(1rem + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.8125rem;
  color: var(--mist);
}
.foot p {
  margin: 0;
}

/* ---- Launched -------------------------------------------------------------- */

/* Once launched the photo sits under the copy, so the scrim can be shorter. */
.is-launched .stage::after {
  height: 50%;
}

/* ---- 404 -------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  margin-top: 1.5rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: var(--amber);
  color: var(--hour);
  font-weight: 650;
  text-decoration: none;
}
.button:hover {
  background: #f8c47a;
}
.button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* ---- Reduced motion -------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .curtain,
  .curtain__fabric,
  .curtain__fabric::after,
  .panel__open:not([hidden]),
  .countdown__num.is-ticking {
    animation: none;
    transition: none;
  }
}

/* 404: no photo or curtains, just the dusk gradient. */
.stage--plain {
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, #0d1932 0%, #182a53 35%, #2f4479 70%, #435489 100%);
}
.stage--plain::after {
  content: none;
}
.stage--plain .panel {
  grid-row: 2;
  align-self: center;
}
.stage--plain .foot {
  grid-row: 3;
}
