:root {
  --primary-color: #ff0055;
  --secondary-color: #00e5ff;
  --accent-color: #ffcc00;
  --bg-color: #1a1a2e;
  --panel-bg: #16213e;
  --text-color: #ffffff;
  --nav-bg: rgba(26, 26, 46, 0.95);
  --font-heading: 'Bangers', cursive;
  --font-body: 'Space Grotesk', sans-serif;
}

[data-theme="light"] {
  --primary-color: #ff0055;
  --secondary-color: #00b8cc; /* Slightly darker cyan for contrast */
  --accent-color: #ffcc00;
  --bg-color: #f0f0f5;
  --panel-bg: #ffffff;
  --text-color: #1a1a2e;
  --nav-bg: rgba(255, 255, 255, 0.95);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  overflow-x: hidden;
  height: 100vh;
  overflow-y: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.comic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Halftone effect overlay */
  background-image:
      radial-gradient(var(--secondary-color) 1px, transparent 1px),
      radial-gradient(var(--primary-color) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
  animation: bg-drift 20s linear infinite;
}

@keyframes bg-drift {
  0% { background-position: 0 0, 15px 15px; }
  100% { background-position: 30px 30px, 45px 45px; }
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  background: var(--panel-bg);
  border: 3px solid var(--accent-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  box-shadow: 3px 3px 0 var(--primary-color);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 5px 5px 0 var(--primary-color);
}

.comic-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--primary-color);
  flex-wrap: wrap;
  z-index: 100;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.nav-btn {
  background: var(--panel-bg);
  border: 2px solid var(--secondary-color);
  color: var(--secondary-color);
  font-family: var(--font-heading);
  font-size: 1.3rem;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 4px 4px 0 var(--secondary-color);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-btn:hover {
  transform: translate(-3px, -3px) scale(1.1) rotate(-2deg);
  box-shadow: 6px 6px 0 var(--primary-color);
  background: var(--secondary-color);
  color: var(--bg-color);
  border-color: var(--primary-color);
}

.nav-btn.active {
  background: var(--primary-color);
  border-color: #fff;
  color: #fff;
  box-shadow: 4px 4px 0 var(--accent-color);
  transform: translate(2px, 2px) scale(1.05);
}

.content-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.comic-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 6rem 2rem 4rem 2rem; /* Adjusted for fixed nav */
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8) rotate(-5deg);
  transition: opacity 0.4s ease-in-out, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  scrollbar-width: thin;
  scrollbar-color: var(--secondary-color) var(--bg-color);
}

.comic-page.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) rotate(0deg);
  z-index: 10;
}

