/* ============================================================
   KELLY LAB — SHARED DESIGN SYSTEM
   css/shared.css
   ============================================================ */

/* ── CSS CUSTOM PROPERTIES ──────────────────────────────── */
:root {
  --bg-void:        #07090D;
  --bg-deep:        #0A0D14;
  --bg-surface:     #0E1420;
  --bg-light:       #F2F4F8;
  --blue-midnight:  #0D1B2A;
  --blue-core:      #1A5FFF;
  --blue-electric:  #2979FF;
  --cyan-glow:      #00D4FF;
  --cyan-soft:      #7ECFEA;
  --text-primary:   #F0F4FC;
  --text-secondary: #A8BAD4;
  --text-muted:     #6B7E99;
  --text-dark:      #0A0D14;
  --border-subtle:  rgba(26, 95, 255, 0.15);
  --border-glow:    rgba(0, 212, 255, 0.3);
  --font-display:   'Google Sans', sans-serif;
  --font-body:      'DM Sans', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:    cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
}

/* ── CUSTOM CURSOR ──────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--cyan-glow);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s var(--ease-out-expo), width 0.3s, height 0.3s, border-color 0.3s;
}

body:has(a:hover) .cursor-ring,
body:has(button:hover) .cursor-ring {
  width: 56px;
  height: 56px;
  border-color: rgba(0, 212, 255, 0.7);
}

/* ── NAVIGATION ─────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s var(--ease-in-out), padding 0.4s var(--ease-in-out), backdrop-filter 0.4s;
}

nav.scrolled {
  background: rgba(7, 9, 13, 0.92);
  backdrop-filter: blur(20px);
  padding: 1rem 4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2.5rem);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.25s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--cyan-glow);
  transition: width 0.3s var(--ease-out-expo);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); }

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-cta {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg-void);
  background: var(--cyan-glow);
  border: none;
  padding: 0.6rem 1.5rem;
  text-decoration: none;
  transition: background 0.25s, box-shadow 0.25s, transform 0.2s;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.nav-cta:hover {
  background: #fff;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.5);
  transform: translateY(-1px);
}

/* ── MOBILE NAV ─────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text-secondary);
  transition: all 0.3s;
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 13, 0.98);
  backdrop-filter: blur(30px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.25s;
}

.mobile-menu a:hover { color: var(--cyan-glow); }

/* ── PAGE HERO (inner pages) ────────────────────────────── */
.page-hero {
  position: relative;
  padding: 10rem 4rem 6rem;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 80% 30%, rgba(26, 95, 255, 0.1), transparent),
    radial-gradient(ellipse 40% 50% at 10% 80%, rgba(0, 212, 255, 0.06), transparent);
  pointer-events: none;
}

.page-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 95, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 95, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 4rem;
  right: 4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
}

.page-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan-glow);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s var(--ease-out-expo) 0.2s forwards;
}

.page-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--cyan-glow);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.8s var(--ease-out-expo) 0.35s forwards;
}

.page-title .accent {
  background: linear-gradient(90deg, var(--blue-electric), var(--cyan-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.85;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.8s var(--ease-out-expo) 0.5s forwards;
}

/* ── SHARED UTILITIES ───────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan-glow);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--cyan-glow);
}

.section-label.dark { color: var(--blue-core); }
.section-label.dark::before { background: var(--blue-core); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg-void);
  background: linear-gradient(90deg, var(--blue-electric), var(--cyan-glow));
  padding: 0.85rem 2rem;
  text-decoration: none;
  transition: box-shadow 0.3s, transform 0.2s;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}

.btn-primary:hover {
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
}

.btn-primary svg { transition: transform 0.3s var(--ease-out-expo); }
.btn-primary:hover svg { transform: translateX(4px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 2rem;
  text-decoration: none;
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-glow);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

/* ── FOOTER ─────────────────────────────────────────────── */
footer {
  padding: 3rem 4rem;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.25s;
}

.footer-links a:hover { color: var(--text-primary); }

.footer-legal {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: right;
}

.footer-disclaimer {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 900px;
}

.footer-bottom {
  grid-column: 1 / -1;
  padding-top: 1rem;
  display: flex;
  justify-content: flex-start;
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-legal-links a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.25s;
}

.footer-legal-links a:hover { color: var(--cyan-glow); }

/* ── SCROLL REVEAL ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

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

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  footer { grid-template-columns: 1fr; text-align: center; }
  .footer-legal { text-align: center; }
  .footer-links { flex-wrap: wrap; }
  .footer-bottom { justify-content: center; }
}

@media (max-width: 768px) {
  nav { padding: 1.25rem 2rem; }
  nav.scrolled { padding: 0.875rem 2rem; }
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
  .page-hero, section, footer { padding-left: 1.5rem; padding-right: 1.5rem; }
  footer { padding: 2rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .cursor, .cursor-ring { display: none; }
  body { cursor: auto; }
}
