:root {
  --bg-base: #06070a;
  --bg-card: rgba(12, 16, 26, 0.42);
  --bg-card-hover: rgba(16, 22, 34, 0.58);
  --bg-surface: rgba(14, 18, 30, 0.48);
  --border: transparent;
  --border-hover: transparent;
  --line-subtle: rgba(255, 255, 255, 0.08);
  --line-hover: rgba(255, 255, 255, 0.18);
  --border-focus: #38bdf8;
  --text-main: #f8fafc;
  --text-primary: #f8fafc;
  --text-sub: #94a3b8;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-glow: rgba(56, 189, 248, 0.25);
  --emerald: #10b981;
  --accent-emerald: #10b981;
  --amber: #f59e0b;
  --accent-amber: #f59e0b;
  --rose: #f43f5e;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: var(--font-main);
  --font-display: var(--font-main);
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#paintCanvas {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  filter: blur(65px);
  opacity: 0.95;
  transform: translateZ(0);
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.88;
  transform: translateZ(0);
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.026;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
  width: 100%;
}

section {
  padding: 80px 0;
  position: relative;
}

section[id] {
  scroll-margin-top: 84px;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 44px;
}

.section-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.25;
}

.section-desc {
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.6;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section,
.page-hero {
  padding: 84px 0 64px;
  text-align: center;
  position: relative;
}

.hero-title,
.page-hero h1 {
  font-size: clamp(34px, 5.2vw, 56px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: #fff;
  max-width: 860px;
  margin: 0 auto 20px;
  animation: heroFadeUp 0.75s var(--ease-out-expo);
}

.accent-text,
.gradient-text {
  color: var(--accent);
}

.hero-desc,
.page-hero p {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--text-sub);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.62;
  animation: heroFadeUp 0.8s var(--ease-out-expo);
}

/* Sticky Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(6, 7, 10, 0.72) 0, rgba(6, 7, 10, 0.16) 75%, transparent 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: none;
  transition: background 0.35s var(--ease-out-expo), backdrop-filter 0.35s ease, box-shadow 0.35s ease;
}

header.site-header.scrolled {
  background: rgba(6, 7, 11, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: none;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.8), 0 1px 0 0 rgba(56, 189, 248, 0.25);
}

header.site-header .container {
  max-width: 1320px;
  padding: 0 28px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand span {
  white-space: nowrap;
}

.brand-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease-out-expo);
}

.brand:hover .brand-icon {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.18);
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-menu li {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-sub);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  transition: color 0.15s ease;
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: all 0.25s var(--ease-out-expo);
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-link:hover {
  color: #fff;
}

.nav-link.active {
  color: var(--accent);
  font-weight: 600;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line-subtle);
}

.nav-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #34d399;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-status-pill:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.nav-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: dotBlink 2s infinite ease-in-out;
}

@keyframes dotBlink {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.4);
    opacity: 1;
    box-shadow: 0 0 12px #10b981;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-out-expo);
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #041019;
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
}

.mobile-nav-drawer {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 20px 18px;
  background: rgba(6, 7, 11, 0.96);
  border-top: 1px solid var(--line-subtle);
  border-bottom: 1px solid var(--line-subtle);
}

.mobile-nav-drawer.open {
  display: flex;
}

.mobile-nav-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.mobile-nav-drawer a:hover,
.mobile-nav-drawer a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Unified Glass Cards */
.spotlight-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.65);
}

.spotlight-card::before {
  display: none;
}

.spotlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(350px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(56, 189, 248, 0.05), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.spotlight-card:hover::after {
  opacity: 1;
}

.spotlight-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.16);
  box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.75), 0 0 32px -10px var(--accent-glow);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

pre code,
.code-snippet code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Unified 4-Column Footer */
footer.site-footer {
  border-top: none;
  padding: 72px 0 40px;
  background: linear-gradient(180deg, transparent 0, rgba(4, 5, 8, 0.75) 20%, #020305 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 13.5px;
  position: relative;
  z-index: 2;
}

footer.site-footer::before {
  display: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}

.footer-brand-p {
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 12px;
  max-width: 320px;
}

.footer-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-sub);
  font-family: var(--font-mono);
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0;
  margin: 0;
}

.footer-col a {
  color: var(--text-sub);
  text-decoration: none;
  transition: all 0.18s ease;
}

