/* ==========================================================================
   KYPLAIN.CA — BOOT SEQUENCE TERMINAL & CRT OVERLAY STYLES
   Retro-futuristic terminal shell, CRT scanlines, flicker & glow
   ========================================================================== */

#boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #080b10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s ease;
}

#boot-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* CRT Scanline Grid Overlay */
#boot-overlay::before {
  content: " ";
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.38) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
  z-index: 99998;
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
  opacity: 0.88;
}

/* CRT Vignette & Screen Depth */
#boot-overlay::after {
  content: " ";
  display: block;
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 55%, rgba(4, 6, 10, 0.75) 100%);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85);
  z-index: 99998;
  pointer-events: none;
}

/* Header Bar */
.boot-header-bar {
  position: relative;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: rgba(13, 17, 23, 0.96);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
}

.boot-brand {
  color: #94a3b8;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.boot-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981, 0 0 18px rgba(16, 185, 129, 0.6);
  animation: boot-pulse 2s infinite ease-in-out;
}

@keyframes boot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.9); }
}

.boot-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.boot-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 34px;
  touch-action: manipulation;
}

.boot-action-btn:hover,
.boot-action-btn:active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.boot-btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #10b981 100%);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

.boot-btn-primary:hover,
.boot-btn-primary:active {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5);
  filter: brightness(1.12);
}

.boot-btn-close {
  padding: 0.4rem 0.75rem;
  font-size: 0.95rem;
  color: #94a3b8;
  border-color: rgba(239, 68, 68, 0.2);
}

.boot-btn-close:hover,
.boot-btn-close:active {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Terminal Core Window */
#boot-overlay .terminal {
  height: calc(100% - 52px) !important;
  width: 100% !important;
  flex: 1;
  --color: #e2e8f0;
  --background: #080b10;
  --link-color: #38bdf8;
  --glow-color: rgba(56, 189, 248, 0.35);
  padding: 0.75rem 1rem !important;
  font-family: 'JetBrains Mono', monospace !important;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.2), 0 0 8px var(--glow-color);
  animation: crt-flicker 0.2s infinite;
}

#boot-overlay .terminal-output div span {
  font-family: 'JetBrains Mono', monospace !important;
}

#boot-overlay .cmd {
  --color: #38bdf8;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
}

#boot-skip-hint {
  position: absolute;
  bottom: 0.85rem;
  right: 1.25rem;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  pointer-events: none;
  letter-spacing: 0.03em;
  z-index: 100000;
  background: rgba(13, 17, 23, 0.75);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
}

/* CRT Screen Subtle Micro-Flicker */
@keyframes crt-flicker {
  0% { opacity: 0.985; }
  50% { opacity: 1; }
  52% { opacity: 0.97; }
  54% { opacity: 1; }
  85% { opacity: 0.99; }
  100% { opacity: 1; }
}

/* Navbar & Global Terminal Launch Button */
.nav-link-terminal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.nav-link-terminal:hover,
.nav-link-terminal:focus-visible {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.nav-link-terminal .terminal-icon {
  font-size: 0.85rem;
  color: #10b981;
}

@media (max-width: 640px) {
  .boot-brand {
    display: none;
  }

  .boot-header-bar {
    padding: 0.5rem 0.75rem;
  }

  .boot-action-btn {
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
  }

  #boot-skip-hint {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.5rem;
    text-align: center;
    font-size: 0.68rem;
  }
}

/* ==========================================================================
   LAUGHING SKULL FULLSCREEN TAKEOVER
   Cyber intrusion, matrix rain, animated laughing jaw & glowing laser eyes
   ========================================================================== */

#skull-takeover {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  width: 100vw;
  height: 100vh;
  background: #030408;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s ease;
  user-select: none;
}

#skull-takeover.skull-takeover-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Background Canvas Matrix Rain */
#skull-matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.72;
}

/* CRT Scanlines and Edge Vignette */
.skull-crt-lines {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.5) 50%),
              linear-gradient(90deg, rgba(239, 68, 68, 0.03), rgba(16, 185, 129, 0.02), rgba(56, 189, 248, 0.03));
  background-size: 100% 3px, 6px 100%;
  opacity: 0.92;
}

.skull-crt-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 35%, rgba(2, 3, 6, 0.88) 100%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.95);
}

/* Stage & Container */
.skull-stage {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 720px;
  padding: 1.5rem;
  box-sizing: border-box;
  animation: skull-screen-shake 0.5s ease-out;
}

@keyframes skull-screen-shake {
  0% { transform: scale(1.08) translate(0, 0); filter: hue-rotate(90deg); }
  15% { transform: scale(1.04) translate(-8px, 6px); filter: hue-rotate(180deg); }
  30% { transform: scale(1.02) translate(8px, -6px); filter: hue-rotate(270deg); }
  45% { transform: scale(1.01) translate(-5px, -4px); filter: hue-rotate(0deg); }
  60% { transform: scale(1) translate(4px, 3px); }
  100% { transform: scale(1) translate(0, 0); }
}

/* Top Security Alert Badge */
.skull-banner-top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
  margin-bottom: 1.25rem;
  animation: skull-alert-pulse 1.4s infinite ease-in-out;
}

.skull-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

@keyframes skull-alert-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); box-shadow: 0 0 24px rgba(239, 68, 68, 0.6); }
}

/* Animated Skull SVG Wrapper — Watch Dogs 2 DedSec Glitch Aesthetics */
.skull-svg-wrap {
  display: inline-block;
  position: relative;
  max-width: 330px;
  width: 80vw;
  height: auto;
  filter: drop-shadow(-4px 0 16px rgba(0, 240, 255, 0.75)) drop-shadow(4px 0 20px rgba(255, 0, 85, 0.75)) drop-shadow(0 0 45px rgba(255, 255, 255, 0.35));
  animation: skull-head-laugh 0.52s infinite ease-in-out;
}

