/* ============================================================================
   ShareMockups — "Launching soon" (home)
   Loaded after tokens.css, fonts.css and auth.css. Reuses their tokens
   (--tx, --tx-2, --tx-3, --ac, --ac-tx, --vi, --ac-dim, --vi-dim, --font-*,
   --r-pill) and only adds --soon-* values, scoped to .soon.

   Paint order: CSS ground (.soon) → fixed WebGL canvas (.soon-field) → HTML.
   The ground is the complete page when the canvas is off (no WebGL, context
   lost, JS failed); text never depends on the canvas.
   ========================================================================= */

body[data-page='home'] {
  background: #ffffff;
  background-image: none;
}

.soon {
  --soon-flake: clamp(120px, 19vh, 176px);
  --soon-word: clamp(140px, 15vw, 240px);
  --soon-pad-inline: clamp(20px, 5vw, 64px);
  --soon-pad-edge: 28px;
  --soon-gap-scene: clamp(16px, 3vh, 32px);
  --soon-gap-badge: clamp(16px, 2.4vh, 24px);
  --soon-gap-title: clamp(12px, 1.8vh, 18px);
  --soon-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --soon-ui: cubic-bezier(0.2, 0.8, 0.2, 1);
  --soon-sky-vignette: radial-gradient(
    78% 70% at 50% 46%,
    rgba(234, 243, 252, 1),
    rgba(234, 243, 252, 0) 72%
  );
  --soon-mint-vignette: linear-gradient(to top, rgba(231, 245, 238, 1), rgba(231, 245, 238, 0) 40%);

  position: relative;
  isolation: isolate;
  flex: 1 0 auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--soon-mint-vignette), var(--soon-sky-vignette), #ffffff;
  color: var(--tx);
}

/* Strength variants (palette-candidates.json → css_vignettes). Text colours
   never change between them. */
.soon[data-strength='airy'] {
  --soon-sky-vignette: radial-gradient(
    78% 70% at 50% 46%,
    rgba(234, 243, 252, 0.7),
    rgba(234, 243, 252, 0) 70%
  );
  --soon-mint-vignette: linear-gradient(to top, rgba(231, 245, 238, 0.7), rgba(231, 245, 238, 0) 38%);
}
.soon[data-strength='vivid'] {
  --soon-sky-vignette:
    radial-gradient(80% 72% at 50% 46%, rgba(234, 243, 252, 1), rgba(234, 243, 252, 0) 76%),
    radial-gradient(40% 40% at 12% 18%, rgba(34, 118, 201, 0.1), rgba(34, 118, 201, 0) 70%);
  --soon-mint-vignette:
    linear-gradient(to top, rgba(231, 245, 238, 1), rgba(231, 245, 238, 0) 46%),
    radial-gradient(36% 36% at 88% 82%, rgba(96, 205, 150, 0.14), rgba(96, 205, 150, 0) 70%);
}

.soon ::selection {
  background: var(--ac-dim);
  color: var(--tx);
}
.soon [hidden] {
  display: none !important;
}

/* ---------- soon-field: the canvas ---------- */
.soon-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms var(--soon-expo);
}
.soon-field--live {
  opacity: 1;
}
.soon--static .soon-field {
  display: none;
}

.soon-header,
.soon-stage,
.soon-footer {
  position: relative;
  z-index: 2;
}

/* ---------- soon-header ---------- */
.soon-header {
  display: flex;
  justify-content: center;
  padding: var(--soon-pad-edge) var(--soon-pad-inline) 0;
}
.soon-header .brand:focus-visible {
  outline: 2px solid var(--ac-tx);
  outline-offset: 4px;
  border-radius: 8px;
}

/* ---------- stage: scene above message, centred as one group ---------- */
.soon-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* soon-scene: an empty box that reserves the snowflake's room and tells the shader
   where to draw it. font-size carries the drifting word's size to site.js. */
.soon-scene {
  flex: none;
  width: var(--soon-flake);
  height: calc(var(--soon-flake) * 1.55);
  font-size: var(--soon-word);
}

/* ---------- soon-message ---------- */
.soon-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, calc(1000px + 2 * var(--soon-pad-inline)));
  margin-top: var(--soon-gap-scene);
  padding: 0 var(--soon-pad-inline);
  text-align: center;
}

