/* ==========================================================================
   Interactive Motion & Psychological Engagement Layer
   andrea.heads.bio
   ========================================================================== */

/* --- Colour tokens (interactive layer only) --- */
:root {
  --ix-accent:        #3B5E82;
  --ix-accent-glow:   rgba(59, 94, 130, 0.18);
  --ix-accent-subtle: rgba(59, 94, 130, 0.07);
  --ix-bg-dark:       #1E1D1B;
  --ix-bg-terminal:   #141412;
  --ix-text-light:    #EAE9E6;
  --ix-text-muted:    rgba(234, 233, 230, 0.55);
  --ix-font-mono:     'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* --- Reduced motion: respect user preference --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ix-boot-overlay,
  .ix-particle-canvas,
  .ix-chat-fab { display: none !important; }
  .ix-reveal { opacity: 1 !important; transform: none !important; }
  [data-counter] { opacity: 1 !important; }
}

/* ==========================================================================
   1. Boot Sequence Overlay
   ========================================================================== */
.ix-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--ix-bg-terminal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: var(--ix-font-mono);
  color: var(--ix-text-light);
  font-size: 14px;
  line-height: 1.8;
  padding: 2rem;
  opacity: 1;
  transition: opacity 300ms ease-out;
}
.ix-boot-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.ix-boot-overlay .boot-content {
  max-width: 560px;
  width: 100%;
}
.ix-boot-overlay .boot-line {
  white-space: pre;
  opacity: 0;
}
.ix-boot-overlay .boot-line.visible {
  opacity: 1;
}
.ix-boot-overlay .boot-line .accent {
  color: var(--ix-accent);
}
.ix-boot-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--ix-accent);
  animation: ix-blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}
@keyframes ix-blink {
  50% { opacity: 0; }
}
.ix-boot-skip {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  color: var(--ix-text-muted);
  font-family: var(--ix-font-mono);
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 200ms;
}
.ix-boot-skip:hover {
  border-color: var(--ix-accent);
  color: var(--ix-accent);
}

/* ==========================================================================
   2. Particle Canvas (background)
   ========================================================================== */
.ix-particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   3. Animated Stat Counters
   ========================================================================== */
[data-counter] {
  opacity: 0;
  transition: opacity 400ms ease;
}
[data-counter].ix-counted {
  opacity: 1;
}

/* Stat card hover lift */
.ix-stat-card {
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.ix-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--ix-accent-glow);
}

/* ==========================================================================
   4. Scroll Reveal
   ========================================================================== */
.ix-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ix-reveal.ix-visible {
  opacity: 1;
  transform: translateY(0);
}
.ix-reveal-left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ix-reveal-left.ix-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================================================
   5. Timeline entries (about page)
   ========================================================================== */
.ix-timeline-entry {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid #e0e0e0;
  transition: border-color 300ms ease;
}
.ix-timeline-entry:hover {
  border-left-color: var(--ix-accent);
}
.ix-timeline-entry:hover .h5 {
  text-decoration: underline;
  text-decoration-color: var(--ix-accent);
  text-underline-offset: 0.2rem;
}
.ix-timeline-entry::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e0e0e0;
  transition: background 300ms ease, box-shadow 300ms ease;
}
.ix-timeline-entry:hover::before {
  background: var(--ix-accent);
  box-shadow: 0 0 12px var(--ix-accent-glow);
}

/* ==========================================================================
   6. Skills Filtering
   ========================================================================== */
.ix-skill-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}
.ix-skill-filter-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid #dee2e6;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all 200ms ease;
}
.ix-skill-filter-btn:hover {
  border-color: var(--ix-accent);
  color: var(--ix-accent);
}
.ix-skill-filter-btn.active {
  background: var(--ix-accent);
  border-color: var(--ix-accent);
  color: #fff;
  transform: scale(1.05);
}
.ix-skill-group {
  transition: opacity 200ms ease, transform 200ms ease;
}
.ix-skill-group.ix-hidden {
  opacity: 0;
  transform: scale(0.95);
  position: absolute;
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

/* ==========================================================================
   7. Floating Chat CTA
   ========================================================================== */
.ix-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1020;
  background: var(--ix-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  box-shadow: 0 4px 20px rgba(248, 93, 127, 0.4);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 400ms ease, transform 400ms ease, box-shadow 200ms ease;
}
.ix-chat-fab.ix-visible {
  opacity: 1;
  transform: translateY(0);
}
.ix-chat-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 28px rgba(248, 93, 127, 0.55);
  color: #fff;
  text-decoration: none;
}
@keyframes ix-fab-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ==========================================================================
   8. Terminal Teaser (hero section)
   ========================================================================== */
