/* ============================================
   Erik Maday Portfolio
   Bold Editorial Design System
   ============================================ */

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

:root {
  --color-primary: #171717;
  --color-accent: #10b981;
  --color-accent-dim: #059669;
  --color-background: #ffffff;
  --color-text: #171717;
  --color-text-muted: #525252;
  --color-border: #e5e5e5;
  --color-surface: #fafafa;

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font-primary);
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --radius-sm: 3px;
  --radius-md: 6px;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 6rem;

  --max-width: 1100px;
  --transition-fast: 150ms ease;
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Film grain overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* Smooth page load */
body.loading * {
  animation-duration: 0s !important;
  transition-duration: 0s !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h3 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

ul {
  list-style: none;
}

em {
  font-style: italic;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.nav-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}


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

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
}

.nav-logo span {
  background: linear-gradient(135deg, var(--color-primary) 0%, #404040 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo .character-head {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform var(--transition-base);
}

.nav-logo:hover .character-head {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-links a {
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
  padding: var(--space-xs) 0;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--color-accent);
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  margin-left: var(--space-xs);
}

.theme-toggle:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: rgba(16, 185, 129, 0.05);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

.theme-icon-dark,
.theme-icon-auto {
  display: none;
}

/* Light mode forced - show sun */
body.light-mode .theme-icon-light {
  display: block;
}
body.light-mode .theme-icon-dark,
body.light-mode .theme-icon-auto {
  display: none;
}

/* Dark mode forced - show moon */
body.dark-mode .theme-icon-dark {
  display: block;
}
body.dark-mode .theme-icon-light,
body.dark-mode .theme-icon-auto {
  display: none;
}

/* Auto mode - show half circle */
body.theme-auto .theme-icon-auto {
  display: block;
}
body.theme-auto .theme-icon-light,
body.theme-auto .theme-icon-dark {
  display: none;
}

/* Nav Actions (theme toggle + hamburger) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  order: 3;
}

.nav-links {
  order: 2;
  margin-left: auto;
  margin-right: var(--space-sm);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

@media (max-width: 800px) {
  .nav-inner {
    flex-wrap: wrap;
  }

  .nav-actions {
    order: 2;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: var(--space-xs) 0;
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-sm);
    margin-right: 0;
    margin-left: 0;
    order: 3;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: var(--space-xs) 0;
  }

  .nav-links a:first-child {
    padding-top: var(--space-sm);
  }

  .nav-links a::after {
    display: none;
  }
}

/* Hero + About gradient wrapper */
.hero-about-wrapper {
  background:
    radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(16, 185, 129, 0.02) 0%, transparent 40%),
    var(--color-background);
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
  padding-top: calc(var(--space-2xl) + 80px);
  position: relative;
  background:
    radial-gradient(circle, var(--color-border) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
}


.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.hero-text {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.2;
  margin-bottom: var(--space-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero h1 span.highlight {
  background: linear-gradient(120deg, var(--color-accent) 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 em {
  font-style: italic;
  position: relative;
}

.hero h1 em::after {
  content: '';
  position: absolute;
  bottom: 0.1em;
  left: -0.05em;
  right: -0.05em;
  height: 0.15em;
  background: var(--color-primary);
  z-index: -1;
}

.hero-character {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  animation: fadeInScale 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.character-full {
  width: 100%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  opacity: 0.9;
  will-change: transform;
  cursor: grab;
}


/* Sections */
.section {
  padding: var(--space-3xl) var(--space-lg);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* About Section */
.about {
  padding: var(--space-xl) var(--space-lg);
  background: transparent;
  border-bottom: 1px solid var(--color-border);
}

.about-text {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-weight: 400;
}

/* Background Section */
.background {
  background: var(--color-background);
  padding: var(--space-2xl) var(--space-lg);
}

.background-content {
  max-width: 800px;
}

.background-content p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.background-content p:last-child {
  margin-bottom: 0;
}

/* Scope Section */
.scope {
  background: var(--color-surface);
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
}

.scope::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 90% 20%, rgba(16, 185, 129, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 10% 80%, rgba(16, 185, 129, 0.02) 0%, transparent 30%);
  pointer-events: none;
}

.scope-content {
  max-width: 800px;
}

.scope-content p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.scope-content p:last-child {
  margin-bottom: 0;
}

.scope-list {
  margin-top: var(--space-sm);
  padding-left: var(--space-md);
}

.scope-list li {
  position: relative;
  padding-left: var(--space-sm);
  margin-bottom: var(--space-xs);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.scope-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  background: var(--color-primary);
}

.section-header {
  margin-bottom: var(--space-2xl);
}

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

.section-title {
  display: inline-block;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--color-accent);
}

.section-header-center .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

.section-subtitle {
  margin-top: var(--space-sm);
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

/* Experience Section */
.experience {
  background: var(--color-background);
}

/* Featured Job */
.job-featured {
  position: relative;
  background: var(--color-surface);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.job-featured::before,
.job-featured::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--color-accent);
  border-style: solid;
}

.job-featured::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
  border-radius: var(--radius-md) 0 0 0;
}

.job-featured::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 var(--radius-md) 0;
}

.job-featured .job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-lg);
}

.job-featured h3 {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.job-featured h3 a {
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition-fast);
}

.job-featured h3 a:hover {
  border-color: var(--color-primary);
}

.job-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}

