/* ============================================
   Rahul Simi — sci-fi design system
   Tailwind handles utilities. This file owns
   the decorative layer: grids, glows, HUD
   panels, scanlines and effects.
   ============================================ */

:root {
  --void:    #050810;
  --deep:    #0a0e1a;
  --surface: #0f1424;
  --panel:   #141a2e;
  --line:    #1d2540;
  --line2:   #2a3554;
  --ink:     #e8ecf3;
  --muted:   #7a8aa0;
  --dim:     #4a5470;
  --accent:  #1e90ff;
  --accent2: #0066ff;
  --glow:    #00d4ff;
  --cyan:    #22e3ff;
}

html { scroll-behavior: smooth; }

::selection {
  background: var(--accent);
  color: var(--void);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

body {
  background-color: var(--void);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--deep); }
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border: 3px solid var(--deep);
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(30, 144, 255, 0.5);
}
::-webkit-scrollbar-thumb:hover { background: var(--glow); }

/* =====================
   Grid background
   ===================== */
.grid-bg {
  background-image:
    linear-gradient(rgba(30, 144, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 144, 255, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center top;
  mask-image: linear-gradient(to bottom, transparent, black 100px, black calc(100% - 200px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 100px, black calc(100% - 200px), transparent);
}

.vignette {
  background: radial-gradient(ellipse at top, transparent 0%, transparent 40%, rgba(5, 8, 16, 0.6) 100%);
}

.grid-fine {
  background-image:
    linear-gradient(rgba(30, 144, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 144, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

.dot-grid {
  background-image: radial-gradient(rgba(30, 144, 255, 0.18) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* =====================
   Glow text
   ===================== */
.text-glow-text {
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.6), 0 0 8px rgba(30, 144, 255, 0.4);
}

.text-glow-soft {
  text-shadow: 0 0 18px rgba(30, 144, 255, 0.4);
}

/* =====================
   HUD panel — bracketed corners
   ===================== */
.hud-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 26, 46, 0.6), rgba(15, 20, 36, 0.8));
  border: 1px solid var(--line2);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.hud-panel:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(30, 144, 255, 0.25), inset 0 0 0 1px rgba(0, 212, 255, 0.2);
  transform: translateY(-2px);
}

/* Corner brackets — pseudo elements */
.hud-panel::before,
.hud-panel::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--glow);
  opacity: 0.8;
  transition: opacity 0.3s, width 0.3s, height 0.3s;
}
.hud-panel::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}
.hud-panel::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}
.hud-panel:hover::before,
.hud-panel:hover::after {
  width: 22px;
  height: 22px;
  opacity: 1;
}

/* Card variant for projects */
.tech-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.4s;
  overflow: hidden;
}
.tech-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 40px -10px rgba(30, 144, 255, 0.35);
  transform: translateY(-4px);
}
.tech-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(30, 144, 255, 0.05));
  pointer-events: none;
}

/* Logo card — for displaying logos against light bg in dark theme */
.logo-tile {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.4s;
  overflow: hidden;
}
.logo-tile:hover {
  border-color: var(--glow);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.4);
  transform: translateY(-4px);
}

/* =====================
   Continuous contained glow on image cards
   (same vibe as the logo glow). Animates OPACITY only —
   compositor-cheap, so it scales to 70+ cards without jank.
   The inset shadow frames each card from inside its own
   bounds, so nothing bleeds onto neighbouring cards.
   ===================== */
.tech-card::after,
.logo-tile::after,
.img-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 24px rgba(30, 144, 255, 0.45),
              inset 0 0 0 1px rgba(0, 212, 255, 0.5);
  opacity: 0.3;
  z-index: 6;
  animation: cardGlow 3.6s ease-in-out infinite;
  will-change: opacity;
}
@keyframes cardGlow {
  0%, 100% { opacity: 0.28; }
  50%      { opacity: 0.7; }
}

/* Wrapper utility so non-card image holders (e.g. the About photo) match */
.img-glow { position: relative; isolation: isolate; }

