/* ============================================
   PORTFOLIO - Cyber-Editorial Redesign
   Aesthetics: Tiempos Serif + High Contrast Accents
   ============================================ */

/* --- Dark theme tokens (default) --- */
:root,
[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-hover: #1a1a1a;
  --primary: #f59e0b; /* Amber */
  --secondary: #d97706;
  --accent: #10b981; /* Muted Green */
  --text: #a1a1aa;
  --text-bright: #eaeaea;
  --muted: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --glow: rgba(245, 158, 11, 0.15);

  --radius: 8px;
  --transition: 400ms cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 1100px;
  --nav-height: 64px;

  --font-heading: 'Tiempos', 'Tiempos Headline', 'Playfair Display', serif;
  --font-body: 'Tiempos Text', 'Tiempos', 'Playfair Display', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* --- Light theme tokens --- */
[data-theme="light"] {
  --bg: #fdfdfc;
  --surface: #f4f4f2;
  --surface-hover: #e9e9e6;
  --primary: #eab308; /* Soft Yellow */
  --secondary: #ca8a04;
  --accent: #10b981; /* Muted Green */
  --text: #3f3f46;
  --text-bright: #18181b;
  --muted: #71717a;
  --border: rgba(0, 0, 0, 0.08);
  --glow: rgba(234, 179, 8, 0.1);
}

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

img, video, svg, embed {
  max-width: 100%;
  height: auto;
}

button {
  cursor: pointer;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 40px);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
}



a {
  color: var(--text-bright);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

ul,
ol {
  list-style: none;
}

/* --- Nav --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background-color 0.5s ease, border-color 0.5s ease;
}

[data-theme="light"] .nav {
  background: rgba(253, 253, 252, 0.8);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  color: var(--text-bright);
  letter-spacing: -0.5px;
  border: none !important;
}

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

.nav-links {
  display: flex;
  gap: 12px;
  margin-left: auto; /* Shift to the right */
  margin-right: 48px; /* Breathing room before actions */
}

.nav-links a {
  padding: 8px 24px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: none !important;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.15), 
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.05), 
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-bright);
  padding: 4px;
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* --- Theme toggle --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-bright);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--text-bright);
  color: var(--bg);
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

/* --- Main container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* --- Sections --- */
section {
  padding: 120px 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 400;
  font-style: normal;
  color: var(--text-bright);
  margin-bottom: 64px;
  letter-spacing: -0.03em;
  line-height: 1.1;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--primary);
}

/* --- Fade-in on scroll --- */
.fade-in {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* --- About --- */
.about {
  padding-top: calc(var(--nav-height) + 100px);
  min-height: 90vh;
}
/* --- About / Hero --- */
.about-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
  padding: 120px 0;
  min-height: 80vh;
}

.about-text {
  flex: 1;
}

.about-image {
  flex-shrink: 0;
  width: 440px;
  height: 440px;
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-image img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.about-image::after {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
  transition: all 0.5s ease;
}

.about-image:hover img {
  transform: scale(1.02) translateY(-5px);
  border-color: var(--primary);
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 0 30px var(--glow);
}

.about-name {
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  color: var(--text-bright);
}

.about-title {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--primary);
  border-left: 2px solid var(--primary);
  padding-left: 16px;
  margin-bottom: 48px;
}

.about-tagline {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-bright);
  margin-bottom: 32px;
  margin-top: 0;
}

.about-desc {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: 24px;
  max-width: 640px;
}

.about-learning {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 48px;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
}

.about-learning strong {
  color: var(--text-bright);
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.about-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.about-link-btn svg {
  width: 18px;
  height: 18px;
}

.about-link-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.about-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-bright);
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
}

.about-link-icon svg {
  width: 20px;
  height: 20px;
}

.about-link-icon:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 0 20px var(--glow);
}



/* --- Experience --- */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

/* --- Experience Focus Flow --- */
.exp-focus-container {
  display: flex;
  flex-direction: column;
  gap: 120px; /* Large gap for clear separation */
  padding: 80px 0;
  max-width: 800px;
  margin: 0 auto;
}

.exp-focus-item {
  width: 100%;
  display: flex;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 0.4;
  transform: scale(0.95);
}

.exp-focus-item.active {
  opacity: 1;
  transform: scale(1.05);
}

