/* ============================================================
   RAMIR — brand tokens (the only colors allowed on this site)
   ============================================================ */
:root {
  --nero:   #050505;
  --bianco: #FFFFFF;
  --pietra: #8A8A85;
  --ambra:  #FFB300;
  --font:   'Space Grotesk', system-ui, sans-serif;
  --ease:   cubic-bezier(.22, 1, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--nero);
  color: var(--bianco);
  font-family: var(--font);
  font-weight: 300;
  overflow: hidden; /* the site is an experience, not a page */
}

.amber { color: var(--ambra); }

/* ============================================================
   Liquid glass v3 (Apple-style physical glass)
   Layers: refracting body · thick gradient light rim (::before)
   · specular pooling + diagonal glare streak (::after).
   ============================================================ */
.glass, .glass-card, .chrome-btn {
  position: relative;
  isolation: isolate;
  border: none;
  /* A faint dark base keeps white text readable on bright frames,
     topped by a barely-there light gradient. */
  background:
    linear-gradient(150deg,
              rgba(255, 255, 255, .055) 0%,
              rgba(255, 255, 255, .015) 55%,
              rgba(255, 255, 255, .04) 100%),
    rgba(8, 8, 8, .28);
  -webkit-backdrop-filter: blur(24px) saturate(155%) brightness(1.02);
  backdrop-filter: blur(24px) saturate(155%) brightness(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    inset 0 -1px 1px rgba(0, 0, 0, .12),
    0 1px 1px rgba(0, 0, 0, .18),
    0 12px 36px rgba(0, 0, 0, .38);
}
.glass, .chrome-btn { border-radius: 14px; }
.glass-card { border-radius: 18px; }

/* Thick light rim: refraction running along the edge of the glass */
.glass::before, .glass-card::before, .chrome-btn::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg,
              rgba(255, 255, 255, .32) 0%,
              rgba(255, 255, 255, .08) 30%,
              rgba(255, 255, 255, .03) 55%,
              rgba(255, 255, 255, .06) 80%,
              rgba(255, 255, 255, .18) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

/* Specular pooling + a diagonal glare streak crossing the surface */
.glass::after, .glass-card::after, .chrome-btn::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 46% at 50% -18%, rgba(255, 255, 255, .07), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.glass > *, .glass-card > *, .chrome-btn > * { position: relative; z-index: 2; }

/* Fallback where backdrop-filter is unsupported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass-card, .chrome-btn { background: rgba(14, 14, 14, .88); }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible {
  outline: 1px solid var(--ambra);
  outline-offset: 3px;
}

/* ============================================================
   Preloader
   ============================================================ */
#preloader {
  position: fixed; inset: 0; z-index: 50;
  background: var(--nero);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 28px;
  transition: opacity .9s var(--ease);
}
#preloader.done { opacity: 0; pointer-events: none; }

.preloader-emblem {
  width: 54px; height: 54px;
  opacity: .9;
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1);    opacity: .55; }
  50%      { transform: scale(1.06); opacity: .95; }
}

#preloader-pct {
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--pietra);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Menu
   ============================================================ */
#menu {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transition: opacity .9s var(--ease);
}
#menu.visible { opacity: 1; }

/* --- the seed logo: a soft pulsing invitation to hover/click --- */
.menu-logo {
  position: relative;
  background: none; border: none; cursor: pointer;
  padding: 6px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.menu-logo img {
  width: 52px; height: 52px;
  display: block;
  transition: transform .5s var(--ease), filter .5s var(--ease);
  animation: seedBreath 3.4s ease-in-out infinite;
}
/* a gentle amber halo that breathes with the logo */
.logo-halo {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,179,0,.42) 0%, rgba(255,179,0,0) 68%);
  filter: blur(4px);
  pointer-events: none;
  animation: haloBreath 3.4s ease-in-out infinite;
}
@keyframes seedBreath {
  0%, 100% { transform: scale(1)    rotate(0deg); }
  50%      { transform: scale(1.07) rotate(4deg); }
}
@keyframes haloBreath {
  0%, 100% { opacity: .35; transform: translate(-50%,-50%) scale(1); }
  50%      { opacity: .8;  transform: translate(-50%,-50%) scale(1.5); }
}
.menu-logo:hover img,
#menu.open .menu-logo img {
  transform: rotate(90deg) scale(1.12);
  filter: drop-shadow(0 0 10px rgba(255,179,0,.6));
  animation-play-state: paused;
}
.menu-logo:hover .logo-halo,
#menu.open .logo-halo { animation-play-state: paused; opacity: .9; transform: translate(-50%,-50%) scale(1.7); }

/* --- the rays: links unfurl downward from under the seed --- */
.menu-rays {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  padding-top: 4px;
  pointer-events: none;
}
.menu-item {
  --i: 0;
  position: relative;
  background: none; border: none; cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
  padding: 9px 14px;
  /* collapsed: tucked up under the seed, invisible, slightly fanned */
  opacity: 0;
  transform: translateY(-14px) scale(.9);
  transform-origin: top center;
  transition:
    opacity .45s var(--ease),
    transform .55s cubic-bezier(.22,1.2,.36,1);
  transition-delay: calc(var(--i) * 60ms);
}
.menu-item span { position: relative; z-index: 1; transition: color .3s; }