/* Frosted-glass status chip (crystallize glass chip, ANALYSIS T7). */
.soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 16px 0 12px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 10px 30px -12px rgba(34, 118, 201, 0.35),
    0 1px 2px rgba(26, 100, 168, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ac-tx);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .soon-badge {
    background: rgba(255, 255, 255, 0.92);
  }
}
.soon-badge__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vi);
  box-shadow: 0 0 0 3px rgba(96, 205, 150, 0.28);
  animation: soon-breathe 3s ease-in-out infinite;
}

.soon-title {
  margin-top: var(--soon-gap-badge);
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw + 4px, 76px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.032em;
  color: var(--tx);
  text-wrap: balance;
  font-kerning: normal;
  font-feature-settings: 'ss01' 0;
  text-rendering: optimizeLegibility;
}

.soon-line {
  margin-top: var(--soon-gap-title);
  max-width: 34ch;
  font-family: var(--font-ui);
  font-size: clamp(16px, 0.45vw + 13.5px, 19px);
  font-weight: 500;
  line-height: 1.5;
  color: var(--tx-2);
}

.soon-cta {
  margin-top: 28px;
}
.soon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 26px;
  border-radius: var(--r-pill);
  background-color: var(--ac);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 55%);
  box-shadow:
    0 12px 28px -14px rgba(34, 118, 201, 0.6),
    0 1px 2px rgba(26, 100, 168, 0.2);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.005em;
  color: var(--on-ac);
  text-decoration: none;
  transition:
    transform 250ms var(--soon-ui),
    box-shadow 300ms var(--soon-expo),
    background-color 300ms var(--soon-expo);
}
.soon-button:hover {
  transform: translateY(-1px);
  background-color: #1f6cb9;
  box-shadow:
    0 16px 34px -14px rgba(34, 118, 201, 0.7),
    0 2px 4px rgba(26, 100, 168, 0.22);
  color: var(--on-ac);
  text-decoration: none;
}
.soon-button:active {
  transform: translateY(0);
  transition-duration: 120ms;
}
.soon-button:focus-visible {
  outline: 2px solid var(--ac-tx);
  outline-offset: 3px;
  border-radius: var(--r-pill);
}

/* ---------- soon-footer ---------- */
.soon-footer {
  display: flex;
  justify-content: center;
  padding: 0 var(--soon-pad-inline) var(--soon-pad-edge);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--tx-3);
}

/* ---------- entrance (motion.md §2). Pure CSS, so text never waits on JS.
   site.js reads the badge animation's startTime as the shared clock. ---------- */
@keyframes soon-rise {
  from {
    opacity: 0;
    transform: translateY(var(--soon-rise, 24px));
  }
}
@keyframes soon-fade {
  from {
    opacity: 0;
  }
}
@keyframes soon-breathe {
  50% {
    box-shadow: 0 0 0 6px rgba(96, 205, 150, 0.1);
  }
}
.soon-header {
  --soon-rise: 8px;
  animation: soon-rise 700ms var(--soon-expo) 1800ms both;
}
.soon-badge {
  animation: soon-rise 1000ms var(--soon-expo) 1900ms both;
}
.soon-title {
  animation: soon-rise 1000ms var(--soon-expo) 2000ms both;
}
.soon-line,
.soon-cta {
  animation: soon-rise 1000ms var(--soon-expo) 2100ms both;
}
.soon-footer {
  animation: soon-fade 600ms var(--soon-expo) 2400ms both;
}

/* ---------- breakpoints ---------- */
@media (max-width: 599px) {
  .soon {
    --soon-flake: clamp(92px, 28vw, 124px);
    --soon-word: clamp(96px, 30vw, 132px);
    --soon-pad-edge: 20px;
  }
}
@media (max-height: 559px) {
  .soon {
    --soon-flake: clamp(72px, 18vh, 96px);
    --soon-word: clamp(72px, 24vh, 140px);
    --soon-pad-edge: 16px;
    --soon-gap-scene: 16px;
    --soon-gap-badge: 14px;
    --soon-gap-title: 10px;
  }
  .soon-cta {
    margin-top: 18px;
  }
}

/* ---------- reduced motion: content visible at once, nothing loops ---------- */
@media (prefers-reduced-motion: reduce) {
  .soon-header,
  .soon-badge,
  .soon-badge__dot,
  .soon-title,
  .soon-line,
  .soon-cta,
  .soon-footer {
    animation: none;
  }
  .soon-field,
  .soon-button {
    transition: none;
  }
  .soon-button:hover {
    transform: none;
  }
}