.exp-focus-content {
  text-align: center;
  position: relative;
  padding-bottom: 32px;
}

.exp-focus-role {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.exp-focus-company {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.exp-focus-desc {
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 24px;
}

.exp-focus-date {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

/* Focused Underline Accent */
.exp-focus-accent {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transform: translateX(-50%);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.exp-focus-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.exp-focus-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(128, 128, 128, 0.08);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 30px;
  transition: all 0.3s ease;
}

.exp-focus-item.active .exp-focus-tag {
  border-color: var(--primary);
  color: var(--text-bright);
}

.exp-focus-item.active .exp-focus-accent {
  width: 120px;
}

/* Hover Interaction */
.exp-focus-item:hover {
  opacity: 0.8 !important;
}

.exp-focus-item.active:hover {
  opacity: 1 !important;
  transform: scale(1.07);
}

@media (max-width: 768px) {
  .exp-focus-container {
    gap: 80px;
  }
  .exp-focus-role {
    font-size: 1.75rem;
  }
  .exp-focus-desc {
    font-size: 1rem;
    padding: 0 20px;
  }
}

.exp-bullets li::before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: -18px;
}

.exp-show-more {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

.btn-editorial {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-bright);
  padding: 12px 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-editorial:hover {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.exp-item-hidden {
  display: none;
}

/* --- Skills --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 24px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  transform: translate(30%, -30%);
}

.skill-card:hover {
  border-color: var(--text-bright);
  transform: translateY(-4px);
}

.skill-card:hover::after {
  opacity: 0.1;
}

.skill-card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-bright);
  margin-bottom: 16px;
  font-weight: 400;
  font-style: italic;
}

.skill-card-items {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

/* --- Projects --- */
.projects-premium-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.project-premium-card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

@media (hover: hover) {
  .project-premium-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  }
}

.project-card-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.project-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

@media (hover: hover) {
  .project-premium-card:hover .project-card-image {
    transform: scale(1.1);
  }
}

.project-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (hover: hover) {
  .project-premium-card:hover .project-card-overlay {
    opacity: 1;
  }
}

.project-view-btn {
  display: inline-block;
  padding: 10px 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  border-radius: 30px;
  text-decoration: none;
  transition: all 0.3s ease;
  transform: translateY(10px);
}

@media (hover: hover) {
  .project-premium-card:hover .project-view-btn {
    transform: translateY(0);
  }
}

.project-view-btn:hover {
  background: var(--text-bright);
  color: var(--bg);
}

.project-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-bright);
  margin-bottom: 12px;
  line-height: 1.3;
}

.project-card-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

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

.project-tag-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.project-tag-pill:hover {
  border-color: var(--text-bright);
  color: var(--text-bright);
}

/* --- Project Status & CI/CD System --- */
.project-status-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  z-index: 10;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.project-premium-card:hover .project-status-badge {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
}

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

/* Status Colors (Subtle Tone) */
.completed .status-dot { background: #10B981; }
.deployed .status-dot { background: #64748B; }
.in-progress .status-dot { background: #EAB308; }
.building .status-dot { background: #F59E0B; }
.paused .status-dot { background: #6B7280; }

@keyframes status-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

.pulse-building, .pulse-in-progress {
  animation: status-pulse 2s infinite ease-in-out;
}

/* Project Progress Bar */
.project-progress-container {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  position: absolute;
  bottom: 0;
  left: 0;
  overflow: hidden;
}

.project-progress-bar {
  height: 100%;
  background: var(--primary);
  opacity: 0.4;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-premium-card:hover .project-progress-bar {
  opacity: 1;
}

/* --- Achievements Journey Tree --- */
.achievements-tree {
  position: relative;
  max-width: 800px;
  margin: 60px auto;
  padding: 40px 0;
}

.achievements-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--primary), var(--accent), transparent);
  transform: translateX(-50%);
  opacity: 0.4;
}

.achieve-node-wrapper {
  position: relative;
  width: 50%;
  margin-bottom: 60px;
  clear: both;
}

.achieve-left {
  float: left;
  text-align: right;
  padding-right: 40px;
}

.achieve-right {
  float: right;
  text-align: left;
  padding-left: 40px;
  margin-top: 60px;
}

.achieve-branch {
  position: absolute;
  top: 24px;
  width: 40px;
  height: 2px;
  background: var(--border);
  transition: all 0.4s ease;
  z-index: 1;
}

.achieve-left .achieve-branch {
  right: 0;
}
.achieve-right .achieve-branch {
  left: 0;
}

.achieve-node {
  position: absolute;
  top: 16px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--primary);
  z-index: 2;
  transition: all 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achieve-left .achieve-node {
  right: -9px;
}
.achieve-right .achieve-node {
  left: -9px;
}

.achieve-node-core {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transition: all 0.4s ease;
}

.achieve-node-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  filter: blur(8px);
  transition: all 0.4s ease;
}

.achieve-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  z-index: 3;
  transition: all 0.4s ease;
  overflow: hidden;
}

.achieve-year {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.achieve-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-bright);
  font-weight: 700;
  line-height: 1.3;
}

.achieve-position {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 16px;
  opacity: 0;
  max-height: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.achieve-desc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  opacity: 0;
  max-height: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

/* Hover effects */
@media (hover: hover) {
  .achieve-node-wrapper:hover .achieve-branch {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
  }
  
  .achieve-node-wrapper:hover .achieve-node {
    transform: scale(1.3);
    border-color: var(--accent);
  }
  
  .achieve-node-wrapper:hover .achieve-node-core {
    background: var(--primary);
  }
  
  .achieve-node-wrapper:hover .achieve-node-glow {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.5);
  }
  
  .achieve-node-wrapper:hover .achieve-content {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--glow);
  }
  
  .achieve-node-wrapper:hover .achieve-position,
  .achieve-node-wrapper:hover .achieve-desc {
    opacity: 1;
    max-height: 200px;
    transform: translateY(0);
  }
}

