/* ==========================================================================
   envision3d studios — teaser
   One splash screen: the mark, the wordmark, one status line, one address.
   Palette and lettering come from the supplied logo master (Montserrat
   variable at weight 650; the "3d" gradient #02e5ff → #00beff → #0081ed).
   The reveal is pure CSS, so the page resolves even if JS never runs.
   ========================================================================== */

/* ── brand tokens ─────────────────────────────────────────────────────── */
:root {
  --void:        #04060c;
  --void-deep:   #010206;

  /* blue family, sampled from the logo */
  --cy-100:      #9dffff;
  --cy-300:      #44eaff;
  --cy-500:      #02e5ff;
  --bl-500:      #00beff;
  --bl-600:      #009eff;
  --bl-700:      #0081ed;

  --paper:       #f1f5fb;
  --paper-dim:   #c3d2e4;
  --muted:       #7c8fa8;
  --faint:       #667c93;   /* 4.6:1 on the ink - small print stays legible */

  --brand-grad:  linear-gradient(178deg, #02e5ff 0%, #00beff 46%, #0081ed 100%);

  --ease-out:    cubic-bezier(.16, .84, .30, 1);
  --ease-soft:   cubic-bezier(.40, 0, .20, 1);

  --gut:         clamp(1.1rem, 4vw, 3.25rem);
  --font:        "Montserrat Var", "Montserrat", "Segoe UI", system-ui,
                 -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* the face that carries the logo lettering (SIL OFL — see assets/fonts) */
@font-face {
  font-family: "Montserrat Var";
  src: url("../fonts/montserrat-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow-x: clip; }  /* the mark halo bleeds past the viewport by design */

body {
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  background: var(--void);
  color: var(--paper);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

::selection { background: rgba(0, 190, 255, .28); color: #fff; }

/* ==========================================================================
   the reveal — one shared set of keyframes, staggered by animation-delay
   ========================================================================== */
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: var(--to, 1); }
}

@keyframes fade-up {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: var(--to, 1); translate: 0 0; }
}

@keyframes rise {                                  /* one glyph at a time */
  from { opacity: 0; translate: 0 .45em; filter: blur(10px); }
  to   { opacity: 1; translate: 0 0;     filter: none; }
}

@keyframes mark-in {                               /* the eye comes into focus */
  from { opacity: 0; scale: .96; filter: blur(14px) brightness(1.5); }
  to   { opacity: 1; scale: 1;
         filter: blur(0) brightness(1) drop-shadow(0 0 34px rgba(0, 140, 255, .32)); }
}

/* every animated layer arrives and then stays put */
.masthead__mark, .masthead__name, .bg__field,
.logo__eye, .logo__horizon, .logo__flash,
.wordmark__core, .wordmark .ltr, .wordmark__studios, .wordmark__mirror,
.status, .contact, .baseline {
  animation-duration: 1.2s;
  animation-timing-function: var(--ease-out);
  animation-fill-mode: both;
}

/* ==========================================================================
   background stack
   ========================================================================== */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }

.bg__base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(118% 78% at 50% 6%,  #0a1526 0%, rgba(10, 21, 38, 0) 60%),
    radial-gradient(90% 70% at 50% 106%, #02091a 0%, rgba(2, 9, 26, 0) 60%),
    linear-gradient(180deg, #05080f 0%, var(--void) 48%, var(--void-deep) 100%);
}

/* cold haze that breathes behind the mark */
.bg__haze {
  position: absolute;
  left: 50%;
  top: 40%;
  width: min(150vw, 1400px);
  aspect-ratio: 1.7 / 1;
  translate: -50% -50%;
  /* a plain centred glow: .bg__core punches the black pocket out of it, which
     keeps the falloff smooth instead of reading as a ring */
  background: radial-gradient(closest-side,
              rgba(0, 131, 237, .15), rgba(2, 229, 255, .05) 46%, rgba(2, 229, 255, 0) 76%);
  filter: blur(6px);
  animation: haze 15s var(--ease-soft) infinite alternate;
}
@keyframes haze {
  from { opacity: .34; scale: .92; }
  to   { opacity: .68; scale: 1.05; }
}

/* The pocket: true black immediately behind the eye. Sized from the same
   formula as the mark so it tracks the artwork at every viewport, and painted
   under the canvas so the sparks crossing the eye stay lit. */
.bg__core {
  position: absolute;
  left: var(--core-x, 50%);
  top: var(--core-y, 40%);
  width: calc(min(86svw, 63.69svh, 620px) * 1.95);
  aspect-ratio: 1.95 / 1;
  translate: -50% -50%;
  background: radial-gradient(closest-side,
              rgba(1, 2, 6, 1) 0%, rgba(1, 2, 6, .98) 30%, rgba(1, 2, 6, .86) 48%,
              rgba(1, 2, 6, .42) 70%, rgba(1, 2, 6, 0) 92%);
  filter: blur(10px);
}

.bg__field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation-name: fade;
  animation-duration: 2s;
  animation-timing-function: var(--ease-soft);
  animation-delay: .25s;
}

.bg__vignette {
  position: absolute;
  inset: -1px;
  background: radial-gradient(124% 92% at 50% 42%, rgba(0, 0, 0, 0) 46%, rgba(0, 0, 0, .66) 100%);
}

.bg__grain {
  position: absolute;
  inset: -60px;
  opacity: .045;
  mix-blend-mode: overlay;
  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='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ==========================================================================
   masthead
   ========================================================================== */
.masthead {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: max(calc(var(--gut) * .8), env(safe-area-inset-top)) var(--gut) 0;
}

.masthead__mark {
  height: 24px;
  width: 24px;
  filter: drop-shadow(0 0 10px rgba(0, 158, 255, .5));
  animation-name: fade;
  animation-delay: .35s;
}

.masthead__name {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  animation-name: fade;
  animation-duration: 1.4s;
  animation-timing-function: var(--ease-soft);
  animation-delay: .55s;
}

/* ==========================================================================
   splash
   ========================================================================== */
.stage {
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 1.5rem var(--gut);
  text-align: center;
}

/* ── the mark ─────────────────────────────────────────────────────────── */
.logo {
  position: relative;
  display: grid;
  place-items: center;
  --px: 0; --py: 0;              /* parallax handles, written by main.js */
}

.logo__bloom {
  position: absolute;
  width: 150%;
  height: 230%;
  background: radial-gradient(closest-side,
              rgba(0, 158, 255, 0) 0%, rgba(0, 158, 255, .04) 26%,
              rgba(0, 158, 255, .11) 54%, rgba(0, 100, 220, .04) 72%, rgba(0, 20, 60, 0) 86%);
  /* hollow the halo so it rings the eye instead of flooding it */
  -webkit-mask-image: radial-gradient(closest-side, #0000 0%, #0000 24%, #000 56%, #0000 90%);
          mask-image: radial-gradient(closest-side, #0000 0%, #0000 24%, #000 56%, #0000 90%);
  filter: blur(16px);
  animation: bloom 9s var(--ease-soft) infinite alternate;
}
@keyframes bloom {
  from { opacity: .26; scale: .88; }
  to   { opacity: .52; scale: 1.06; }
}

.logo__flash {
  position: absolute;
  width: 118%;
  height: 180%;
  background: radial-gradient(closest-side,
              rgba(157, 255, 255, .5), rgba(2, 229, 255, .16) 36%, rgba(2, 229, 255, 0) 66%);
  filter: blur(22px);
  animation: flash 1.6s var(--ease-out) .45s 1 both;
}
@keyframes flash {
  0%   { opacity: 0;  scale: .55; }
  22%  { opacity: .8; scale: 1;   }
  100% { opacity: 0;  scale: 1.5; }
}

.logo__eye {
  position: relative;
  display: block;
  width: min(calc(100vw - 2 * var(--gut)), calc(2.123 * clamp(132px, 30svh, 330px)));
  height: auto;   /* dissolve the art box so the mark melts into the dark */
  -webkit-mask-image: radial-gradient(ellipse 74% 70% at 50% 50%, #000 48%, rgba(0, 0, 0, 0) 100%);
          mask-image: radial-gradient(ellipse 74% 70% at 50% 50%, #000 48%, rgba(0, 0, 0, 0) 100%);
  transform: translate3d(calc(var(--px) * -12px), calc(var(--py) * -9px), 0);
  animation-name: mark-in;
  animation-duration: 1.9s;
  animation-delay: .1s;
}

/* the cold line the mark rests on */
.logo__horizon {
  position: absolute;
  bottom: -14%;
  width: 128%;
  height: 1px;
  background: linear-gradient(90deg,
              rgba(2, 229, 255, 0) 0%, rgba(2, 229, 255, .22) 24%,
              rgba(157, 255, 255, .7) 50%, rgba(2, 229, 255, .22) 76%,
              rgba(2, 229, 255, 0) 100%);
  box-shadow: 0 0 20px 2px rgba(0, 158, 255, .3);
  --to: .5;
  animation-name: fade;
  animation-duration: 1.8s;
  animation-timing-function: var(--ease-soft);
  animation-delay: 1.1s;
}

/* ── wordmark ─────────────────────────────────────────────────────────── */
.wordmark {
  position: relative;
  margin: clamp(2.2rem, 6.4svh, 4.2rem) 0 0;
  font-weight: 650;
  font-size: clamp(2rem, 6.4vw, 4.1rem);
  line-height: 1;
  letter-spacing: -.03em;
  display: grid;
  justify-items: center;
}

.wordmark__core { display: inline-block; }

/* whole word if the script never splits it into glyphs */
.wordmark__core:not(:has(.ltr)) {
  animation-name: fade-up;
  animation-duration: 1.3s;
  animation-delay: .7s;
}

.wordmark .ltr {
  display: inline-block;
  animation-name: rise;
  animation-duration: .95s;
  animation-delay: calc(.7s + var(--i) * 46ms);
}

/* "3d" carries the logo's blue gradient. With the script running each glyph
   is isolated by its own filter, so the gradient is painted glyph by glyph;
   without the script it is painted on the whole accent run. */
.wordmark__accent:not(:has(.ltr)),
.wordmark__accent .ltr,
.wordmark__mirror em, .contact__mark {
  background: var(--brand-grad);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.wordmark__studios {
  margin-top: clamp(.55rem, 1.6svh, 1rem);
  font-size: clamp(.625rem, .5vw + .4rem, .8125rem);
  font-weight: 550;
  letter-spacing: .5em;
  text-indent: .5em;
  text-transform: uppercase;
  color: var(--paper-dim);
  --to: .8;
  animation-name: fade-up;
  animation-delay: 1.5s;
}

/* faint floor reflection, as on the animation poster */
.wordmark__mirror {
  position: absolute;
  top: 100%;
  left: 50%;
  translate: -50% .1em;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: .62;
  white-space: nowrap;
  color: var(--bl-600);
  scale: 1 -1;
  filter: blur(4px);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 72%);
          mask-image: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 72%);
  --to: .08;
  animation-name: fade;
  animation-duration: 1.8s;
  animation-timing-function: var(--ease-soft);
  animation-delay: 1.7s;
  pointer-events: none;
}

/* ── status ───────────────────────────────────────────────────────────── */
.status {
  margin: clamp(2.1rem, 6.6svh, 3.6rem) 0 0;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .44em;
  text-indent: .44em;
  text-transform: uppercase;
  color: var(--muted);
  animation-name: fade-up;
  animation-delay: 1.95s;
}

/* ── the one call to action: general inquiries ────────────────────────── */
.contact {
  margin: clamp(1.4rem, 4svh, 2.4rem) 0 0;
  display: grid;
  justify-items: center;
  gap: .3rem;
  font-style: normal;
  animation-name: fade-up;
  animation-delay: 2.15s;
}

.contact__label {
  font-size: .5625rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  color: var(--faint);
}

.contact__mail {
  position: relative;
  display: inline-block;
  font-size: clamp(.9rem, .5vw + .74rem, 1.12rem);
  font-weight: 600;
  letter-spacing: .022em;
  color: var(--paper);
  text-decoration: none;
  padding: .2em .08em .9em;
  transition: color .4s var(--ease-soft), text-shadow .5s var(--ease-soft);
}
.contact__mail::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .12em;
  height: 1px;
  background: linear-gradient(90deg, var(--cy-500), var(--bl-700));
  box-shadow: 0 0 12px rgba(0, 190, 255, .55);
  scale: .3 1;
  opacity: .4;
  transform-origin: 50% 50%;
  transition: scale .55s var(--ease-out), opacity .45s var(--ease-soft);
}
.contact__mail:hover,
.contact__mail:focus-visible { color: #fff; text-shadow: 0 0 26px rgba(0, 158, 255, .5); }
.contact__mail:hover::after,
.contact__mail:focus-visible::after { scale: 1 1; opacity: 1; }

.contact__copy {
  font: inherit;
  font-size: .5625rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint);
  background: transparent;
  border: 1px solid rgba(124, 143, 168, .22);
  border-radius: 999px;
  padding: .36em .95em .32em;
  cursor: pointer;
  transition: color .35s, border-color .35s, background .35s;
}
.contact__copy:hover,
.contact__copy:focus-visible {
  color: var(--paper-dim);
  border-color: rgba(0, 190, 255, .45);
  background: rgba(0, 129, 237, .10);
}
.contact__copy.is-done { color: var(--cy-300); border-color: rgba(2, 229, 255, .5); }

:where(a, button):focus-visible {
  outline: 1px solid rgba(2, 229, 255, .8);
  outline-offset: .45em;
  border-radius: 2px;
}

/* ==========================================================================
   baseline
   ========================================================================== */
.baseline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: calc(var(--gut) * .7) var(--gut) max(calc(var(--gut) * .7), env(safe-area-inset-bottom));
  font-size: .625rem;
  font-weight: 550;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
  animation-name: fade;
  animation-duration: 1.3s;
  animation-timing-function: var(--ease-soft);
  animation-delay: 2.4s;
}

/* ==========================================================================
   small and short viewports
   ========================================================================== */
@media (max-width: 600px) {
  .masthead { gap: .55rem; }
  .masthead__mark { height: 20px; width: 20px; }
  .masthead__name { font-size: .5625rem; letter-spacing: .24em; }
  .wordmark { letter-spacing: -.022em; font-size: clamp(1.85rem, 11vw, 2.9rem); }
  .logo__eye { width: min(calc(100vw - 2 * var(--gut)), calc(2.123 * clamp(104px, 24svh, 230px))); }
  .logo__horizon { width: 100%; --to: .38; }
  .wordmark__mirror { display: none; }
  .baseline { letter-spacing: .16em; }
}

@media (max-height: 760px) {
  .wordmark__mirror { display: none; }
  .status { margin-top: clamp(1.4rem, 5svh, 2.4rem); }
  .contact { margin-top: clamp(1rem, 3svh, 1.6rem); }
}

@media (max-height: 620px) {
  .logo__eye { width: min(calc(100vw - 2 * var(--gut)), calc(2.123 * clamp(92px, 22svh, 170px))); }
}

/* ==========================================================================
   reduced motion — the page arrives already settled
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .masthead__mark, .masthead__name, .bg__field, .logo__eye, .logo__horizon,
  .wordmark__core, .wordmark .ltr, .wordmark__studios, .wordmark__mirror,
  .status, .contact, .baseline {
    animation: none;
    opacity: var(--to, 1);
  }
  .wordmark .ltr, .wordmark__core { filter: none; translate: 0 0; }
  .logo__eye { filter: blur(0) drop-shadow(0 0 30px rgba(0, 140, 255, .3)); }
  .logo__flash { animation: none; opacity: 0; }
  .logo__horizon, .wordmark__mirror { opacity: var(--to); }
  .bg__haze { animation: none; opacity: .52; } .logo__bloom { animation: none; opacity: .39; }
  .contact__mail, .contact__mail::after { transition: none; }
  .contact__mail::after { scale: 1 1; }
}