.hero-section {
  justify-content: center;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  width: 100%;
  background: rgba(22, 33, 62, 0.8);
  [data-theme="light"] & {
      background: rgba(255, 255, 255, 0.9);
  }
  padding: 4rem;
  border: 4px solid var(--primary-color);
  box-shadow: 15px 15px 0 var(--secondary-color);
  backdrop-filter: blur(5px);
  position: relative;
  animation: hero-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes hero-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.issue-number {
  font-family: var(--font-heading);
  color: var(--accent-color);
  font-size: 2rem;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  text-shadow: 3px 3px 0 #000;
  transform: rotate(-2deg);
  display: inline-block;
}

.comic-title {
  font-family: var(--font-heading);
  font-size: 6rem;
  color: var(--text-color);
  text-transform: uppercase;
  line-height: 0.9;
  margin-bottom: 2rem;
  text-shadow: 6px 6px 0 var(--primary-color);
  position: relative;
}

.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.glitch::before {
  left: 3px;
  text-shadow: -2px 0 var(--secondary-color);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-1 4s infinite linear alternate-reverse;
}
.glitch::after {
  left: -3px;
  text-shadow: -2px 0 var(--accent-color);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-2 4s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% { clip: rect(20px, 9999px, 80px, 0); }
  20% { clip: rect(60px, 9999px, 10px, 0); }
  40% { clip: rect(10px, 9999px, 90px, 0); }
  60% { clip: rect(80px, 9999px, 30px, 0); }
  80% { clip: rect(40px, 9999px, 60px, 0); }
  100% { clip: rect(70px, 9999px, 20px, 0); }
}
@keyframes glitch-anim-2 {
  0% { clip: rect(80px, 9999px, 20px, 0); }
  20% { clip: rect(10px, 9999px, 90px, 0); }
  40% { clip: rect(60px, 9999px, 40px, 0); }
  60% { clip: rect(30px, 9999px, 80px, 0); }
  80% { clip: rect(90px, 9999px, 10px, 0); }
  100% { clip: rect(50px, 9999px, 30px, 0); }
}

.hero-badge {
  display: inline-block;
  background: var(--accent-color);
  color: #000;
  font-family: var(--font-heading);
  font-size: 2rem;
  padding: 0.5rem 1.5rem;
  transform: rotate(-3deg);
  margin-bottom: 2.5rem;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #fff;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.comic-btn {
  background: var(--panel-bg);
  border: 3px solid var(--secondary-color);
  color: var(--secondary-color);
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.comic-btn:hover {
  background: var(--secondary-color);
  color: #000;
  box-shadow: 6px 6px 0 var(--primary-color);
  transform: scale(1.1) rotate(2deg);
}

.location-tag {
  display: flex;
  align-items: center;
  color: var(--accent-color);
  font-weight: bold;
  font-size: 1.2rem;
  text-shadow: 1px 1px 0 #000;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 5rem;
  color: var(--accent-color);
  text-align: center;
  margin-bottom: 4rem;
  text-shadow: 4px 4px 0 var(--primary-color), 8px 8px 0 #000;
  transform: skew(-5deg) rotate(-2deg);
  margin-top: 2rem;
}

.comic-panel {
  background: var(--panel-bg);
  border: 4px solid #000;
  padding: 2.5rem;
  position: relative;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.8);
  transition: transform 0.3s ease;
  overflow: visible; /* Changed for captions */
}

.comic-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: var(--primary-color);
  z-index: 1;
}

.comic-panel:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 15px 15px 0 var(--secondary-color);
  z-index: 5;
}

.caption {
  position: absolute;
  top: -20px;
  left: 20px;
  background: var(--accent-color);
  color: #000;
  padding: 5px 15px;
  font-family: var(--font-heading);
  border: 3px solid #000;
  font-size: 1.3rem;
  z-index: 2;
  transform: rotate(-2deg);
  box-shadow: 3px 3px 0 #fff;
}

.panel-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  max-width: 1200px;
  width: 100%;
  padding-bottom: 2rem;
}

.narration-box {
  border-style: solid;
}
.mission-box {
  border-color: #000;
}
.summary-box {
  border-color: #000;
}
.narration-box:hover { border-color: var(--primary-color); }
.mission-box:hover { border-color: var(--secondary-color); }
.summary-box:hover { border-color: var(--accent-color); }


.stat-list {
  list-style: none;
}
.stat-list li {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  padding-left: 1.5rem;
  position: relative;
}
.stat-list li::before {
    content: '⚡';
    position: absolute;
    left: 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  max-width: 1200px;
  width: 100%;
  padding-bottom: 2rem;
}

.skill-card h3 {
  font-family: var(--font-heading);
  color: var(--secondary-color);
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  border-bottom: 3px dashed var(--accent-color);
  padding-bottom: 0.5rem;
  text-shadow: 2px 2px 0 #000;
}

.power-item {
  margin-bottom: 1.2rem;
  font-weight: bold;
  font-size: 1.1rem;
}

.bar {
  height: 15px;
  background: var(--primary-color);
  margin-top: 8px;
  width: 0;
  transition: width 1s cubic-bezier(0.65, 0, 0.35, 1);
  box-shadow: 3px 3px 0 #000;
  border: 1px solid #000;
}

/* Sagas (Timeline) Zigzag */
.timeline {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 2rem;
  position: relative;
}

.timeline::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: var(--secondary-color);
    transform: translateX(-50%);
    z-index: 0;
}

