@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap');

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

:root {
  --space-dark: #090A0F;
  --space-mid: #1B2735;
  --space-accent: #38495a;
  --text-gradient: linear-gradient(to bottom, #fff 0%, #38495a 100%);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Lato', sans-serif;
  background: var(--space-dark);
  color: #fff;
  overflow-x: hidden;
}

/* ── Parallax Stars Background ── */
.stars-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--space-dark);
  pointer-events: none;
}

.stars-bg .bg-radial-space {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at bottom, var(--space-mid) 0%, var(--space-dark) 100%);
}

@keyframes animStar {
  from { transform: translateY(0); }
  to { transform: translateY(-2000px); }
}

.stars-layer {
  position: absolute;
  left: 0;
  top: 0;
  background: transparent;
  animation: animStar linear infinite;
}

.stars-layer-1 {
  width: 1px;
  height: 1px;
  animation-duration: 50s;
}

.stars-layer-2 {
  width: 2px;
  height: 2px;
  animation-duration: 100s;
}

.stars-layer-3 {
  width: 3px;
  height: 3px;
  animation-duration: 150s;
}

.stars-layer .stars-repeat {
  position: absolute;
  top: 2000px;
  background: transparent;
}

.stars-layer-1 .stars-repeat { width: 1px; height: 1px; }
.stars-layer-2 .stars-repeat { width: 2px; height: 2px; }
.stars-layer-3 .stars-repeat { width: 3px; height: 3px; }

/* ── Layout ── */
.page-content {
  position: relative;
  z-index: 1;
}

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  background: rgba(9, 10, 15, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.3s, padding 0.3s;
}

nav.scrolled {
  background: rgba(9, 10, 15, 0.9);
  padding: 0.75rem 2.5rem;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #fff;
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero h1 {
  font-weight: 300;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: 10px;
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

.text-gradient {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 2px;
  max-width: 500px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  transition: background 0.3s, color 0.3s, transform 0.3s;
  cursor: pointer;
  background: transparent;
  font-family: inherit;
}

.btn:hover {
  background: #fff;
  color: var(--space-dark);
  transform: translateY(-2px);
}

.btn-primary {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: bounce 2s infinite;
}

.scroll-indicator .arrow {
  width: 20px;
  height: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ── Sections ── */
section {
  padding: 6rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 1rem;
}

.section-title {
  font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: 6px;
  margin-bottom: 3rem;
}

/* ── Scroll Reveal Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ── Feature Cards ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 2rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, transform 0.3s;
}

.feature-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Stats ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  text-align: center;
  padding: 3rem 0;
}

.stat-number {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 4px;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.5rem;
}

/* ── About ── */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-text p {
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.about-visual {
  height: 300px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.orbit {
  width: 120px;
  height: 120px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  position: relative;
  animation: spin 20s linear infinite;
}

.orbit::before {
  content: '';
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.orbit-2 {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  animation: spin 35s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Contact ── */
.contact-form {
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--glass-border);
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
  letter-spacing: 2px;
}

/* ── Admin Page ── */
.admin-page {
  min-height: 100vh;
  position: relative;
}

.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 3rem;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(16px);
}

.login-card h2 {
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: 6px;
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-card .subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  letter-spacing: 2px;
  margin-bottom: 2rem;
}

.login-error {
  color: #ff6b6b;
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 1rem;
  display: none;
}

.admin-dashboard {
  display: none;
  padding: 6rem 2rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.admin-dashboard.active {
  display: block;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.admin-header h1 {
  font-weight: 300;
  font-size: 1.8rem;
  letter-spacing: 6px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.dash-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.75rem;
  backdrop-filter: blur(8px);
}

.dash-card .value {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 0.25rem;
}

.dash-card .label {
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.visits-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.visits-table th,
.visits-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
}

.visits-table th {
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.visits-table td {
  color: rgba(255, 255, 255, 0.7);
}

.content-editor {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 2rem;
  backdrop-filter: blur(8px);
}

.content-editor h3 {
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.btn-danger {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
}

.btn-danger:hover {
  background: #ff6b6b;
  color: #fff;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.7rem;
}

/* ── Play Page (Tubes 3D Background) ── */
.play-page {
  overflow: hidden;
  height: 100vh;
  background: #000;
}

.play-page nav {
  background: rgba(0, 0, 0, 0.4);
}

.nav-logo {
  text-decoration: none;
}

.nav-links a.active-link {
  color: #fff;
}

.tubes-page {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.tubes-page #tubes-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  z-index: 1;
}

.tubes-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  pointer-events: none;
}

.tubes-page.loaded .tubes-loading {
  display: none;
}

.tubes-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tubes-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
  padding: 2rem;
}

.tubes-titles {
  pointer-events: auto;
  cursor: default;
  user-select: none;
}

.tubes-titles h1 {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 0, 0, 1);
  line-height: 1;
}

.tubes-titles h2 {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 20px rgba(0, 0, 0, 1);
  line-height: 1.1;
}

.tubes-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  pointer-events: auto;
  margin-top: 1rem;
}

.tubes-info p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  max-width: 28rem;
  line-height: 1.6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.tubes-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 1px;
  transition: background 0.3s, transform 0.3s;
}

.tubes-credit:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.tubes-credit svg {
  transition: transform 0.3s;
}

.tubes-credit:hover svg {
  transform: translate(2px, -2px);
}

.tubes-hint {
  position: absolute;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  animation: pulse-hint 2s ease-in-out infinite;
}

.tubes-hint span {
  font-size: 0.7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
}

@keyframes pulse-hint {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.tubes-page.load-error::after {
  content: 'Failed to load 3D background. Please use a modern browser with internet access.';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  z-index: 5;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  nav {
    padding: 1rem 1.5rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.7rem;
    letter-spacing: 2px;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    letter-spacing: 6px;
  }

  .tubes-titles h1 {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .tubes-titles h2 {
    font-size: clamp(1.8rem, 10vw, 3rem);
  }
}