/* Studio OS landing — shared scene + chrome for all landing pages.
   Ported from the Studio OS login scene (frontend/src/styles/index.css, dark
   variant) — same gradients, glow pools, grid and animated seam field, with
   the oklch(from …) alphas precomputed for a dependency-free static page. */
* { margin: 0; box-sizing: border-box; }
:root {
  --bg: oklch(0.17 0.015 260);
  --card: oklch(0.21 0.018 260 / 0.88);
  --border: oklch(0.32 0.02 260);
  --text: oklch(0.93 0.01 250);
  --muted: oklch(0.68 0.02 250);
  --accent: oklch(0.74 0.11 162);
  --gradient-brand: linear-gradient(145deg, oklch(0.5 0.18 164), oklch(0.56 0.17 205) 48%, oklch(0.52 0.2 260));
}
html, body { height: 100%; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: #10131a; /* fallback */
  background:
    radial-gradient(120% 90% at 12% -10%, oklch(0.46 0.08 250 / 0.32), transparent 46%),
    radial-gradient(120% 90% at 92% 4%, oklch(0.42 0.09 168 / 0.24), transparent 44%),
    var(--bg);
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
/* Slow-breathing ambient glow pools behind the seams */
body::before {
  content: "";
  position: fixed; inset: -25%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40% 36% at 22% 24%, oklch(0.48 0.09 168 / 0.42), transparent 64%),
    radial-gradient(44% 40% at 80% 26%, oklch(0.46 0.08 250 / 0.38), transparent 66%),
    radial-gradient(36% 34% at 60% 80%, oklch(0.46 0.09 190 / 0.32), transparent 62%);
  animation: bg-drift 30s ease-in-out infinite alternate;
  will-change: transform;
}
/* Faint studio grid */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, oklch(1 0 0 / 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(1 0 0 / 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.seam-field {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%; overflow: visible;
}
.seam { transform-box: fill-box; transform-origin: center; will-change: transform; }
.seam-core { fill: none; stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.seam-glow { fill: none; stroke-width: 28; stroke-linecap: round; vector-effect: non-scaling-stroke;
             animation: glow-pulse 9s ease-in-out infinite alternate; }
.seam-a { opacity: 0.8; }
.seam-a .seam-core { stroke: oklch(0.78 0.08 200 / 0.42); }
.seam-a .seam-glow { stroke: oklch(0.78 0.08 200 / 0.55); }
.seam-b { opacity: 1; }
.seam-b .seam-core { stroke: oklch(0.74 0.11 162 / 0.42); }
.seam-b .seam-glow { stroke: oklch(0.74 0.11 162 / 0.55); animation-delay: -3s; }
.seam-c { opacity: 0.65; }
.seam-c .seam-core { stroke: oklch(0.78 0.09 150 / 0.42); }
.seam-c .seam-glow { stroke: oklch(0.78 0.09 150 / 0.55); animation-delay: -6s; }
.seam-d { opacity: 0.75; }
.seam-d .seam-core { stroke: oklch(0.74 0.08 250 / 0.42); }
.seam-d .seam-glow { stroke: oklch(0.74 0.08 250 / 0.55); animation-delay: -4.5s; }
.drift-a { animation: seam-float-a 24s ease-in-out infinite alternate; }
.drift-b { animation: seam-float-b 29s ease-in-out infinite alternate; }
.drift-c { animation: seam-float-a 34s ease-in-out infinite alternate-reverse; }
.drift-d { animation: seam-float-b 27s ease-in-out infinite alternate-reverse; }

@keyframes bg-drift {
  0%   { transform: translate3d(-2%, -1.5%, 0) scale(1.05) rotate(-0.6deg); }
  100% { transform: translate3d(2.5%, 2%, 0) scale(1.13) rotate(0.6deg); }
}
@keyframes glow-pulse { 0% { opacity: 0.45; } 100% { opacity: 1; } }
@keyframes seam-float-a {
  0%   { transform: translate3d(-16px, -13px, 0) rotate(-0.3deg); }
  100% { transform: translate3d(28px, 16px, 0) rotate(0.34deg); }
}
@keyframes seam-float-b {
  0%   { transform: translate3d(20px, 13px, 0) rotate(0.22deg); }
  100% { transform: translate3d(-26px, -19px, 0) rotate(-0.3deg); }
}

/* ── Shared foreground chrome ─────────────────────────────── */
main {
  position: relative; z-index: 10; width: 100%; max-width: 26rem;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.4, 0, 1, 1);
}
.brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
a.brand { color: inherit; text-decoration: none; }
.brand-plate {
  display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; color: #fff;
  background: var(--gradient-brand);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 0 0 1.5px oklch(1 0 0 / 0.25);
  flex: none;
}
.brand-plate svg { width: 1.75rem; height: 1.75rem; }
.brand h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.brand p { font-size: 0.875rem; color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem;
  backdrop-filter: blur(8px); overflow: hidden;
  box-shadow: 0 0 40px -12px oklch(0.6 0.12 190 / 0.25), 0 18px 34px -26px oklch(0 0 0 / 0.6);
}

footer { margin-top: 2.5rem; font-size: 0.8rem; color: var(--muted); opacity: 0.7; }
footer a { color: inherit; }
footer .sep { margin: 0 0.5rem; opacity: 0.6; }

/* ── Leave transition: content lifts away, glow swells, then navigate ── */
body.leaving main { opacity: 0; transform: translateY(-14px) scale(0.985); }
body.leaving::before { animation: none; transform: scale(1.22); opacity: 1.35; transition: transform 0.55s ease, opacity 0.55s ease; }
body.leaving .seam-field { transition: opacity 0.55s ease; opacity: 0.35; }

/* Arrival: content settles in (mirrors the leave transition). `backwards`
   fill only — a retained (forwards) fill would pin opacity/transform and
   override the body.leaving transition on the way out. */
@keyframes arrive {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
main { animation: arrive 0.5s ease backwards; }

@media (prefers-reduced-motion: reduce) {
  body::before, .seam, .seam-glow { animation: none; }
  .seam-field animate { display: none; }
  main { transition: none; animation: none; }
}
