/* SimAgent — shared styles.
   Palette mirrors the client (client/app/globals.css). */

:root {
  --color-bg:             #0d0f14;
  --color-surface:        #13161f;
  --color-surface-raised: #191d29;
  --color-border:         #222840;

  --color-accent:         #4d7cfe;
  --color-accent-hover:   #3a6cf4;
  --color-accent-subtle:  #1a2347;

  --color-text:           #eef2f9;
  --color-text-secondary: #b0bad0;
  --color-text-muted:     #7d88a3;

  --color-success:        #2ecc8d;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", monospace;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.6;
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
}

/* ---------- Ambient background ---------- */

.backdrop {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

/* Perspective grid receding to the horizon. */
.backdrop::before {
  background-image:
    linear-gradient(to right, rgb(77 124 254 / 14%) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(77 124 254 / 14%) 1px, transparent 1px);
  background-size: 64px 64px;
  bottom: -40%;
  content: "";
  left: -50%;
  mask-image: linear-gradient(to top, #000 0%, transparent 70%);
  position: absolute;
  right: -50%;
  top: 45%;
  transform: perspective(320px) rotateX(62deg);
}

/* Two slow drifting light pools. */
.glow {
  border-radius: 50%;
  filter: blur(90px);
  position: absolute;
}

.glow--accent {
  animation: drift 22s ease-in-out infinite alternate;
  background: radial-gradient(circle, rgb(77 124 254 / 42%), transparent 70%);
  height: 620px;
  left: 50%;
  top: -180px;
  transform: translateX(-50%);
  width: 620px;
}

.glow--teal {
  animation: drift 28s ease-in-out infinite alternate-reverse;
  background: radial-gradient(circle, rgb(46 204 141 / 22%), transparent 70%);
  bottom: -220px;
  height: 480px;
  right: -120px;
  width: 480px;
}

@keyframes drift {
  from { translate: 0 0; }
  to   { translate: 40px 30px; }
}

/* ---------- Layout ---------- */

.page {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: 48px 24px;
  position: relative;
  text-align: center;
  z-index: 1;
}

/* ---------- Hero ---------- */

.badge {
  align-items: center;
  backdrop-filter: blur(8px);
  background-color: rgb(25 29 41 / 70%);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: 12px;
  gap: 8px;
  letter-spacing: 0.1em;
  margin-bottom: 40px;
  padding: 7px 16px;
  text-transform: uppercase;
}

.badge__dot {
  animation: pulse 2.4s ease-in-out infinite;
  background-color: var(--color-success);
  border-radius: 50%;
  flex: none;
  height: 7px;
  width: 7px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(46 204 141 / 55%); opacity: 1; }
  50%      { box-shadow: 0 0 0 7px rgb(46 204 141 / 0%); opacity: 0.75; }
}

.wordmark {
  background: linear-gradient(180deg, #ffffff 25%, #9fb2dd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(3.25rem, 13vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 0;
}

.wordmark__accent {
  background: linear-gradient(180deg, #7fa0ff 20%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  color: var(--color-text-secondary);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  margin: 24px auto 0;
  max-width: 52ch;
}

/* Thin accent rule under the hero. */
.rule {
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  border: 0;
  height: 1px;
  margin: 48px auto;
  opacity: 0.55;
  width: min(420px, 70%);
}

.status {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.34em;
  margin: 0;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */

.footer {
  bottom: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  left: 0;
  padding: 24px;
  position: absolute;
  right: 0;
  text-align: center;
  z-index: 1;
}

.footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--color-text-secondary);
  text-decoration: underline;
}

.footer__separator {
  opacity: 0.45;
  padding: 0 8px;
}

/* Legal pages scroll, so their footer follows the content instead of the viewport. */
.footer--static {
  position: static;
}

/* ---------- Legal pages ---------- */

.legal {
  margin: 0 auto;
  max-width: 720px;
  padding: 96px 24px 120px;
  position: relative;
  text-align: left;
  z-index: 1;
}

.legal__back {
  color: var(--color-text-muted);
  display: inline-block;
  font-size: 13px;
  margin-bottom: 40px;
  text-decoration: none;
}

.legal__back:hover,
.legal__back:focus-visible {
  color: var(--color-accent);
}

.legal h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 48px;
}

.legal h2 {
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 48px 0 16px;
  padding-top: 32px;
}

.legal h3 {
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 28px 0 8px;
}

.legal p,
.legal address {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-style: normal;
  margin: 0 0 16px;
}

.legal a {
  color: var(--color-accent);
  text-decoration: none;
}

.legal a:hover,
.legal a:focus-visible {
  text-decoration: underline;
}

/* Address is stored reversed in the markup and flipped back for display, so the
   readable form never appears in the page source. */
.legal__email-fallback {
  direction: rtl;
  unicode-bidi: bidi-override;
}

.legal__note {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

/* ---------- Entrance ---------- */

.reveal {
  animation: reveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal--1 { animation-delay: 0.05s; }
.reveal--2 { animation-delay: 0.18s; }
.reveal--3 { animation-delay: 0.31s; }
.reveal--4 { animation-delay: 0.44s; }

@keyframes reveal {
  from { opacity: 0; translate: 0 16px; }
  to   { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
