/* Maithili AI · coming soon
   One palette: warm Mithila dawn + sindoor. */

:root {
  --paper: #EEE6DB;
  --sky-top: #E4E0D9;
  --sky-mid: #ECE4D9;
  --sky-low: #F3DFC9;
  --ground: #EEE5D9;

  --ink: #1C1613;
  --ink-2: rgba(28, 22, 19, 0.66);
  --ink-3: rgba(28, 22, 19, 0.42);
  --hair: rgba(28, 22, 19, 0.14);

  --sindoor: #B3381F;

  --serif: "Newsreader", "Iowan Old Style", "Georgia", serif;
  --deva: "Tiro Devanagari Hindi", "Noto Serif Devanagari", "Kohinoor Devanagari", serif;
  --tirh: "Noto Sans Tirhuta", var(--deva);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  /* temple cutout is 1636 × 555 */
  --temple-w: min(108vw, 136vh);
  --temple-bottom: clamp(52px, 7.5vh, 96px);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deva { font-family: var(--deva); }

/* ───────────────────────── Scene ───────────────────────── */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene > * { position: absolute; }

.sky {
  inset: 0;
  background:
    linear-gradient(180deg,
      var(--sky-top) 0%,
      var(--sky-mid) 34%,
      #F1E3D2 56%,
      var(--sky-low) 70%,
      var(--ground) 100%);
}

.sun {
  left: 50%;
  bottom: calc(var(--temple-bottom) + var(--temple-w) * 0.2);
  width: max(110vw, 900px);
  height: 80vh;
  transform: translate(-50%, 50%);
  background: radial-gradient(closest-side, rgba(246, 197, 150, 0.55), rgba(246, 197, 150, 0.18) 55%, rgba(246, 197, 150, 0) 100%);
  animation: breathe 11s var(--ease-io) infinite alternate;
  opacity: 0;
}

.clouds {
  top: -2vh;
  left: -8vw;
  width: 116vw;
  height: 66vh;
  background: url("assets/clouds.webp") center / cover no-repeat;
  opacity: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
}

.temple {
  left: 50%;
  bottom: var(--temple-bottom);
  width: var(--temple-w);
  aspect-ratio: 1636 / 555;
  transform: translate3d(calc(-50% + var(--px, 0px)), var(--py, 0px), 0);
}

.temple img {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(6%) scale(1.04);
  will-change: transform, opacity;
  transform-origin: 50% 100%;
  user-select: none;
  -webkit-user-drag: none;
}

/* warm light passing across the façade, masked to the building */
.sheen {
  position: absolute;
  inset: 0;
  -webkit-mask: url("assets/temple.webp") center / 100% 100% no-repeat;
          mask: url("assets/temple.webp") center / 100% 100% no-repeat;
  background: linear-gradient(105deg,
    transparent 38%,
    rgba(255, 220, 178, 0.0) 42%,
    rgba(255, 220, 178, 0.55) 50%,
    rgba(255, 220, 178, 0.0) 58%,
    transparent 62%);
  background-size: 260% 100%;
  background-position: 130% 0;
  mix-blend-mode: soft-light;
}

.mist {
  left: -50vw;
  width: 200vw;
  height: 24vh;
  bottom: calc(var(--temple-bottom) - 12vh);
  opacity: 0;
  filter: blur(6px);
}
.mist--a {
  background:
    radial-gradient(38% 46% at 18% 60%, rgba(238, 229, 217, 0.95), rgba(238, 229, 217, 0) 70%),
    radial-gradient(30% 40% at 52% 70%, rgba(238, 229, 217, 0.85), rgba(238, 229, 217, 0) 70%),
    radial-gradient(34% 44% at 84% 58%, rgba(238, 229, 217, 0.9), rgba(238, 229, 217, 0) 70%);
  animation: drift-a 48s linear infinite alternate;
}
.mist--b {
  bottom: calc(var(--temple-bottom) - 6vh);
  height: 14vh;
  background:
    radial-gradient(26% 50% at 30% 50%, rgba(243, 223, 201, 0.7), rgba(243, 223, 201, 0) 70%),
    radial-gradient(24% 50% at 70% 50%, rgba(243, 223, 201, 0.6), rgba(243, 223, 201, 0) 70%);
  animation: drift-b 36s linear infinite alternate;
}

.ground {
  left: 0; right: 0; bottom: 0;
  height: calc(var(--temple-bottom) + 3vh);
  background: linear-gradient(180deg, rgba(238, 229, 217, 0) 0%, rgba(238, 229, 217, 0.9) 50%, var(--ground) 80%);
}

.grain {
  inset: -50%;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}

/* ───────────────────────── Interface ───────────────────────── */

.ui {
  position: relative;
  z-index: 1;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    calc(env(safe-area-inset-top, 0px) + clamp(16px, 3vh, 28px))
    clamp(18px, 3.4vw, 48px)
    calc(env(safe-area-inset-bottom, 0px) + clamp(14px, 2.6vh, 26px));
}

/* header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.mark {
  width: 26px;
  height: 26px;
  color: var(--sindoor);
  transition: transform 0.8s var(--ease-out);
}
.brand:hover .mark { transform: translateX(-3px) rotate(-6deg); }
.wordmark {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.wordmark span { color: var(--ink-3); }

.locale {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
}
.locale [lang="mai"] { font-family: var(--deva); font-size: 15px; transform: translateY(1px); }
.locale .tz { color: var(--ink-3); margin-left: -4px; }
#clock { color: var(--ink); font-variant-numeric: tabular-nums; }

.sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  display: inline-block;
  vertical-align: middle;
}

/* hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(20px, 7.5vh, 96px);
}

.eyebrow {
  margin: 0 0 clamp(14px, 2.6vh, 26px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
}
.eyebrow .deva { font-size: 15px; transform: translateY(1px); }
.eyebrow .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sindoor);
}
.eyebrow .rule {
  width: clamp(20px, 4vw, 48px);
  height: 1px;
  background: var(--hair);
}

.headline {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 72;
  font-size: clamp(40px, min(6.4vw, 9.6vh), 104px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.headline > [aria-hidden] { display: inline; }

.mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.04em 0.02em 0.14em;
  margin: -0.04em 0 -0.14em;
}
.mask--slot { overflow: visible; }

.headline .w {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
}
.mask--slot .w { transform: translateY(40%); filter: blur(10px); }

.slot {
  position: relative;
  display: inline-grid;
  vertical-align: baseline;
  transition: width 0.9s var(--ease-out);
  color: var(--sindoor);
  font-style: italic;
}
.word {
  grid-area: 1 / 1;
  justify-self: start;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0.35em);
  filter: blur(8px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.9s var(--ease-out),
    filter 0.7s var(--ease-out);
}
.word i {
  font-style: normal;
  color: var(--ink);
  margin-left: 0.02em;
}
.word.deva i, .word.tirh i { font-family: var(--deva); margin-left: 0.08em; }
.word.is-on { opacity: 1; transform: none; filter: none; transition-delay: 0.12s; }
.word.is-out { opacity: 0; transform: translateY(-0.3em); filter: blur(8px); transition-delay: 0s; }
.word.deva {
  font-family: var(--deva);
  font-style: normal;
  font-size: 0.86em;
  letter-spacing: 0;
  translate: 0 0.04em;
}
.word.tirh {
  font-family: var(--tirh);
  font-style: normal;
  font-size: 0.8em;
  letter-spacing: 0;
  translate: 0 0.02em;
}

.script-tag {
  margin: clamp(8px, 1.4vh, 14px) 0 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: var(--ink-3);
}
.script-tag__line {
  width: 18px; height: 1px;
  background: var(--sindoor);
  opacity: 0.6;
}
#scriptName { display: inline-block; transition: opacity 0.4s ease; }

.lede {
  margin: clamp(12px, 2.2vh, 22px) 0 0;
  max-width: 35rem;
  font-size: clamp(15px, min(1.2vw, 2vh), 17px);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: balance;
}

/* waitlist */
.waitlist {
  position: relative;
  margin-top: clamp(16px, 3.2vh, 32px);
  display: flex;
  align-items: center;
  width: min(100%, 420px);
  padding: 5px;
  border-radius: 999px;
  background: rgba(250, 246, 240, 0.62);
  border: 1px solid rgba(28, 22, 19, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 12px 32px -18px rgba(70, 40, 20, 0.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
          backdrop-filter: blur(14px) saturate(1.2);
  transition: border-color 0.3s ease, box-shadow 0.4s ease;
}
.waitlist:focus-within {
  border-color: rgba(179, 56, 31, 0.45);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 0 0 4px rgba(179, 56, 31, 0.08),
    0 16px 36px -18px rgba(70, 40, 20, 0.4);
}

.waitlist input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px 0 16px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
}
.waitlist input::placeholder { color: var(--ink-3); }

.waitlist button {
  flex: none;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #F6F0E8;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s var(--ease-out);
}
.waitlist button svg { width: 14px; height: 14px; transition: transform 0.4s var(--ease-out); }
.waitlist button:hover { background: #2B211C; }
.waitlist button:hover svg { transform: translateX(3px); }
.waitlist button:active { transform: scale(0.97); }
.waitlist button:focus-visible { outline: 2px solid var(--sindoor); outline-offset: 2px; }
.waitlist button[disabled] { cursor: default; }

.form-note {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 10px);
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
  transition: color 0.3s ease;
}
.waitlist.is-error .form-note { color: var(--sindoor); }
.waitlist.is-error { animation: nudge 0.42s var(--ease-io); }

.waitlist.is-done input { pointer-events: none; color: var(--ink-2); }
.waitlist.is-done button { background: var(--sindoor); }

/* footer */
.bottom {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.quote { margin: 0; }
.quote blockquote {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
}
.quote figcaption {
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ink-3);
}
.quote figcaption .mono { font-size: 10px; }
.quote__en {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-2);
}

.legal {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: var(--ink-3);
}

/* ───────────────────────── Motion ───────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(4px);
}

.is-ready .reveal {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    opacity 1.1s var(--ease-out) var(--d, 0ms),
    transform 1.3s var(--ease-out) var(--d, 0ms),
    filter 1.1s var(--ease-out) var(--d, 0ms);
}

.is-ready .headline .w {
  opacity: 1;
  transform: none;
  filter: none;
  transition:
    transform 1.3s var(--ease-out) var(--d, 0ms),
    opacity 0.9s var(--ease-out) var(--d, 0ms),
    filter 1.1s var(--ease-out) var(--d, 0ms);
}

.is-ready .temple img {
  opacity: 1;
  transform: none;
  transition:
    opacity 1.8s var(--ease-out) 0.1s,
    transform 2.8s var(--ease-out) 0.1s;
}
.is-ready .sun { opacity: 1; transition: opacity 3s ease 0.2s; }
.is-ready .clouds { opacity: 0.85; transition: opacity 3.5s ease 0.4s; }
.is-ready .mist { opacity: 0.85; transition: opacity 3s ease 0.8s; }
.is-ready .sheen { animation: sheen 16s var(--ease-io) 2.4s infinite; }

/* slow cloud drift lives on an inner transform-free property so parallax can own transform */
.is-ready .clouds { animation: clouds 90s ease-in-out infinite alternate; }

@keyframes clouds {
  from { background-position: 46% 50%; }
  to   { background-position: 56% 46%; }
}
@keyframes breathe {
  from { opacity: 0.85; scale: 1; }
  to   { opacity: 1;    scale: 1.06; }
}
@keyframes drift-a {
  from { translate: -6vw 0; }
  to   { translate: 6vw 0; }
}
@keyframes drift-b {
  from { translate: 8vw 0; }
  to   { translate: -8vw 0; }
}
@keyframes sheen {
  0%   { background-position: 130% 0; }
  24%  { background-position: -30% 0; }
  100% { background-position: -30% 0; }
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}
@keyframes nudge {
  20% { translate: -5px 0; }
  45% { translate: 4px 0; }
  70% { translate: -2px 0; }
}

/* ───────────────────────── Responsive ───────────────────────── */

@media (max-width: 860px) {
  .quote__en { display: none; }
}

@media (orientation: portrait) {
  :root {
    --temple-w: min(180vw, 118vh);
    --temple-bottom: clamp(84px, 11vh, 120px);
  }
}

@media (max-width: 640px) {
  .locale [lang="mai"], .locale .sep { display: none; }
  .hero { padding-top: clamp(28px, 7vh, 64px); }
  .headline { font-size: clamp(38px, 11.5vw, 56px); line-height: 1.04; }
  .eyebrow .rule { display: none; }
  .lede { font-size: 15px; max-width: 22rem; }
  .waitlist button { padding: 0 14px; }
  .waitlist .btn-label { font-size: 13.5px; }
  .bottom { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .quote figcaption { justify-content: center; }
  .quote blockquote { font-size: 16px; }
}

@media (max-width: 380px) {
  .waitlist .btn-label { display: none; }
  .waitlist button { width: 40px; padding: 0; justify-content: center; }
}

@media (max-height: 640px) and (min-width: 641px) {
  .lede { display: none; }
  .script-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
