:root {
  --bg-color: #fafafa;
  --text-main: #1a1a1a;
  --text-muted: #666666;
  --accent-color: #000000;

  --bg-hover: #f0f0f0;
  --bg-tag: #f5f5f5;
  --border-color: #eaeaea;
  --text-dark: #333333;
  --text-medium: #444444;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container-width: 680px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-color: #ffffff;

    --bg-hover: #2a2a2a;
    --bg-tag: #222222;
    --border-color: #333333;
    --text-dark: #d0d0d0;
    --text-medium: #c0c0c0;
  }
}

/* Class override for manual theme toggle */
[data-theme="dark"] {
  --bg-color: #121212;
  --text-main: #e0e0e0;
  --text-muted: #a0a0a0;
  --accent-color: #ffffff;

  --bg-hover: #2a2a2a;
  --bg-tag: #222222;
  --border-color: #333333;
  --text-dark: #d0d0d0;
  --text-medium: #c0c0c0;
}

[data-theme="light"] {
  --bg-color: #fafafa;
  --text-main: #1a1a1a;
  --text-muted: #666666;
  --accent-color: #000000;

  --bg-hover: #f0f0f0;
  --bg-tag: #f5f5f5;
  --border-color: #eaeaea;
  --text-dark: #333333;
  --text-medium: #444444;
}

[data-theme="retro"] {
  --bg-color: #0d0221;
  --text-main: #00ffcc;
  --text-muted: #ff00cc;
  --accent-color: #ffff00;

  --bg-hover: #1f0441;
  --bg-tag: transparent;
  --border-color: #ff00cc;
  --text-dark: #ffffff;
  --text-medium: #00ffcc;
}

/* Retro Theme Typography Overrides */
[data-theme="retro"] body {
  font-family: 'Courier New', Courier, monospace;
}

[data-theme="retro"] h1,
[data-theme="retro"] h2,
[data-theme="retro"] h3 {
  font-family: 'Press Start 2P', monospace;
  text-transform: uppercase;
  text-shadow: 2px 2px 0px #ff00cc;
  color: #00ffcc;
  letter-spacing: 1px;
}

[data-theme="retro"] h1 {
  font-size: 1.5rem;
  /* Downsize 8bit font so it fits */
}

[data-theme="retro"] .resume-section h2,
[data-theme="retro"] .consulting-section h2 {
  font-size: 1rem;
}

[data-theme="retro"] .resume-content h3 {
  font-size: 0.75rem;
  line-height: 1.4;
}

[data-theme="retro"] .skill-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #00ffcc;
  text-shadow: 1px 1px 0px #ff00cc;
  letter-spacing: 1px;
}

[data-theme="retro"] .subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  line-height: 1.4;
  color: #ffff00;
  text-shadow: 1px 1px 0px #ff00cc;
}

[data-theme="retro"] #view-about p,
[data-theme="retro"] #view-consulting p {
  font-family: 'Courier New', monospace;
}

[data-theme="retro"] #view-about p:nth-of-type(3n+1),
[data-theme="retro"] #view-consulting p:nth-of-type(3n+1) {
  color: #ff00cc;
}


[data-theme="retro"] #view-about p:nth-of-type(3n+2),
[data-theme="retro"] #view-consulting p:nth-of-type(3n+2) {
  color: #00ffcc;
}

[data-theme="retro"] #view-about p:nth-of-type(3n),
[data-theme="retro"] #view-consulting p:nth-of-type(3n) {
  color: #ffff00;
}

[data-theme="retro"] .tab-view a {
  color: inherit;
  text-decoration-color: currentColor;
}

[data-theme="retro"] .tab-view a:hover {
  background-color: transparent !important;
  text-decoration-color: currentColor !important;
  text-shadow: 0 0 8px currentColor;
}

[data-theme="retro"] .tab-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: #00ffcc;
  text-transform: uppercase;
  border: none;
  outline: none;
}

[data-theme="retro"] .tab-btn:focus-visible {
  outline: 2px dashed #ffff00;
  outline-offset: 4px;
}

[data-theme="retro"] .tab-btn.active {
  color: #ff00cc;
  text-shadow: 0 0 8px #ff00cc;
}