/* reveal on hover (desktop) or when open (mobile/click) */
#menu:hover .menu-rays,
#menu.open  .menu-rays { pointer-events: auto; }
#menu:hover .menu-item,
#menu.open  .menu-item {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.menu-item:hover span { color: var(--ambra); }
.menu-item:hover {
  text-shadow: 0 1px 4px rgba(0,0,0,.55), 0 0 14px rgba(255,179,0,.35);
}

@media (prefers-reduced-motion: reduce) {
  .menu-logo img, .logo-halo { animation: none; }
}

/* --- Contact/signature view: remove the duplicate. The big emblem above
   RAMIR disappears and the menu's seed logo glides down + grows to replace it. --- */
body.sig-active .signature-emblem { opacity: 0; }

body.sig-active #menu .logo-halo { opacity: 0; }
body.sig-active #menu .menu-logo img {
  animation: none;
  transform: translate(var(--sigDX, 0), var(--sigDY, 0)) scale(var(--sigScale, 1));
  filter: drop-shadow(0 0 16px rgba(255, 179, 0, .3));
}
/* smooth, slightly-eased glide for the morph */
body.sig-active #menu .menu-logo img,
#menu .menu-logo img {
  transition: transform .9s cubic-bezier(.22,1,.36,1), filter .9s var(--ease);
}
/* keep the logo interactive as the home/emblem, but hide the rays in this view */
body.sig-active #menu .menu-rays { opacity: 0; pointer-events: none; }

/* ============================================================
   Stage: poster + film
   ============================================================ */
#stage { position: fixed; inset: 0; }

#poster, #film {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--nero);
}

#film   { opacity: 0; transition: opacity 1.2s var(--ease); }
#poster { opacity: 1; transition: opacity 1.2s var(--ease); }

#stage.playing #film   { opacity: 1; }
#stage.playing #poster { opacity: 0; }
/* When the film ends, its last frame stays behind the glass signature */
#stage.ended #film   { opacity: 1; }
#stage.ended #poster { opacity: 0; }

/* Readability scrim over the poster, tinted with the brand palette.
   A soft dark vignette deepens toward the edges with a faint amber warmth,
   so the centered "Scroll" text reads clearly. Fades out when the film starts. */
#hero-scrim {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 1;
  transition: opacity 1.2s var(--ease);
  background:
    radial-gradient(120% 90% at 50% 46%,
        rgba(5, 5, 5, .30) 0%,
        rgba(5, 5, 5, .52) 45%,
        rgba(5, 5, 5, .74) 100%),
    linear-gradient(180deg,
        rgba(5, 5, 5, .38) 0%,
        rgba(20, 12, 0, .28) 50%,
        rgba(5, 5, 5, .46) 100%);
}
/* radial darkening right behind the text for extra legibility */
#hero-scrim::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(38% 26% at 50% 50%, rgba(5, 5, 5, .40), transparent 70%);
}
#stage.playing #hero-scrim,
#stage.ended  #hero-scrim { opacity: 0; }

/* Scroll cue — centered on screen */
#cue {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  pointer-events: none;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
#cue.hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }

#cue p {
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--bianco);
  text-align: center;
  padding: 4px 0;
}

/* Cell division: one amber dot splits into five, then reunites */
.cue-cell {
  position: relative;
  width: 34px; height: 34px;
  display: block;
}
.cue-cell span {
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--ambra);
  box-shadow: 0 0 10px rgba(255, 179, 0, .35);
  animation: mitosis 3s cubic-bezier(.45, 0, .25, 1) infinite;
}
.cue-cell span:nth-child(1) { --dx:      0px; --dy: -13px; }
.cue-cell span:nth-child(2) { --dx:  12.4px; --dy:  -4px; }
.cue-cell span:nth-child(3) { --dx:   7.6px; --dy: 10.5px; }
.cue-cell span:nth-child(4) { --dx:  -7.6px; --dy: 10.5px; }
.cue-cell span:nth-child(5) { --dx: -12.4px; --dy:  -4px; }
@keyframes mitosis {
  0%       { transform: translate(0, 0) scale(1); }
  12%      { transform: translate(0, 0) scale(1.25); }
  38%      { transform: translate(var(--dx), var(--dy)) scale(.72); opacity: .95; }
  58%      { transform: translate(var(--dx), var(--dy)) scale(.72); opacity: .95; }
  86%      { transform: translate(0, 0) scale(1.18); }
  100%     { transform: translate(0, 0) scale(1); }
}

/* Film chrome: progress bar, sound, skip */
#progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(255,255,255,.06);
  opacity: 0; transition: opacity .6s var(--ease);
}
#stage.playing #progress { opacity: 1; }