.footer-col a:hover {
  color: #fff;
  transform: translateX(3px);
  display: inline-block;
}

.footer-bottom {
  border-top: none;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* Utilities & Modals */
#pageTransitionShutter {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #0c101b 0, #030407 100%);
  opacity: 0;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.24s ease;
}

#pageTransitionShutter::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8, #7dd3fc, #38bdf8, transparent);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.65);
}

#pageTransitionShutter.shutter-in {
  opacity: 1;
  transform: scaleY(1);
  pointer-events: all;
}

#pageTransitionShutter.shutter-enter {
  opacity: 1;
  transform: scaleY(1);
  transform-origin: top;
  animation: shutterExitAnim 0.35s var(--ease-out-expo) forwards;
}

@keyframes shutterExitAnim {
  0% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(0);
    opacity: 0;
  }
}

@keyframes sectionGlowPulse {
  0% {
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
  35% {
    box-shadow: 0 0 70px rgba(56, 189, 248, 0.28);
  }
  100% {
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
}

.target-section-glow {
  animation: sectionGlowPulse 1.3s var(--ease-out-expo);
}

.btn-click-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%) scale(0);
  animation: btnRippleAnim 0.55s ease-out forwards;
  pointer-events: none;
}

@keyframes btnRippleAnim {
  to {
    transform: translate(-50%, -50%) scale(22);
    opacity: 0;
  }
}

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(14, 18, 28, 0.82);
  border: 1px solid var(--line-subtle);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.3s var(--ease-out-expo);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: #050b14;
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.45);
}

.reveal-fade {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s var(--ease-out-expo), transform 0.65s var(--ease-out-expo);
}

.reveal-fade.revealed {
  opacity: 1;
  transform: translateY(0);
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 4, 7, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999999;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: rgba(12, 16, 26, 0.98);
  backdrop-filter: blur(32px);
  border-radius: 20px;
  border: 1px solid var(--line-subtle);
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 30px 90px -10px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 80px);
  transform: translateY(-16px) scale(0.98);
  opacity: 0;
  transition: transform 0.28s var(--ease-out-expo), opacity 0.24s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14, 18, 30, 0.98);
  backdrop-filter: blur(20px);
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.modal-body {
  padding: 26px 28px 36px;
  overflow-y: auto;
  flex: 1;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}

/* Responsive Breakpoints */
@media (max-width: 1310px) {
  header.site-header .container {
    padding: 0 20px;
  }
  .header-inner {
    gap: 18px;
  }
  .nav-menu {
    gap: 14px;
  }
  .nav-link {
    font-size: 13px;
  }
  .header-actions {
    gap: 8px;
    padding-left: 14px;
  }
  .btn-sm {
    padding: 6px 11px;
    font-size: 12px;
  }
}

@media (max-width: 1080px) {
  .nav-menu {
    display: none;
  }
  .header-actions {
    padding-left: 0;
    border-left: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header-actions .btn-outline {
    display: none;
  }
  .header-actions {
    gap: 8px;
  }
  .nav-status-pill {
    padding: 5px 8px;
    font-size: 11px;
  }
  .btn-sm {
    padding: 6px 11px;
    font-size: 12px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  section {
    padding: 56px 0;
  }
  .hero-section,
  .page-hero {
    padding: 52px 0 44px;
  }
  .hero-title,
  .page-hero h1 {
    font-size: 30px;
    line-height: 1.18;
  }
  .hero-desc,
  .page-hero p {
    font-size: 15px;
  }
  .spotlight-card {
    padding: 20px 16px;
  }
  .section-header {
    margin-bottom: 28px;
  }
  .section-title {
    font-size: 25px;
  }
}

@media (max-width: 480px) {
  .nav-status-pill {
    display: none;
  }
  .header-inner {
    height: 60px;
  }
  .brand span {
    font-size: 15px;
  }
  .brand-icon {
    width: 30px;
    height: 30px;
  }
  .btn-sm {
    padding: 6px 10px;
    font-size: 11.5px;
  }
}

@media (max-width: 340px) {
  .container {
    padding: 0 12px;
  }
  .brand span {
    font-size: 13.5px;
  }
  .btn-sm {
    padding: 5px 8px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .nav-status-dot {
    animation: none;
  }
  .hero-title,
  .page-hero h1,
  .hero-desc,
  .page-hero p {
    animation: none;
  }
}
