/* ============================================================
 * Vilkax landing — style.css (Pass 59)
 * ============================================================
 *
 * Aligns the landing page with the canonical Vilkax ecosystem
 * brand:
 *
 *   - Background      → brand ink #0B1426 (matches mobile-app
 *                       authority ground and dashboard --vk-bg)
 *   - Accent          → Vilkax Blue #2563EB (matches
 *                       brand-tokens.json primary, dashboard
 *                       primary, mobile app's VilkaxColors.primary)
 *   - Brand mark      → the real PNG (assets/logos/
 *                       vilkax-mark-full-color.png)
 *   - Atmosphere      → subtle radial brand-blue glow + a faint
 *                       geometric wolf outline behind everything
 *   - Form card       → frosted-glass with backdrop-filter blur
 *   - Typography      → Manrope (brand font)
 *
 * The previous landing's #000000 + #00F2FF neon was bespoke to
 * this page; Pass 59 brings it into the same visual family as
 * the rest of the Vilkax surfaces.
 */

:root {
  /* ── Brand tokens (mirrors packages/brand-tokens/tokens.json) ── */
  --bg-ink:        #0B1426;
  --bg-ink-deep:   #060A14;
  --bg-surface:    rgba(255, 255, 255, 0.025);
  --bg-card:       rgba(15, 23, 42, 0.55);

  --brand-primary:        #2563EB;
  --brand-primary-hover:  #1D4ED8;
  --brand-primary-bright: #3B82F6;
  --brand-accent-soft:    rgba(37, 99, 235, 0.18);
  --brand-accent-glow:    rgba(37, 99, 235, 0.45);

  --text-strong:   #FFFFFF;
  --text-default:  #E2E8F0;
  --text-muted:    #A5B4CD;
  --text-dim:      #94A3B8;

  --border-subtle: rgba(165, 180, 205, 0.10);
  --border-strong: rgba(165, 180, 205, 0.20);

  --font-brand: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Runtime — JS updates this on scroll for the eye-glow effect. */
  --eye-glow: 0.10;
}

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

html {
  background: var(--bg-ink);
}

body {
  min-height: 100vh;
  /* Subtle depth gradient — brand ink at the top, slightly deeper
   * at the bottom. Adds dimension without disturbing minimalism. */
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
    radial-gradient(ellipse 90% 50% at 50% 100%, rgba(37, 99, 235, 0.04), transparent 60%),
    linear-gradient(180deg, var(--bg-ink) 0%, var(--bg-ink-deep) 100%);
  background-attachment: fixed;
  color: var(--text-default);
  font-family: var(--font-brand);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Atmosphere — radial glow + faint geometric wolf behind UI ── */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.atmosphere-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.atmosphere-glow-top {
  top: -30vh;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 1100px;
  height: 70vh;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.35), transparent 70%);
}
.atmosphere-glow-bottom {
  bottom: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 70vw;
  max-width: 800px;
  height: 40vh;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 70%);
}
.atmosphere-wolf {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(110vmin, 1100px);
  height: min(110vmin, 1100px);
  color: var(--brand-primary);
  opacity: 0.05;
  /* The eye sits inside this SVG; JS will ramp #wolf-eye opacity
   * separately on scroll. */
}

#wolf-eye {
  opacity: var(--eye-glow);
  transform-box: fill-box;
  transform-origin: center;
  animation: heartbeat 1.6s ease-in-out infinite;
  filter:
    drop-shadow(0 0 14px rgba(59, 130, 246, 0.75))
    drop-shadow(0 0 28px rgba(37, 99, 235, 0.40));
}

@keyframes heartbeat {
  0%   { transform: scale(1.00); }
  8%   { transform: scale(1.22); }
  16%  { transform: scale(1.00); }
  26%  { transform: scale(1.14); }
  34%  { transform: scale(1.00); }
  100% { transform: scale(1.00); }
}

