/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Ancient Paper Color Palette */
  --primary-color: #5c4033;
  --primary-light: #8b6914;
  --primary-rgb: 92, 64, 51;
  --accent-color: #a0522d;
  --secondary-color: #6b5344;
  --light-bg: #f4e4c1;
  --light-surface: #e8d4a8;
  --bg-primary: #f4e4c1;
  --bg-light: #efe0c3;
  --text-primary: #3d2914;
  --text-dark: #2d1f10;
  --text-secondary: #5a4a3a;
  --text-light: #7a6a5a;
  --border-color: #c9b896;

  /* Typography */
  --font-primary: "Inter", sans-serif;
  --font-heading: "Playfair Display", serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Spacing */
  --section-padding: 100px 0;
  --container-padding: 0 40px;
  --max-width: 1000px;

  /* Minimal Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--light-bg);
  overflow-x: hidden;
  /* Ancient paper texture - optimized for performance */
  background-image: 
    /* Subtle paper grain */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E"),
    /* Subtle fold crease */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 400px,
      rgba(61, 41, 20, 0.03) 400px,
      rgba(61, 41, 20, 0.05) 402px,
      transparent 402px,
      transparent 800px
    ),
    /* Base aged paper gradient */
    linear-gradient(180deg, 
      rgba(244, 228, 193, 1) 0%, 
      rgba(239, 224, 195, 0.95) 50%, 
      rgba(232, 212, 168, 1) 100%
    );
  background-blend-mode: soft-light, overlay, normal;
  background-attachment: fixed;
  position: relative;
}

/* Corner aging overlay - simplified for performance */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(139, 105, 20, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 100% 100%, rgba(139, 105, 20, 0.06) 0%, transparent 40%);
  opacity: 0.8;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--container-padding);
  width: 100%;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(244, 228, 193, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition-normal);
}

.navbar.scrolled {
  background: rgba(244, 228, 193, 0.98);
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 8px; /* Space for outer ring */
}

.nav-logo .logo-text {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
}

.logo-details {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.5px;
  word-spacing: -2px;
}

.logo-title {
  font-family: var(--font-primary);
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  margin-right: -15px; /* Push closer to right edge */
}

@media (min-width: 769px) {
  .nav-menu {
    position: relative;
    left: auto;
    width: auto;
    height: auto;
    background: transparent;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding-top: 0;
    box-shadow: none;
  }
}

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 400;
  position: relative;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-light);
  font-weight: 500;
}

.nav-text {
  font-size: 0.9rem;
}

.nav-link:hover .nav-number {
  color: var(--primary-color);
  transition: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary-color);
  transition: none;
  border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  transition: width 0.2s ease-out;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition-fast);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: var(--light-bg);
  padding: 0 var(--container-padding);
  padding-top: 80px; /* Account for fixed navbar */
  overflow: hidden;
}

.hero-sidebar {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 2rem;
}

/* Hide sidebar on screens narrower than 1400px - needs wide screen to not overlap */
@media (max-width: 1400px) {
  .hero-sidebar {
    display: none;
  }
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.meta-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.status-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.hero-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(300px, 400px);
  gap: 3rem;
  align-items: center;
  padding: 0 20px;
}

.hero-text {
  color: var(--text-primary);
}

.hero-badge {
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.badge-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  display: inline-block;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 2rem;
}

.title-line {
  display: block;
}

.title-line.accent {
  color: var(--text-secondary);
  font-weight: 300;
  font-style: italic;
}

.hero-subtitle {
  font-size: 1.1rem;
  margin-bottom: 3rem;
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.6;
  width: 100%;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 16px 24px;
  border-radius: 0;
  text-decoration: none;
  font-weight: 400;
  transition: var(--transition-normal);
  border: 1px solid var(--primary-color);
  font-size: 0.9rem;
  font-family: var(--font-primary);
}

.btn-primary {
  background: var(--primary-color);
  color: var(--light-bg);
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: var(--light-bg);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 1px dashed var(--primary-color);
  gap: 0.5rem;
}

.btn-outline:hover {
  background: rgba(92, 64, 51, 0.08);
  border-style: solid;
}

.btn-outline i {
  font-size: 0.9em;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--light-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(92, 64, 51, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(244, 228, 193, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(92, 64, 51, 0.4);
}

.back-to-top:active {
  transform: translateY(-1px);
}

.hero-visual {
  background: var(--light-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.code-snippet {
  background: #1a1a1a;
  color: #e6e6e6;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #2a2a2a;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #333;
}

.code-dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: #ff5f56;
}
.dot.yellow {
  background: #ffbd2e;
}
.dot.green {
  background: #27ca3f;
}

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #888;
}

.code-content {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
}

.code-line {
  display: flex;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: codeFadeIn 0.5s ease forwards;
}

/* Staggered fade-in for each code line */
.code-line:nth-child(1) { animation-delay: 1.2s; }
.code-line:nth-child(2) { animation-delay: 1.5s; }
.code-line:nth-child(3) { animation-delay: 1.8s; }

@keyframes codeFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.line-number {
  color: #666;
  margin-right: 1rem;
  width: 20px;
  flex-shrink: 0;
}

.code-text {
  flex: 1;
}

.keyword {
  color: #c678dd;
}
.variable {
  color: #e06c75;
}
.operator {
  color: #56b6c2;
}
.string {
  color: #98c379;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.scroll-dot {
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: scrollDotMove 2s ease-in-out infinite;
  position: relative;
}

@keyframes scrollDotMove {
  0% {
    transform: translateY(0px);
    opacity: 1;
  }
  50% {
    transform: translateY(20px);
    opacity: 0.3;
  }
  100% {
    transform: translateY(0px);
    opacity: 1;
  }
}

.scroll-line {
  width: 2px;
  height: 50px;
  background: var(--border-color);
  position: relative;
  transition: var(--transition-fast);
  animation: scrollLineBounce 2s ease-in-out infinite;
  border-radius: 1px;
}

.scroll-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--scroll-height, 0%);
  background: linear-gradient(
    180deg,
    var(--primary-color),
    var(--primary-light)
  );
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation: scrollFillPulse 1.5s ease-in-out infinite;
  border-radius: 1px;
}

@keyframes scrollLineBounce {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 0.7;
  }
  50% {
    transform: scaleY(1.2);
    opacity: 1;
  }
}

@keyframes scrollFillPulse {
  0%,
  100% {
    opacity: 0.8;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.05);
  }
}

.scroll-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transform: rotate(90deg);
  white-space: nowrap;
  opacity: 0.8;
  transition: var(--transition-fast);
  font-weight: 500;
}

.scroll-indicator:hover .scroll-dot {
  animation-play-state: paused;
  background: var(--primary-light);
}

.scroll-indicator:hover .scroll-text {
  opacity: 1;
  color: var(--primary-color);
  animation-play-state: paused;
}

.scroll-indicator:hover .scroll-line {
  background: var(--primary-color);
  animation-play-state: paused;
}

.scroll-indicator:hover .scroll-line::after {
  animation-play-state: paused;
}