/* =====================
   Bracket tag chip
   ===================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  border: 1px solid var(--line2);
  background: rgba(15, 20, 36, 0.85);
  backdrop-filter: blur(8px);
  color: var(--ink);
  border-radius: 4px;
  position: relative;
}
.tag.is-glow {
  border-color: var(--glow);
  color: var(--glow);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}
.tag.is-accent {
  border-color: var(--accent);
  color: var(--accent);
}

/* Tag with bracket prefix */
.tag-bracket::before {
  content: '[';
  color: var(--glow);
  margin-right: 0.1em;
}
.tag-bracket::after {
  content: ']';
  color: var(--glow);
  margin-left: 0.1em;
}

/* =====================
   Buttons
   ===================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.6rem;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 6px;
  transition: all 0.25s ease;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--accent);
  color: var(--void);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.3), 0 0 18px rgba(30, 144, 255, 0.35);
}
.btn-primary:hover {
  background: var(--glow);
  box-shadow: 0 0 0 1px var(--glow), 0 0 32px rgba(0, 212, 255, 0.6);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line2);
}
.btn-ghost:hover {
  border-color: var(--glow);
  background: rgba(30, 144, 255, 0.08);
  color: var(--glow);
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.2);
}

/* =====================
   Forms
   ===================== */
.input-tech {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: var(--deep);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-tech::placeholder { color: var(--dim); }
.input-tech:focus {
  outline: none;
  border-color: var(--glow);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15), inset 0 0 0 1px rgba(0, 212, 255, 0.3);
}
textarea.input-tech { resize: vertical; min-height: 150px; }

/* =====================
   Section divider — animated scan line
   ===================== */
.scan-divider {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2), transparent);
  overflow: hidden;
}
.scan-divider::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--glow), transparent);
  animation: scan-line 4s linear infinite;
}
@keyframes scan-line {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* =====================
   Logo glow — fully contained inside the white box.
   No bleeding outside the container. Pulse + sweep
   both stay strictly within bounds.
   ===================== */
.logo-glow {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  animation: logoIntensity 3s ease-in-out infinite;
}

/* Inset edge glow that pulses — visible on the white padding around the logo image */
@keyframes logoIntensity {
  0%, 100% {
    box-shadow:
      inset 0 0 32px rgba(30, 144, 255, 0.4),
      inset 0 0 8px rgba(0, 212, 255, 0.5);
  }
  50% {
    box-shadow:
      inset 0 0 60px rgba(30, 144, 255, 0.65),
      inset 0 0 16px rgba(0, 212, 255, 0.75);
  }
}

/* Diagonal sweep — slides across the white padding inside the box */
.logo-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(30, 144, 255, 0.22) 50%,
    transparent 70%
  );
  background-size: 250% 100%;
  animation: logoSweep 4s linear infinite;
  z-index: 1;
}

@keyframes logoSweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

/* Disabled — replaced by the simpler contained set above */
.logo-glow::after { display: none; }

/* =====================
   Glowing dot
   ===================== */
.dot-pulse {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 12px var(--glow);
}
.dot-pulse::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--glow);
  animation: ping-ring 2s ease-out infinite;
}
@keyframes ping-ring {
  0%   { opacity: 1; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(2.5); }
}

/* =====================
   Marquee mask
   ===================== */
.marquee-mask {
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

/* =====================
   Portfolio filter
   ===================== */
.work-item {
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.work-item.is-hidden { display: none !important; }

/* =====================
   Circuit decoration — corner brackets you can drop anywhere
   ===================== */
.corner-tl, .corner-tr, .corner-bl, .corner-br {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--glow);
  opacity: 0.5;
  pointer-events: none;
}
.corner-tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.corner-tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.corner-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.corner-br { bottom: 0; right: 0; border-left: none; border-top: none; }

/* =====================
   Scanline overlay (subtle)
   ===================== */
.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 212, 255, 0.025) 0px,
    rgba(0, 212, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* =====================
   Underline link
   ===================== */
.link-line {
  position: relative;
  display: inline-block;
}
.link-line::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.link-line:hover::after { transform: scaleX(1); transform-origin: left; }

/* =====================
   AOS safety net — content always visible
   even if AOS transitions are blocked.
   ===================== */
[data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Image transitions */
img { transition: opacity 0.4s ease, transform 0.4s ease; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

a, button { -webkit-tap-highlight-color: transparent; }