.timeline-entry {
  width: 45%;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

.timeline-entry.left {
    align-self: flex-start;
    margin-right: auto;
}

.timeline-entry.right {
    align-self: flex-end;
    margin-left: auto;
}

/* Connector Lines */
.timeline-entry::after {
    content: '';
    position: absolute;
    top: 20px;
    width: 60px; /* distance to center line approx */
    height: 4px;
    background: var(--secondary-color);
}

.timeline-entry.left::after {
    right: -60px; /* extend towards center */
    width: calc(11% + 2px); /* rough calc to hit center line */
}
.timeline-entry.right::after {
    left: -60px;
    width: calc(11% + 2px);
}
/* Small circle at center */
.timeline-entry::before {
    content: '';
    position: absolute;
    top: 14px;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border: 3px solid #000;
    border-radius: 50%;
    z-index: 2;
}
.timeline-entry.left::before { right: -13.5%; }
.timeline-entry.right::before { left: -13.5%; }


.entry-header {
  margin-bottom: 1rem;
}

.entry-header h3 {
  font-family: var(--font-heading);
  color: var(--secondary-color);
  font-size: 2rem;
  line-height: 1.1;
  text-shadow: 2px 2px 0 #000;
}

.company {
  display: block;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.date {
  font-size: 0.9rem;
  opacity: 0.8;
  font-style: italic;
  display: block;
  margin-top: 0.2rem;
  color: var(--text-color);
}

.entry-body ul {
  padding-left: 1.5rem;
}
.entry-body li {
  margin-bottom: 0.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  max-width: 1200px;
  width: 100%;
  padding-bottom: 2rem;
}

.project-card {
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 250px;
  background-image: linear-gradient(45deg, var(--panel-bg) 25%, transparent 25%, transparent 75%, var(--panel-bg) 75%, var(--panel-bg)),
                    linear-gradient(45deg, var(--panel-bg) 25%, transparent 25%, transparent 75%, var(--panel-bg) 75%, var(--panel-bg));
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  text-shadow: 3px 3px 0 #000;
}

.project-desc {
  font-size: 1.3rem;
}

.education-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 800px;
  width: 100%;
}

.education-card {
  text-align: center;
  max-width: 700px;
  width: 100%;
  margin-bottom: 2rem;
}

.education-card h3 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 0 #000;
}

.grad-year {
  display: inline-block;
  background: var(--secondary-color);
  color: #000;
  font-weight: bold;
  padding: 0.4rem 1.2rem;
  margin-top: 1rem;
  border-radius: 0;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 var(--accent-color);
  transform: rotate(-2deg);
}

.main-footer {
  text-align: center;
  padding: 1rem;
  border-top: 3px solid var(--secondary-color);
  background: #000;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 20;
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--accent-color);
  margin: 0;
}

.main-footer p {
    font-size: 0.9rem;
    margin: 0;
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .comic-title { font-size: 3.5rem; }
  .section-title { font-size: 3rem; }
  .hero-content { padding: 2rem; }

  .comic-nav {
    top: auto;
    bottom: 0;
    border-bottom: none;
    border-top: 3px solid var(--primary-color);
    width: 100%;
    padding: 0.5rem;
    gap: 0.5rem;
    overflow-x: auto; /* allow horizontal scroll if tabs are wide */
    justify-content: flex-start; /* align left for scroll */
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap; /* prevent stacking */
  }

  .nav-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    flex: 0 0 auto; /* don't shrink */
    margin-bottom: 0.5rem; /* for safe area */
  }

  /* Adjust page padding for bottom nav */
  .comic-page {
    padding: 4rem 1rem 6rem 1rem;
    height: calc(100% - 60px); /* rough height of bottom nav */
  }

  /* Move footer up so it's not hidden by nav */
  .main-footer {
    bottom: 70px; /* above nav */
    padding: 0.5rem;
    font-size: 0.8rem;
    z-index: 150; /* above page content, below nav */
  }

  /* Adjust timeline for mobile vertical list */
  .timeline::after {
    left: 20px;
    transform: none;
  }

  .timeline-entry {
    width: calc(100% - 40px);
    margin-left: 40px !important;
    margin-right: 0 !important;
    margin-bottom: 2rem;
  }

  .timeline-entry::before {
    left: -28px !important;
    right: auto !important;
  }

  .timeline-entry::after {
    display: none;
  }

  /* Theme toggle position tweak */
  .theme-toggle {
    top: 0.5rem;
    right: 0.5rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}
