/* ==========================================================================
   VARIABLES & DESIGN SYSTEM
   ========================================================================== */
:root {
  /* Color Palette */
  --bg-dark: #0c0c1e;
  --bg-surface: rgba(12, 22, 12, 0.9);
  --bg-surface-card: #161822;
  --bg-surface-high: #2d372c;
  
  --primary-green: #00ff66;
  --primary-dim-green: #00e55b;
  --primary-light-green: #edffe8;
  
  --secondary-cyan: #00e3fd;
  --secondary-dim-cyan: #00daf3;
  
  --accent-pink: #ff0055;
  --text-main: #dae6d5;
  --text-muted: #b9ccb5;
  --border-muted: #3b4b3a;

  /* Typography */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --max-width: 1200px;
}

/* ==========================================================================
   BASE & RESET STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-dark);
  color: var(--text-main);
}

body {
  background-image: radial-gradient(circle, #1a1a3a 0%, var(--bg-dark) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background-color: var(--primary-green);
  color: #0d0e12;
}

.pixel-art {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* CRT Overlay Effect */
.crt-scanline-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.25) 50%), 
              linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
  background-size: 100% 4px, 3px 100%;
  opacity: 0.2;
}

/* ==========================================================================
   LAYOUT & CONTAINER UTILITIES
   ========================================================================== */
.main-container {
  flex-grow: 1;
  z-index: 10;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dim-green);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid var(--border-muted);
  padding-bottom: 8px;
}

/* ==========================================================================
   SURFACES & RETRO EFFECTS
   ========================================================================== */
.retro-surface {
  background-color: var(--bg-surface-card);
  border: 2px solid var(--secondary-dim-cyan);
  box-shadow: inset 0 0 10px rgba(0, 218, 243, 0.2);
}

.pixel-corners {
  clip-path: polygon(
    4px 0, calc(100% - 4px) 0, 
    100% 4px, 100% calc(100% - 4px), 
    calc(100% - 4px) 100%, 4px 100%, 
    0 calc(100% - 4px), 0 4px
  );
}

.neon-border-pink {
  border: 2px solid var(--accent-pink);
  box-shadow: 0 0 8px rgba(255, 0, 85, 0.6);
}

.neon-border-cyan {
  border: 2px solid var(--secondary-cyan);
  box-shadow: 0 0 8px rgba(0, 227, 253, 0.6);
}

.accent-bullet-cyan { color: var(--secondary-cyan); }
.accent-bullet-pink { color: var(--accent-pink); }
.highlight-green { color: var(--primary-dim-green); filter: drop-shadow(0 0 10px rgba(0, 229, 91, 0.5)); }
.highlight-cyan { color: var(--secondary-cyan); }

/* Buttons */
.retro-btn {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 16px 32px;
  text-decoration: none;
  display: inline-block;
  text-transform: uppercase;
  transition: all 0.1s;
}

.retro-btn-green {
  border: 2px solid var(--primary-green);
  color: var(--primary-green);
}
.retro-btn-green:hover {
  background-color: var(--primary-green);
  color: var(--bg-dark);
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.8);
}

.retro-btn-cyan {
  border: 2px solid var(--secondary-cyan);
  color: var(--secondary-cyan);
}
.retro-btn-cyan:hover {
  background-color: var(--secondary-cyan);
  color: var(--bg-dark);
  box-shadow: 0 0 15px rgba(0, 227, 253, 0.8);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 4px solid var(--border-muted);
  box-shadow: 0 4px 0 0 rgba(0,0,0,1);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(4px);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-light-green);
  filter: drop-shadow(0 0 8px rgba(0, 229, 91, 0.6));
  display: flex;
  align-items: center;
  width: 12ch; 
  white-space: nowrap;
}

#brand-typed,
#typed-title {
  display: inline;
}

#brand-typed {
  display: inline;
  width: auto;
  min-width: 0;
  color: inherit;
}

.typed-cursor {
  display: inline;
  color: var(--primary-green) !important;
  font-weight: bold;
  margin-left: 1px;
  animation: typed-blink 0.7s infinite;
}

@keyframes typed-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-item {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  transition: background-color 0.1s, color 0.1s;
}

.nav-item:hover {
  background-color: var(--primary-light-green);
  color: #003911;
}

