@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'VT323', monospace;
  background: #d4e4bc;
  color: #2d3a1e;
  line-height: 1.6;
  font-size: 20px;
  overflow-x: hidden;
  image-rendering: pixelated;
  position: relative;
}

/* Tiled pixel grass background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 23px,
      rgba(76, 120, 44, 0.06) 23px,
      rgba(76, 120, 44, 0.06) 24px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 23px,
      rgba(76, 120, 44, 0.06) 23px,
      rgba(76, 120, 44, 0.06) 24px
    );
  pointer-events: none;
  z-index: 0;
}

/* Floating pixel leaves */
body::after {
  content: '🍃 🌿 🍂 🍃 🌿 🍂 🍃 🌿';
  position: fixed;
  top: -40px;
  left: 0;
  width: 200%;
  font-size: 24px;
  letter-spacing: 80px;
  opacity: 0.15;
  animation: leaf-drift 30s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes leaf-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-50%, 100vh); }
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

a {
  color: #4c782c;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #2d5a0f;
}

/* === Scroll Indicator === */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, #6b8f3c, #4c782c, #8b6914, #c9a84c);
  z-index: 1000;
  transition: width 0.05s linear;
  image-rendering: pixelated;
}

/* === Pixel Divider === */
.divider {
  border: none;
  height: 4px;
  max-width: 500px;
  margin: 16px auto;
  background: repeating-linear-gradient(
    90deg,
    #6b8f3c 0px, #6b8f3c 8px,
    #8baf5c 8px, #8baf5c 16px,
    #4c782c 16px, #4c782c 24px,
    transparent 24px, transparent 32px
  );
  image-rendering: pixelated;
}

/* === Header === */
.header {
  padding: 60px 0 30px;
  position: relative;
  z-index: 1;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 28px;
}

.profile-photo {
  flex-shrink: 0;
}

.photo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 4px;
  background: #6b8f3c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 1.8rem;
  color: #d4e4bc;
  border: 4px solid #2d3a1e;
  box-shadow: 6px 6px 0 #2d3a1e;
  image-rendering: pixelated;
}

.header-text h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.6rem;
  color: #2d3a1e;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  text-shadow: 2px 2px 0 rgba(107, 143, 60, 0.4);
}

.tagline {
  font-size: 1.3rem;
  color: #4c6630;
  margin-bottom: 14px;
}

.social-links {
  display: flex;
  gap: 14px;
}

.social-links a {
  color: #4c782c;
  transition: color 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 3px solid #4c782c;
  border-radius: 2px;
  box-shadow: 3px 3px 0 #2d3a1e;
}

.social-links a:hover {
  color: #d4e4bc;
  background: #4c782c;
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #2d3a1e;
}

/* === Bio === */
.bio {
  padding: 30px 0;
  position: relative;
  z-index: 1;
}

.bio p {
  font-size: 1.2rem;
  color: #3d5225;
  max-width: 720px;
  background: #c5d9a8;
  border: 3px solid #6b8f3c;
  border-radius: 2px;
  padding: 20px;
  box-shadow: 4px 4px 0 #4c6630;
}

/* === Section Title === */
.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 1rem;
  color: #2d3a1e;
  margin-bottom: 36px;
  letter-spacing: 0.02em;
  text-align: center;
  position: relative;
  z-index: 1;
}

.section-title::before {
  content: '>> ';
  color: #6b8f3c;
}

.section-title::after {
  content: ' <<';
  color: #6b8f3c;
}

/* === Timeline === */
.timeline-section {
  padding: 50px 0 60px;
  position: relative;
  overflow: hidden;
}

.timeline-wrapper {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Spine — pixelated vine */
.timeline-spine {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: repeating-linear-gradient(
    to bottom,
    #6b8f3c 0px, #6b8f3c 12px,
    #8baf5c 12px, #8baf5c 16px,
    #4c782c 16px, #4c782c 24px
  );
  transform: translateX(-50%);
  z-index: 1;
  image-rendering: pixelated;
}

.timeline-progress-fill {
  position: absolute;
  left: 50%;
  top: 0;
  width: 6px;
  height: 0%;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, #c9a84c, #8b6914, #6b8f3c);
  z-index: 2;
  image-rendering: pixelated;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.5);
}

/* Era Colors */
.era-highschool {
  --era-color: #4c782c;
  --era-glow: rgba(76, 120, 44, 0.4);
  --era-bg: #c5d9a8;
}

.era-college {
  --era-color: #6b8f3c;
  --era-glow: rgba(107, 143, 60, 0.4);
  --era-bg: #cce0b0;
}

