/* ==========================================================================
   IlmCore AI — Shared Design System
   Design tokens:
     Background : #060812 -> #0b0f1e (deep space navy)
     Blue        : #3b82f6 / #5b8cff
     Purple      : #8b5cf6 / #a855f7
     Indigo glow : #6366f1
     Glass       : rgba(255,255,255,0.05) + blur(20px)
     Display type: 'Space Grotesk'   Body: 'Inter'   Mono: 'JetBrains Mono'
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-0: #05070d;
  --bg-1: #0a0e1a;
  --bg-2: #0f1424;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.12);
  --blue: #3b82f6;
  --blue-soft: #5b8cff;
  --purple: #8b5cf6;
  --purple-soft: #a855f7;
  --indigo: #6366f1;
  --text-hi: #eef1f8;
  --text-mid: #aab2c8;
  --text-low: #6b7390;
  --danger: #f16565;
  --success: #4ade80;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-glow: 0 8px 40px rgba(99, 102, 241, 0.25);
}

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

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #141a30 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  color: var(--text-hi);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(139, 92, 246, 0.35); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; color: inherit; }

/* ---------- Animated background canvas layers ---------- */
#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(45% 35% at 20% 20%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(40% 30% at 80% 15%, rgba(168, 85, 247, 0.18), transparent 60%),
    radial-gradient(50% 40% at 50% 90%, rgba(59, 130, 246, 0.16), transparent 60%);
  filter: blur(60px);
  animation: auroraDrift 22s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
  0%   { transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(2%, 3%, 0) rotate(3deg) scale(1.06); }
  100% { transform: translate3d(-3%, 1%, 0) rotate(-2deg) scale(1.02); }
}

.wave-layer {
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 120%;
  height: 60%;
  background: linear-gradient(120deg, rgba(59,130,246,0.08), rgba(139,92,246,0.1), rgba(99,102,241,0.06));
  filter: blur(40px);
  border-radius: 50%;
  animation: waveMove 18s ease-in-out infinite alternate;
}

@keyframes waveMove {
  0%   { transform: translateX(-5%) scaleY(1); }
  100% { transform: translateX(5%) scaleY(1.15); }
}

canvas#stars-canvas,
canvas#bubbles-canvas,
canvas#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Mouse ripple */
.ripple {
  position: fixed;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(139,92,246,0.55), rgba(99,102,241,0.15) 60%, transparent 70%);
  animation: rippleOut 900ms var(--ease) forwards;
}

@keyframes rippleOut {
  0%   { width: 8px; height: 8px; opacity: 0.9; filter: blur(0px); }
  100% { width: 260px; height: 260px; opacity: 0; filter: blur(2px); }
}

/* ---------- Glass surfaces ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}

.glass-reflection {
  position: relative;
  overflow: hidden;
}
.glass-reflection::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -20%;
  width: 60%;
  height: 220%;
  background: linear-gradient(115deg, rgba(255,255,255,0.14), transparent 40%);
  transform: rotate(8deg);
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), background 220ms var(--ease), border-color 220ms var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-soft), var(--purple));
  color: #fff;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(99, 102, 241, 0.55); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-hi);
}
.btn-ghost:hover { background: var(--glass-strong); border-color: rgba(139,92,246,0.4); transform: translateY(-1px); }

.btn-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-mid);
  transition: all 200ms var(--ease);
}
.btn-icon:hover { color: var(--text-hi); background: var(--glass-strong); transform: translateY(-1px); }

.btn-block { width: 100%; }

/* click ripple inside buttons */
.click-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: clickRipple 600ms ease-out forwards;
  pointer-events: none;
}
@keyframes clickRipple {
  to { transform: scale(3); opacity: 0; }
}

/* ---------- Form fields ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 0.02em;
}
.field-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease);
}
.field-input-wrap:focus-within {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
  background: rgba(255,255,255,0.06);
}
.field-input-wrap svg { flex-shrink: 0; color: var(--text-low); width: 18px; height: 18px; }
.field-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 13px 0;
  font-size: 15px;
  color: var(--text-hi);
}
.field-input-wrap input::placeholder { color: var(--text-low); }
.field-toggle {
  color: var(--text-low);
  display: flex;
  align-items: center;
  transition: color 180ms var(--ease);
}
.field-toggle:hover { color: var(--text-mid); }
.field-error {
  font-size: 12.5px;
  color: var(--danger);
  min-height: 16px;
  display: none;
}
.field.has-error .field-input-wrap { border-color: rgba(241, 101, 101, 0.6); }
.field.has-error .field-error { display: block; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.muted { color: var(--text-mid); }
.divider-text {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-low);
  font-size: 13px;
  margin: 22px 0;
}
.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

/* ---------- Google button ---------- */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-hi);
  font-weight: 600;
  font-size: 14.5px;
  transition: all 200ms var(--ease);
}
.btn-google:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.btn-google img { width: 18px; height: 18px; }

/* ---------- Toast ---------- */
#toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 13px 18px;
  border-radius: var(--radius-md);
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  animation: toastIn 320ms var(--ease);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.leaving { animation: toastOut 260ms var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px);} to { opacity: 1; transform: translateX(0);} }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px);} }

/* ---------- Landing page (index.html) ---------- */
.landing {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 64px);
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.brand img { width: 38px; height: 38px; filter: drop-shadow(0 0 12px rgba(99,102,241,0.6)); }
.nav-actions { display: flex; gap: 12px; }

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px 80px;
  position: relative;
}

.hero-orb {
  width: 120px; height: 120px;
  margin-bottom: 28px;
  filter: drop-shadow(0 0 40px rgba(99,102,241,0.55));
  animation: orbFloat 5s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.03); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 26px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); animation: pulseDot 1.6s ease-in-out infinite; }
@keyframes pulseDot { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 6.5vw, 76px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 900px;
  background: linear-gradient(135deg, #fff 20%, #c7cdf5 55%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin-top: 22px;
  font-size: clamp(15px, 2vw, 19px);
  color: var(--text-mid);
  max-width: 620px;
  line-height: 1.6;
}
.hero-actions {
  margin-top: 38px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-actions .btn { padding: 15px 30px; font-size: 16px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 70px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}
.feature-card {
  padding: 26px 24px;
  border-radius: var(--radius-lg);
  text-align: left;
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-glow); }
.feature-card .icon-wrap {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(139,92,246,0.25));
  margin-bottom: 14px;
  color: var(--blue-soft);
}
.feature-card h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-mid); line-height: 1.55; }

.landing-footer {
  text-align: center;
  padding: 26px;
  color: var(--text-low);
  font-size: 13px;
  position: relative;
  z-index: 2;
}

@media (max-width: 860px) {
  .feature-grid { grid-template-columns: 1fr; max-width: 460px; }
}
@media (max-width: 560px) {
  .nav-actions .btn span { display: none; }
  .hero-actions { flex-direction: column; width: 100%; max-width: 320px; }
}

/* ---------- Page transition ---------- */
.page-fade { animation: pageFadeIn 520ms var(--ease); }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }

.page-leaving { animation: pageFadeOut 320ms var(--ease) forwards; }
@keyframes pageFadeOut { to { opacity: 0; transform: translateY(-8px); } }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