.job-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.1);
}

.job-current::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Role Styling */
.job-roles {
  padding-left: var(--space-md);
}

.role {
  margin-bottom: var(--space-lg);
}

.role:last-child {
  margin-bottom: 0;
}

.role-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.role-header h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.role-header h4::before {
  content: '>';
  color: var(--color-accent);
  margin-right: 0.5em;
  font-weight: 400;
}

.role-dates {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.role-bullets {
  padding-left: var(--space-md);
}

.role-bullets li {
  position: relative;
  margin-bottom: var(--space-xs);
  padding-left: var(--space-sm);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.role-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 4px;
  height: 4px;
  background: var(--color-text-muted);
  border-radius: 50%;
}


/* Secondary Jobs */
.job {
  margin-bottom: var(--space-2xl);
}

.job:last-child {
  margin-bottom: 0;
}

.job .job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.job h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

/* Projects Section */
.projects {
  background: var(--color-background);
  border-top: 1px solid var(--color-border);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  max-width: 700px;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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


.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.project-card h3 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.project-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.25em 0.6em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

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

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.project-tags .tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  padding: 0.25em 0.6em;
  border-radius: var(--radius-sm);
}

.project-links {
  display: flex;
  gap: var(--space-sm);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.project-link:hover {
  color: var(--color-accent);
}

.project-link svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 600px) {
  .project-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Skills Section */
.skills {
  background: var(--color-background);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.skills-simple {
  max-width: 600px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.skills-row {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.skills-row.visible {
  opacity: 1;
  transform: translateX(0);
}

.skills-row:last-child {
  border-bottom: none;
}

.skills-label {
  flex-shrink: 0;
  width: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
}


.skills-items {
  color: var(--color-text);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .skills-row {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .skills-label {
    width: auto;
  }
}

/* Education Section */
.education {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.education-path {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
}

.education-step {
  flex: 1;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-lg);
  background: var(--color-background);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.education-logo {
  width: 50px;
  height: auto;
  margin-bottom: var(--space-sm);
  opacity: 0.4;
}

.education-connector {
  width: 60px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.education-connector::before {
  content: '';
  width: 100%;
  height: 2px;
  background: var(--color-border);
}

.education-connector::after {
  content: '→';
  position: absolute;
  color: var(--color-accent);
  font-size: 1.25rem;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.education-content h3 {
  font-size: 1.375rem;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.education-degree {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.education-detail {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.education-dates {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .education-path {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .education-step {
    max-width: 100%;
    width: 100%;
  }

  .education-connector {
    width: 2px;
    height: 40px;
    min-width: auto;
  }

  .education-connector::before {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-border), var(--color-accent), var(--color-border));
  }

  .education-connector::after {
    content: '↓';
  }

  .skills-group {
    justify-content: center;
  }
}

/* Contact Section */
.contact {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  position: relative;
}

.contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--color-accent);
}

.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact h2 {
  font-size: clamp(2rem, 5vw, 2.5rem);
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.contact p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.contact-link svg {
  width: 16px;
  height: 16px;
}

.contact-link span {
  font-size: 0.875rem;
}

.contact-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Footer */
.footer {
  padding: var(--space-xl) var(--space-lg);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.footer .character-head {
  width: 50px;
  height: 50px;
  object-fit: contain;
  opacity: 0.3;
  cursor: grab;
  transition: opacity var(--transition-base), transform var(--transition-base), filter var(--transition-base);
}

.footer .character-head:hover {
  opacity: 1;
  transform: scale(1.1) rotate(-5deg);
  filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.4));
}

.footer p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

.footer-location {
  font-size: 0.8125rem;
  font-style: normal;
  color: var(--color-text-muted);
}

/* Custom Selection Color */
::selection {
  background: var(--color-accent);
  color: white;
}



/* Staggered Section Reveal */
.section-inner > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-inner.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.section-inner.visible > *:nth-child(1) { transition-delay: 0s; }
.section-inner.visible > *:nth-child(2) { transition-delay: 0.08s; }
.section-inner.visible > *:nth-child(3) { transition-delay: 0.16s; }
.section-inner.visible > *:nth-child(4) { transition-delay: 0.24s; }
.section-inner.visible > *:nth-child(5) { transition-delay: 0.32s; }

/* Section title underline animation */
.section-title::after {
  width: 0;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.section-inner.visible .section-title::after {
  width: 32px;
}

/* Glowing Accent on Hero Highlight */
.hero h1 span.highlight {
  position: relative;
  text-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Animations */
.job:not(.job-featured) {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.job.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1000px) {
  .about {
    padding: var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 1024px) {
  .hero {
    padding-bottom: var(--space-sm);
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-xl);
  }

  .hero-text {
    order: 2;
  }

  .hero-character {
    order: 1;
  }

  .character-full {
    max-width: 280px;
  }

  .jobs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  :root {
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
  }

  .nav-links {
    gap: var(--space-md);
  }

  .nav-links a {
    font-size: 0.8125rem;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--space-2xl) + 60px);
    padding-bottom: var(--space-sm);
  }

  .hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  .job-featured {
    padding: var(--space-md);
  }

  .job-featured h3 {
    font-size: 1.5rem;
  }

  .job-roles {
    padding-left: var(--space-md);
  }

  .role-header {
    flex-direction: column;
    gap: var(--space-xs);
  }

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

  .contact-link {
    width: 100%;
    max-width: 240px;
    padding: var(--space-xs) var(--space-sm);
    justify-content: center;
  }
}

/* Print Styles */
@media print {
  .nav,
  .hero-character,
  .contact-links,
  .footer .character-head {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: var(--space-lg) 0;
  }

  .section {
    padding: var(--space-lg) 0;
    break-inside: avoid;
  }

  .contact {
    background: none;
    color: var(--color-text);
  }

  body {
    font-size: 11pt;
  }
}

/* Dark Mode Easter Egg */
body.dark-mode {
  --color-primary: #e5e5e5;
  --color-background: #171717;
  --color-text: #e5e5e5;
  --color-text-muted: #a3a3a3;
  --color-border: #404040;
  --color-surface: #262626;
  transition: background-color 0.5s ease, color 0.5s ease;
}

body.dark-mode .nav {
  background: rgba(23, 23, 23, 0.95);
  border-bottom-color: var(--color-border);
}

body.dark-mode .nav-scrolled {
  background: rgba(23, 23, 23, 0.98);
}

body.dark-mode .nav-logo span {
  background: linear-gradient(135deg, #e5e5e5 0%, #a3a3a3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark-mode .character-head {
  filter:
    drop-shadow(1px 0 0 rgba(255, 255, 255, 0.8))
    drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.8));
}

body.dark-mode .footer .character-head:hover {
  filter:
    drop-shadow(1px 0 0 rgba(255, 255, 255, 0.8))
    drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 4px 12px rgba(16, 185, 129, 0.4));
}

body.dark-mode .character-full {
  filter:
    drop-shadow(2px 0 0 rgba(255, 255, 255, 0.8))
    drop-shadow(-2px 0 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 -2px 0 rgba(255, 255, 255, 0.8));
}

body.dark-mode .hero {
  background: radial-gradient(circle, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 24px 24px;
}

body.dark-mode .education-logo {
  filter: invert(1);
  opacity: 0.7;
}

body.dark-mode .job-featured {
  background: var(--color-surface);
}

body.dark-mode .education-item {
  background: var(--color-surface);
  border-color: var(--color-border);
}


body.dark-mode .footer {
  border-top-color: var(--color-border);
}

body.dark-mode ::selection {
  background: var(--color-accent);
  color: var(--color-background);
}

/* Dark mode glow effects (refined intensity) */
body.dark-mode .highlight {
  text-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

body.dark-mode .job-current {
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

body.dark-mode .skills-label {
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

body.dark-mode .nav-links a:hover {
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

body.dark-mode .project-link:hover {
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

body.dark-mode .contact-link:hover svg {
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.25));
}

/* System dark mode preference (applies before JS loads) */
@media (prefers-color-scheme: dark) {
  body:not(.light-mode) {
    --color-primary: #e5e5e5;
    --color-background: #171717;
    --color-text: #e5e5e5;
    --color-text-muted: #a3a3a3;
    --color-border: #404040;
    --color-surface: #262626;
  }

  body:not(.light-mode) .nav {
    background: rgba(23, 23, 23, 0.95);
    border-bottom-color: var(--color-border);
  }

  body:not(.light-mode) .nav-scrolled {
    background: rgba(23, 23, 23, 0.98);
  }

  body:not(.light-mode) .nav-logo span {
    background: linear-gradient(135deg, #e5e5e5 0%, #a3a3a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  body:not(.light-mode) .character-head {
    filter:
      drop-shadow(1px 0 0 rgba(255, 255, 255, 0.8))
      drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.8))
      drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8))
      drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.8));
  }

  body:not(.light-mode) .footer .character-head:hover {
    filter:
      drop-shadow(1px 0 0 rgba(255, 255, 255, 0.8))
      drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.8))
      drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8))
      drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.8))
      drop-shadow(0 4px 12px rgba(16, 185, 129, 0.4));
  }

  body:not(.light-mode) .character-full {
    filter:
      drop-shadow(2px 0 0 rgba(255, 255, 255, 0.8))
      drop-shadow(-2px 0 0 rgba(255, 255, 255, 0.8))
      drop-shadow(0 2px 0 rgba(255, 255, 255, 0.8))
      drop-shadow(0 -2px 0 rgba(255, 255, 255, 0.8));
  }

  body:not(.light-mode) .hero {
    background: radial-gradient(circle, rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 24px 24px;
  }

  body:not(.light-mode) .education-logo {
    filter: invert(1);
    opacity: 0.7;
  }

  body:not(.light-mode) .job-featured {
    background: var(--color-surface);
  }

  body:not(.light-mode) .education-item {
    background: var(--color-surface);
    border-color: var(--color-border);
  }

  body:not(.light-mode) .footer {
    border-top-color: var(--color-border);
  }

  body:not(.light-mode) ::selection {
    background: var(--color-accent);
    color: var(--color-background);
  }

  /* Glow effects for system dark mode (refined intensity) */
  body:not(.light-mode) .highlight {
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
  }

  body:not(.light-mode) .job-current {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
  }

  body:not(.light-mode) .skills-label {
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
  }

  body:not(.light-mode) .nav-links a:hover {
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
  }

  body:not(.light-mode) .project-link:hover {
    text-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
  }

  body:not(.light-mode) .contact-link:hover svg {
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.25));
  }
}
