/* ════════════════════════════════════════════════════════
   CODESCAPE — SHARED DESIGN SYSTEM
   Common styles used across all pages
   ════════════════════════════════════════════════════════ */

:root {
  /* Core palette */
  --bg-deep:     #0a0a0c;
  --bg-primary:  #111114;
  --bg-card:     #16161a;
  --bg-elevated: #1c1c22;
  --bg-hover:    #222230;

  /* Text */
  --text-primary:   #f0f0f5;
  --text-secondary: #8888a0;
  --text-dim:       #555568;

  /* Accent — electric blue to cyan */
  --accent:        #00d4ff;
  --accent-dim:    #0088aa;
  --accent-glow:   rgba(0, 212, 255, 0.15);
  --accent-glow-s: rgba(0, 212, 255, 0.35);

  /* Secondary accent — violet */
  --accent2:       #8b5cf6;
  --accent2-dim:   #6d3fcc;
  --accent2-glow:  rgba(139, 92, 246, 0.15);

  /* Tertiary — green */
  --accent3:       #10b981;
  --accent3-glow:  rgba(16, 185, 129, 0.15);

  /* Borders */
  --border:       rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  /* Spacing */
  --section-pad: clamp(80px, 10vw, 140px);
  --side-pad:    clamp(24px, 5vw, 80px);

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { border: none; background: none; color: inherit; cursor: pointer; font: inherit; }

/* ─── SKIP TO CONTENT ─── */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 16px;
}

/* ─── SCROLL PROGRESS BAR ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 10001;
  width: 0%;
  transition: width 0.05s linear;
}

/* ─── NAV ─── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 var(--side-pad);
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 12, 0.7);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.logo-icon {
  color: var(--accent);
  font-size: 22px;
}
.logo-text { text-transform: lowercase; }
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active {
  color: var(--accent);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-cta {
  font-size: 13px;
  font-weight: 600;
  text-transform: lowercase;
  padding: 8px 20px;
  border: 1px solid var(--accent-dim);
  border-radius: 100px;
  color: var(--accent);
  transition: all 0.25s;
}
.nav-cta:hover {
  background: var(--accent);
  color: var(--bg-deep);
  box-shadow: 0 0 24px var(--accent-glow-s);
}

/* ─── HAMBURGER MENU ─── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  z-index: 1001;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.nav-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.95);
  backdrop-filter: blur(24px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  transition: opacity 0.3s;
}
.nav-mobile-overlay.visible {
  opacity: 1;
}
.nav-mobile-overlay a {
  font-size: 24px;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--text-secondary);
  transition: color 0.2s;
  letter-spacing: -0.01em;
}
.nav-mobile-overlay a:hover {
  color: var(--accent);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  padding: 12px 28px;
  border-radius: 100px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
  box-shadow: 0 0 32px var(--accent-glow);
}
.btn-primary:hover {
  box-shadow: 0 0 48px var(--accent-glow-s), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}
.btn-ghost {
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  border-color: var(--text-dim);
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}
.btn-large {
  padding: 16px 36px;
  font-size: 15px;
}
.btn-secondary {
  background: var(--accent2);
  color: #fff;
  box-shadow: 0 0 32px var(--accent2-glow);
}
.btn-secondary:hover {
  box-shadow: 0 0 48px rgba(139, 92, 246, 0.35), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

/* ─── SECTION COMMON ─── */
section {
  padding: var(--section-pad) var(--side-pad);
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 16px;
  padding: 6px 16px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 100px;
  background: rgba(0, 212, 255, 0.05);
}
.section-header h2 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.section-desc {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--text-secondary);
  font-size: 16px;
}
.accent { color: var(--accent); }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--accent-glow), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 48px var(--side-pad) 32px;
  max-width: 1400px;
  margin: 0 auto;
}
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}
.footer-copy {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 8px;
}
.footer-columns {
  display: flex;
  gap: 64px;
}
.footer-col h5 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  text-transform: lowercase;
  transition: color 0.2s;
  margin-bottom: 10px;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom span {
  font-size: 12px;
  color: var(--text-dim);
}
.footer-social {
  display: flex;
  gap: 16px;
}
.footer-social a {
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.2s;
}
.footer-social a:hover { color: var(--accent); }

/* ─── BACK TO TOP ─── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: all 0.3s;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.back-to-top:hover svg { stroke: var(--bg-deep); }
.back-to-top svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Reveal on scroll */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ─── PAGE HEADER (for sub-pages) ─── */
.page-header {
  padding: calc(64px + var(--section-pad)) var(--side-pad) var(--section-pad);
  text-align: center;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}
.page-header h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}
.page-header p {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── FOCUS STYLES ─── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile-overlay { display: flex; }
  .nav-cta { display: none; }
  .footer-columns { gap: 40px; }
}
@media (max-width: 600px) {
  .footer-inner { flex-direction: column; }
  .footer-columns { flex-wrap: wrap; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