#progress-fill {
  height: 100%; width: 0%;
  background: var(--ambra);
}

.chrome-btn {
  position: absolute;
  z-index: 5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  cursor: pointer;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .95);
  padding: 12px 22px;
  opacity: 0;
  transition: opacity .6s var(--ease), color .3s,
              box-shadow .3s, transform .3s var(--ease);
}
.chrome-btn:hover {
  color: var(--ambra);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    inset 0 0 0 1px rgba(255, 179, 0, .28),
    0 12px 36px rgba(0, 0, 0, .38);
}
.chrome-btn.visible { opacity: .94; }

#skip  { bottom: 26px; right: 26px; }

/* ============================================================
   Signature / contact
   ============================================================ */
#signature {
  position: fixed; inset: 0; z-index: 20;
  will-change: opacity;
  background: rgba(5, 5, 5, .48);
  -webkit-backdrop-filter: blur(34px) saturate(140%);
  backdrop-filter: blur(34px) saturate(140%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
#signature.visible { opacity: 1; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #signature { background: rgba(5, 5, 5, .94); }
}

.signature-emblem {
  position: relative;
  width: clamp(84px, 10vw, 112px);
  height: clamp(84px, 10vw, 112px);
  margin-bottom: 6px;
}
.signature-emblem img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transition: opacity .5s var(--ease);
}
.signature-emblem .emblem-amber { opacity: 0; }
.signature-emblem:hover .emblem-amber { opacity: 1; }

.wordmark {
  font-size: clamp(44px, 9vw, 110px);
  font-weight: 400;
  letter-spacing: .18em;
  margin-right: -.18em; /* optically recenters tracked type */
  line-height: 1;
}

.claim {
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  font-size: 14px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
}

/* Contact form */
/* ---- Contact form: no container. Each field is a furrow in the dark that
   lights up as you plant something in it. ---- */
#contact {
  margin-top: 30px;
  width: min(460px, 100%);
  display: flex; flex-direction: column; gap: 26px;
  padding: 0;
}

.contact-lead {
  font-size: clamp(14px, 1.6vw, 16px);
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .94);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  margin-bottom: 2px;
}

.field-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
/* the quiet index — a ritual in two steps, not a form */
.field-index {
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(255, 255, 255, .28);
  padding-top: 9px;
  font-variant-numeric: tabular-nums;
  transition: color .45s var(--ease);
  flex: none;
}
.field-row:focus-within .field-index { color: var(--ambra); }

.field-well {
  position: relative;
  flex: 1;
  min-width: 0;
}

#contact input,
#contact textarea {
  width: 100%;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--bianco);
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  letter-spacing: .01em;
  padding: 6px 2px 12px;
  resize: none;
  display: block;
  transition: color .3s;
}
#contact input::placeholder,
#contact textarea::placeholder {
  color: rgba(255, 255, 255, .34);
  font-weight: 300;
  transition: color .45s var(--ease);
}
#contact input:focus::placeholder,
#contact textarea:focus::placeholder { color: rgba(255, 255, 255, .18); }
#contact input:focus,
#contact textarea:focus { outline: none; }

/* the furrow: a hairline that stays, and a light that grows through it */
.field-line {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, .14);
  overflow: visible;
}
.field-line::after {
  content: '';
  position: absolute;
  left: 0; top: -1px; bottom: -1px;
  width: 100%;
  background: linear-gradient(90deg,
    var(--ambra) 0%,
    rgba(255, 179, 0, .85) 55%,
    rgba(255, 179, 0, 0) 100%);
  box-shadow: 0 0 14px rgba(255, 179, 0, .5), 0 0 3px rgba(255, 179, 0, .8);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .75s var(--ease);
}
.field-row:focus-within .field-line::after { transform: scaleX(1); }
/* once something is written, the furrow keeps a faint trace */
#contact input:not(:placeholder-shown) ~ .field-line,
#contact textarea:not(:placeholder-shown) ~ .field-line {
  background: rgba(255, 179, 0, .3);
}

/* the send: no button, no box — just the word, in the amber of the logo. */
#contact button {
  align-self: center;
  margin: 16px 0 0;
  position: relative;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--ambra);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  padding: 8px 4px;
  cursor: pointer;
  text-shadow: 0 0 18px rgba(255, 179, 0, .35);
  transition: letter-spacing .5s var(--ease), text-shadow .5s var(--ease), color .4s var(--ease);
}
#contact button span { position: relative; }

/* a thread of the same amber, drawn from the centre out, on approach */
#contact button::after {
  content: '';
  position: absolute;
  left: 4px; right: 4px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(255, 179, 0, 0) 0%,
    var(--ambra) 50%,
    rgba(255, 179, 0, 0) 100%);
  box-shadow: 0 0 10px rgba(255, 179, 0, .5);
  transform: scaleX(0);
  transition: transform .65s var(--ease);
}
#contact button:hover {
  letter-spacing: .34em;
  color: #ffc633;
  text-shadow: 0 0 26px rgba(255, 179, 0, .6);
}
#contact button:hover::after { transform: scaleX(1); }
#contact button:active { color: #f08a00; }
#contact button:focus-visible { outline: 1px solid rgba(255, 179, 0, .7); outline-offset: 6px; }