/* Section Styles */
section {
  padding: var(--section-padding);
}

.section-header {
  text-align: center;
  margin-bottom: 7rem;
  position: relative;
}

.projects .section-header {
  margin-bottom: 8rem !important;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* About Section */
.about {
  background: var(--light-surface);
  position: relative;
  overflow: hidden;
}

/* Experience Section */
.experience {
  padding: 6rem 0;
  background: var(--bg-primary);
}

.timeline {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.timeline-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  margin-bottom: 5rem;
  position: relative;
  align-items: center;
}

.timeline-item:nth-child(even) {
  grid-template-columns: 1fr 200px;
}

.timeline-item:nth-child(even) .timeline-year {
  order: 2;
}

.timeline-item:nth-child(even) .timeline-content {
  order: 1;
}

.timeline-year {
  position: relative;
  z-index: 3;
}

.timeline-year-number {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  color: var(--text-secondary);
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.75rem;
  font-family: var(--font-primary);
  border: 2px solid var(--border-color);
  position: relative;
  transition: all 0.3s ease;
  text-align: center;
  line-height: 1.2;
  padding: 0.25rem;
}

.timeline-item:hover .timeline-year-number {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.timeline-content {
  background: rgba(244, 228, 193, 0.98);
  padding: 2.5rem;
  border-radius: 20px;
  border: 1px solid rgba(201, 184, 150, 0.5);
  box-shadow: 0 20px 40px rgba(61, 41, 20, 0.15);
  position: relative;
  transition: all 0.3s ease;
}

.timeline-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
  border-radius: 20px 20px 0 0;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.timeline-content h3 {
  color: var(--text-dark);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  position: relative;
}

.timeline-content h3::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
  transition: left 0.3s ease;
}

.timeline-content p {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.timeline-achievement {
  background: linear-gradient(135deg, rgba(139, 105, 20, 0.1), rgba(92, 64, 51, 0.05));
  border-left: 4px solid var(--primary-color);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 8px;
  font-weight: 500;
  color: var(--text-dark);
  position: relative;
  transition: all 0.3s ease;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.timeline-achievement::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235c4033'%3E%3Cpath d='M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94A5.01 5.01 0 0 0 11 15.9V19H7v2h10v-2h-4v-3.1a5.01 5.01 0 0 0 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  border-radius: 50%;
  padding: 2px;
  background-color: var(--light-bg);
}

.timeline-achievement:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(92, 64, 51, 0.15);
}

.timeline-achievement strong {
  color: var(--primary-color);
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.timeline-tags .tag {
  background: var(--bg-light);
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.timeline-tags .tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Timeline responsive rules moved to main responsive section */

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.about-text p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.about-image {
  position: relative;
}

.image-container {
  position: relative;
  width: min(300px, 80vw);
  height: min(400px, 100vw);
  margin: 0 auto;
}

/* Layer 1 - Back frame (furthest behind) */
.image-container::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 20px;
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  border-radius: 20px;
  opacity: 0.15;
  z-index: -2;
  transition: transform 0.3s ease;
}

/* Layer 2 - Middle frame */
.image-container::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 100%;
  height: 100%;
  background: var(--accent-color);
  border-radius: 20px;
  opacity: 0.25;
  z-index: -1;
  transition: transform 0.3s ease;
}

.image-container:hover::before {
  transform: translate(5px, 5px);
}

.image-container:hover::after {
  transform: translate(3px, 3px);
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  position: relative;
  z-index: 2;
  transition: var(--transition-normal);
}

.profile-image:hover {
  transform: translateY(-5px);
}

.image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--light-bg);
  position: relative;
  z-index: 2;
}

.image-decoration {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--primary-color)
  );
  border-radius: 20px;
  z-index: 1;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-category {
  background: var(--light-bg);
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
}

.skill-category:hover {
  border-color: var(--primary-color);
}

.skill-category h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
  text-align: center;
  font-weight: 400;
}

.skill-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-align: center;
  min-height: 90px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  transition: var(--transition-normal);
}

.skill-item:hover {
  border-color: var(--primary-color);
}

.skill-item i {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.skill-item span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  text-align: center;
  word-break: break-word;
}

/* Projects Section */
.projects {
  background: var(--light-surface);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2rem;
  padding-top: 0;
}

/* Only the first 4 project cards show by default, regardless of markup order mistakes */
.projects-grid .project-card:nth-child(n + 5) {
  display: none;
}

.projects-grid .project-card:nth-child(n + 5).is-visible {
  display: block;
}

.projects-more {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.projects-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  background: transparent;
  border: none;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.projects-more-line {
  width: 36px;
  height: 1px;
  background: var(--border-color);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.projects-more-btn:hover .projects-more-line,
.projects-more-btn.is-expanded .projects-more-line {
  width: 60px;
  background: var(--primary-color);
}

.projects-more-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--light-bg);
  color: var(--text-secondary);
  font-size: 0.68rem;
  transition: border-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.projects-more-btn.is-expanded .projects-more-count {
  opacity: 0;
  width: 0;
  min-width: 0;
  padding: 0;
  border: none;
  overflow: hidden;
}

.projects-more-btn i {
  font-size: 0.7rem;
  transition: transform 0.3s ease, color 0.3s ease;
}

.projects-more-btn:hover {
  color: var(--primary-color);
}

.projects-more-btn:hover .projects-more-count {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.projects-more-btn.is-expanded i {
  transform: rotate(180deg);
}

.project-card {
  background: var(--light-bg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition-normal);
  border-radius: 12px !important;
}

.project-card:hover {
  border-color: var(--primary-color);
}

.project-image {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: var(--light-surface);
  border-radius: 12px 12px 0 0 !important;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  background: var(--light-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-secondary);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: var(--light-surface);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-normal);
  padding-left: 10px;
  padding-top: 10px;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  width: 40px;
  height: 40px;
  background: var(--light-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-normal);
}

.project-link:hover {
  background: var(--primary-color);
  color: var(--light-bg);
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1.8rem;
  line-height: 1.7;
  font-size: 0.95rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}

.tech-tag {
  background: var(--light-surface);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 400;
  border: 1px solid var(--border-color);
}

/* Contact Section */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.contact-methods {
  margin-bottom: 2rem;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-method i {
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: var(--light-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.method-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
}

.method-value {
  display: block;
  color: var(--text-secondary);
}

.x-logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: inherit;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 50px;
  height: 50px;
  background: var(--light-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-normal);
}

.social-link:hover {
  background: var(--primary-color);
  color: var(--light-bg);
  transform: translateY(-2px);
}

.contact-form {
  background: var(--bg-light);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.simple-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  transition: var(--transition-normal);
  background: var(--light-bg);
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-input[type="textarea"] {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-primary);
  line-height: 1.6;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border-color);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  transition: var(--transition-normal);
  background: var(--light-bg);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Footer */
.footer {
  background: var(--light-surface);
  color: var(--text-secondary);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo-text {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
}

.footer-logo-details {
  display: flex;
  flex-direction: column;
}

.footer-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.5px;
  word-spacing: -2px;
}

.footer-title {
  font-family: var(--font-primary);
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 300px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition-normal);
  position: relative;
}

.footer-list a:hover {
  color: var(--primary-color);
}

.footer-list a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary-color);
  transition: var(--transition-normal);
}

