/* Promethist engine stylesheet, shared by the index and error pages and the agent debugger: font, blurred orb
   backdrop, liquid glass cards, buttons and form controls, plus the landing layout of the index and error
   pages (body.landing). */
@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #08080e;
  --fg: #eaeaec;
  --brand: #ff6e50;
  --brand-hover: #ff6a57;
  /* The muted coral of promethist-marketing's calls to action, for tinted rather than solid buttons. */
  --accent: #e58a67;
}

body {
  color: var(--fg);
  font-family: var(--font);
  letter-spacing: -0.005em;
  background: var(--bg);
}

/* ── Blurred backdrop — the same orb loop promethist-site's homepage feeds
   its WebGL backdrop shader (frontend/public/assets/videos/orb-hero-1280.mp4),
   reproduced here as a plain blurred + desaturated <video> since these pages
   have no shader stage, plus a smaller warm CSS accent for brand depth. ─── */
.bg-orb-video {
  position: fixed;
  z-index: -2;
  top: 50%;
  left: 50%;
  width: min(115vw, 1400px);
  height: min(115vw, 1400px);
  object-fit: cover;
  border-radius: 50%;
  opacity: 0.7;
  filter: blur(90px) saturate(0.75) contrast(1.05);
  transform: translate3d(-50%, -50%, 0);
  animation: orb-drift-a 30s ease-in-out infinite alternate;
  pointer-events: none;
}

/* The warm accent belongs to the orb backdrop only. */
body:has(.bg-orb-video)::after {
  content: "";
  position: fixed;
  z-index: -2;
  right: -15%;
  bottom: -20%;
  width: min(70vw, 800px);
  height: min(70vw, 800px);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 110, 80, 0.4) 0%,
    rgba(145, 56, 18, 0.22) 45%,
    transparent 72%
  );
  filter: blur(110px);
  animation: orb-drift-b 34s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Slow, organic drift + breathing scale so the glow reads as alive
   without ever looking like it is repeating on a fixed loop. */
@keyframes orb-drift-a {
  0%   { transform: translate3d(-50%, -50%, 0) scale(1); }
  50%  { transform: translate3d(-42%, -56%, 0) scale(1.12); }
  100% { transform: translate3d(-56%, -46%, 0) scale(0.96); }
}
@keyframes orb-drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-6%, -5%, 0) scale(1.1); }
  100% { transform: translate3d(4%, 5%, 0) scale(0.94); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-orb-video,
  body::after,
  .bg-aurora span {
    animation: none;
  }
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    70% 60% at 50% 45%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.2) 60%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* ── Aurora backdrop of promethist-marketing's working pages (company assets): three slow, deeply blurred
   washes, a faint coral one in the middle and two navy ones, under a film grain and a vignette that fades
   into the page colour. Calmer than the orb, for pages that are read for long. Markup:
   <div class="bg-aurora"><span></span><span></span><span></span></div><div class="bg-grain"></div>
   <div class="bg-aurora-vignette"></div> ── */
.bg-aurora {
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
}

.bg-aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(84px);
  opacity: 0.75;
  will-change: transform;
}

.bg-aurora span:nth-child(1) {
  top: 34%;
  left: 50%;
  margin-left: -16vw;
  width: 32vw;
  height: 32vw;
  background: radial-gradient(circle at 50% 50%, rgba(255, 110, 80, 0.1) 0%, transparent 62%);
  animation: aurora-drift-a 40s cubic-bezier(0.22, 1, 0.36, 1) infinite alternate;
}

.bg-aurora span:nth-child(2) {
  top: 12%;
  right: -6%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle at 50% 50%, rgba(40, 55, 105, 0.46) 0%, transparent 64%);
  animation: aurora-drift-b 52s cubic-bezier(0.22, 1, 0.36, 1) infinite alternate;
}

.bg-aurora span:nth-child(3) {
  bottom: -22%;
  left: 22%;
  width: 58vw;
  height: 42vw;
  background: radial-gradient(circle at 50% 50%, rgba(5, 30, 131, 0.58) 0%, transparent 66%);
  animation: aurora-drift-c 60s cubic-bezier(0.22, 1, 0.36, 1) infinite alternate;
}

@keyframes aurora-drift-a {
  to { transform: translate3d(2vw, -3vh, 0) scale(1.1); }
}
@keyframes aurora-drift-b {
  to { transform: translate3d(-6vw, 5vh, 0) scale(1.07); }
}
@keyframes aurora-drift-c {
  to { transform: translate3d(4vw, -4vh, 0) scale(1.12); }
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg-aurora-vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 92% 72% at 50% 40%, transparent 0%, rgba(8, 8, 14, 0.4) 72%, rgba(8, 8, 14, 0.86) 100%);
}

/* ── Liquid glass card — the promethist-site hero card's own recipe
   (features/landing/components/glass-gpu/glass-surface.tsx), carried over
   as its plain-CSS fallback: a "material" wash (barely-there white
   gradients, no dark fill) so the backdrop reads through almost
   untouched, a 1px rim gradient standing in for the shader's refraction
   highlight, and its exact backdrop-filter fallback recipe. ──────────── */