.achievements-tree::after {
  content: "";
  display: table;
  clear: both;
}

/* --- Education --- */
/* --- Section Header Customization --- */
#education .section-title::after {
  opacity: 0.3;
  width: 20px; /* Reduced to avoid competition with card accents */
}

/* --- Education Progression System --- */
.edu-row-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  padding-left: 16px;
}

/* Vertical Progression Line (Directional Growth) */
.edu-row-container::before {
  content: "";
  position: absolute;
  left: 0;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to top, 
    rgba(245, 158, 11, 0) 0%, 
    rgba(245, 158, 11, 0.3) 40%, 
    var(--primary) 100%
  );
  border-radius: 2px;
}

.edu-row-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  opacity: 0;
  transform: translateY(30px) translateX(calc(var(--index) * 8px)); /* Directional Flow */
}

/* Scroll Reveal */
.edu-row-card.reveal {
  opacity: 0.85; /* Older cards are slightly muted */
  transform: translateY(0) translateX(calc(var(--index) * 8px));
}

/* Highlight (Present Day / Current) */
.edu-row-card.edu-row-highlight {
  padding: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  opacity: 1 !important;
  transform: translateY(0) translateX(0); /* Anchored at center */
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.edu-row-card.edu-row-highlight .edu-row-degree {
  color: var(--text-bright);
}

/* Left Accent Progression Indicator */
.edu-row-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
  transition: all 0.5s ease;
  opacity: 0.2;
}

.edu-row-card.reveal::after {
  height: 25%;
}

.edu-row-card.edu-row-highlight::after {
  height: 60%;
  opacity: 1;
}

/* Interaction: Visual Lift */
.edu-row-card:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-6px) translateX(calc(var(--index) * 6px));
}

.edu-row-highlight:hover {
  transform: translateY(-8px) translateX(0);
  border-color: var(--primary);
}

.edu-row-card:hover::after {
  height: 85%;
  opacity: 1;
}