/* ── Skip-link (WCAG 2.4.1) ────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--brand-primary);
  color: var(--text-strong);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 6px;
  transition: top 120ms ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 16px;
  outline: 2px solid var(--text-strong);
  outline-offset: 2px;
}

/* ── Hero composition ──────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  padding-block: clamp(24px, 5vh, 56px);
  padding-inline: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vh, 40px);
  text-align: center;
  outline: none;
}

.hero-entrance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 2vh, 18px);
  opacity: 0;
  transform: translateY(12px);
  animation: heroEntranceFade 1000ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms forwards;
}

@keyframes heroEntranceFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Brand mark (the real ecosystem PNG) ──────────────────────── */

.brand-mark {
  display: block;
  width: clamp(140px, 22vmin, 260px);
  height: auto;
  filter: drop-shadow(0 8px 32px rgba(37, 99, 235, 0.25));
  /* Subtle 4s breathing — disabled in reduced-motion. */
  animation: brandBreathe 4.5s ease-in-out infinite;
}
.brand-mark img {
  width: 100%;
  height: auto;
  display: block;
}
@keyframes brandBreathe {
  0%, 100% { transform: scale(1.000); }
  50%      { transform: scale(1.018); }
}

/* ── Wordmark (kinetic per-letter reveal) ─────────────────────── */

.logo-text {
  margin: 0;
  font-weight: 800;
  font-size: clamp(38px, 6.5vw, 84px);
  letter-spacing: 0.36em;
  padding-left: 0.36em;
  color: var(--text-strong);
  text-shadow:
    0 0 24px rgba(37, 99, 235, 0.20),
    0 0 64px rgba(37, 99, 235, 0.08);
}

.kt-line { display: inline-block; }
.kt-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  animation: ktReveal 700ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--kt-i, 0) * 90ms + 350ms);
}
/* The trailing X is the brand-accent letter — picks up the same
 * Vilkax Blue used everywhere else in the ecosystem. */
.kt-char.accent {
  color: var(--brand-primary-bright);
  text-shadow:
    0 0 28px rgba(59, 130, 246, 0.55),
    0 0 56px rgba(37, 99, 235, 0.22);
}
@keyframes ktReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Tagline ──────────────────────────────────────────────────── */

.tagline {
  margin: 0;
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: lowercase;
}
.kt-tagline {
  opacity: 0;
  animation: ktFade 800ms ease-out 1100ms forwards;
}
.kt-dots {
  display: inline-block;
  opacity: 0;
  animation: ktBreath 2.6s ease-in-out 1500ms infinite;
}
@keyframes ktFade   { to { opacity: 1; } }
@keyframes ktBreath {
  0%, 100% { opacity: 0.30; }
  50%      { opacity: 0.95; }
}

/* ── CTA — frosted-glass card with the form inside ────────────── */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cta {
  width: min(460px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  opacity: 0;
  animation: ktFade 1100ms ease-out 1400ms forwards;
}

.cta-glass {
  padding: 18px;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Mode toggle — segmented control. */
.mode-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px;
  position: relative;
}
.mode-tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 9px 14px;
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 999px;
  transition: color 200ms ease, background 200ms ease;
}
.mode-tab.is-active {
  background: var(--brand-accent-soft);
  color: var(--brand-primary-bright);
  box-shadow:
    inset 0 0 0 1px rgba(59, 130, 246, 0.35),
    0 0 16px rgba(37, 99, 235, 0.12);
}
.mode-tab:hover { color: var(--text-strong); }

/* Form. */
.register-form {
  display: flex;
  gap: 8px;
  position: relative;
}

#email {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-strong);
  font-family: var(--font-brand);
  font-size: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