.era-career {
  --era-color: #8b6914;
  --era-glow: rgba(139, 105, 20, 0.4);
  --era-bg: #e8dcc0;
}

.era-current {
  --era-color: #c9a84c;
  --era-glow: rgba(201, 168, 76, 0.4);
  --era-bg: #f0e8d0;
}

/* Timeline Entries Container */
.timeline-entries {
  position: relative;
}

/* Timeline Entry */
.timeline-entry {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: 50px;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-entry:nth-child(odd) {
  padding-right: calc(50% + 36px);
  justify-content: flex-end;
  transform: translateX(-40px);
}

.timeline-entry:nth-child(even) {
  padding-left: calc(50% + 36px);
  justify-content: flex-start;
  transform: translateX(40px);
}

.timeline-entry.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* Node — pixel diamond */
.timeline-node {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.node-dot {
  width: 14px;
  height: 14px;
  background: #c5d9a8;
  border: 3px solid #4c782c;
  transform: rotate(45deg);
  transition: all 0.4s ease;
  z-index: 2;
}

.node-ring {
  position: absolute;
  inset: -4px;
  border: 2px solid transparent;
  transform: rotate(45deg);
  opacity: 0;
  transition: all 0.4s ease;
}

.timeline-entry.in-view .node-dot {
  background: var(--era-color, #6b8f3c);
  border-color: #2d3a1e;
  box-shadow: 2px 2px 0 #2d3a1e;
}

.timeline-entry.in-view .node-ring {
  opacity: 1;
  border-color: var(--era-color, #6b8f3c);
  animation: pixel-pulse 1.5s ease-in-out infinite;
}

@keyframes pixel-pulse {
  0%, 100% { transform: rotate(45deg) scale(1); opacity: 0.6; }
  50% { transform: rotate(45deg) scale(1.6); opacity: 0; }
}

/* Timeline Card — RPG dialog box style */
.timeline-card {
  background: #eef5e0;
  border: 3px solid #4c782c;
  border-radius: 2px;
  padding: 20px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  max-width: 400px;
  box-shadow: 4px 4px 0 #3d5225;
  position: relative;
}

.timeline-entry.in-view .timeline-card {
  border-color: var(--era-color, #4c782c);
}

.timeline-card::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  height: 3px;
  background: linear-gradient(90deg, var(--era-color, #6b8f3c), transparent);
  opacity: 0.4;
}

.timeline-date {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: var(--era-color, #6b8f3c);
  letter-spacing: 0.05em;
}

.timeline-card h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  line-height: 1.8;
  color: #2d3a1e;
  margin: 8px 0 10px;
}

.timeline-card p {
  font-size: 1.05rem;
  color: #3d5225;
  line-height: 1.5;
}

/* Achievement Badge — pixel treasure */
.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 2px;
  background: #f5ecd0;
  border: 3px solid #c9a84c;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  line-height: 1.6;
  color: #8b6914;
  margin-top: 12px;
  box-shadow: 3px 3px 0 #8b6914;
  opacity: 0;
  transform: scale(0.5);
}

.timeline-entry.in-view .achievement-badge {
  animation: badge-unlock 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes badge-unlock {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.badge-icon {
  font-size: 1.1rem;
}

/* Particles — pixel fireflies */
.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #c9a84c;
  pointer-events: none;
  animation: firefly 8s ease-in-out infinite;
  z-index: 0;
  image-rendering: pixelated;
}

.particle:nth-child(2) { background: #8baf5c; }
.particle:nth-child(4) { background: #6b8f3c; }
.particle:nth-child(5) { background: #d4b85a; }

@keyframes firefly {
  0%, 100% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 0.9; }
  25% { transform: translate(15px, -20px); opacity: 0.7; }
  50% { transform: translate(-10px, -35px); opacity: 0; }
  75% { transform: translate(20px, -15px); opacity: 0.8; }
  90% { opacity: 0.5; }
}

/* Year Indicator */
.year-indicator {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: #6b8f3c;
  opacity: 0;
  transition: opacity 0.3s;
  letter-spacing: 0.08em;
  z-index: 100;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: #c5d9a8;
  padding: 8px 6px;
  border: 2px solid #6b8f3c;
  border-radius: 2px;
}

.year-indicator.visible {
  opacity: 0.8;
}

/* === Education === */
.education {
  padding: 50px 0;
  position: relative;
  z-index: 1;
}

/* === Projects === */
.projects {
  padding: 50px 0;
  position: relative;
  z-index: 1;
}

.project-card {
  background: #eef5e0;
  border: 3px solid #6b8f3c;
  border-radius: 2px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 4px 4px 0 #3d5225;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.project-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #3d5225;
}

.project-card h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  line-height: 1.8;
  color: #2d3a1e;
  margin-bottom: 4px;
}

.project-card h3 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.project-card h3 a:hover {
  border-bottom-color: #6b8f3c;
}

.project-year {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #8b6914;
  letter-spacing: 0.05em;
}

.project-card p {
  margin-top: 10px;
  font-size: 1.05rem;
  color: #3d5225;
  line-height: 1.5;
}

/* Tech Tags — pixel inventory items */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tech-tags span {
  padding: 4px 10px;
  border-radius: 2px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  line-height: 1.6;
  background: #c5d9a8;
  color: #4c782c;
  border: 2px solid #6b8f3c;
}

.tech-tags.accent span {
  background: #f5ecd0;
  color: #8b6914;
  border-color: #c9a84c;
}

/* === Skills === */
.skills {
  padding: 50px 0;
  position: relative;
  z-index: 1;
}

.skill-group {
  margin-bottom: 24px;
}

.skill-group h4 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #4c782c;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

/* === Interests === */
.interests {
  padding: 50px 0;
  position: relative;
  z-index: 1;
}

.interests-list {
  list-style: none;
  background: #eef5e0;
  border: 3px solid #6b8f3c;
  border-radius: 2px;
  padding: 20px 24px;
  box-shadow: 4px 4px 0 #3d5225;
  max-width: 600px;
  margin: 0 auto;
}

.interests-list li {
  padding: 8px 0;
  font-size: 1.1rem;
  color: #3d5225;
  border-bottom: 2px dashed rgba(107, 143, 60, 0.2);
}

.interests-list li:last-child {
  border-bottom: none;
}

.interests-list li::before {
  content: '> ';
  color: #6b8f3c;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  vertical-align: middle;
}

/* === Substack === */
.substack {
  padding: 50px 0;
  position: relative;
  z-index: 1;
}

.substack-embed {
  display: flex;
  justify-content: center;
}

.substack-embed iframe {
  border: 3px solid #6b8f3c !important;
  border-radius: 2px;
  box-shadow: 4px 4px 0 #3d5225;
  max-width: 100%;
}

/* === Footer === */
.footer {
  padding: 40px 0 50px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer p {
  font-size: 0.95rem;
  color: #4c6630;
}

.footer a {
  color: #4c782c;
  border-bottom: 2px solid #6b8f3c;
}

.footer a:hover {
  color: #2d3a1e;
}

/* === Pixel Tree Decorations === */
.timeline-section::before {
  content: '🌲';
  position: absolute;
  left: 5%;
  top: 60px;
  font-size: 48px;
  opacity: 0.12;
  z-index: 0;
  animation: tree-sway 6s ease-in-out infinite;
}

.timeline-section::after {
  content: '🌲🌳';
  position: absolute;
  right: 3%;
  bottom: 80px;
  font-size: 40px;
  opacity: 0.1;
  z-index: 0;
  animation: tree-sway 8s ease-in-out infinite reverse;
}

@keyframes tree-sway {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}

/* === Responsive === */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }

  .header-text h1 {
    font-size: 1.1rem;
  }

  .photo-placeholder {
    width: 90px;
    height: 90px;
    font-size: 1.4rem;
  }

  .bio p {
    text-align: center;
  }

  /* Timeline mobile */
  .timeline-spine {
    left: 20px;
  }

  .timeline-progress-fill {
    left: 20px;
  }

  .timeline-entry {
    padding-right: 0 !important;
    padding-left: 48px !important;
    justify-content: flex-start !important;
  }

  .timeline-entry:nth-child(odd),
  .timeline-entry:nth-child(even) {
    transform: translateY(20px);
  }

  .timeline-entry.in-view {
    transform: translateY(0);
  }

  .timeline-node {
    left: 20px;
  }

  .timeline-card {
    max-width: 100%;
  }

  .year-indicator {
    display: none;
  }

  .section-title {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 40px 0 20px;
  }

  .header-text h1 {
    font-size: 0.9rem;
  }

  .tagline {
    font-size: 1.1rem;
  }

  .timeline-card {
    padding: 16px;
  }

  .project-card {
    padding: 18px;
  }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  .timeline-entry {
    opacity: 1;
    transform: none !important;
    transition: none;
  }

  .achievement-badge {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .node-ring {
    animation: none !important;
  }

  .particle {
    animation: none !important;
    display: none;
  }

  .scroll-indicator {
    transition: none;
  }

  body::after {
    animation: none !important;
  }

  .timeline-section::before,
  .timeline-section::after {
    animation: none !important;
  }
}
