/* =====================================================
   AXEL GALINDO — Shared design system
   Used across index.html and all case study pages
   ===================================================== */

:root {
  --bg: #0a0a0b;
  --surface: #0f0f12;
  --elevated: #131316;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --ink: #ededed;
  --ink-muted: #a1a1a6;
  --ink-faint: #6b6b72;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; background: var(--bg); }

body {
  font-family: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: -0.01em;
}

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

/* Light section: flips the ink/border tokens so everything inside adapts.
   The light background itself is painted by dots.js on the canvas,
   with a soft gradient into the dark sections above and below. */
.section-light {
  color: #17171a;
  --ink: #17171a;
  --ink-muted: #4d4d55;
  --ink-faint: #85858e;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.18);
}
.section-light .btn-primary { background: #17171a; color: #f4f4f5; border-color: rgba(0, 0, 0, 0.85); }
.section-light .btn-primary:hover { background: #000; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.35); }
.section-light .btn-ghost:hover { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.3); }

.bg-noise {
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.035;
}

/* Hero orbs */
.orb { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform, opacity; }
.orb-violet { background: radial-gradient(circle, rgba(139, 92, 246, 0.55) 0%, transparent 70%); animation: drift-a 18s ease-in-out infinite alternate; }
.orb-cyan   { background: radial-gradient(circle, rgba(34, 211, 238, 0.4) 0%, transparent 70%);  animation: drift-b 22s ease-in-out infinite alternate; }
.orb-pink   { background: radial-gradient(circle, rgba(236, 72, 153, 0.28) 0%, transparent 70%); animation: drift-c 26s ease-in-out infinite alternate; }
.orb-navy   { background: radial-gradient(circle, rgba(0, 55, 142, 0.65) 0%, transparent 70%);   animation: drift-a 22s ease-in-out infinite alternate; }
.orb-brand-violet { background: radial-gradient(circle, rgba(121, 108, 249, 0.55) 0%, transparent 70%); animation: drift-b 24s ease-in-out infinite alternate; }
.orb-green  { background: radial-gradient(circle, rgba(100, 244, 149, 0.35) 0%, transparent 70%); animation: drift-c 20s ease-in-out infinite alternate; }

@keyframes drift-a { 0% { transform: translate(0, 0) scale(1); opacity: 0.9; } 100% { transform: translate(40px, -30px) scale(1.15); opacity: 0.7; } }
@keyframes drift-b { 0% { transform: translate(0, 0) scale(1); opacity: 0.7; } 100% { transform: translate(-60px, 40px) scale(1.2); opacity: 0.9; } }
@keyframes drift-c { 0% { transform: translate(0, 0) scale(1); opacity: 0.6; } 100% { transform: translate(30px, 30px) scale(0.9); opacity: 0.8; } }

/* Typography */
.font-display {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
}
.italic-serif {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 450;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  /* accent violet on every italic word site-wide; the hero keeps its
     .text-white utility, and inline color styles also take precedence */
  color: var(--accent);
}
.eyebrow {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.mono { font-family: 'JetBrains Mono', monospace; }

/* Status dot */
.status-dot {
  position: relative;
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
  animation: pulse-dot 2.2s ease-out infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Liquid glass surface: translucent panel that blurs and saturates whatever
   sits behind it (dots, orbs), with a specular top edge and soft depth. */
.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.008) 45%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03),
    0 20px 40px -24px rgba(0, 0, 0, 0.45);
  transition: border-color 250ms ease, box-shadow 250ms ease;
}
.glass:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 24px 48px -24px rgba(0, 0, 0, 0.6);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  transition: transform 200ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  white-space: nowrap;
}
.btn-primary { background: #ededed; color: #0a0a0b; border: 1px solid rgba(255, 255, 255, 0.9); }
.btn-primary:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 10px 30px -10px rgba(255, 255, 255, 0.25); }
.btn-ghost {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
  color: var(--ink);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.btn-ghost:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.24); }