@media (prefers-reduced-motion: reduce) {
  .field-line::after, #contact button::after { transition: none; }
  #contact button:hover { letter-spacing: .28em; }
}

.direct-mail {
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .08em;
  transition: color .3s;
}
.direct-mail:hover { color: var(--ambra); }


/* "watch again" — a quiet invitation, not a panel of glass.
   Bare type with a thread of amber that draws itself on approach. */
#replay {
  position: absolute;
  bottom: 22px; left: 50%;
  z-index: 5;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
  padding: 10px 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .8s var(--ease), color .4s var(--ease), letter-spacing .5s var(--ease);
}
#replay.visible { opacity: .62; pointer-events: auto; }
/* the thread of light under the words */
#replay::after {
  content: '';
  position: absolute;
  left: 4px; right: 4px; bottom: 4px;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(255, 179, 0, 0) 0%,
    var(--ambra) 50%,
    rgba(255, 179, 0, 0) 100%);
  box-shadow: 0 0 8px rgba(255, 179, 0, .45);
  transform: scaleX(0);
  transition: transform .6s var(--ease);
}
#replay:hover {
  color: rgba(255, 255, 255, .95);
  letter-spacing: .26em;
  opacity: 1;
}
#replay:hover::after { transform: scaleX(1); }
#replay:focus-visible { outline: 1px solid rgba(255, 179, 0, .6); outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) {
  #replay { transition: opacity .3s; }
  #replay:hover { letter-spacing: .22em; }
  #replay::after { transition: none; }
}

.noscript {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  background: var(--nero); color: var(--bianco);
}
.noscript a { color: var(--ambra); }


/* ============================================================
   Studio panel
   ============================================================ */
#studio {
  position: fixed; inset: 0; z-index: 20;
  will-change: opacity;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(18px, 3.5vh, 34px);
  padding: clamp(16px, 4vw, 40px);
  padding-top: max(clamp(16px, 4vw, 40px), 84px); /* clear the menu */
  background: linear-gradient(165deg, #101010 0%, #070707 55%, #0b0a08 100%);
  overflow: hidden;
  opacity: 0;
  transition: opacity 1s var(--ease);
}

/* Ambient loop: two amber glows drifting slowly through the dark */
#studio::before,
#studio::after {
  content: '';
  position: absolute;
  width: 90vmax; height: 90vmax;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}
#studio::before {
  top: -45vmax; right: -30vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 179, 0, .10), rgba(255, 140, 0, .04) 40%, transparent 68%);
  animation: drift-a 14s ease-in-out infinite;
}
#studio::after {
  bottom: -50vmax; left: -32vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 179, 0, .07), rgba(120, 80, 10, .05) 45%, transparent 70%);
  animation: drift-b 19s ease-in-out infinite;
}
@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1);        opacity: .85; }
  33%      { transform: translate(-9vmax, 7vmax) scale(1.12); opacity: 1; }
  66%      { transform: translate(4vmax, 12vmax) scale(.94);  opacity: .7; }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1);        opacity: .8; }
  40%      { transform: translate(10vmax, -8vmax) scale(1.15); opacity: 1; }
  75%      { transform: translate(-6vmax, -3vmax) scale(.9);   opacity: .65; }
}



#constellations {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Star map: two tiled layers flickering in counterphase */
.stars {
  position: absolute; inset: 0;
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
}
.stars-a {
  background-image: url('assets/stars-a.png');
  animation: twinkle-a 9s ease-in-out infinite;
}
.stars-b {
  background-image: url('assets/stars-b.png');
  background-position: 260px 170px;
  animation: twinkle-b 6.5s ease-in-out infinite;
}
@keyframes twinkle-a {
  0%, 100% { opacity: .7; }
  50%      { opacity: .28; }
}
@keyframes twinkle-b {
  0%, 100% { opacity: .3; }
  55%      { opacity: .75; }
}

.studio-card { z-index: 1; }
#studio.visible { opacity: 1; }

.studio-card {
  width: min(600px, 100%);
  gap: clamp(12px, 2vh, 18px);
  padding: clamp(24px, 4.5vw, 40px) clamp(20px, 5vw, 42px);
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center;
}

/* Studio: no frame — just the text and emblem, floating on the starfield */
.studio-card {
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  border-radius: 0;
}
.studio-card::before,
.studio-card::after { display: none; content: none; }

.studio-emblem { width: clamp(88px, 11vh, 124px); height: clamp(88px, 11vh, 124px); margin-bottom: 2px; }

.studio-card h2 {
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .95);
}

.studio-card p {
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.75;
  color: rgba(255, 255, 255, .92);
  max-width: 46ch;
}

.studio-card .studio-footnote {
  font-size: clamp(12px, 1.3vw, 13px);
  color: rgba(255, 255, 255, .68);
  margin-top: 6px;
}