@keyframes skull-head-laugh {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-7px) rotate(-1.5deg) scale(1.03); }
  50% { transform: translateY(4px) rotate(1deg) scale(0.99); }
  75% { transform: translateY(-10px) rotate(1.8deg) scale(1.04); }
}

/* Watch Dogs 2 DedSec Animated Glitch Eyes (X X) */
.dedsec-eye-glyph {
  transform-origin: center;
  animation: dedsec-eye-twitch 0.38s infinite alternate ease-in-out;
}

.eye-glyph-left {
  animation: dedsec-eye-twitch 0.32s infinite alternate ease-in-out;
}

.eye-glyph-right {
  animation: dedsec-eye-twitch 0.44s infinite alternate-reverse ease-in-out;
}

@keyframes dedsec-eye-twitch {
  0% {
    transform: scale(1) translate(0, 0);
    filter: drop-shadow(0 0 8px #00f0ff);
  }
  35% {
    transform: scale(1.1) translate(-1px, 1px);
    filter: drop-shadow(0 0 16px #00f0ff) drop-shadow(0 0 26px rgba(0, 240, 255, 0.85));
  }
  65% {
    transform: scale(0.96) translate(1px, -1px);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.15) translate(0, -1px);
    filter: drop-shadow(0 0 18px #ff0055) drop-shadow(0 0 30px rgba(255, 0, 85, 0.95));
  }
}

/* Animated Lower Jaw (DedSec Laughing motion) */
.skull-jaw-animated,
.dedsec-jaw-animated {
  transform-origin: 200px 260px;
  animation: skull-jaw-laugh 0.28s infinite ease-in-out;
}

@keyframes skull-jaw-laugh {
  0%, 100% { transform: translateY(0) scaleY(1); }
  25% { transform: translateY(30px) scaleY(1.1) rotate(1.5deg); }
  50% { transform: translateY(14px) scaleY(1.04); }
  75% { transform: translateY(36px) scaleY(1.14) rotate(-1.5deg); }
}

/* Glowing Pupils & Highlights */
.skull-eye-glow {
  animation: skull-eye-flicker 0.4s infinite alternate;
}

@keyframes skull-eye-flicker {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 1; filter: drop-shadow(0 0 14px #00f0ff); }
}

/* Laugh Title and Subtext */
.skull-laugh-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #00f0ff;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.8), -3px 0 #ff0055, 3px 0 #ffffff;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  animation: skull-glitch-text 0.8s infinite steps(2);
}

@keyframes skull-glitch-text {
  0%, 100% { transform: translate(0, 0); text-shadow: 0 0 20px rgba(0, 240, 255, 0.8), -3px 0 #ff0055; }
  25% { transform: translate(-2px, 1px); text-shadow: 0 0 25px rgba(255, 0, 85, 0.9), 3px 0 #00f0ff; }
  50% { transform: translate(2px, -1px); text-shadow: 0 0 22px rgba(255, 255, 255, 0.8), -2px 0 #00f0ff; }
  75% { transform: translate(-1px, -1px); text-shadow: 0 0 30px rgba(255, 0, 85, 0.85), 3px 0 #ff0055; }
}

.skull-subtext {
  font-size: clamp(0.75rem, 2.2vw, 0.92rem);
  color: #94a3b8;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

/* Action Buttons */
.skull-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.skull-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.skull-btn-enter {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.35));
  border: 1px solid #10b981;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.skull-btn-enter:hover {
  background: #10b981;
  color: #022c22;
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.8);
  transform: translateY(-2px);
}

.skull-btn-term {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.skull-btn-term:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
}

.skull-dismiss-hint {
  font-size: 0.76rem;
  color: #64748b;
  letter-spacing: 0.05em;
}

.skull-dismiss-hint .kbd-hint {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  color: #e2e8f0;
  font-weight: 700;
}

/* Ambient Floating Laugh Tags */
.skull-laugh-ambient {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  pointer-events: none;
  z-index: 2;
  opacity: 0.75;
  animation: skull-float-flicker 1.8s infinite ease-in-out;
}

.laugh-pos-1 { top: 8%; left: 6%; font-size: 1.1rem; color: #ef4444; animation-delay: 0.1s; transform: rotate(-8deg); }
.laugh-pos-2 { top: 12%; right: 8%; font-size: 1.3rem; color: #10b981; animation-delay: 0.3s; transform: rotate(10deg); }
.laugh-pos-3 { bottom: 22%; left: 5%; font-size: 1.2rem; color: #38bdf8; animation-delay: 0.5s; transform: rotate(6deg); }
.laugh-pos-4 { bottom: 18%; right: 7%; font-size: 1.15rem; color: #ef4444; animation-delay: 0.2s; transform: rotate(-6deg); }
.laugh-pos-5 { top: 35%; left: 2%; font-size: 0.85rem; color: #f59e0b; animation-delay: 0.4s; letter-spacing: 0.12em; }
.laugh-pos-6 { top: 38%; right: 3%; font-size: 0.85rem; color: #a855f7; animation-delay: 0.6s; letter-spacing: 0.12em; }

@keyframes skull-float-flicker {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 0.95; transform: scale(1.08); text-shadow: 0 0 16px currentColor; }
}

@media (max-width: 640px) {
  .skull-svg-wrap {
    max-width: 240px;
  }
  .skull-laugh-ambient {
    display: none;
  }
  .skull-banner-top {
    font-size: 0.72rem;
    padding: 0.3rem 0.75rem;
  }
}