.btn .arrow { transition: transform 250ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Nav */
/* Floating pill nav */
.nav-blur {
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  background: linear-gradient(180deg, rgba(58, 58, 60, 0.32) 0%, rgba(47, 47, 48, 0.36) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 32px -16px rgba(0, 0, 0, 0.45);
  transition: border-color 300ms ease, background 300ms ease, box-shadow 300ms ease;
}
.nav-blur.scrolled {
  background: linear-gradient(180deg, rgba(58, 58, 60, 0.45) 0%, rgba(47, 47, 48, 0.5) 100%);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 16px 40px -18px rgba(0, 0, 0, 0.6);
}
/* Adaptive nav over light sections: glass goes light, ink goes dark (toggled by ui.js) */
.nav-blur.over-light {
  background: linear-gradient(180deg, rgba(244, 244, 245, 0.5) 0%, rgba(244, 244, 245, 0.58) 100%);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 12px 32px -16px rgba(0, 0, 0, 0.25);
  color: #17171a;
}
.nav-blur.over-light .nav-link { color: #4d4d55; }
.nav-blur.over-light .nav-link:hover { color: #17171a; }
.nav-blur.over-light .nav-link::after { background: #17171a; }
.nav-blur.over-light .btn-ghost { color: #17171a; border-color: rgba(0, 0, 0, 0.2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }

/* Buttons inside the pill nav follow its rounded geometry */
.nav-blur .btn { border-radius: 999px; }

/* Mobile dropdown: browsers ignore nested backdrop-filters (the pill already
   has one), so the menu needs a near-opaque background to stay readable */
.nav-blur #mobileMenu {
  background: rgba(17, 17, 20, 0.97);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-link { position: relative; color: var(--ink-muted); font-size: 13.5px; transition: color 200ms ease; }
.nav-link:hover { color: var(--ink); }
.nav-link::after { content: ''; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0; background: var(--ink); transition: width 300ms ease; }
.nav-link:hover::after { width: 100%; }

/* Chips */
.chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.02);
}

/* Back to top floating button (injected by ui.js).
   Sits vertically centered on the right edge; hover reveals its label. */
.back-to-top {
  position: fixed;
  right: 40px; top: 50%;
  height: 44px; min-width: 44px;
  padding: 0 13px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(47, 47, 48, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ededed;
  cursor: pointer;
  z-index: 60;
  opacity: 0;
  transform: translateY(calc(-50% + 12px));
  pointer-events: none;
  transition: opacity 300ms ease, transform 300ms ease, background 200ms ease;
}
.back-to-top.visible { opacity: 1; transform: translateY(-50%); pointer-events: auto; }
.back-to-top:hover { background: rgba(70, 70, 72, 0.85); }
.back-to-top .btt-label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-size: 12px;
  font-weight: 500;
  transition: max-width 300ms ease, opacity 300ms ease, margin-left 300ms ease;
}
.back-to-top:hover .btt-label { max-width: 160px; opacity: 1; margin-left: 8px; }

/* On mobile the button sits near the bottom corner instead of mid-screen */
@media (max-width: 768px) {
  .back-to-top { top: auto; bottom: 28px; right: 20px; transform: translateY(12px); }
  .back-to-top.visible { transform: translateY(0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

.hero-stagger > * {
  opacity: 0; transform: translateY(16px);
  animation: hero-in 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.hero-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.hero-stagger > *:nth-child(3) { animation-delay: 0.35s; }
.hero-stagger > *:nth-child(4) { animation-delay: 0.5s; }
.hero-stagger > *:nth-child(5) { animation-delay: 0.65s; }
@keyframes hero-in { to { opacity: 1; transform: translateY(0); } }

/* Case study specific */
.case-hero-cover {
  aspect-ratio: 21 / 9;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.case-hero-cover::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mix-blend-mode: overlay;
  opacity: 0.4;
}

.screenshot-frame {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  /* colorful blobs standing in for the future screenshot... */
  background:
    radial-gradient(ellipse at 20% 25%, rgba(139, 92, 246, 0.5) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(34, 211, 238, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 55% 85%, rgba(236, 72, 153, 0.3) 0%, transparent 60%),
    linear-gradient(160deg, #101018 0%, #0c0c12 100%);
  aspect-ratio: 16 / 10;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
/* ...seen through frosted glass */
.screenshot-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
}
.screenshot-frame::after {
  content: attr(data-label);
  position: absolute;
  bottom: 16px; left: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: rgba(10, 10, 11, 0.7);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.screenshot-frame .placeholder-text {
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 11, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.metric-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.015);
}
.metric-card .metric-value {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.metric-card .metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 12px;
}

/* Color swatch (used in Helios design system section) */
.swatch {
  height: 88px;
  border-radius: 12px;
  border: 1px solid var(--border);
  position: relative;
}

/* Focus states */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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