@media (max-width: 640px) {
  .studio-card { padding: 34px 24px; }
}

.clients {
  width: 100%;
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
  z-index: 1;
}

.clients h3 {
  font-size: clamp(10px, 1.1vw, 11px);
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}

/* 3D cylinder: logos ride a slowly rotating drum, fading in from
   the edge, fully visible at center, fading out on the way off. */
.cyl-mask {
  position: relative;
  width: min(920px, 96vw);
  height: 84px;
  overflow: hidden;
}
/* Edge fade as overlays: identical look, none of Safari's masked-subtree bugs */
.cyl-mask::before,
.cyl-mask::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 42%;
  z-index: 2;
  pointer-events: none;
}
.cyl-mask::before {
  left: 0;
  background: linear-gradient(90deg, #0a0a09 12%, rgba(10, 10, 9, .85) 40%, transparent 100%);
}
.cyl-mask::after {
  right: 0;
  background: linear-gradient(-90deg, #0a0a09 12%, rgba(10, 10, 9, .85) 40%, transparent 100%);
}

.cyl-viewport {
  --cyl-r: 350px;
  width: 100%;
  height: 100%;
  perspective: 1650px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
}

.cyl {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.cyl-item {
  position: absolute;
  top: 0; left: 50%;
  width: 185px; height: 100%;
  margin-left: -92.5px;
  display: flex; align-items: center; justify-content: center;
  transform: rotateY(calc(var(--i) * 25.7143deg)) translateZ(var(--cyl-r));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cyl-item img {
  height: clamp(27px, 3.8vh, 38px);
  width: auto;
  max-width: 150px;
  object-fit: contain;
  opacity: .92;
  filter: grayscale(1);
}
.cyl-item img.wide { max-width: 176px; }

@media (max-width: 640px) {
  .cyl-mask { height: 66px; }
  .cyl-viewport { --cyl-r: 245px; perspective: 1150px; }
  .cyl-item { width: 128px; margin-left: -64px; }
  .cyl-item img { height: 24px; max-width: 112px; }
  .cyl-item img.wide { max-width: 138px; }
}


/* Mobile marquee fallback (desktop keeps the 3D drum) */
.clients-marquee { display: none; }

@media (pointer: coarse), (max-width: 700px) {
  .cyl-mask { display: none; }
  .clients-marquee {
    display: block;
    width: min(920px, 96vw);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 2%, #000 22%, #000 78%, transparent 98%);
            mask-image: linear-gradient(90deg, transparent 2%, #000 22%, #000 78%, transparent 98%);
  }
  .marquee-track {
    display: flex;
    align-items: center;
    gap: 38px;
    width: max-content;
    padding: 8px 0;
    animation: marquee 30s linear infinite;
  }
  .marquee-track img {
    height: 24px;
    width: auto;
    max-width: 112px;
    object-fit: contain;
    opacity: .92;
    filter: grayscale(1);
    flex: none;
  }
  .marquee-track img.wide { max-width: 140px; }
  @keyframes marquee {
    to { transform: translateX(-50%); }
  }
}

/* ============================================================
   Studio CTA + emblem bloom
   ============================================================ */
#studio-seed {
  background: none; border: none; padding: 0;
  cursor: pointer;
  border-radius: 50%;
}
#studio-seed .studio-emblem { display: block; transition: filter .3s; }
#studio-seed:hover .studio-emblem { filter: drop-shadow(0 0 14px rgba(255, 179, 0, .45)); }
#studio-seed.bloom .studio-emblem { animation: bloom .6s var(--ease); }
@keyframes bloom {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.22) rotate(36deg); filter: drop-shadow(0 0 26px rgba(255, 179, 0, .9)); }
  100% { transform: scale(1) rotate(72deg); }
}

#studio-cta {
  background: none; border: none; cursor: pointer;
  font-family: var(--font);
  font-size: clamp(11px, 1.2vw, 12.5px);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ambra);
  opacity: .85;
  z-index: 1;
  transition: opacity .3s, text-shadow .3s;
}
#studio-cta:hover { opacity: 1; text-shadow: 0 0 16px rgba(255, 179, 0, .5); }

/* ============================================================
   Seeds — the works
   ============================================================ */
#seeds {
  position: fixed; inset: 0; z-index: 20;
  will-change: opacity;
  overflow: hidden;
  background: linear-gradient(165deg, #101010 0%, #070707 55%, #0b0a08 100%);
  opacity: 0;
  transition: opacity 1s var(--ease);
}
#seeds.visible { opacity: 1; }

/* ============================================================
   Seeds — interactive star map
   ============================================================ */
#seeds-hint {
  position: absolute;
  top: max(84px, 12vh);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: clamp(11px, 1.3vw, 13px);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .6s var(--ease);
}
#seeds.showing-viewer #seeds-hint { opacity: 0; }

#starmap {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

#constels {
  position: absolute; inset: 0;
  z-index: 2;
}

