:root {
  --bg-dark: #080914;
  --card-bg: rgba(18, 20, 42, 0.65);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-purple: #818cf8;
  --accent-magenta: #c084fc;
  --gradient-glow: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
  --font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-family);
  color: var(--text-main);
}

/* Fullscreen Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 280px;
  text-align: center;
}

.loader-gear-box {
  position: relative;
  width: 90px;
  height: 90px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-gear-svg {
  position: absolute;
  width: 100%;
  height: 100%;
}

.spin-gear {
  transform-origin: 50px 50px;
  animation: gearSpin 4s linear infinite;
}

@keyframes gearSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-logo {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--gradient-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.loader-title {
  font-size: 1.1rem;
  letter-spacing: 3px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
}

.loader-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gradient-glow);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  transition: width 0.1s linear;
}

.loader-status {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.25;
}

.main-container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  pointer-events: none;
}

.main-container > * {
  pointer-events: auto;
}

/* Header */
.header {
  width: 100%;
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-glow);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.contact-email, .footer-email {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.contact-email:hover, .footer-email:hover {
  color: #fff;
  text-decoration: underline;
}

.author-credit {
  color: #f8fafc;
  font-weight: 500;
}

.author-credit strong {
  color: var(--accent-magenta);
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  padding: 0.45rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 10px #34d399;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Glass Card Content */
.content-wrapper {
  max-width: 700px;
  width: 100%;
  text-align: center;
  margin: 1.5rem 0;
}

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 2.75rem 2.25rem;
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.badge-tag {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  border-radius: 20px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.9rem;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Mechanical Gear Analog Clock */
.clock-showcase {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 1.75rem 1.5rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.mechanical-clock {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 20, 42, 0.9) 0%, rgba(8, 9, 20, 0.95) 100%);
  border: 2px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.2), inset 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gears-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.gear {
  transform-origin: 150px 150px;
}

.gear-sub-1 {
  transform-origin: 95px 95px;
}

.gear-sub-2 {
  transform-origin: 205px 205px;
}

.clock-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.tick {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.tick-12 { top: 12px; left: 50%; transform: translateX(-50%); }
.tick-3  { right: 14px; top: 50%; transform: translateY(-50%); }
.tick-6  { bottom: 12px; left: 50%; transform: translateX(-50%); }
.tick-9  { left: 14px; top: 50%; transform: translateY(-50%); }

/* Hands */
.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 4px;
  transition: transform 0.05s cubic-bezier(0.4, 2.08, 0.55, 0.44);
}

.hour-hand {
  width: 6px;
  height: 55px;
  margin-left: -3px;
  background: linear-gradient(to top, var(--accent-purple), #fff);
  box-shadow: 0 0 10px var(--accent-purple);
  z-index: 3;
}

.minute-hand {
  width: 4px;
  height: 75px;
  margin-left: -2px;
  background: linear-gradient(to top, var(--accent-cyan), #fff);
  box-shadow: 0 0 10px var(--accent-cyan);
  z-index: 4;
}

.second-hand {
  width: 2px;
  height: 90px;
  margin-left: -1px;
  background: var(--accent-magenta);
  box-shadow: 0 0 12px var(--accent-magenta);
  z-index: 5;
}

.clock-cap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  background: var(--gradient-glow);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.8);
  z-index: 6;
}

/* Digital Display Below */
.digital-time-display {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

#digital-clock {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  background: var(--gradient-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}

.time-label {
  font-size: 0.68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* 3D Cyber Loading Bar Under Clock */
.clock-loading-bar {
  width: 100%;
  max-width: 260px;
  margin-top: 1.25rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
}

.clock-loading-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
}

.loading-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 1.5s infinite;
}

.loading-percent {
  font-weight: 700;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
}

.clock-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.clock-progress-fill {
  height: 100%;
  background: var(--gradient-glow);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  position: relative;
  transition: width 0.3s ease;
}

.clock-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.8s infinite;
}

/* Subscription Form */
.subscribe-form {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}

.input-group {
  position: relative;
  flex: 1;
}

.subscribe-input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

.subscribe-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.btn-primary {
  padding: 0.85rem 1.6rem;
  background: var(--gradient-glow);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(129, 140, 248, 0.4);
}

.form-message {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  min-height: 18px;
}

.form-message.success { color: #34d399; }
.form-message.error { color: #f87171; }

/* Footer */
.footer {
  width: 100%;
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  gap: 1rem;
}

.social-links {
  display: flex;
  gap: 1.25rem;
}

.social-icon {
  color: var(--text-muted);
  transition: color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icon:hover {
  color: var(--accent-cyan);
  transform: translateY(-2px);
}

.social-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Controls / Instructions */
.interaction-hint {
  margin-top: 1rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1px;
  text-transform: uppercase;
  pointer-events: none;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .header-right {
    justify-content: center;
    width: 100%;
  }

  .glass-card {
    padding: 2rem 1.5rem;
  }

  .title {
    font-size: 2rem;
  }
}

@media (max-width: 520px) {
  .title {
    font-size: 1.75rem;
  }

  .subscribe-form {
    flex-direction: column;
  }

  .btn-primary {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .feature-pills {
    flex-direction: column;
    align-items: stretch;
  }

  .status-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
  }
}
