/* ═════════════════════════════════════════════════════════════════
   24-public-polish.css  —  AI-glass + mobile polish for public pages
   ─────────────────────────────────────────────────────────────────
   Used on: landing.html, login.html
   Aesthetic: keeps the CRYS/T●L editorial off-white theme intact;
   adds subtle frosted-glass on key CTAs/cards, gold glow accents,
   smooth micro-animations, and mobile-first ≤480px refinements.

   Loads LAST (after each page's inline <style>) so it overrides only
   surface styling — never structure or color tokens.
   ═════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   1. AMBIENT GOLD GLOW BACKGROUND — soft, slow drift
   ───────────────────────────────────────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(45vmax 40vmax at 12% 18%, rgba(139,105,20,0.10), transparent 60%),
    radial-gradient(40vmax 36vmax at 88% 14%, rgba(122,120,112,0.10), transparent 62%),
    radial-gradient(48vmax 44vmax at 50% 95%, rgba(139,105,20,0.06), transparent 65%);
  animation: pp-drift 32s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes pp-drift {
  0%   { transform: translate3d(-1.5%, -1%, 0); }
  100% { transform: translate3d(2%, 2%, 0); }
}
/* canvas on landing should sit above ambient layer */
.canvas, nav, .hud, .hud-frame, main, footer { position: relative; z-index: 1; }

/* ─────────────────────────────────────────────────────────────────
   2. NAV — subtle frosted glass on scroll
   ───────────────────────────────────────────────────────────────── */
nav {
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(232, 228, 220, 0.78) !important;
}
nav.scrolled {
  background: rgba(232, 228, 220, 0.92) !important;
  box-shadow: 0 4px 24px rgba(26,25,22,0.10),
              0 0 0 1px rgba(139,105,20,0.08) !important;
}

/* ─────────────────────────────────────────────────────────────────
   3. CARDS / CTA BANDS — gentle glass + gold halo
   ───────────────────────────────────────────────────────────────── */
.advisor-card,
.feat-row,
.cta-band,
.login-card,
.lp-specs,
.chat-live {
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  backdrop-filter: blur(10px) saturate(130%);
  border-radius: 6px;
  transition: box-shadow 280ms ease, border-color 280ms ease, transform 280ms ease;
}
.advisor-card:hover,
.cta-band:hover {
  box-shadow: 0 0 0 1px rgba(139,105,20,0.22),
              0 18px 48px rgba(139,105,20,0.10),
              0 6px 18px rgba(26,25,22,0.08);
}

/* Pricing/CTA buttons — sharper hover */
.btn-blk,
.btn-ghost-ink,
.price-btn,
.google-btn {
  transition: transform 180ms ease, box-shadow 220ms ease, filter 180ms ease;
  cursor: pointer;
}
.btn-blk:hover,
.price-btn:hover,
.google-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(139,105,20,0.32),
              0 10px 28px rgba(139,105,20,0.18),
              0 4px 10px rgba(26,25,22,0.10);
}
.btn-blk:active,
.price-btn:active,
.google-btn:active { transform: translateY(0); }

/* Inputs — gold focus ring */
input,
select,
textarea,
.input {
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
input:focus,
select:focus,
textarea:focus,
.input:focus {
  outline: none !important;
  border-color: var(--gold, #8B6914) !important;
  box-shadow: 0 0 0 3px rgba(139,105,20,0.16),
              0 0 16px rgba(139,105,20,0.10) !important;
}

/* ─────────────────────────────────────────────────────────────────
   4. HEADLINE GOLD SHEEN — premium feel on hero text
   ───────────────────────────────────────────────────────────────── */
.lp-headline em,
.cta-title em {
  background: linear-gradient(135deg, #8B6914 0%, #C4993B 60%, #8B6914 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 12px rgba(139,105,20,0.18));
}

/* ─────────────────────────────────────────────────────────────────
   5. FOCUS RING (a11y)
   ───────────────────────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--gold, #8B6914) !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────────────
   6. MOBILE  ≤480px  — comfort + safe areas + condensed editorial
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Hide HUD chrome on small screens */
  .hud, .hud-frame { display: none !important; }

  /* Tighter page paddings */
  .canvas { padding: 0 !important; }
  body { font-size: 16px; }

  /* Nav: condensed, scrollable links */
  nav { height: auto !important; }
  .nav-inner {
    height: auto !important;
    flex-wrap: wrap;
    padding: 8px 12px;
  }
  .nav-brand {
    padding: 0 10px 0 0 !important;
    border-right: none !important;
  }
  .nav-name { font-size: 0.95rem !important; }
  .nav-sub { display: none !important; }
  .nav-links {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1 1 100%;
    margin-top: 6px;
    border-top: 1px solid rgba(26,25,22,0.08);
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links li { border-right: none !important; flex-shrink: 0; }
  .nav-links a {
    padding: 12px 10px !important;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Touch targets everywhere */
  button,
  .btn-blk,
  .btn-ghost-ink,
  .price-btn,
  .google-btn,
  .lang-b,
  .mode-btn,
  .btab,
  a[href] {
    min-height: 44px;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  /* Stack any 2-col grids → 1-col */
  .ai-grid,
  .cta-band,
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .feat-table { font-size: 0.85rem !important; }
  .feat-row { padding: 14px 12px !important; }

  /* Bigger headlines feel right on phone */
  .lp-headline { font-size: clamp(2.5rem, 12vw, 4rem) !important; }

  /* Bottom tabs (if used as mobile nav) — full-width, glass */
  .bottom-tabs {
    background: rgba(232, 228, 220, 0.92) !important;
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    border-top: 1px solid rgba(139,105,20,0.18) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  /* === LOGIN page ≤480px — split panel becomes single column === */
  .canvas {
    grid-template-columns: 1fr !important;
    box-shadow: none !important;
    max-width: 100% !important;
  }
  .lp {
    padding: 24px 18px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(26,25,22,0.18);
  }
  .lp-headline { margin-bottom: 14px !important; }
  .lp-desc { margin-bottom: 22px !important; }
  .lp-quote { font-size: 0.85rem !important; }
  .rp {
    padding: 36px 18px 24px !important;
  }
  .rp-header { padding: 10px 14px !important; }

  /* Login card — full-width with gentle glass */
  .login-card {
    width: 100% !important;
    padding: 18px !important;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 0 0 1px rgba(139,105,20,0.18),
                0 14px 40px rgba(26,25,22,0.10);
  }

  /* Inputs comfortable + iOS-zoom safe */
  input, .input, select {
    font-size: 16px !important;
    min-height: 44px !important;
    padding: 12px 14px !important;
  }

  /* Reduce ambient drift cost on phones */
  body::before { animation-duration: 50s; opacity: 0.85; }
}

/* ─────────────────────────────────────────────────────────────────
   7. TABLET 481–768px  — keep split layout but add comfort
   ───────────────────────────────────────────────────────────────── */
@media (min-width: 481px) and (max-width: 768px) {
  .canvas {
    grid-template-columns: 1fr !important;
  }
  .lp { padding: 32px !important; border-right: none !important; }
  .rp { padding: 32px !important; }
}

/* ─────────────────────────────────────────────────────────────────
   8. REDUCED MOTION
   ───────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─────────────────────────────────────────────────────────────────
   9. PERFORMANCE FALLBACK — no backdrop-filter support
   ───────────────────────────────────────────────────────────────── */
@supports not (backdrop-filter: blur(8px)) {
  nav, .advisor-card, .feat-row, .cta-band, .login-card, .bottom-tabs {
    background: rgba(232, 228, 220, 0.96) !important;
  }
}