/* Each seed's clickable label: pulsing amber dot + title */
.cnode {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  cursor: pointer;
  text-align: center;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.cnode .dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--ambra);
  box-shadow: 0 0 0 0 rgba(255, 179, 0, .5);
  animation: seed-pulse 2.4s ease-in-out infinite;
}
.cnode .label {
  font-size: clamp(10px, 1.1vw, 12px);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
  text-shadow: 0 1px 5px rgba(0, 0, 0, .6);
  line-height: 1.5;
  transition: color .3s;
}
.cnode .label b { display: block; font-weight: 400; }
.cnode .label .song {
  color: var(--ambra);
  font-size: 1.35em;
  letter-spacing: .1em;
  margin-top: 2px;
}
.cnode:hover .dot { transform: scale(1.25); }
#seeds.showing-viewer .cnode { opacity: .12; pointer-events: none; }

/* All dots pulse in unison (shared animation, no per-node delay) */
@keyframes seed-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 179, 0, .5);  transform: scale(1); }
  50%      { box-shadow: 0 0 14px 5px rgba(255, 179, 0, .12); transform: scale(1.18); }
}

/* Viewer: the projected video */
#viewer {
  position: absolute; inset: 0;
  z-index: 4;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
#viewer .seed {
  width: min(64vw, 920px);
  opacity: 0;
  transform: scale(.94);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
#viewer.on .seed { opacity: 1; transform: scale(1); pointer-events: auto; }

@media (max-width: 900px) {
  #viewer .seed { width: min(92vw, 620px); }
  #seeds-hint { top: 76px; font-size: 10px; letter-spacing: .2em; }
}


/* Same ambient loop as the studio: two amber glows drifting */
#seeds::before,
#seeds::after {
  content: '';
  position: absolute;
  width: 90vmax; height: 90vmax;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}
#seeds::before {
  top: -45vmax; right: -30vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 179, 0, .10), rgba(255, 140, 0, .04) 40%, transparent 68%);
  animation: drift-a 14s ease-in-out infinite;
}
#seeds::after {
  bottom: -50vmax; left: -32vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 179, 0, .07), rgba(120, 80, 10, .05) 45%, transparent 70%);
  animation: drift-b 19s ease-in-out infinite;
}

#trail {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}


   large — like the next pages of a book peeking out. */

/* Thin, minimal liquid-glass frame around each still */
.glass-frame {
  position: relative;
  overflow: hidden;
  padding: 9px;
  border-radius: 16px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .015) 55%, rgba(255, 255, 255, .035) 100%),
    rgba(8, 8, 8, .3);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .09),
    0 18px 60px rgba(0, 0, 0, .5);
}
.glass-frame::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg,
              rgba(255, 255, 255, .30) 0%,
              rgba(255, 255, 255, .07) 30%,
              rgba(255, 255, 255, .03) 55%,
              rgba(255, 255, 255, .16) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
}
.glass-frame img,
.glass-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 9px;
}


.glass-frame .still {
  position: absolute;
  top: 9px; left: 9px;
  width: calc(100% - 18px);
  height: calc(100% - 18px);
  object-fit: cover;
  border-radius: 9px;
  opacity: 1;
  transition: opacity .6s var(--ease);
}

/* Title beside the central frame */
.seed-title {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  font-size: clamp(12px, 1.3vw, 16px);
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .96);
  line-height: 1.5;
  padding: 12px 20px;
  border-radius: 13px;
  /* liquid glass over the video */
  background:
    linear-gradient(150deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,.02) 55%, rgba(255,255,255,.05) 100%),
    rgba(8, 8, 8, .28);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.1),
    0 8px 24px rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.seed-title::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,.06) 40%, rgba(255,255,255,.14) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
}
/* Only the front title is ever shown (via JS handoff) */
.seed-title span {
  color: var(--ambra);
  display: inline-block;
  font-size: 1.5em;
  letter-spacing: .1em;
  margin-top: 2px;
  line-height: 1.2;
}
.seed[data-slot="0"] .seed-title { opacity: 1; }

@media (max-width: 900px) {
            .seed-title {
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    padding: 9px 16px;
    font-size: 11px;
  }
}

#halo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Position dots: which seed is front */

/* Depth: the waiting seeds sit deeper in focus */


/* Front frame: 3D tilt follows the cursor, amber rim wakes on hover */
.glass-frame {
  transform-style: preserve-3d;
  will-change: transform;
  transition: box-shadow .4s var(--ease);
}

@media (max-width: 900px) {
    }

#particles {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 60; /* above panels: the constellations write over everything */
}

/* While a title is being written by the stars, the HTML text waits */
.seed.forming .seed-title { opacity: 0 !important; }

/* ============================================================
   Custom cursor — amber liquid-glass triangle, pointing up
   ============================================================ */