.nav-item.active {
  color: var(--primary-green);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.terminal-btn {
  background: transparent;
  border: none;
  color: var(--secondary-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.terminal-btn:hover { color: var(--primary-green); }

.avatar-badge {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 0;
  gap: 32px;
}

.hero-beetle-img {
  width: 192px;
  filter: drop-shadow(0 0 15px rgba(0,255,102,0.8));
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text-main);
  filter: drop-shadow(0 2px 0 #00e3fd);
}

.hero-tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  max-width: 42rem;
  border-top: 2px solid var(--border-muted);
  border-bottom: 2px solid var(--border-muted);
  padding: 8px 0;
}

.hero-actions {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

/* ==========================================================================
   SKILLS & CARDS
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-category-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--secondary-cyan);
  border-bottom: 2px solid var(--secondary-cyan);
  padding-bottom: 8px;
  text-transform: uppercase;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  text-transform: uppercase;
  border: 1px solid;
}

.tag-green { border-color: var(--primary-green); color: var(--primary-green); }
.tag-pink { 
  border-color: var(--accent-pink); 
  color: var(--accent-pink); 
  box-shadow: 0 0 4px rgba(255,0,85,0.4); 
}
.tag-muted { border-color: var(--border-muted); color: var(--text-muted); }

/* ==========================================================================
   WORK LOG TIMELINE
   ========================================================================== */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-left: 16px;
  border-left: 2px solid var(--border-muted);
  position: relative;
}

.timeline-item {
  position: relative;
  padding-left: 24px;
}

.timeline-node {
  position: absolute;
  width: 12px;
  height: 12px;
  left: -7px;
  top: 6px;
}

.node-green { background-color: var(--primary-green); box-shadow: 0 0 8px rgba(0,255,102,0.8); }
.node-cyan { background-color: var(--secondary-cyan); box-shadow: 0 0 8px rgba(0,227,253,0.8); }

.timeline-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-date {
  font-size: 12px;
  color: var(--secondary-cyan);
}

.card-description {
  font-size: 14px;
  color: var(--text-muted);
}

.card-tags {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.text-tag { font-size: 12px; }

/* ==========================================================================
   TECH MANIFESTO
   ========================================================================== */
.manifesto-box {
  padding: 32px;
  position: relative;
}

.manifesto-badge {
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--accent-pink);
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
}

.manifesto-quote {
  font-size: 12px;
  color: var(--text-main);
  margin-top: 24px;
  line-height: 1.6;
}

.blinking-cursor {
  display: inline-block;
  vertical-align: middle;
  width: 8px;
  height: 16px;
  background-color: var(--primary-green);
  margin-left: 4px;
  animation: pulse-cursor 1s infinite;
}

@keyframes pulse-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ==========================================================================
   SIDE QUESTS & STATS
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.stat-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-list {
  list-style: none;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-muted);
  padding-bottom: 4px;
}

.stat-label { color: var(--text-muted); }
.stat-value { color: var(--primary-green); }

.hobbies-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
}

.hobby-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-pink { color: var(--accent-pink); }
.icon-green { color: var(--primary-green); }
.icon-cyan { color: var(--secondary-cyan); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--bg-surface-high);
  border-top: 4px solid var(--border-muted);
  margin-top: 48px;
  z-index: 40;
  position: relative;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 32px;
  gap: 16px;
}

.footer-copyright {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-light-green);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.status-badge {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--primary-dim-green);
}

.footer-link {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-link:hover { color: var(--secondary-cyan); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-green); }

.crt-flicker { animation: flicker 0.15s infinite; }
@keyframes flicker {
  0% { opacity: 0.95; }
  50% { opacity: 1; }
  100% { opacity: 0.98; }
}

/* ==========================================================================
   TERMINAL MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(12, 12, 30, 0.85);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-container {
    width: 100%;
    max-width: 500px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--bg-surface-card);
}

.modal-header {
    border-bottom: 2px solid var(--border-muted);
    padding-bottom: 8px;
}

.modal-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--secondary-cyan);
    letter-spacing: 0.1em;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--accent-pink);
    font-family: var(--font-mono);
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}

.modal-close-btn:hover {
    color: var(--primary-green);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    margin: 8px 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.modal-footer .retro-btn {
    padding: 8px 16px;
    font-size: 12px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */

/* Mobile Navigation Toggle / Stacked Header Setup */
@media (max-width: 768px) {
  /* Header & Navigation */
  .header-container {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand-logo {
    font-size: 1.5rem;
    width: auto; /* Allow flexible width on small screens */
  }

  .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    width: 100%;
    justify-content: center;
    order: 3; /* Push navigation below brand & actions on mobile */
    border-top: 1px dashed var(--border-muted);
    padding-top: 8px;
  }

  .nav-item {
    font-size: 11px;
    padding: 2px 4px;
  }

  /* Main Container Padding */
  .main-container {
    padding: 16px;
    gap: 32px;
  }

  /* Hero Section */
  .hero-section {
    padding: 40px 0;
    gap: 20px;
  }

  .hero-title {
    font-size: 1.75rem;
    word-break: break-word;
  }

  .hero-tagline {
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    padding: 6px 0;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .retro-btn {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
  }

  /* Section Titles */
  .section-title {
    font-size: 1.35rem;
    gap: 8px;
  }

  /* Grids */
  .skills-grid,
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Timeline */
  .timeline-container {
    padding-left: 12px;
  }

  .timeline-item {
    padding-left: 16px;
  }

  .timeline-card .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Tech Manifesto */
  .manifesto-box {
    padding: 20px 16px;
  }

  .manifesto-quote {
    font-size: 11px;
  }

  /* Footer */
  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
}

/* Extra Small Screens (Phones < 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.4rem;
  }
  
  .brand-logo {
    font-size: 1.25rem;
  }
}