/* ═══════════════════════════════════════════════════════════════
   NEXUS — Glassmorphism Cyber Homepage
   style.css — All styles, no inline CSS
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   1. CSS CUSTOM PROPERTIES (Design Tokens)
───────────────────────────────────────── */
:root {
  /* Background gradient stops */
  --bg-1: #070707; /* Void Black */
  --bg-2: #1A1A1A; /* Charcoal */
  --bg-3: #162939; /* Deep Navy */
  --bg-4: #3C3C3C; /* Iron Grey */

  /* Glass surface */
  --glass-bg: rgba(255, 255, 255, 0.042);
  --glass-bg-hover: rgba(255, 255, 255, 0.075);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-hover: rgba(40, 142, 189, 0.3);
  --glass-blur: blur(20px);

  /* Accent / brand colors */
  --accent: #288EBD;          /* Signal Blue */
  --accent-dim: #162939;      /* Deep Navy */
  --accent-glow: rgba(40, 142, 189, 0.18);
  --accent-glow-strong: rgba(40, 142, 189, 0.35);

  /* Text */
  --text-primary: rgba(255, 255, 255, 0.92); /* Starlight White */
  --text-secondary: rgba(177, 176, 176, 0.8); /* Mist Grey */
  --text-muted: rgba(123, 122, 120, 0.7); /* Ash Grey */

  /* Card */
  --radius-card: 16px;
  --radius-input: 50px;

  /* Shadow */
  --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255,255,255,0.06) inset;
  --shadow-hover: 0 8px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(40, 142, 189, 0.2);
  --shadow-glow: 0 0 30px rgba(40, 142, 189, 0.12);

  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-w: 900px;
  --gap: 1.25rem;
}

/* ─────────────────────────────────────────
   2. RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Syne', sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none; /* hide default cursor — custom glow cursor used */

  /* Animated gradient background */
  background: linear-gradient(
    135deg,
    var(--bg-1) 0%,
    var(--bg-2) 35%,
    var(--bg-3) 65%,
    var(--bg-4) 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
}

/* Touch devices: restore default cursor */
@media (hover: none) {
  body { cursor: auto; }
  #cursor-glow { display: none; }
}

/* ─────────────────────────────────────────
   3. ANIMATED BACKGROUND
───────────────────────────────────────── */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─────────────────────────────────────────
   4. CANVAS LAYERS (matrix + particles)
───────────────────────────────────────── */
#matrix-canvas,
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

#matrix-canvas  { opacity: 0.035; }
#particle-canvas { opacity: 0.55; }

/* ─────────────────────────────────────────
   5. CUSTOM CURSOR GLOW
───────────────────────────────────────── */
#cursor-glow {
  position: fixed;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(40, 142, 189, 0.55) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s linear, width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  mix-blend-mode: screen;
}

#cursor-glow.cursor-expanded {
  width: 48px;
  height: 48px;
  opacity: 0.7;
}

/* ─────────────────────────────────────────
   6. GLASS CARD BASE (reusable)
───────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), border-color var(--transition), background var(--transition);
}

/* ─────────────────────────────────────────
   7. MAIN APP LAYOUT
───────────────────────────────────────── */
.app {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  gap: var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ─────────────────────────────────────────
   8. SITE HEADER
───────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  opacity: 0;
  animation: fadeSlideDown 0.8s ease 0.1s forwards;
}

.site-logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(0.85rem, 2vw, 1rem);
  letter-spacing: 0.35em;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.site-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.65rem, 1.5vw, 0.72rem);
  color: var(--text-muted);
  letter-spacing: 0.12em;
}

/* ─────────────────────────────────────────
   9. CLOCK CARD
───────────────────────────────────────── */
.clock-card {
  width: 100%;
  padding: 2rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;

  /* Entry animation */
  opacity: 0;
  animation: fadeSlideDown 0.9s ease 0.2s forwards, floatY 6s ease-in-out 1.1s infinite;
}

/* Subtle inner top highlight */
.clock-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(40, 142, 189, 0.35), transparent);
}

.clock-time {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(40, 142, 189, 0.25), 0 2px 4px rgba(0,0,0,0.3);
  line-height: 1;
}

.clock-date {
  font-family: 'Syne', sans-serif;
  font-weight: 400;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  color: var(--text-secondary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.6rem;
}

/* Seconds progress bar */
.clock-bar {
  width: 60%;
  max-width: 280px;
  height: 2px;
  background: rgba(40, 142, 189, 0.1);
  border-radius: 2px;
  margin: 1.2rem auto 0;
  overflow: hidden;
}

.clock-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 8px var(--accent-glow-strong);
  border-radius: 2px;
  transition: width 0.5s linear;
  width: 0%;
}

/* ─────────────────────────────────────────
   10. SEARCH CARD
───────────────────────────────────────── */
.search-card {
  width: 100%;
  padding: 1.5rem 1.75rem;
  opacity: 0;
  animation: fadeSlideDown 0.9s ease 0.4s forwards;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-input);
  padding: 0.65rem 0.75rem 0.65rem 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-wrapper:focus-within {
  border-color: rgba(40, 142, 189, 0.45);
  box-shadow: 0 0 0 3px rgba(40, 142, 189, 0.08), 0 0 25px rgba(40, 142, 189, 0.12);
}

