/* =========================================================
   DEV NOCTIS — Design Tokens & Components
   Palette: Navy #0F172A / Blue #2563EB / White #F8FAFC
   Display: Space Grotesk | Body: Inter | Mono: JetBrains Mono
   ========================================================= */

:root {
  --bg: #0F172A;
  --bg-elevated: #141E33;
  --bg-elevated-2: #182444;
  --border: rgba(248, 250, 252, 0.09);
  --border-strong: rgba(248, 250, 252, 0.16);
  --accent: #2563EB;
  --accent-light: #3B82F6;
  --accent-glow: #60A5FA;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --text-faint: #64748B;
  --whatsapp: #25D366;
}

* { scroll-behavior: smooth; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.font-display { font-family: 'Space Grotesk', 'Inter', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

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

/* ---------- Background texture ---------- */
.grid-glow {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.16), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(96, 165, 250, 0.10), transparent 40%),
    linear-gradient(rgba(248,250,252,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248,250,252,0.035) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
}

/* ---------- Nav ---------- */
.nav-blur {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav-blur.scrolled {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.92);
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  transition: color .2s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent-light);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--accent);
  color: #fff;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
  box-shadow: 0 8px 24px -8px rgba(37, 99, 235, 0.55);
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(37, 99, 235, 0.65);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: border-color .2s ease, background .2s ease;
}
.btn-ghost:hover {
  border-color: var(--accent-glow);
  background: rgba(37, 99, 235, 0.08);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.card:hover {
  border-color: rgba(96, 165, 250, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(37, 99, 235, 0.35);
}

/* ---------- Terminal signature component ---------- */
.terminal {
  background: linear-gradient(180deg, #101A33, #0C1428);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,0.6), 0 0 0 1px rgba(37,99,235,0.06);
  overflow: hidden;
}
.terminal-bar {
  background: rgba(248,250,252,0.03);
  border-bottom: 1px solid var(--border);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }

.type-cursor::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent-glow);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.typing-line {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid transparent;
}

/* ---------- Eyebrow / tag ---------- */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--accent-glow);
}
.eyebrow::before { content: "// "; color: var(--text-faint); }

/* ---------- Floating WhatsApp button ---------- */
.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--whatsapp);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -8px rgba(37, 211, 102, 0.55);
  transition: transform .2s ease;
}
.wa-float:hover { transform: scale(1.08); }
.wa-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--whatsapp);
  opacity: 0.55;
  animation: waPulse 2.2s ease-out infinite;
}
@keyframes waPulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- Sticky consultation bar (mobile) ---------- */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-strong);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Browser chrome frame for portfolio ---------- */
.browser-frame {
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.browser-chrome {
  background: rgba(248,250,252,0.04);
  border-bottom: 1px solid var(--border);
}

/* ---------- Utility ---------- */
.text-gradient {
  background: linear-gradient(90deg, #60A5FA, #2563EB);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1E2A47; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-glow);
  outline-offset: 2px;
}