.edu-row-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.edu-row-logo-wrapper {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.edu-row-card.edu-row-highlight .edu-row-logo-wrapper {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.edu-row-logo {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.edu-row-logo-placeholder {
  width: 20px;
  height: 20px;
  background: var(--muted);
  border-radius: 50%;
  opacity: 0.3;
}

.edu-row-info {
  display: flex;
  flex-direction: column;
}

.edu-row-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.edu-row-degree {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 700;
  color: var(--text);
  margin: 0;
  transition: color 0.3s ease;
}

.edu-current-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(16, 185, 129, 0.08);
  color: #10B981;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.edu-row-institution {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}

.edu-row-right {
  text-align: right;
  flex-shrink: 0;
}

.edu-row-year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  opacity: 0.8;
}

@media (max-width: 768px) {
  .edu-row-container {
    padding-left: 0;
  }
  .edu-row-container::before {
    display: none;
  }
  .edu-row-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    transform: none !important;
  }
  .edu-row-left {
    gap: 16px;
  }
  .edu-row-right {
    text-align: left;
    width: 100%;
    padding-left: 68px;
  }
}

@media (max-width: 768px) {
  .edu-stack-card {
    position: relative;
    top: 0 !important;
    padding-top: 0 !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .edu-stack-card-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    opacity: 1 !important;
    transform: none !important;
  }
  .edu-stack-right {
    text-align: left;
    width: 100%;
  }
}



/* --- Footer --- */
.footer {
  padding: 80px 0 40px;
  transition: background-color 0.5s ease;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.footer-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-bright);
  border: none;
  opacity: 0.7;
}

.footer-links svg {
  width: 24px;
  height: 24px;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--primary);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* --- Back to top --- */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 56px;
  height: 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--text-bright);
  color: var(--bg);
  transform: translateY(-8px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* --- Resume Preview Modal --- */
.resume-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.resume-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.resume-modal-content {
  position: relative;
  width: 95%;
  max-width: 1000px;
  height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  transform: translateY(40px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.resume-modal.active .resume-modal-content {
  transform: translateY(0) scale(1);
}

.resume-modal-content embed {
  width: 100%;
  height: 100%;
  border: none;
}

.resume-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 210;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-bright);
  font-size: 24px;
  transition: all var(--transition);
}

.resume-modal-close:hover {
  background: var(--text-bright);
  color: var(--bg);
  transform: rotate(90deg);
}

/* --- Blog Page --- */
.blog-page {
  padding-top: calc(var(--nav-height) + 100px);
  padding-bottom: 120px;
  min-height: 80vh;
}

.blog-header {
  margin-bottom: 80px;
}

.blog-header .section-title {
  margin-bottom: 16px;
}

.blog-subtitle {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.blog-list {
  display: flex;
  flex-direction: column;
}

.blog-entry {
  display: grid;
  grid-template-columns: 160px 1fr 56px;
  gap: 32px;
  align-items: start;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: all var(--transition);
}

.blog-entry::before {
  content: '';
  position: absolute;
  left: -40px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary);
  opacity: 0;
  transform: scaleY(0);
  transition: opacity var(--transition), transform var(--transition);
}

.blog-entry:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.blog-entry:first-child {
  padding-top: 0;
}

.blog-entry:last-child {
  border-bottom: none;
}

.blog-entry:hover {
  transform: translateX(8px);
}

/* -- Meta column -- */
.blog-entry-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.blog-date {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.blog-platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius);
  width: fit-content;
  transition: all var(--transition);
}

.blog-platform svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.blog-entry:hover .blog-platform {
  border-color: var(--primary);
  background: var(--glow);
}

[data-theme="light"] .blog-entry:hover .blog-platform {
  background: rgba(255, 60, 0, 0.05);
}

/* -- Content column -- */
.blog-entry-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  font-style: normal;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  line-height: 1.2;
  transition: color var(--transition);
}

.blog-entry:hover .blog-title {
  color: var(--primary);
}

.blog-summary {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 640px;
}

.blog-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* -- Link column -- */
.blog-entry-link {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  margin-top: 4px;
  flex-shrink: 0;
}

.blog-entry-link:hover {
  color: var(--bg);
  background: var(--text-bright);
  border-color: var(--text-bright);
  transform: rotate(45deg);
}

.blog-entry-link svg {
  width: 20px;
  height: 20px;
}

/* Blog empty state */
.blog-empty {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 80px 0;
  letter-spacing: 0.5px;
}


/* --- GitHub Live Chart --- */
.gh-chart-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  position: relative;
  transition: all var(--transition);
}

.gh-chart-wrapper:hover {
  border-color: var(--glow);
}

.gh-chart-header {
  margin-bottom: 32px;
}

.gh-chart-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-bright);
}