.glass-card {
  position: relative;
  isolation: isolate;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.025) 55%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 55%);
  backdrop-filter: blur(14px) saturate(1.6) brightness(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.6) brightness(1.05);
  box-shadow:
    inset 0 16px 32px -28px rgba(255, 255, 255, 0.22),
    0 30px 60px -30px rgba(0, 0, 0, 0.65);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.18) 25%,
    rgba(255, 255, 255, 0.1) 55%,
    rgba(255, 255, 255, 0.16) 85%,
    rgba(255, 255, 255, 0.32) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Buttons mirror the landing site's <ButtonLanding> variants
   (components/ui/button-landing.tsx): "primary" (solid white, coral on
   hover) for the one main action, "glass" (frosted, low-emphasis pill)
   for the parallel/secondary one. */
.btn-primary,
.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 300ms ease-out, background-color 300ms ease-out,
    border-color 300ms ease-out, box-shadow 300ms ease-out;
}

.btn-primary {
  background: #fff;
  color: #1a1a2e;
  border: 1px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-primary:hover:not(:disabled) {
  color: var(--brand-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 24px -16px rgba(0, 0, 0, 0.6);
}

.btn-glass:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary:disabled,
.btn-glass:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary:focus-visible,
.btn-glass:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 2px;
}

/* Segmented switch, after the family tabs of promethist-marketing's company assets: a faint pill track
   whose active segment is lit by a brighter wash and ring rather than filled solid. */
.mode-switch {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.mode-switch button {
  min-height: 30px;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  transition: color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out;
}

.mode-switch button:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
}

.mode-switch button[aria-pressed="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.mode-switch button:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.field {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  outline: none;
  transition: border-color 200ms ease-out, background-color 200ms ease-out;
}

.field:hover,
.field:focus {
  background: rgba(255, 255, 255, 0.05);
}

.field:focus {
  border-color: rgba(255, 255, 255, 0.25);
}

.field::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ff8a70;
}

.kpi-value {
  font-weight: 300;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

/* ── Soft variants for working pages such as the agent debugger, after promethist-marketing's company
   assets: content glass without the hero card's rim and shadow, a faint wash with a hairline ring, an
   accent-tinted primary action and a quiet secondary one. ── */
.glass-card--soft {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.glass-card--soft::before {
  display: none;
}

/* A card inside a soft glass card. */
.surface {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.015) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-accent,
.btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 999px;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 200ms ease-out, background-color 200ms ease-out, box-shadow 200ms ease-out;
}

.btn-accent {
  min-height: 30px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: color-mix(in oklab, var(--accent) 18%, white);
  background: color-mix(in oklab, var(--accent) 30%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px color-mix(in oklab, var(--accent) 58%, transparent),
    0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-accent:hover:not(:disabled),
.btn-accent:focus-visible {
  color: #fff;
  background: color-mix(in oklab, var(--accent) 48%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 0 0 1px color-mix(in oklab, var(--accent) 78%, transparent),
    0 8px 20px -10px color-mix(in oklab, var(--accent) 55%, transparent);
}

.btn-quiet {
  min-height: 28px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

.btn-quiet:hover:not(:disabled),
.btn-quiet:focus-visible {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.btn-accent:disabled,
.btn-quiet:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn-accent:focus-visible,
.btn-quiet:focus-visible {
  outline: none;
}

/* Logo lockup: the Promethist icon (img/promethist-icon.svg) with its wordmark. */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo {
  width: 30px;
  height: auto;
  opacity: 0.95;
}

.logo-wordmark {
  font-size: 1.15rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.9);
}

/* ── Landing layout: the engine index and error pages, one centred glass card. ── */
body.landing,
body.landing * {
  margin: 0;
  padding: 0;
}

html:has(body.landing),
body.landing {
  height: 100%;
}

body.landing {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  font-weight: 300;
  overflow: hidden;
  position: relative;
}

.landing .content-container {
  width: 440px;
  max-width: 100%;
  padding: 44px 36px 36px;
  border-radius: 32px;
  text-align: center;
}

.landing .logo-container {
  margin-bottom: 24px;
}

.landing h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
  line-height: 1.15;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 20px;
}

.landing .text-content,
.landing .text-content-p {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 10px;
}

.landing p {
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}

.landing p strong {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.landing #reason-text {
  color: rgba(255, 255, 255, 0.85);
}

/* Two-CTA row, same pairing as the landing site's own: primary for the main
   action, glass for the parallel/secondary one. */
.landing .btn-row {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.landing .btn-row .btn-primary,
.landing .btn-row .btn-glass {
  flex: 1;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 14px;
}

@media (max-width: 480px) {
  .landing .content-container {
    width: 100%;
    padding: 34px 24px 28px;
    border-radius: 24px;
  }

  .landing .btn-row {
    flex-direction: column;
    gap: 10px;
  }

  .landing .btn-row .btn-primary,
  .landing .btn-row .btn-glass {
    min-height: 54px;
    padding: 15px 20px;
  }
}