.ix-terminal-teaser {
  background: var(--ix-bg-terminal);
  border: 1px solid rgba(248, 93, 127, 0.25);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-family: var(--ix-font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--ix-text-light);
  max-width: 520px;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 300ms ease, box-shadow 300ms ease;
}
.ix-terminal-teaser:hover {
  border-color: rgba(248, 93, 127, 0.5);
  box-shadow: 0 0 20px rgba(248, 93, 127, 0.15);
}
.ix-terminal-teaser .prompt {
  color: var(--ix-accent);
}
.ix-terminal-teaser .cmd {
  color: rgba(255, 255, 255, 0.9);
}
.ix-terminal-teaser .response {
  color: rgba(255, 255, 255, 0.7);
  padding-left: 0;
}
.ix-terminal-teaser .teaser-link {
  color: var(--ix-accent);
  text-decoration: none;
  transition: text-shadow 200ms;
}
.ix-terminal-teaser .teaser-link:hover {
  text-shadow: 0 0 8px var(--ix-accent-glow);
}
.ix-terminal-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 0.75rem;
}
.ix-terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.ix-terminal-dots .red { background: #ff5f57; }
.ix-terminal-dots .yellow { background: #febc2e; }
.ix-terminal-dots .green { background: #28c840; }


/* ==========================================================================
   10. Section divider animation
   ========================================================================== */
.ix-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ix-accent-glow), transparent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 800ms ease-in-out;
}
.ix-divider.ix-visible {
  transform: scaleX(1);
}

/* ==========================================================================
   11. Konami Code Overlay
   ========================================================================== */
.ix-konami-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--ix-bg-terminal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ix-font-mono);
  color: var(--ix-text-light);
  font-size: 14px;
  line-height: 1.8;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.ix-konami-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.ix-konami-overlay .konami-content {
  max-width: 560px;
  width: 100%;
  position: relative;
}
.ix-konami-overlay .konami-line {
  white-space: pre-wrap;
  opacity: 0;
}
.ix-konami-overlay .konami-line.visible {
  opacity: 1;
}
.ix-konami-overlay .accent {
  color: var(--ix-accent);
}
/* CRT scanline effect for Konami overlay */
.ix-konami-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
}
.ix-konami-close {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  color: var(--ix-text-muted);
  font-family: var(--ix-font-mono);
  font-size: 12px;
}

/* ==========================================================================
   12. Reading progress bar (blog pages)
   ========================================================================== */
.ix-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ix-accent), #ff8fab);
  width: 0%;
  z-index: 9999;
  transition: width 100ms linear;
}

/* Back to top button */
.ix-back-to-top {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 1019;
  background: transparent;
  border: 1.5px solid rgba(248, 93, 127, 0.4);
  color: var(--ix-accent);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 300ms ease, transform 300ms ease,
              border-color 200ms ease, background 200ms ease;
  pointer-events: none;
}
.ix-back-to-top.ix-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ix-back-to-top:hover {
  background: var(--ix-accent);
  border-color: var(--ix-accent);
  color: #fff;
}


/* ==========================================================================
   14. Blog card hover enhancements
   ========================================================================== */
.ix-blog-card {
  transition: transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
}
.ix-blog-card:hover {
  transform: translateY(-6px);
  border-color: rgba(248, 93, 127, 0.4) !important;
}
.ix-blog-card .ix-read-time {
  opacity: 0;
  transition: opacity 250ms ease;
  font-size: 0.75rem;
  color: var(--ix-accent);
}
.ix-blog-card:hover .ix-read-time {
  opacity: 1;
}

/* ==========================================================================
   Fira Code font import (used for terminal elements only)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');
