:root {
  --bg: #0f1724;
  --card: #0b1220;
  --muted: #9aa4b2;
  --accent: #7dd3fc;
  --glass: rgba(255,255,255,0.03);
  --container: #17253c;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* Global Tooltip Styles */
*[title]:not([title=""]):not(iframe):not(svg) {
  position: relative;
}

*[title]:not([title=""]):not(iframe):not(svg):hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(20, 20, 20, 0.95);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: tooltip-fade-in 0.2s ease forwards;
  margin-bottom: 6px;
}

*[title]:not([title=""]):not(iframe):not(svg):hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(20, 20, 20, 0.95) transparent transparent transparent;
  z-index: 10000;
  animation: tooltip-fade-in 0.2s ease forwards;
}

@keyframes tooltip-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Tooltip positioning variants */
[data-tooltip-position="bottom"]::after {
  top: 100%;
  bottom: auto;
  transform: translateX(-50%) translateY(8px);
  margin-top: 6px;
  margin-bottom: 0;
}

[data-tooltip-position="bottom"]::before {
  top: 100%;
  bottom: auto;
  transform: translateX(-50%) translateY(2px);
  border-color: transparent transparent rgba(20, 20, 20, 0.95) transparent;
}

[data-tooltip-position="left"]::after {
  right: 100%;
  left: auto;
  bottom: 50%;
  transform: translateX(-8px) translateY(50%);
  margin-right: 6px;
  margin-bottom: 0;
}

[data-tooltip-position="left"]::before {
  right: 100%;
  left: auto;
  bottom: 50%;
  transform: translateX(-2px) translateY(50%);
  border-color: transparent transparent transparent rgba(20, 20, 20, 0.95);
}

[data-tooltip-position="right"]::after {
  left: 100%;
  right: auto;
  bottom: 50%;
  transform: translateX(8px) translateY(50%);
  margin-left: 6px;
  margin-bottom: 0;
}

[data-tooltip-position="right"]::before {
  left: 100%;
  right: auto;
  bottom: 50%;
  transform: translateX(2px) translateY(50%);
  border-color: transparent rgba(20, 20, 20, 0.95) transparent transparent;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, var(--bg), #071021);
  color: #e6eef6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  width: 100%;
}

/* Custom Cursor */
body.custom-cursor-enabled {
  cursor: none;
}

body.custom-cursor-enabled * {
  cursor: none !important;
}

.custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transition: transform 0.15s ease, opacity 0.3s ease, width 0.2s ease, height 0.2s ease, border-width 0.2s ease;
  box-shadow: 0 0 10px rgba(125, 211, 252, 0.5),
              0 0 20px rgba(125, 211, 252, 0.3),
              inset 0 0 10px rgba(125, 211, 252, 0.2);
  opacity: 0;
  transform: translate(-50%, -50%);
}

.custom-cursor.hovering {
  width: 28px;
  height: 28px;
  border-width: 3px;
  box-shadow: 0 0 15px rgba(125, 211, 252, 0.7),
              0 0 30px rgba(125, 211, 252, 0.4),
              inset 0 0 15px rgba(125, 211, 252, 0.3);
}

@keyframes wobble {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  25% { transform: translate(-50%, -50%) scale(1.15); }
  50% { transform: translate(-50%, -50%) scale(1); }
  75% { transform: translate(-50%, -50%) scale(1.15); }
}

.custom-cursor.active {
  opacity: 1;
}

.custom-cursor.clicking {
  width: 28px;
  height: 28px;
  box-shadow: 0 0 20px rgba(125, 211, 252, 0.8),
              0 0 40px rgba(125, 211, 252, 0.5),
              inset 0 0 15px rgba(125, 211, 252, 0.4);
}

.custom-cursor-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 5px rgba(125, 211, 252, 0.8);
}

.ripple {
  position: fixed;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: ripple-expand 0.8s ease-out forwards;
  transform: translate(-50%, -50%);
}

@keyframes ripple-expand {
  0% {
    width: 20px;
    height: 20px;
    opacity: 1;
    box-shadow: 0 0 10px rgba(125, 211, 252, 0.6);
  }
  100% {
    width: 100px;
    height: 100px;
    opacity: 0;
    box-shadow: 0 0 30px rgba(125, 211, 252, 0);
  }
}

.distortion-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Layout */
main.wrap {
  transition: opacity 0.2s ease;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  margin-top: 80px;
}

main.hidden {
  opacity: 0;
}

.wrap {
  width: min(980px, 96%);
  margin: 0 auto;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(180deg, #000000 0%, rgba(0,0,0,0.8) 60%, rgba(0,0,0,0) 100%);
  z-index: 1000;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 32px;
  height: 70px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.5));
  overflow: visible;
}

.brand-logo:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px rgba(125, 211, 252, 0.8));
}

.nav-left .brand {
  font-size: 28px !important;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-links {
  font-size: 18px;
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
  justify-content: right;
}

.nav-links li {
  display: flex;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: #e6eef6;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Sections */
section {
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

section.hidden {
  opacity: 0;
  transform: translateY(20px);
}

#main-content {
  width: 100%;
  max-width: 100%;
}

#main-content > section {
  width: 100%;
  max-width: 100%;
}

/* Popup */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.popup:not(.hidden) {
  opacity: 1;
  pointer-events: all;
}

.popup-content {
  background: var(--container);
  border-radius: 12px;
  width: min(800px, 90%);
  height: 80%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup-content iframe {
  border: none;
  flex: 1;
  width: 100%;
}

.popup-content .close {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 1.5rem;
  padding: 8px 12px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding-top: 70px;
  }
  
  .navbar {
    padding: 12px 16px;
  }
  
  .navbar .wrap {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .nav-left .brand {
    font-size: 24px;
  }
  
  .nav-right {
    width: 100%;
  }
  
  .nav-links {
    font-size: 16px;
    gap: 20px;
    flex-wrap: wrap;
  }
}

/* Footer */
.site-footer {
  width: 100%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.5));
  border-top: 1px solid rgba(125, 211, 252, 0.1);
  margin-top: 4rem;
  padding: 2rem 0;
}

.footer-content {
  width: min(980px, 96%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #e6eef6;
}

@media (max-width: 768px) {
  .site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
  }
  
  .footer-links {
    gap: 1.5rem;
  }
}