@media (pointer: fine) {
  * { cursor: none !important; }

  #cursor {
    position: fixed;
    top: 0; left: 0;
    width: 26px; height: 26px;
    margin: -13px 0 0 -13px;
    z-index: 9999;
    pointer-events: none;
    will-change: transform;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  }
  #cursor svg { display: block; width: 100%; height: 100%; overflow: visible; }

  /* both shapes share the same SVG; we cross-fade between them */
  #cursor .tri,
  #cursor .ring {
    transform-box: fill-box;
    transform-origin: center;
    transition: opacity .32s var(--ease),
                transform .42s cubic-bezier(.34,1.4,.5,1);
  }

  #cursor .tri {
    fill: rgba(255, 179, 0, .5);
    stroke: rgba(255, 210, 120, .85);
    stroke-width: 1;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    filter: drop-shadow(0 0 6px rgba(255, 179, 0, .55))
            drop-shadow(0 0 2px rgba(255, 255, 255, .5));
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }

  /* the light circle — hidden until hovering something clickable */
  #cursor .ring {
    fill: rgba(255, 255, 255, .16);
    stroke: rgba(255, 255, 255, .9);
    stroke-width: 1.2;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    filter: drop-shadow(0 0 7px rgba(255, 255, 255, .45))
            drop-shadow(0 0 2px rgba(255, 255, 255, .6));
    opacity: 0;
    transform: scale(.55);
  }

  /* hover a clickable: triangle melts away, circle blooms in */
  #cursor.hot .tri  { opacity: 0; transform: scale(.5) rotate(-30deg); }
  #cursor.hot .ring { opacity: 1; transform: scale(1); }
  #cursor.hot       { transform: scale(1.25); }

  #cursor.click  { transform: scale(.82); }
  #cursor.hidden { opacity: 0; }
}

/* ============================================================
   Seeds — interactive star map
   ============================================================ */
#seeds {
  position: fixed; inset: 0; z-index: 20;
  overflow: hidden;
  background: linear-gradient(165deg, #101010 0%, #070707 55%, #0b0a08 100%);
  opacity: 0;
  transition: opacity 1s var(--ease);
}
#seeds.visible { opacity: 1; }
#seeds::before, #seeds::after {
  content: ''; position: absolute; width: 90vmax; height: 90vmax;
  border-radius: 50%; pointer-events: none; will-change: transform, opacity;
}
#seeds::before { top: -45vmax; right: -30vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255,179,0,.09), rgba(255,140,0,.04) 40%, transparent 68%);
  animation: drift-a 14s ease-in-out infinite; }
#seeds::after { bottom: -50vmax; left: -32vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255,179,0,.06), rgba(120,80,10,.05) 45%, transparent 70%);
  animation: drift-b 19s ease-in-out infinite; }

#starmap { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }

#seeds-hint {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; z-index: 3;
  font-size: clamp(13px, 1.5vw, 17px);
  font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  line-height: 1.7;
  color: rgba(255,255,255,.9);
  transition: opacity .6s var(--ease);
  pointer-events: none;
}
#seeds-hint .amber { color: #fff; }
#seeds-hint.gone { opacity: 0; }

/* Animated amber gradient sweep across TOUCH, with glow */
#seeds-hint .hint-touch {
  font-weight: 600;
  letter-spacing: .24em;
  background: linear-gradient(100deg,
    #fff 0%, #FFB300 30%, #ffe6b0 50%, #FFB300 70%, #fff 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: hint-sweep 4s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255,179,0,.4));
}
@keyframes hint-sweep {
  0%   { background-position: 130% 0; }
  100% { background-position: -130% 0; }
}
/* Soft glow on the rest of the words too */
#seeds-hint { text-shadow: 0 0 10px rgba(255,255,255,.12), 0 2px 16px rgba(0,0,0,.55); }

/* Projected video */
#viewer {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.viewer-wrap {
  pointer-events: auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
}
#viewer-heading {
  font-size: clamp(14px, 1.6vw, 19px);
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s var(--ease) .25s, transform .6s var(--ease) .25s;
}
#viewer-heading span { color: var(--ambra); }
#viewer.visible #viewer-heading { opacity: 1; transform: translateY(0); }

#viewer .glass-frame {
  width: min(70vw, 1040px);
  padding: 11px;
  border-radius: 20px;
  opacity: 0;
  /* The world doesn't fade in — it opens. It arrives slightly small and
     settles, so the frame reads as something that grew, not something
     that was placed. */
  transform: scale(.955);
  transition: opacity .75s var(--ease),
              transform .95s var(--ease),
              box-shadow .5s var(--ease);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 30px 90px rgba(0,0,0,.6),
    0 0 0 1px rgba(255,255,255,.06);
}
#viewer.visible .glass-frame { opacity: 1; transform: scale(1); }
#viewer.dissolving .glass-frame { opacity: 0; transition: opacity .55s var(--ease); }