#email::placeholder { color: var(--text-dim); }
#email:hover { background: rgba(255, 255, 255, 0.055); }
#email:focus,
#email:focus-visible {
  border-color: var(--brand-primary-bright);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.submit-btn {
  position: relative;
  background: linear-gradient(135deg, var(--brand-primary-bright) 0%, var(--brand-primary) 100%);
  color: var(--text-strong);
  border: 0;
  padding: 13px 22px;
  border-radius: 12px;
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 180ms ease, filter 180ms ease;
  box-shadow:
    0 8px 24px rgba(37, 99, 235, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 36px rgba(37, 99, 235, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
  filter: brightness(1.06);
}
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.submit-btn .submit-spinner {
  display: none;
  width: 14px; height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--text-strong);
  border-radius: 50%;
  vertical-align: middle;
  animation: spin 700ms linear infinite;
}
.submit-btn.is-loading .submit-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.hook {
  margin: 4px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}
.hook strong {
  color: var(--text-strong);
  font-weight: 600;
}

.form-status {
  margin: 0;
  min-height: 1.4em;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--text-muted);
}
.form-status.is-success { color: var(--brand-primary-bright); }
.form-status.is-error   { color: #ff8a8a; }

/* ── Footer — invisible until hover, scroll, or focus ──────────── */

.footer {
  position: fixed;
  inset: auto 0 0 0;
  padding: 16px 24px env(safe-area-inset-bottom, 16px);
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 360ms ease;
  z-index: 10;
}

.footer.is-revealed,
.footer:hover,
.footer:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.footer-links {
  display: flex;
  gap: clamp(16px, 4vw, 48px);
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 180ms ease, border-color 180ms ease;
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--brand-primary-bright);
  border-color: var(--brand-primary-bright);
  outline: none;
}

.footer-mark {
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.18em;
}

/* ── 404 fallback link ─────────────────────────────────────────── */

.fallback-action { margin: 8px 0 0; }
.fallback-link {
  color: rgba(59, 130, 246, 0.85);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid rgba(37, 99, 235, 0.35);
  padding-bottom: 2px;
}
.fallback-link:hover,
.fallback-link:focus-visible {
  color: var(--brand-primary-bright);
  border-color: var(--brand-primary-bright);
}

.noscript-note {
  margin-top: 16px;
  opacity: 0.5;
}

/* ── Universal focus-visible ──────────────────────────────────── */

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 2px solid var(--brand-primary-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Reduced motion (WCAG 2.3.3) ──────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .atmosphere-wolf,
  #wolf-eye,
  .brand-mark,
  .hero-entrance,
  .kt-char,
  .kt-tagline,
  .kt-dots,
  .cta,
  .submit-spinner,
  .footer-link,
  .skip-link,
  .footer {
    animation: none !important;
    transition: none !important;
  }
  .brand-mark   { transform: none; }
  .hero-entrance{ opacity: 1; transform: none; }
  .kt-char      { opacity: 1; transform: none; }
  .kt-tagline   { opacity: 1; }
  .kt-dots      { opacity: 0.6; }
  .cta          { opacity: 1; }
}

/* ── Forced colors (Windows HCM) ──────────────────────────────── */

@media (forced-colors: active) {
  .skip-link    { background: Highlight; color: HighlightText; }
  .footer-link  { color: LinkText; }
  .footer-link:hover { color: Highlight; }
  a:focus-visible { outline: 2px solid Highlight; }
  .cta-glass    { border-color: CanvasText; background: Canvas; }
  .submit-btn   { background: Highlight; color: HighlightText; }
}

/* ── Phone (≤ 480px) — single-viewport fit ────────────────────── */

@media (max-width: 480px) {
  .hero { gap: 16px; padding-block: 20px; }
  .hero-entrance { gap: 8px; }
  .brand-mark { width: clamp(112px, 32vw, 180px); }
  .logo-text { letter-spacing: 0.28em; padding-left: 0.28em; font-size: clamp(30px, 8.5vw, 50px); }
  .tagline   { font-size: 11.5px; }
  .cta       { gap: 10px; }
  .cta-glass { padding: 14px; }
  .hook      { font-size: 10.5px; }
}

/* ── Squat viewport (landscape phone, short laptop) ───────────── */

@media (max-height: 640px) {
  .hero { padding-block: 14px; gap: 12px; }
  .hero-entrance { gap: 6px; }
  .brand-mark { width: clamp(96px, 20vh, 140px); }
  .logo-text  { font-size: clamp(26px, 4vw, 42px); }
  .tagline    { font-size: 11px; }
  .atmosphere-glow-top { height: 50vh; }
}