.footer-list a:hover::after {
  width: 100%;
}

.footer-contact-item {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-light);
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-tech {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-light);
}

.tech-label {
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tech-stack {
  color: var(--text-secondary);
}

/* Responsive Design */

/* Large screens - 1200px+ */
@media (max-width: 1200px) {
  .nav-container {
    padding: 0 30px;
  }

  .hero-content {
    gap: 2.5rem;
  }

  .footer-main {
    gap: 3rem;
  }
}

/* Large tablets and small desktops - 1024px */
@media (max-width: 1024px) {
  :root {
    --container-padding: 0 25px;
  }

  .hero {
    padding: 0 20px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-visual {
    max-width: 450px;
    margin: 0 auto;
  }

  /* Hide decorative coffee stain on tablets */
  .hero::after {
    display: none;
  }

  .nav-container {
    padding: 0 20px;
  }

  .nav-menu {
    gap: 1.25rem;
  }

  .nav-text {
    font-size: 0.85rem;
  }

  .timeline-item {
    grid-template-columns: 100px 1fr;
    gap: 1.5rem;
  }

  .timeline-item:nth-child(even) {
    grid-template-columns: 1fr 100px;
  }

  .timeline-year-number {
    width: 70px;
    height: 70px;
    font-size: 0.7rem;
  }

  .about-content {
    gap: 2.5rem;
  }

  .contact-content {
    gap: 2.5rem;
  }

  .footer-main {
    gap: 2.5rem;
  }

  .footer-links {
    gap: 1.5rem;
  }

  .skills-grid {
    gap: 1.5rem;
  }

  .projects-grid {
    gap: 1.5rem;
  }
}

/* Tablets - 900px */
@media (max-width: 900px) {
  :root {
    --section-padding: 80px 0;
    --container-padding: 0 20px;
  }

  .nav-menu {
    gap: 1rem;
  }

  .nav-number {
    display: none;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    text-align: center;
  }

  .timeline-year {
    order: 1 !important;
  }

  .timeline-content {
    order: 2 !important;
  }

  .timeline-year-number {
    margin: 0 auto;
    width: 75px;
    height: 75px;
  }

  .timeline-content h3::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline-tags {
    justify-content: center;
  }

  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about-text {
    text-align: center;
  }

  .about-text h3 {
    text-align: center;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand {
    align-items: center;
    text-align: center;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-description {
    max-width: 400px;
    margin: 0 auto;
  }

  .hero-visual {
    max-width: 400px;
  }

  .section-header {
    margin-bottom: 3rem;
  }

  .skill-category {
    padding: 2rem;
  }

  .project-content {
    padding: 1.75rem;
  }
}

/* Small tablets - 850px (bridge between 900 and 768) */
@media (max-width: 850px) {
  .nav-menu {
    position: fixed !important;
    top: 80px !important;
    left: -100% !important;
    width: 100% !important;
    height: calc(100vh - 80px) !important;
    background: var(--light-bg) !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding-top: 2rem !important;
    gap: 1.5rem !important;
    transition: left 0.3s ease !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    margin-left: 0 !important;
    z-index: 999;
  }

  .nav-menu.active {
    left: 0 !important;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-number {
    display: inline;
  }

  .nav-link {
    font-size: 1.1rem;
  }
}

/* Mobile landscape and small tablets - 768px */
@media (max-width: 768px) {
  :root {
    --section-padding: 60px 0;
    --container-padding: 0 20px;
  }

  /* Nav toggle animation */
  .nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  .nav-container {
    height: 70px;
  }

  .nav-menu {
    top: 70px !important;
    height: calc(100vh - 70px) !important;
  }

  /* Logo - keep name visible */
  .logo-details {
    display: flex;
  }

  .logo-name {
    font-size: 0.7rem;
    letter-spacing: 1px;
  }

  .logo-title {
    font-size: 0.55rem;
  }

  .nav-logo .logo-text {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .nav-logo {
    gap: 0.6rem;
  }

  /* Hero */
  .hero {
    min-height: calc(100vh - 70px);
    padding-top: 90px;
  }

  .hero-content {
    padding: 0 10px;
  }

  .hero-title {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    margin-bottom: 1.5rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .hero-badge {
    margin-bottom: 1rem;
  }

  .badge-text {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    letter-spacing: 1px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .btn {
    width: 100%;
    max-width: 220px;
    justify-content: center;
    padding: 14px 20px;
  }

  .hero-visual {
    max-width: 100%;
  }

  /* Hide decorative flourish on hero visual on mobile */
  .hero-visual::before {
    display: none;
  }

  .code-content {
    padding: 1rem;
    font-size: 0.8rem;
    overflow-x: auto;
  }

  .code-line {
    white-space: nowrap;
  }

  .scroll-indicator {
    display: none;
  }

  /* Sections */
  .section-header {
    margin-bottom: 2.5rem;
  }

  .section-title {
    font-size: clamp(1.6rem, 6vw, 2rem);
  }

  .section-subtitle {
    font-size: 0.95rem;
    padding: 0 10px;
  }

  /* About */
  .about-text h3 {
    font-size: 1.5rem;
  }

  .about-text p {
    font-size: 1rem;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .image-container {
    width: 240px;
    height: 300px;
  }

  .image-decoration {
    top: -10px;
    left: -10px;
  }

  /* Experience */
  .experience {
    padding: 4rem 0;
  }

  .timeline-item {
    margin-bottom: 3rem;
  }

  .timeline-content {
    padding: 1.5rem;
  }

  .timeline-content h3 {
    font-size: 1.25rem;
  }

  .timeline-content p {
    font-size: 0.95rem;
  }

  .timeline-year-number {
    width: 70px;
    height: 70px;
    font-size: 0.7rem;
  }

  .timeline-tags .tag {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .skill-category {
    padding: 1.5rem;
  }

  .skill-category h3 {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
  }

  .skill-item {
    padding: 1rem;
  }

  .skill-item i {
    font-size: 1.25rem;
  }

  .skill-item span {
    font-size: 0.8rem;
  }

  .skill-items {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Projects */
  .project-content {
    padding: 1.5rem;
  }

  .project-title {
    font-size: 1.1rem;
  }

  .project-description {
    font-size: 0.95rem;
  }

  .project-image {
    height: 180px;
  }

  /* Contact */
  .contact-info h3 {
    font-size: 1.5rem;
    text-align: center;
  }

  .contact-info p {
    font-size: 1rem;
    text-align: center;
  }

  .contact-methods {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .contact-method {
    width: 100%;
    max-width: 300px;
  }

  .contact-method i {
    width: 45px;
    height: 45px;
    font-size: 1rem;
    flex-shrink: 0;
  }

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

  .social-link {
    width: 45px;
    height: 45px;
  }

  .contact-form {
    padding: 1.25rem;
  }

  /* Footer */
  .footer {
    padding: 3rem 0 1.5rem;
  }

  .footer-links {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    text-align: center;
  }

  .footer-column {
    align-items: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-meta {
    align-items: center;
  }

  .footer-status {
    font-size: 0.75rem;
  }

  .footer-tech {
    font-size: 0.7rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Bridge breakpoint - 650px */
@media (max-width: 650px) {
  .hero-title {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .badge-text {
    font-size: 0.65rem;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .image-container {
    width: 200px;
    height: 260px;
  }

  .timeline-content {
    padding: 1.25rem;
  }

  .timeline-year-number {
    width: 65px;
    height: 65px;
    font-size: 0.65rem;
  }

  .skill-item {
    padding: 0.875rem;
  }

  .skill-item i {
    font-size: 1.1rem;
  }

  .skill-item span {
    font-size: 0.75rem;
  }

  .project-image {
    height: 160px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

/* Small mobile - 550px */
@media (max-width: 550px) {
  .hero-visual {
    max-width: 100%;
  }

  .code-content {
    font-size: 0.7rem;
    padding: 0.875rem;
  }

  .code-header {
    padding: 0.75rem;
  }

  .dot {
    width: 10px;
    height: 10px;
  }

  .timeline-content h3 {
    font-size: 1.15rem;
  }

  .timeline-content p {
    font-size: 0.9rem;
  }

  .timeline-tags .tag {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }

  .contact-method {
    max-width: 100%;
  }

  .social-link {
    width: 42px;
    height: 42px;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  :root {
    --section-padding: 50px 0;
    --container-padding: 0 15px;
  }

  /* Logo scales down but stays visible */
  .logo-name {
    font-size: 0.6rem;
    letter-spacing: 0.5px;
  }

  .logo-title {
    font-size: 0.5rem;
  }

  .nav-logo .logo-text {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .nav-logo {
    gap: 0.5rem;
  }

  .nav-container {
    padding: 0 15px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.6rem;
    letter-spacing: 0;
  }

  .image-container {
    width: 180px;
    height: 230px;
  }

  .timeline-content {
    padding: 1.25rem;
  }

  .skill-items {
    grid-template-columns: repeat(2, 1fr);
  }

  .skill-item {
    padding: 0.75rem 0.5rem;
  }

  .skill-item i {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .skill-item span {
    font-size: 0.65rem;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-method {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .project-placeholder {
    font-size: 2rem;
  }

  /* Projects mobile optimizations */
  .projects-grid {
    gap: 1.2rem;
  }

  .project-content {
    padding: 1.2rem;
  }

  .project-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .project-description {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .project-image {
    height: 160px;
  }

  .tech-tag {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
  }

  .code-content {
    font-size: 0.65rem;
    padding: 0.75rem;
  }

  .code-header {
    padding: 0.75rem;
  }

  .code-filename {
    font-size: 0.7rem;
  }

  .dot {
    width: 8px;
    height: 8px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  /* Logo stays visible even on smallest screens */
  .logo-name {
    font-size: 0.55rem;
    letter-spacing: 0;
  }

  .logo-title {
    font-size: 0.45rem;
  }

  .nav-logo .logo-text {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .nav-logo {
    gap: 0.4rem;
  }

  .nav-container {
    padding: 0 10px;
    height: 60px;
  }

  .nav-menu {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
  }

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

  .btn {
    padding: 12px 16px;
    font-size: 0.85rem;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .skill-items {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-year-number {
    width: 55px;
    height: 55px;
    font-size: 0.6rem;
  }

  /* Hide unnecessary elements on small screens */
  .hero-sidebar,
  .section-ornament,
  .hero-visual::before,
  .hero::after,
  .timeline-year,
  .footer-bottom,
  .back-to-top {
    display: none !important;
  }

  /* Centralize content */
  .container {
    padding: 0 15px;
    max-width: 100%;
  }

  .hero-content {
    text-align: center;
    gap: 1.5rem;
  }

  .hero-text {
    text-align: center;
  }

  .section-header {
    text-align: center;
    margin-bottom: 2rem;
  }

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

  .section-subtitle {
    font-size: 0.9rem;
  }

  /* Projects mobile optimizations - centralized */
  .projects-grid {
    gap: 1rem;
    padding-top: 1rem;
    justify-content: center;
  }

  .project-card {
    border-radius: 8px !important;
    max-width: 100%;
    margin: 0 auto;
  }

  .project-content {
    padding: 1rem;
    text-align: center;
  }

  .project-title {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    text-align: center;
  }

  .project-description {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
    text-align: center;
  }

  .project-image {
    height: 140px;
  }

  .project-overlay {
    opacity: 0.9;
  }

  .project-links {
    justify-content: center;
    gap: 0.5rem;
  }

  .tech-tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    justify-content: center;
  }

  /* Skills section - simplified */
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    justify-content: center;
  }

  .skill-item {
    text-align: center;
    padding: 1rem;
  }

  /* Timeline - simplified */
  .timeline {
    padding-left: 1rem;
  }

  .timeline-content {
    text-align: center;
  }

  /* Contact - simplified */
  .contact-content {
    text-align: center;
  }

  .contact-method {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  /* Footer - simplified */
  .footer-main {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-section {
    text-align: center;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* Loading animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Utility classes */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

/* ========================================
   FUN ANCIENT PAPER ELEMENTS
   ======================================== */

/* Subtle Dust Particles - Static for performance */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9998;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(139, 105, 20, 0.2) 50%, transparent 50%),
    radial-gradient(1px 1px at 50% 15%, rgba(61, 41, 20, 0.15) 50%, transparent 50%),
    radial-gradient(1px 1px at 85% 30%, rgba(92, 64, 51, 0.15) 50%, transparent 50%),
    radial-gradient(1px 1px at 45% 85%, rgba(139, 105, 20, 0.2) 50%, transparent 50%);
  opacity: 0.5;
}

/* Wax Seal Effect on Logo */
/* Authentic Stamp Effect */
.nav-logo .logo-text {
  position: relative;
  background: transparent;
  color: var(--primary-color) !important;
  border: 3px solid var(--primary-color) !important;
  font-weight: 800;
  letter-spacing: -1px;
  transition: all 0.3s ease;
  /* Ink bleed effect */
  text-shadow: 
    0.5px 0.5px 0 var(--primary-color),
    -0.5px -0.5px 0 var(--primary-color),
    0.5px -0.5px 0 var(--primary-color),
    -0.5px 0.5px 0 var(--primary-color);
  /* Extra outer ring via box-shadow */
  box-shadow: 
    0 0 0 6px transparent,
    0 0 0 8px rgba(92, 64, 51, 0.3);
}

/* Outer decorative ring */
.nav-logo .logo-text::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  opacity: 0.5;
}

/* Inner decorative ring */
.nav-logo .logo-text::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border: 1px solid var(--primary-color);
  border-radius: 50%;
  opacity: 0.4;
}

/* Stamp pressed effect on hover - handled by stampWiggle animation */

/* Decorative Flourish on Section Headers */
.section-title::before {
  display: none; /* Hide pseudo-element, using real element now */
}

/* Real ornament element for dodge effect */
.section-ornament {
  display: block;
  font-size: 1.2rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  opacity: 0.5;
  transition: transform 0.15s ease-out;
  cursor: default;
}

/* Coffee Stain Ring - Decorative */
/* Decorative Stamp on Hero */
.hero::after {
  content: "APPROVED";
  position: absolute;
  bottom: 12%;
  right: 6%;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: transparent;
  border: 4px solid rgba(139, 37, 0, 0.25);
  box-shadow: 
    inset 0 0 0 3px transparent,
    inset 0 0 0 6px rgba(139, 37, 0, 0.15);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(139, 37, 0, 0.3);
  transform: rotate(-15deg);
  text-shadow: 
    0.5px 0.5px 0 rgba(139, 37, 0, 0.2),
    -0.5px -0.5px 0 rgba(139, 37, 0, 0.2);
  animation: stampPress 0.6s ease-out 1s both;
}

@keyframes stampPress {
  0% {
    opacity: 0;
    transform: rotate(-15deg) scale(1.3);
  }
  50% {
    opacity: 1;
    transform: rotate(-15deg) scale(0.95);
  }
  70% {
    transform: rotate(-15deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: rotate(-15deg) scale(1);
  }
}

/* Keep default pointer for better performance */

/* Paper Lifting Effect on Cards */
.project-card,
.skill-category,
.timeline-content {
  position: relative;
}

.project-card::after,
.skill-category::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 10px;
  background: linear-gradient(180deg, transparent, rgba(61, 41, 20, 0.1));
  border-radius: 50%;
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.project-card:hover::after,
.skill-category:hover::after {
  transform: scaleY(1);
}

.project-card:hover,
.skill-category:hover {
  transform: translateY(-5px) rotate(-0.5deg);
  box-shadow: 
    0 15px 30px rgba(61, 41, 20, 0.15),
    5px 5px 0 rgba(201, 184, 150, 0.3);
}

/* Ink Underline Animation on Links */
.nav-link::after {
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--primary-color) 20%, 
    var(--primary-color) 80%, 
    transparent 100%
  ) !important;
  height: 2px !important;
}

/* Torn Paper Edge Effect on Footer */
.footer::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  height: 15px;
  background: 
    linear-gradient(135deg, var(--light-surface) 25%, transparent 25%) -10px 0,
    linear-gradient(225deg, var(--light-surface) 25%, transparent 25%) -10px 0,
    linear-gradient(315deg, var(--light-surface) 25%, transparent 25%),
    linear-gradient(45deg, var(--light-surface) 25%, transparent 25%);
  background-size: 20px 15px;
  background-color: transparent;
}

.footer {
  position: relative;
  margin-top: 15px;
}

/* Quill Icon removed - was causing layout issues */

/* Stat Numbers with Subtle Underline */
.stat-number {
  position: relative;
  display: inline-block;
}

.stat-number::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--accent-color);
  opacity: 0.4;
}

/* Timeline Year Hover - Seal Press Effect */
.timeline-year-number:hover {
  transform: scale(0.95);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Form Input Focus - Ink Well Effect */
.form-input:focus {
  box-shadow: 
    0 0 0 2px var(--light-bg),
    0 0 0 4px rgba(92, 64, 51, 0.2);
  border-color: var(--accent-color) !important;
}

/* Button Pressed Effect - Like a Stamp */
.btn:active {
  transform: scale(0.98) translateY(2px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Decorative Corner Flourish on Hero Visual */
.hero-visual::before {
  content: "❧";
  position: absolute;
  top: -20px;
  right: -10px;
  font-size: 2rem;
  color: var(--accent-color);
  opacity: 0.4;
  transform: rotate(45deg);
}

.hero-visual {
  position: relative;
}

/* Skill Item Hover - Ink Stamp Effect */
.skill-item:hover {
  background: var(--light-surface);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(61, 41, 20, 0.15);
}

.skill-item:hover i {
  color: var(--accent-color);
  transform: rotate(-5deg);
  transition: all 0.3s ease;
}

/* Social Link Wax Seal on Hover */
.social-link:hover {
  background: var(--primary-color) !important;
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.1),
    0 2px 4px rgba(92, 64, 51, 0.2) !important;
}

/* Scrollbar styled like aged paper edge */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, 
    var(--accent-color), 
    var(--primary-color)
  );
  border: 2px solid var(--light-surface);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, 
    var(--primary-color), 
    var(--accent-color)
  );
}

/* Back to top button responsive */
@media (max-width: 768px) {
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 1.5rem;
    right: 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .back-to-top {
    width: 42px;
    height: 42px;
    bottom: 1rem;
    right: 1rem;
  }
  
  /* Resume button on mobile */
  .btn-outline {
    border-width: 1px;
  }
}

/* ============================================
   SUBTLE ANIMATIONS - Performance Optimized
   Using transform & opacity only (GPU accelerated)
   ============================================ */

/* Fade In Up Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide In From Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In From Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Hero Entrance Animations */
.hero-badge {
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-title {
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-subtitle {
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.hero-buttons {
  animation: fadeInUp 0.6s ease-out 0.8s both;
}

.hero-visual {
  animation: fadeIn 0.8s ease-out 0.6s both;
}

.code-window {
  animation: slideInRight 0.7s ease-out 0.8s both;
}

/* Scroll-triggered animations (add .animate class via JS) */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for grid items */
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }
.animate-on-scroll.delay-6 { transition-delay: 0.6s; }

/* Section headers animation - uses .revealed class from new effects */

/* Timeline items slide in alternating */
.timeline-item {
  opacity: 0;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.timeline-item:nth-child(odd) {
  transform: translateX(-20px);
}

.timeline-item:nth-child(even) {
  transform: translateX(20px);
}

.timeline-item.revealed {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item.animated {
  opacity: 1;
  transform: translateX(0);
}

/* Skill categories */
.skill-category {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.skill-category.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Project cards */
.project-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.project-card.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Contact section */
.contact-info {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.contact-info.animated {
  opacity: 1;
  transform: translateX(0);
}

.contact-form-container {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.contact-form-container.animated {
  opacity: 1;
  transform: translateX(0);
}

/* About section */
.about-text {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.about-text.animated {
  opacity: 1;
  transform: translateX(0);
}

.about-image {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.about-image.animated {
  opacity: 1;
  transform: translateX(0);
}

/* Subtle hover enhancements */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.nav-link {
  transition: color 0.2s ease;
}

/* Image container subtle float */
.image-container {
  transition: transform 0.3s ease;
}

.image-container:hover {
  transform: translateY(-5px);
}

/* Stat numbers subtle pulse on hover */
.stat-item {
  transition: transform 0.2s ease;
}

.stat-item:hover {
  transform: scale(1.05);
}

/* Form input focus animation */
.form-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  box-shadow: 0 0 0 3px rgba(92, 64, 51, 0.1);
}

/* ============================================
   PLAYFUL ANIMATIONS - Still Performance Safe
   ============================================ */

/* Bounce keyframe */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Wiggle keyframe */
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

/* Pulse glow */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(92, 64, 51, 0.3); }
  50% { box-shadow: 0 0 20px 5px rgba(92, 64, 51, 0.15); }
}

/* Gentle float */
@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Pop in */
@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

/* Skill icons wiggle on hover */
.skill-item:hover i {
  animation: wiggle 0.4s ease-in-out;
}

/* Timeline year badges bounce on hover */
.timeline-year-number:hover {
  animation: bounce 0.5s ease;
}

/* Navigation links playful underline grow */
.nav-link::after {
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Buttons bounce on click */
.btn:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Project cards tilt on hover */
.project-card:hover {
  transform: translateY(-8px) rotate(-1deg);
}

/* Hero badge playful entrance */
.hero-badge {
  animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s both;
}

/* Code window gentle float */
.code-window {
  animation: slideInRight 0.7s ease-out 0.8s both;
}

.code-window:hover {
  animation: gentleFloat 3s ease-in-out infinite;
}

/* Scroll indicator bounce */
.scroll-indicator {
  animation: bounce 2s ease-in-out infinite;
}

/* Social links pop on hover */
.social-link {
  transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.social-link:hover {
  transform: scale(1.05) rotate(-2deg);
}

/* Contact method icons bounce */
.contact-icon {
  transition: transform 0.3s ease;
}

.contact-method:hover .contact-icon {
  animation: bounce 0.5s ease;
}

/* Footer links playful hover */
.footer-links a {
  transition: transform 0.2s ease, color 0.2s ease;
}

.footer-links a:hover {
  transform: translateX(5px);
}

/* Stats playful hover */
.stat-item:hover .stat-number {
  animation: bounce 0.4s ease;
}

/* Image container playful tilt */
.image-container:hover {
  transform: translateY(-8px) rotate(2deg);
}

/* Form submit button pulse when focused */
.btn-primary:focus {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Tag pills bounce on hover */
.tag:hover,
.timeline-tags .tag:hover {
  transform: translateY(-3px) scale(1.05);
  transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Project tech tags stagger pop */
.project-tech span {
  transition: transform 0.2s ease;
}

.project-card:hover .project-tech span:nth-child(1) { transform: translateY(-2px); transition-delay: 0s; }
.project-card:hover .project-tech span:nth-child(2) { transform: translateY(-2px); transition-delay: 0.05s; }
.project-card:hover .project-tech span:nth-child(3) { transform: translateY(-2px); transition-delay: 0.1s; }
.project-card:hover .project-tech span:nth-child(4) { transform: translateY(-2px); transition-delay: 0.15s; }
.project-card:hover .project-tech span:nth-child(5) { transform: translateY(-2px); transition-delay: 0.2s; }

/* Back to top button bounce */
.back-to-top:hover {
  animation: bounce 0.5s ease;
}

/* Logo stamp wobble on hover - see stampWiggle animation below */

/* Section title ornament (❦) - dodge effect via JS */

/* Code lines stagger animation on hover */
.code-window:hover .code-line:nth-child(1) { transform: translateX(3px); transition: transform 0.2s ease 0s; }
.code-window:hover .code-line:nth-child(2) { transform: translateX(3px); transition: transform 0.2s ease 0.1s; }
.code-window:hover .code-line:nth-child(3) { transform: translateX(3px); transition: transform 0.2s ease 0.2s; }

.code-line {
  transform: translateX(0);
  transition: transform 0.2s ease;
}

/* Skill category title underline grow on hover */
.skill-category h3 {
  position: relative;
}

.skill-category h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease, left 0.3s ease;
}

.skill-category:hover h3::after {
  width: 50%;
  left: 25%;
}

/* Timeline content card playful lift */
.timeline-content:hover {
  transform: translateY(-5px) rotate(0.5deg);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Hero visual decorative flourish spin on hover */
.hero-visual:hover::before {
  transform: rotate(360deg);
  transition: transform 0.8s ease;
}

/* Approved stamp wiggle periodically */
@keyframes stampWiggle {
  0%, 90%, 100% { transform: rotate(-15deg); }
  93% { transform: rotate(-18deg); }
  96% { transform: rotate(-12deg); }
}

.hero::after {
  animation: stampPress 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 1s both,
             stampWiggle 8s ease-in-out 2s infinite;
}

/* ===========================================
   ANCIENT PAPER THEME EFFECTS
   GPU-accelerated, performance-friendly
   =========================================== */

/* ===========================================
   VISIBLE AMBIENT ANIMATIONS
   Always present, subtle & atmospheric
   =========================================== */

/* --- FLOATING INK BLOTS --- */
.hero::before {
  content: "";
  position: absolute;
  top: 20%;
  left: 5%;
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.08;
  animation: floatBlot1 12s ease-in-out infinite;
  box-shadow: 
    60vw 30vh 0 4px rgba(92, 64, 51, 0.05),
    20vw 60vh 0 6px rgba(92, 64, 51, 0.04),
    80vw 70vh 0 3px rgba(92, 64, 51, 0.06);
  pointer-events: none;
}

@keyframes floatBlot1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(15px, -20px) rotate(90deg); }
  50% { transform: translate(-10px, -35px) rotate(180deg); }
  75% { transform: translate(20px, -15px) rotate(270deg); }
}

/* --- TYPEWRITER EFFECT ON "EXPERIENCES" --- */
.hero-title {
  position: relative;
}

/* Title lines fade in first */
.hero-title .title-line {
  display: block;
  opacity: 0;
  transform: translateY(15px);
  animation: lineReveal 0.5s ease forwards;
}

.hero-title .title-line:nth-child(1) { animation-delay: 0.2s; }
.hero-title .title-line:nth-child(2) { animation-delay: 0.5s; }

/* Experiences typewriter effect */
.hero-title .title-line.accent {
  opacity: 1;
  transform: none;
  animation: none;
}

.hero-title .title-line.accent .typewriter-container {
  display: inline;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 300;
}

.hero-title .title-line.accent .typed-char {
  opacity: 0;
  transition: opacity 0.05s ease;
  color: inherit;
  font-style: inherit;
  font-weight: inherit;
}

/* Blinking caret after Experiences */
.hero-title .typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent-color);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

.hero-title .typing-cursor.hidden {
  display: none;
}

@keyframes lineReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes charReveal {
  to {
    opacity: 1;
  }
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- AVAILABILITY PULSE --- */
.hero-sidebar::before {
  content: "";
  position: absolute;
  top: 47px;
  left: 0;
  width: 8px;
  height: 8px;
  background: #4a7c59;
  border-radius: 50%;
  animation: availPulse 2s ease-in-out infinite;
}

@keyframes availPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 124, 89, 0.4); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(74, 124, 89, 0); }
}

/* --- PAPER CORNER CURL --- */
body::after {
  content: "";
  position: fixed;
  bottom: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, transparent 50%, rgba(92, 64, 51, 0.08) 50%);
  pointer-events: none;
  z-index: 1;
  animation: cornerCurl 8s ease-in-out infinite;
}

@keyframes cornerCurl {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-3px, -3px) rotate(-2deg); }
}

/* --- ANIMATED SECTION DIVIDERS --- */
section::after {
  content: "❧";
  display: block;
  text-align: center;
  font-size: 1.5rem;
  color: var(--accent-color);
  opacity: 0.3;
  margin-top: 4rem;
  animation: flourishSway 6s ease-in-out infinite;
}

section:last-of-type::after {
  display: none;
}

@keyframes flourishSway {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(3deg) scale(1.02); }
  75% { transform: rotate(-3deg) scale(1.02); }
}

/* --- INK DRIP ON TIMELINE --- */
.timeline::before {
  animation: inkFlow 4s ease-in-out infinite;
}

@keyframes inkFlow {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 0 10px; }
}

/* --- CODE WINDOW TYPING EFFECT --- */
.code-window .code-line:nth-child(1)::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--primary-color);
  opacity: 0;
  animation: typingCursor 3s ease-in-out infinite;
  animation-delay: 0s;
  margin-left: 2px;
  vertical-align: middle;
}

.code-window .code-line:nth-child(2)::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--primary-color);
  opacity: 0;
  animation: typingCursor 3s ease-in-out infinite;
  animation-delay: 1s;
  margin-left: 2px;
  vertical-align: middle;
}

.code-window .code-line:nth-child(3)::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--primary-color);
  opacity: 0;
  animation: typingCursor 3s ease-in-out infinite;
  animation-delay: 2s;
  margin-left: 2px;
  vertical-align: middle;
}

@keyframes typingCursor {
  0%, 30%, 100% { opacity: 0; }
  5%, 25% { opacity: 0.7; }
}

/* --- STATS COUNTING SHIMMER --- */
.stat-number {
  background: linear-gradient(
    90deg,
    var(--text-primary) 0%,
    var(--text-primary) 40%,
    var(--primary-color) 50%,
    var(--text-primary) 60%,
    var(--text-primary) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerCount 4s ease-in-out infinite;
}

@keyframes shimmerCount {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: -100% 0; }
}

/* --- SKILL ICONS GENTLE BOUNCE --- */
.skill-item:nth-child(odd) i {
  animation: gentleBounce1 4s ease-in-out infinite;
}

.skill-item:nth-child(even) i {
  animation: gentleBounce2 4s ease-in-out infinite;
  animation-delay: 0.5s;
}

@keyframes gentleBounce1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes gentleBounce2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* --- PROJECT ICON ROTATE --- */
.project-icon i {
  animation: iconSpin 20s linear infinite;
}

@keyframes iconSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- FOOTER STAMP PRESS --- */
.footer-brand .logo-text {
  animation: stampBreath 5s ease-in-out infinite;
}

@keyframes stampBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* --- CONTACT ICONS WAVE --- */
.contact-method:nth-child(1) i {
  animation: waveIcon 3s ease-in-out infinite;
  animation-delay: 0s;
}

.contact-method:nth-child(2) i {
  animation: waveIcon 3s ease-in-out infinite;
  animation-delay: 0.3s;
}

.contact-method:nth-child(3) i {
  animation: waveIcon 3s ease-in-out infinite;
  animation-delay: 0.6s;
}

@keyframes waveIcon {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-2px) rotate(-5deg); }
  75% { transform: translateY(-2px) rotate(5deg); }
}

/* --- FORM PLACEHOLDER FADE --- */
.form-input::placeholder {
  animation: placeholderFade 4s ease-in-out infinite;
}

@keyframes placeholderFade {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* --- SOCIAL LINKS ORBIT --- */
.social-links {
  position: relative;
}

.social-links::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  border: 1px dashed rgba(92, 64, 51, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: orbitSpin 30s linear infinite;
  pointer-events: none;
}

@keyframes orbitSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- BACK TO TOP ARROW BOUNCE --- */
.back-to-top.visible i {
  animation: arrowBounce 2s ease-in-out infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* --- HERO BADGE SHINE - Applied to badge-text instead --- */
.badge-text {
  position: relative;
  overflow: hidden;
}

.badge-text::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: badgeShine 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes badgeShine {
  0%, 100% { left: -100%; }
  50% { left: 150%; }
}

/* ===========================================
   MORE VISIBLE AMBIENT ANIMATIONS
   =========================================== */

/* --- FLOATING DECORATIVE DOTS --- */
.about::before {
  content: "";
  position: absolute;
  top: 10%;
  right: 8%;
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.15;
  animation: floatDots 8s ease-in-out infinite;
  box-shadow: 
    -50px 80px 0 4px rgba(92, 64, 51, 0.1),
    30px 150px 0 3px rgba(92, 64, 51, 0.08),
    -80px 200px 0 5px rgba(92, 64, 51, 0.06);
  pointer-events: none;
}

@keyframes floatDots {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-10px, 15px); }
  66% { transform: translate(8px, -10px); }
}

/* --- PULSING SECTION ORNAMENTS --- */
.section-ornament {
  animation: ornamentPulse 4s ease-in-out infinite;
}

@keyframes ornamentPulse {
  0%, 100% { opacity: 0.5; transform: translateX(var(--ornament-dodge, 0)) scale(1); }
  50% { opacity: 0.7; transform: translateX(var(--ornament-dodge, 0)) scale(1.1); }
}

/* --- TIMELINE DOTS HEARTBEAT --- */
.timeline-dot {
  animation: dotHeartbeat 3s ease-in-out infinite;
}

@keyframes dotHeartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
  60% { transform: scale(1); }
}

/* --- NAV LINKS - Smooth fade on hover --- */
.nav-link {
  opacity: 1;
}

.nav-link:hover {
  color: var(--primary-color);
}

/* --- FLOATING QUILL ICON --- */
.hero-visual::after {
  content: "✒";
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 1.5rem;
  color: var(--primary-color);
  opacity: 0.3;
  animation: quillFloat 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes quillFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-5px, -8px) rotate(-10deg); }
  50% { transform: translate(3px, -12px) rotate(5deg); }
  75% { transform: translate(-3px, -5px) rotate(-5deg); }
}

/* --- SKILL CATEGORY BORDER GLOW --- */
.skill-category {
  position: relative;
}

.skill-category::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  animation: borderGlow 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes borderGlow {
  0%, 100% { border-color: transparent; }
  50% { border-color: rgba(92, 64, 51, 0.15); }
}

/* --- PROJECT CARD PAPER RUSTLE --- */
.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(92, 64, 51, 0.1), 
    transparent
  );
  animation: paperRustle 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes paperRustle {
  0%, 100% { transform: scaleX(0.5); opacity: 0; }
  50% { transform: scaleX(1); opacity: 1; }
}

/* --- CONTACT FORM INK WELL --- */
.contact-form::before {
  content: "🪶";
  position: absolute;
  top: -30px;
  right: 20px;
  font-size: 1.2rem;
  opacity: 0.3;
  animation: inkWellBob 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes inkWellBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(10deg); }
}

/* --- IMAGE FRAME SHIMMER - Applied to profile-image instead --- */
.profile-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  animation: frameShimmer 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes frameShimmer {
  0%, 100% { left: -100%; }
  50% { left: 150%; }
}

/* --- SCROLL INDICATOR INK DROP --- */
.scroll-indicator::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  transform: translateX(-50%);
  animation: inkDrop 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes inkDrop {
  0%, 100% { opacity: 0; top: -10px; }
  50% { opacity: 0.5; top: 5px; }
}

/* --- BUTTON TEXT SHIMMER --- */
.btn-primary .btn-text,
.btn-primary span {
  background: linear-gradient(
    90deg,
    #fff 0%,
    #fff 40%,
    rgba(255, 255, 255, 0.7) 50%,
    #fff 60%,
    #fff 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: textShimmer 4s ease-in-out infinite;
}

@keyframes textShimmer {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: -100% 0; }
}

/* --- FOOTER WAVE --- */
.footer::before {
  animation: footerWave 10s ease-in-out infinite !important;
}

@keyframes footerWave {
  0%, 100% { 
    clip-path: polygon(
      0% 5%, 10% 3%, 20% 6%, 30% 2%, 40% 5%, 
      50% 3%, 60% 6%, 70% 2%, 80% 5%, 90% 3%, 100% 5%,
      100% 100%, 0% 100%
    );
  }
  50% { 
    clip-path: polygon(
      0% 3%, 10% 6%, 20% 2%, 30% 5%, 40% 3%, 
      50% 6%, 60% 2%, 70% 5%, 80% 3%, 90% 6%, 100% 3%,
      100% 100%, 0% 100%
    );
  }
}

/* --- APPROVED STAMP - Initial press only, no continuous animation --- */
.hero::after {
  animation: stampPress 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 1s both !important;
}

/* --- CODE WINDOW SCREEN FLICKER --- */
.code-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.02);
  opacity: 0;
  animation: screenFlicker 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes screenFlicker {
  0%, 100% { opacity: 0; }
  48%, 52% { opacity: 1; }
}

/* --- TIMELINE LINE PULSE --- */
.timeline::before {
  background: linear-gradient(
    to bottom,
    var(--primary-color),
    rgba(92, 64, 51, 0.3),
    var(--primary-color)
  ) !important;
  background-size: 100% 200% !important;
  animation: timelinePulse 4s ease-in-out infinite !important;
}

@keyframes timelinePulse {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 0 100%; }
}

/* --- INK SPREAD BUTTON EFFECT --- */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(92, 64, 51, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* --- PAPER CARD 3D TILT --- */
.project-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
}

.project-card:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-8px);
  box-shadow: 
    8px 12px 25px rgba(92, 64, 51, 0.2),
    0 0 0 1px rgba(92, 64, 51, 0.1);
}

/* --- SKILL ITEM INK DOT PULSE --- */
.skill-item {
  position: relative;
}

.skill-item::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 4px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.skill-item:hover::before {
  opacity: 0.6;
  transform: scale(1);
}

/* --- TIMELINE DOT RIPPLE --- */
.timeline-dot {
  position: relative;
}

.timeline-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  transition: all 0.4s ease;
}

.timeline-item:hover .timeline-dot::after {
  transform: translate(-50%, -50%) scale(1.8);
  opacity: 0.3;
}

/* --- IMAGE FRAME GENTLE FLOAT --- */
@keyframes gentleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
}

.image-container {
  animation: gentleFloat 6s ease-in-out infinite;
}

/* --- SOCIAL LINK INK SPLASH --- */
.social-link {
  position: relative;
  overflow: hidden;
}

.social-link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.social-link:hover::before {
  width: 80%;
}

.social-link:hover i {
  transform: translateY(-2px) scale(1.05);
  transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* --- CONTACT METHOD ICON BOUNCE --- */
.contact-method {
  transition: transform 0.3s ease;
}

.contact-method:hover {
  transform: translateX(5px);
}

.contact-method:hover i {
  animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* --- FORM INPUT QUILL LINE --- */
.form-input {
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(92, 64, 51, 0.1);
}

/* --- NAV LOGO WAX SEAL GLOW --- */
.nav-logo .logo-text {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.nav-logo:hover .logo-text {
  box-shadow: 
    0 0 0 8px rgba(92, 64, 51, 0.3),
    0 0 20px rgba(92, 64, 51, 0.2),
    inset 0 0 10px rgba(255, 255, 255, 0.1);
  transform: scale(1.1) rotate(-8deg);
}

/* --- STAT NUMBER INK REVEAL --- */
.stat-number {
  position: relative;
}

.stat-item:hover .stat-number {
  transform: scale(1.1);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* --- SCROLL INDICATOR QUILL BOB --- */
@keyframes quillBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

.scroll-indicator {
  animation: quillBob 2s ease-in-out infinite;
}

/* --- HERO BADGE STAMP EFFECT - Applied to badge-text --- */
.badge-text {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.badge-text:hover {
  transform: rotate(-2deg) scale(1.02);
  box-shadow: 3px 3px 10px rgba(92, 64, 51, 0.2);
}

/* --- SECTION REVEAL ON SCROLL --- */
.section-header,
.about-content,
.skills-grid,
.projects-grid,
.contact-content {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-header.revealed,
.about-content.revealed,
.skills-grid.revealed,
.projects-grid.revealed,
.contact-content.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --- FOOTER LINK STAGGER --- */
.footer-list li {
  transition: transform 0.3s ease;
}

.footer-list li:hover {
  transform: translateX(5px);
}

.footer-list li a::after {
  content: " →";
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.footer-list li:hover a::after {
  opacity: 0.7;
  transform: translateX(0);
}

/* --- CODE WINDOW PAPER SHADOW --- */
.code-window {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.code-window:hover {
  transform: translateY(-5px) rotate(0.5deg);
  box-shadow: 
    10px 15px 30px rgba(92, 64, 51, 0.15),
    0 0 0 1px rgba(92, 64, 51, 0.08);
}

/* --- BACK TO TOP QUILL RISE --- */
.back-to-top {
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.back-to-top:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 25px rgba(92, 64, 51, 0.3);
}

/* --- TIMELINE YEAR STAMP PRESS --- */
.timeline-year-number {
  transition: transform 0.2s ease, color 0.2s ease;
}

.timeline-item:hover .timeline-year-number {
  transform: scale(1.1) rotate(-2deg);
  color: var(--primary-color);
}

/* --- TAG PILLS SHUFFLE --- */
.tag {
  transition: transform 0.2s ease, background 0.2s ease;
}

.tag:hover {
  transform: translateY(-2px) rotate(-1deg);
  background: rgba(92, 64, 51, 0.15);
}

/* --- DECORATIVE INK SPLATTER ON HEADERS --- */
.section-header::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 50%;
  opacity: 0.3;
  transform: translateX(-50%);
  box-shadow: 
    -15px 8px 0 2px rgba(92, 64, 51, 0.15),
    18px 5px 0 1px rgba(92, 64, 51, 0.1),
    -8px -5px 0 1px rgba(92, 64, 51, 0.12);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .section-header,
  .about-content,
  .skills-grid,
  .projects-grid,
  .contact-content {
    opacity: 1;
    transform: none;
  }
}