.gh-chart-subtitle {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.gh-chart-total {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  margin-top: 12px;
}

.gh-chart-total strong {
  color: var(--text-bright);
  font-weight: 700;
}

.gh-grid-container {
  overflow-x: auto;
  padding: 10px 0;
  -webkit-overflow-scrolling: touch;
}

.gh-grid {
  display: flex;
  gap: 4px;
  min-width: 800px;
}

.gh-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gh-square {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.gh-square:hover {
  transform: scale(1.3);
  z-index: 10;
  box-shadow: 0 0 10px var(--primary);
}

/* Color Levels (Neon Mode) */
.gh-square[data-level="NONE"] { background: rgba(255, 255, 255, 0.04); }
.gh-square[data-level="FIRST_QUARTILE"] { background: #1d2500; }
.gh-square[data-level="SECOND_QUARTILE"] { background: #3b4b00; }
.gh-square[data-level="THIRD_QUARTILE"] { background: #7a9800; }
.gh-square[data-level="FOURTH_QUARTILE"] { background: #ccff00; }

/* Light Theme Overrides */
[data-theme="light"] .gh-square[data-level="NONE"] { background: rgba(0, 0, 0, 0.05); }
[data-theme="light"] .gh-square[data-level="FIRST_QUARTILE"] { background: #ffebeb; }
[data-theme="light"] .gh-square[data-level="SECOND_QUARTILE"] { background: #ffad99; }
[data-theme="light"] .gh-square[data-level="THIRD_QUARTILE"] { background: #ff704d; }
[data-theme="light"] .gh-square[data-level="FOURTH_QUARTILE"] { background: #ff3c00; }

.gh-chart-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.gh-legend {
  display: flex;
  gap: 4px;
}

.gh-legend .gh-square {
  width: 10px;
  height: 10px;
  cursor: default;
}

.gh-legend .gh-square:hover {
  transform: none;
  box-shadow: none;
}

/* Tooltip (Optional placeholder if needed) */
.gh-square::after {
  content: attr(data-date);
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}

/* --- Developer Quotes --- */
.quote-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  transition: all var(--transition);
}

.quote-card:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.quote-icon {
  position: absolute;
  top: 4px;
  left: 20px;
  font-size: 100px;
  color: var(--primary);
  opacity: 0.06;
  font-family: var(--font-heading);
  line-height: 1;
  pointer-events: none;
}

.quote-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-bright);
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.quote-author-wrapper {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.quote-author {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ==============================================
   RESPONSIVE DESIGN
   Breakpoints:
   - ≤1024px : Tablet landscape / small laptops
   - ≤768px  : Tablet portrait
   - ≤480px  : Mobile
   - ≤360px  : Small mobile
   ============================================== */

/* --- Tablet Landscape & Small Laptops (≤1024px) --- */
@media (max-width: 1024px) {

  /* Reduce hero image for smaller laptops */
  .about-image {
    width: 320px;
    height: 320px;
  }

  .about-flex {
    gap: 48px;
    padding: 80px 0;
  }

  .about-name {
    font-size: clamp(3rem, 6vw, 5rem);
  }

  .about-tagline {
    font-size: 1.75rem;
  }

  /* Tighter nav spacing */
  .nav-links {
    gap: 20px;
  }

  .nav-links a {
    font-size: 10px;
  }

  /* Smaller section spacing */
  section {
    padding: 80px 0;
  }

  .section-title {
    margin-bottom: 48px;
  }

  /* Skills grid: 2 columns */
  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  /* Projects grid adapt */
  .projects-premium-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  /* Experience cards */
  .exp-list {
    gap: 40px;
  }

  .exp-card {
    padding: 28px;
  }

  /* GitHub chart */
  .gh-chart-wrapper {
    padding: 28px;
  }

  .gh-chart-title {
    font-size: 2rem;
  }

  /* Quote */
  .quote-card {
    max-width: 520px;
  }

  /* About Me Stack */
  .about-me-split {
    flex-direction: column;
    gap: 40px;
  }

  .about-me-left {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .about-me-header {
    text-align: center;
  }

  /* Footer */
  .footer {
    padding: 60px 0 32px;
  }

  .footer-links {
    gap: 24px;
  }
}

/* --- About Me --- */
.about-me-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.about-me-header {
  text-align: left;
}

.about-me-subtitle {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--primary);
  margin-top: -40px;
  margin-bottom: 20px;
}

.about-me-split {
  display: flex;
  gap: 60px;
  align-items: flex-start;
}

.about-me-left {
  flex-shrink: 0;
  width: 300px;
}

.about-me-profile-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all var(--transition);
}

.about-me-profile-img:hover {
  border-color: var(--primary);
}

.about-me-right {
  flex: 1;
}

.about-me-name {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--text-bright);
  margin-bottom: 20px;
}

.about-me-intro {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.8;
}

/* --- Skills Icons Grid --- */
.about-me-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 40px;
}

.skill-icon-wrapper {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  cursor: pointer;
}

.skill-icon-img {
  width: 28px;
  height: 28px;
  transition: all var(--transition);
}

.skill-tooltip {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface-hover);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: all 0.3s ease;
  z-index: 10;
}

.skill-icon-wrapper:hover {
  transform: scale(1.1);
  border-color: var(--glow-color, var(--primary));
  box-shadow: 0 0 15px var(--glow-color, var(--glow));
}

.skill-icon-wrapper:hover .skill-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Tablet Portrait (≤768px) --- */
@media (max-width: 768px) {

  /* Container & global spacing */
  .nav-inner {
    padding: 0 20px;
  }

  .container {
    padding: 0 20px;
  }

  section {
    padding: 64px 0;
  }

  .section-title {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 40px;
  }

  /* === NAVIGATION: Hamburger menu === */
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    flex-direction: column;
    padding: 32px 24px;
    gap: 8px;
    z-index: 99;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links.open {
    display: flex;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-links a {
    font-size: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    letter-spacing: 2px;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Touch-friendly size */
    width: 44px;
    height: 44px;
  }

  /* === HERO: Stack vertically === */
  .about {
    padding-top: calc(var(--nav-height) + 48px);
    min-height: auto;
  }

  .about-flex {
    flex-direction: column-reverse;
    text-align: center;
    gap: 40px;
    padding: 48px 0;
    min-height: auto;
  }

  .about-image {
    width: 220px;
    height: 220px;
    margin: 0 auto;
  }

  .about-image::after {
    inset: -12px;
  }

  .about-text {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .about-name {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
  }

  .about-title {
    font-size: 12px;
    letter-spacing: 3px;
    margin-bottom: 32px;
    /* Center the left-border accent */
    border-left: none;
    padding-left: 0;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
  }

  .about-tagline {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }

  .about-desc {
    font-size: 1rem;
    text-align: center;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .about-learning {
    margin-bottom: 32px;
    text-align: center;
    border-left: none;
    padding-left: 0;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
  }

  .about-links {
    justify-content: center;
    gap: 12px;
  }

  /* Touch-friendly link buttons */
  .about-link-icon {
    width: 48px;
    height: 48px;
  }

  .about-link-btn {
    padding: 14px 24px;
    font-size: 11px;
  }

  /* === EXPERIENCE === */
  .exp-card-header {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }

  .exp-meta-group {
    text-align: left;
    flex-direction: row;
    gap: 12px;
    align-items: center;
  }

  .exp-role {
    font-size: 1.25rem;
  }

  .exp-card {
    padding: 24px;
  }

  .exp-list {
    gap: 24px;
  }

  /* === SKILLS === */
  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 16px;
  }

  .skill-card {
    padding: 24px;
  }

  .skill-card-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }

  .skill-card-items {
    font-size: 12px;
  }

  /* Disable hover lift on touch — avoids sticky hover states */
  .skill-card:hover {
    transform: none;
  }

  /* === PROJECTS === */
  .projects-premium-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  /* Fallbacks for touch devices (where hover might not be supported) */
  .project-card-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    top: auto;
    bottom: 0;
    height: 60px;
  }
  
  .project-view-btn {
    transform: translateY(0);
    padding: 6px 16px;
    font-size: 12px;
  }

  /* === EDUCATION === */
  .edu-premium-card {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }
  .edu-degree {
    font-size: 1.15rem;
  }
  .edu-institution {
    font-size: 0.95rem;
  }
  .edu-year {
    font-size: 0.8rem;
  }

  /* === GITHUB CHART === */
  .gh-chart-wrapper {
    padding: 24px 16px;
  }

  .gh-chart-title {
    font-size: 1.5rem;
  }

  .gh-chart-subtitle,
  .gh-chart-total {
    font-size: 12px;
  }

  .gh-grid {
    min-width: 680px;
  }

  .gh-square {
    width: 10px;
    height: 10px;
  }

  .gh-grid,
  .gh-column {
    gap: 3px;
  }

  /* === QUOTE === */
  .quote-section {
    padding: 40px 0;
  }

  .quote-card {
    padding: 28px 20px;
    max-width: 100%;
  }

  .quote-text {
    font-size: 1.1rem;
  }

  .quote-icon {
    font-size: 72px;
    left: 12px;
    top: 0;
  }

  /* === BLOG === */
  .blog-page {
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 64px;
  }

  .blog-header {
    margin-bottom: 40px;
  }

  .blog-entry {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 28px 0;
  }

  .blog-entry::before {
    display: none;
  }

  .blog-entry:hover {
    transform: none;
  }

  .blog-entry-meta {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .blog-entry-link {
    width: 44px;
    height: 44px;
    justify-self: start;
  }

  .blog-empty {
    padding: 48px 0;
    font-size: 13px;
  }

  /* === FOOTER === */
  .footer {
    padding: 48px 0 24px;
  }

  .footer-inner {
    gap: 24px;
  }

  .footer-links {
    gap: 16px;
    flex-direction: column;
    align-items: center;
  }

  .footer-links a {
    font-size: 11px;
  }

  /* === BACK TO TOP === */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
  }

  /* === RESUME MODAL === */
  .resume-modal-content {
    width: 98%;
    height: 85vh;
  }

  .resume-modal-close {
    width: 44px;
    height: 44px;
    top: 8px;
    right: 8px;
  }

  /* === REDUCE ANIMATIONS ON TOUCH === */
  .fade-in {
    transform: translateY(24px) scale(1);
    transition-duration: 0.5s;
  }

  /* Disable hover transforms on touch devices to avoid sticky states */
  .about-image:hover img {
    transform: none;
  }

  .project-card:hover {
    transform: none;
  }

  .exp-card:hover {
    transform: none;
  }
}

/* --- Mobile (≤480px) --- */
@media (max-width: 480px) {

  .container {
    padding: 0 16px;
  }

  .nav-inner {
    padding: 0 16px;
  }

  section {
    padding: 48px 0;
  }

  .section-title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    margin-bottom: 32px;
  }

  .section-title::after {
    width: 28px;
    height: 2px;
  }

  /* Hero adjustments */
  .about {
    padding-top: calc(var(--nav-height) + 32px);
  }

  .about-flex {
    gap: 32px;
    padding: 32px 0;
  }

  .about-image {
    width: 180px;
    height: 180px;
  }

  .about-name {
    font-size: clamp(2rem, 12vw, 3rem);
    margin-bottom: 16px;
  }

  .about-title {
    font-size: 10px;
    letter-spacing: 2px;
    margin-bottom: 24px;
  }

  .about-tagline {
    font-size: 1.25rem;
    margin-bottom: 16px;
  }

  .about-desc {
    font-size: 0.9375rem;
    line-height: 1.7;
  }

  .about-learning {
    font-size: 10px;
    margin-bottom: 24px;
  }

  .about-links {
    gap: 10px;
  }

  .about-link-icon {
    width: 44px;
    height: 44px;
  }

  .about-link-icon svg {
    width: 18px;
    height: 18px;
  }

  .about-link-btn {
    padding: 12px 20px;
    font-size: 10px;
  }

  /* Experience */
  .exp-card {
    padding: 20px;
  }

  .exp-role {
    font-size: 1.1rem;
  }

  .exp-company {
    font-size: 13px;
  }

  .exp-date {
    font-size: 11px;
  }

  .exp-location {
    font-size: 10px;
  }

  .exp-tag {
    font-size: 10px;
    padding: 3px 10px;
  }

  .exp-bullets li {
    font-size: 0.9375rem;
    margin-bottom: 8px;
  }

  .btn-editorial {
    padding: 12px 24px;
    font-size: 11px;
    width: 100%;
    text-align: center;
  }

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

  .skill-card {
    padding: 20px;
  }

  .skill-card-title {
    font-size: 1.15rem;
  }

  .skill-card-items {
    font-size: 11px;
    line-height: 1.7;
  }

  /* Projects */
  .project-card {
    padding: 20px;
  }

  .project-card-name {
    font-size: 1.25rem;
  }

  .project-card-desc {
    font-size: 0.9375rem;
    margin-bottom: 20px;
  }

  .project-tag {
    font-size: 9px;
    padding: 5px 10px;
  }

  /* Achievements */
  .achievements-spine {
    left: 20px;
    transform: none;
  }
  
  .achieve-node-wrapper {
    width: 100%;
    float: none;
    padding-left: 60px;
    padding-right: 0;
    text-align: left;
    margin-top: 0;
    margin-bottom: 40px;
  }

  .achieve-right {
    margin-top: 0;
  }
  
  .achieve-branch {
    left: 20px;
    width: 40px;
  }

  .achieve-left .achieve-branch,
  .achieve-right .achieve-branch {
    left: 20px;
    right: auto;
  }
  
  .achieve-node {
    left: 11px !important;
  }
  
  .achieve-content {
    padding: 16px;
  }
  
  .achieve-position,
  .achieve-desc {
    opacity: 1;
    max-height: 200px;
    transform: translateY(0);
  }

  /* Education */
  .edu-premium-card {
    padding: 20px;
  }
  .edu-degree {
    font-size: 1.1rem;
  }
  .edu-institution {
    font-size: 0.9rem;
  }

  /* GitHub chart */
  .gh-chart-wrapper {
    padding: 20px 12px;
  }

  .gh-chart-title {
    font-size: 1.25rem;
  }

  .gh-chart-subtitle {
    font-size: 11px;
  }

  .gh-chart-header {
    margin-bottom: 20px;
  }

  /* Quote */
  .quote-section {
    padding: 32px 0;
  }

  .quote-card {
    padding: 24px 16px;
  }

  .quote-text {
    font-size: 1rem;
    margin-bottom: 16px;
  }

  .quote-icon {
    font-size: 56px;
  }

  .quote-author {
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  /* Blog */
  .blog-entry {
    padding: 24px 0;
    gap: 10px;
  }

  .blog-entry-meta {
    gap: 12px;
  }

  .blog-platform {
    font-size: 9px;
    padding: 5px 10px;
  }

  /* Footer */
  .footer {
    padding: 40px 0 20px;
  }

  .footer-links a {
    font-size: 10px;
  }

  .footer-copy {
    font-size: 10px;
  }

  /* Back to top — smaller on mobile */
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }

  .back-to-top svg {
    width: 16px;
    height: 16px;
  }
}

/* --- Small Mobile (≤360px) --- */
@media (max-width: 360px) {

  .container {
    padding: 0 12px;
  }

  .nav-inner {
    padding: 0 12px;
  }

  .nav-name {
    font-size: 16px;
  }

  .about-image {
    width: 150px;
    height: 150px;
  }

  .about-name {
    font-size: 2rem;
  }

  .about-tagline {
    font-size: 1.1rem;
  }

  .about-desc {
    font-size: 0.875rem;
  }

  .about-links {
    flex-direction: column;
    width: 100%;
  }

  .about-link-btn {
    width: 100%;
    justify-content: center;
  }

  .about-link-icon {
    width: 44px;
    height: 44px;
  }

  .exp-card {
    padding: 16px;
  }

  .skill-card {
    padding: 16px;
  }

  .project-card {
    padding: 16px;
  }

  .project-card-name {
    font-size: 1.1rem;
  }

  .gh-chart-title {
    font-size: 1.1rem;
  }
}

/* === Hover media query: only apply hover effects on devices that support it === */
@media (hover: hover) and (pointer: fine) {
  .skill-card:hover {
    transform: translateY(-4px);
  }

  .about-image:hover img {
    transform: scale(1.02) translateY(-5px);
  }
}

/* === Large screens (≥1400px) — breathing room === */
@media (min-width: 1400px) {
  :root {
    --max-width: 1200px;
  }

  .about-flex {
    gap: 100px;
  }

  .about-image {
    width: 480px;
    height: 480px;
  }
}