/* YouTube call-to-action under the video (only for seeds with a link) */
.viewer-yt {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 18px auto 0;
  width: fit-content;
  padding: 9px 18px;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pietra);
  text-decoration: none;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.02);
  transition: color .3s var(--ease), border-color .3s var(--ease),
              background .3s var(--ease), transform .3s var(--ease);
  animation: ytBreath 3.2s ease-in-out infinite;
}
.viewer-yt[hidden] { display: none !important; }
.viewer-yt:hover {
  color: var(--bianco);
  border-color: rgba(255,179,0,.45);
  background: rgba(255,179,0,.08);
  animation-play-state: paused;
}
.viewer-yt .yt-ico {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ambra); color: #140c00;
  flex: none;
}
.viewer-yt .yt-ico svg { width: 11px; height: 11px; margin-left: 1px; }
@keyframes ytBreath {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) { .viewer-yt { animation: none; } }

/* faint "click me" invitation while hovering the open frame */
#viewer .glass-frame.inviting {
  transform: scale(1.008) translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 36px 100px rgba(0,0,0,.62),
    0 0 0 1px rgba(255,179,0,.22),
    0 0 42px rgba(255,179,0,.14);
}

/* viewer-wrap becomes the positioning context for the aura */
.viewer-wrap { position: relative; }

/* the frame sits above the aura */
#viewer .glass-frame { position: relative; z-index: 1; }

/* WebGL solar aura — a sibling BEHIND the frame, bleeding outward on all sides.
   Centered on the wrap; sized larger than the frame so flares have room. */
#viewer-aura {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(120vw, 1780px);
  height: min(165vh, 1300px);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s var(--ease);
  mix-blend-mode: screen;
}
#viewer.visible #viewer-aura { opacity: 1; }
#viewer.dissolving #viewer-aura { opacity: 0; transition: opacity .4s var(--ease); }

/* constellation mesh — same footprint as the aura, sits just above it */
#viewer-constel {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(120vw, 1780px);
  height: min(165vh, 1300px);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s var(--ease);
}
#viewer.visible #viewer-constel { opacity: 1; }
#viewer.dissolving #viewer-constel { opacity: 0; transition: opacity .4s var(--ease); }

@media (max-width: 900px) {
  #viewer .glass-frame { width: 92vw; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .cue-cell span, .preloader-emblem, .stars,
  #studio::before, #studio::after { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 640px) {
  #cue p { font-size: 13px; line-height: 1.5; letter-spacing: .18em; }
  #replay {
    position: static;
    transform: none;
    margin-top: 14px;
  }
  #signature { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  #skip  { right: 14px; }
  .wordmark { letter-spacing: .14em; margin-right: -.14em; }
}

/* ============================================================
   CUSTOM SECTIONS — built from the Console (sections.js)
   They live in the same world as Studio: starfield, dissolves,
   the same typographic voice.
   ============================================================ */
.custom-section {
  position: fixed; inset: 0; z-index: 15;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 5, .72);
  opacity: 0;
  transition: opacity 1.2s var(--ease);
  overflow-y: auto;
}
.custom-section.visible { opacity: 1; }

.cs-wrap {
  position: relative; z-index: 2;
  width: min(780px, 100%);
  margin: auto;
  padding: 40px 0;
}

/* ---- text kind ---- */
.cs-text { text-align: center; }
.cs-text h2 {
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 600; letter-spacing: -.01em;
  margin-bottom: 26px;
}
.cs-text p {
  font-size: clamp(14px, 1.7vw, 16.5px);
  font-weight: 300; line-height: 1.85;
  color: rgba(255, 255, 255, .74);
  max-width: 62ch; margin: 0 auto 16px;
}
.cs-text .cs-footnote {
  font-size: 12.5px; color: rgba(255, 255, 255, .4);
  margin-top: 26px; letter-spacing: .02em;
}

/* ---- gallery kind ---- */
.cs-gallery h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600; letter-spacing: -.01em;
  margin-bottom: 14px; text-align: center;
}
.cs-intro {
  font-size: 14px; font-weight: 300; line-height: 1.8;
  color: rgba(255, 255, 255, .62);
  max-width: 58ch; margin: 0 auto 34px; text-align: center;
}
.cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.cs-item {
  margin: 0; position: relative; overflow: hidden;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: #0a0a0a;
  transition: border-color .4s var(--ease), transform .4s var(--ease);
}
.cs-item:hover {
  border-color: rgba(255, 179, 0, .35);
  transform: translateY(-2px);
}
.cs-item img, .cs-item video {
  width: 100%; display: block; aspect-ratio: 16 / 10;
  object-fit: cover;
}
.cs-item figcaption {
  padding: 9px 12px 11px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
}

@media (max-width: 640px) {
  .cs-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cs-wrap { padding: 24px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .custom-section { transition: opacity .2s; }
  .cs-item { transition: none; }
}

/* the outcome line under the contact form — a whisper, not an alert */
.contact-note {
  min-height: 18px;
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .4);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), color .4s;
}
.contact-note:not(:empty) { opacity: 1; transform: none; }
.contact-note.is-ok   { color: var(--ambra); text-shadow: 0 0 18px rgba(255,179,0,.35); }
.contact-note.is-warn { color: rgba(255, 255, 255, .62); }
#contact button[disabled] { opacity: .55; cursor: default; }