.search-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.search-wrapper:focus-within .search-icon {
  color: var(--accent);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--text-primary);
  caret-color: var(--accent);
  letter-spacing: 0.02em;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Remove browser default search styles */
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button { display: none; }

.search-btn {
  background: rgba(40, 142, 189, 0.1);
  border: 1px solid rgba(40, 142, 189, 0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition), transform 0.15s ease;
}

.search-btn:hover,
.search-btn:focus-visible {
  background: rgba(40, 142, 189, 0.2);
  box-shadow: 0 0 16px rgba(40, 142, 189, 0.25);
  transform: scale(1.08);
  outline: none;
}

.search-btn:active {
  transform: scale(0.95);
}

.search-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
  letter-spacing: 0.08em;
  transition: color var(--transition);
}

/* ─────────────────────────────────────────
   11. QUICK ACCESS SECTION
───────────────────────────────────────── */
.quick-access {
  width: 100%;
  opacity: 0;
  animation: fadeSlideDown 0.9s ease 0.6s forwards;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

/* ─────────────────────────────────────────
   12. LINKS GRID
───────────────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

/* ─────────────────────────────────────────
   13. LINK CARD
───────────────────────────────────────── */
.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.35rem 1rem;
  text-decoration: none;
  cursor: none;
  position: relative;
  overflow: hidden;
  transform: translateY(0) scale(1);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background var(--transition);
}

/* Touch devices — restore pointer */
@media (hover: none) {
  .link-card { cursor: pointer; }
}

.link-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(40, 142, 189, 0.07) 0%, transparent 70%);
  transition: opacity var(--transition);
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-hover), var(--shadow-glow);
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
  outline: none;
}

.link-card:hover::after,
.link-card:focus-visible::after {
  opacity: 1;
}

.link-card:active {
  transform: translateY(-1px) scale(0.99);
}

.link-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity var(--transition), filter var(--transition);
  filter: drop-shadow(0 0 6px rgba(40, 142, 189, 0.2));
}

.link-card:hover .link-icon {
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(40, 142, 189, 0.5));
}

.link-label {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.link-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ─────────────────────────────────────────
   14. STATUS BAR (footer)
───────────────────────────────────────── */
.status-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
  opacity: 0;
  animation: fadeIn 1s ease 0.9s forwards;
}

.status-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-center {
  text-align: center;
}

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

/* ─────────────────────────────────────────
   15. KEYFRAME ANIMATIONS
───────────────────────────────────────── */

/* Page load: slide from above + fade in */
@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Simple fade */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Gentle float for clock */
@keyframes floatY {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}

/* Pulsing dot */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 6px var(--accent); opacity: 1; }
  50%       { box-shadow: 0 0 14px var(--accent); opacity: 0.6; }
}

/* ─────────────────────────────────────────
   16. RESPONSIVE — TABLET (≤768px)
───────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --gap: 1rem;
  }

  .app {
    padding: 1.5rem 1rem;
    justify-content: flex-start;
    padding-top: max(2rem, env(safe-area-inset-top));
  }

  .clock-card {
    padding: 1.5rem 1.5rem;
  }

  .links-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .link-card {
    padding: 1.1rem 0.75rem;
  }
}

/* ─────────────────────────────────────────
   17. RESPONSIVE — MOBILE (≤480px)
───────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --gap: 0.85rem;
    --radius-card: 14px;
  }

  .app {
    padding: 1.25rem 0.85rem;
    gap: 0.85rem;
  }

  .clock-card {
    padding: 1.25rem 1rem;
  }

  .clock-bar { width: 80%; }

  .search-card {
    padding: 1.1rem 1rem;
  }

  .search-wrapper {
    padding: 0.55rem 0.6rem 0.55rem 1rem;
  }

  .links-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .link-card {
    padding: 1rem 0.6rem;
    gap: 0.4rem;
    /* Ensure minimum tap target */
    min-height: 88px;
  }

  .link-url { display: none; } /* Save space on small screens */

  .status-bar {
    font-size: 0.6rem;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
  }

  .status-center { order: -1; width: 100%; text-align: center; }
}

/* ─────────────────────────────────────────
   18. PRINT — just in case
───────────────────────────────────────── */
@media print {
  #matrix-canvas,
  #particle-canvas,
  #cursor-glow { display: none; }
}

/* ─────────────────────────────────────────
   19. REDUCED MOTION SUPPORT (a11y)
───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body { animation: none; background-position: 0% 50%; }
}

/* ─────────────────────────────────────────
   20. WATERMARK
───────────────────────────────────────── */
.watermark {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0;
  animation: fadeIn 1.2s ease 1.2s forwards;
  pointer-events: none;
  user-select: none;
}

.watermark-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.watermark-name {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.55;
  text-shadow: 0 0 12px rgba(40, 142, 189, 0.3);
}

/* ─────────────────────────────────────────
   21. SCROLLBAR (webkit)
───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(40, 142, 189, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(40, 142, 189, 0.3);
}