[data-theme="retro"] .tab-btn.active::after {
  display: none;
}

[data-theme="retro"] .tab-btn:hover {
  background-color: transparent;
  color: #ffff00;
  text-shadow: 0 0 5px #ffff00;
}

[data-theme="retro"] .skills-list li {
  border: 1px solid #ff00cc;
  box-shadow: 0 0 5px #ff00cc inset, 0 0 5px #ff00cc;
  color: #00ffcc;
  text-transform: uppercase;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
}

/* Retro animations */
@keyframes neonFlicker {
  0% {
    text-shadow: 0 0 2px #ff00cc, 0 0 5px #ff00cc, 0 0 10px #ff00cc;
  }

  50% {
    text-shadow: 0 0 2px #ff00cc, 0 0 1px #ff00cc, 0 0 2px #ff00cc;
  }

  100% {
    text-shadow: 0 0 2px #ff00cc, 0 0 5px #ff00cc, 0 0 10px #ff00cc;
  }
}

[data-theme="retro"] h1 {
  animation: neonFlicker 3s infinite alternate;
}

html {
  /* Forces a vertical scrollbar to be always visible to avoid horizontal layout jumps when switching between short/long tabs */
  overflow-y: scroll;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 80px 24px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
  opacity: 0;
}

.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

/* Header */
header {
  margin-bottom: 32px;
}

h1 {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 8px;
  /* Space from Threads link */
}

.theme-toggle:hover {
  color: var(--text-main);
  background-color: var(--bg-hover);
}

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

/* Base state: Light OS. Next is Dark, so show Moon */
.moon-icon {
  display: block;
}

.sun-icon,
.gamepad-icon {
  display: none;
}

/* Base state: Dark OS. Next is Retro, so show Gamepad. */
@media (prefers-color-scheme: dark) {
  .moon-icon {
    display: none;
  }

  .gamepad-icon {
    display: block;
  }
}

/* Explicit Light Mode: Next is Dark -> Show Moon */
[data-theme="light"] .moon-icon {
  display: block;
}

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

/* Explicit Dark Mode: Next is Retro -> Show Gamepad */
[data-theme="dark"] .gamepad-icon {
  display: block;
}

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

/* Explicit Retro Mode: Next is Light -> Show Sun */
[data-theme="retro"] .sun-icon {
  display: block;
}

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

#view-about p,
#view-consulting p {
  margin-bottom: 1.6em;
  line-height: 1.8;
  color: var(--text-medium);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-align: justify;
}



.tab-view a {
  color: var(--text-main);
  text-decoration: underline;
  text-decoration-color: #ccc;
  text-underline-offset: 4px;
  transition: all 0.2s ease;
}

.tab-view a:hover {
  text-decoration-color: var(--text-main);
  background-color: var(--bg-hover);
}

/* Signature / Footer */
.footer {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.social-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.social-links a:hover {
  color: var(--text-main);
}

/* Tabs Navigation */
.tabs-nav {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding-bottom: 12px;
  position: relative;
  transition: color 0.2s ease;
  /* Layout shift fix */
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--text-main);
  font-weight: 500;
}

/* Reserve space for bold text to prevent layout shift */
.tab-btn::before {
  content: attr(data-text);
  height: 0;
  visibility: hidden;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  font-weight: 500;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
}

/* Tab Views */
.tab-view {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-view.active {
  display: block;
}

/* Resume & Consulting Styling */
.resume-section,
.consulting-section {
  margin-bottom: 48px;
}

.resume-section h2,
.consulting-section h2 {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--text-main);
}

.resume-item {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
}

.resume-date {
  min-width: 120px;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-top: 4px;
  /* Align with title */
}

.resume-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.company {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}

.resume-content p {
  font-size: 1rem;
  color: var(--text-medium);
  line-height: 1.6;
}

/* Skills List */
.skills-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skills-list li {
  background-color: var(--bg-tag);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-dark);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }

  .resume-item {
    flex-direction: column;
    gap: 8px;
  }

  .footer {
    flex-direction: column-reverse;
    align-items: center;
    gap: 24px;
  }
}

/* Skills Formatting */
.skill-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-medium);
}

.skills-list {
  margin-bottom: 24px;
}