/* ==========================================================================
   My Porto - Core Stylesheet
   Strict Constraints:
   1. Solid color palette only
   2. Zero Emojis (SVG icons and semantic typography only)
   3. Zero Em Dash characters
   4. High contrast WCAG AA compliant Dual Theme (Dark and Light)
   ========================================================================== */

:root {
  /* Dark Theme Default Palette (Solid colors) */
  --bg-primary: #0a0c10;
  --bg-surface: #12161f;
  --bg-surface-elevated: #1a202c;
  --bg-surface-active: #232b3b;
  --border-subtle: #242c3d;
  --border-strong: #38455e;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-text: #ffffff;

  --accent-success: #10b981;
  --accent-success-hover: #059669;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="light"] {
  /* Light Theme Palette (Solid colors) */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-active: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-primary: #1d4ed8;
  --accent-primary-hover: #1e40af;
  --accent-text: #ffffff;

  --accent-success: #047857;
  --accent-success-hover: #065f46;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Accessible interactive controls */
a,
button,
summary,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

a {
  text-decoration: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

button:disabled,
a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* ==========================================================================
   Loading Screen
   ========================================================================== */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #050608;
  color: #f8fafc;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: #3b82f6;
}

.loader-counter {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.loader-status {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ==========================================================================
   Floating Navbar (Melayang Kapsul)
   ========================================================================== */
.floating-navbar-container {
  position: fixed;
  top: 1.5rem;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 1rem;
}

.floating-navbar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 9999px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
}

.nav-link.active {
  color: var(--accent-text);
  background-color: var(--accent-primary);
}

.nav-divider {
  width: 1px;
  height: 1.25rem;
  background-color: var(--border-subtle);
  margin: 0 0.25rem;
}

.nav-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  color: var(--text-secondary);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.nav-tool-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.nav-tool-btn.active {
  color: var(--accent-text);
  background-color: var(--accent-success);
  border-color: var(--accent-success);
}

/* Sound Wave Animation */
.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.sound-bar {
  width: 2px;
  height: 100%;
  background-color: currentColor;
  transform-origin: bottom;
  animation: soundBarDance 1s ease-in-out infinite alternate;
}

.sound-bar:nth-child(1) {
  animation-delay: 0.1s;
  height: 35%;
}

.sound-bar:nth-child(2) {
  animation-delay: 0.3s;
  height: 85%;
}

.sound-bar:nth-child(3) {
  animation-delay: 0.2s;
  height: 55%;
}

.sound-bar:nth-child(4) {
  animation-delay: 0.4s;
  height: 100%;
}

.sound-bars.paused .sound-bar {
  animation: none;
  height: 35%;
}

@keyframes soundBarDance {
  0% {
    transform: scaleY(0.3);
  }

  100% {
    transform: scaleY(1);
  }
}

/* ==========================================================================
   Section Common Layout
   ========================================================================== */
.section {
  padding: 6rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 7rem;
}

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

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
  width: 100%;
}

.hero-welcome {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.hero-specialty {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.25rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-text);
  background-color: var(--accent-primary);
  border-radius: 8px;
  border: 1px solid var(--accent-primary);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-strong);
}

.social-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.social-icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ==========================================================================
   3D Lanyard ID Card (Hero Right Side)
   ========================================================================== */
.hero-card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  min-height: 480px;
  position: relative;
}

.lanyard-strap {
  width: 38px;
  height: 110px;
  background-color: #1a1e28;
  border: 2px solid #2e3748;
  border-radius: 4px;
  position: relative;
  margin-bottom: -15px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.lanyard-clip {
  width: 18px;
  height: 24px;
  border: 3px solid #718096;
  border-radius: 4px;
  position: absolute;
  bottom: -14px;
  background-color: #2d3748;
  z-index: 3;
}

.id-card-3d {
  width: 320px;
  height: 450px;
  background-color: #10141d;
  border: 2px solid #2d3748;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  cursor: grab;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.id-card-3d:active {
  cursor: grabbing;
}

.card-top-slot {
  width: 50px;
  height: 8px;
  background-color: #07090d;
  border-radius: 4px;
  margin: 0 auto 1rem auto;
  border: 1px solid #2d3748;
}

.card-header-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid #2d3748;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.card-photo-box {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  border: 1px solid #2d3748;
  overflow: hidden;
  background-color: #0a0c10;
  position: relative;
}

.card-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-info {
  margin-top: 1rem;
}

.card-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.card-role-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #3b82f6;
  background-color: #1e293b;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.card-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #2d3748;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.card-qr {
  width: 48px;
  height: 48px;
  background-color: #ffffff;
  padding: 3px;
  border-radius: 4px;
}

.card-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.card-meta-text {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: #64748b;
  text-align: right;
}

/* ==========================================================================
   About Me Section & Spider-Man Hover Effect
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.about-photo-wrapper {
  position: sticky;
  top: 6rem;
}

.interactive-photo-card {
  position: relative;
  width: 100%;
  height: 440px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  background-color: var(--bg-surface);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.photo-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.photo-spiderman {
  opacity: 0;
  transform: scale(1.03);
}

.interactive-photo-card:hover .photo-normal {
  opacity: 0;
}

.interactive-photo-card:hover .photo-spiderman {
  opacity: 1;
  transform: scale(1);
}

.photo-hint {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  background-color: rgba(10, 12, 16, 0.85);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #cbd5e1;
  text-align: center;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.about-narrative {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.timeline-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
}

.timeline-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

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

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item-role {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.timeline-item-org {
  font-size: 0.875rem;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.timeline-item-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-item-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 3 Achievement Stats */
.stats-three-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Spotify Player Card */
.spotify-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
}

.spotify-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.spotify-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-success);
}

.spotify-track-view {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.spotify-cover {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  object-fit: cover;
  background-color: #07090d;
}

.spotify-track-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.track-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.track-artist {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.spotify-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ctrl-btn:hover {
  background-color: var(--bg-surface-active);
  border-color: var(--border-strong);
}

.ctrl-btn.play-btn {
  width: 3rem;
  height: 3rem;
  background-color: var(--accent-success);
  border-color: var(--accent-success);
  color: #ffffff;
}

.ctrl-btn.play-btn:hover {
  background-color: var(--accent-success-hover);
  border-color: var(--accent-success-hover);
}

.spotify-progress-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 38px;
}

.progress-bar-bg {
  flex: 1;
  height: 6px;
  background-color: var(--bg-surface-elevated);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.progress-bar-fill {
  height: 100%;
  width: 30%;
  background-color: var(--accent-success);
  border-radius: 9999px;
  transition: width 0.2s linear;
}

/* ==========================================================================
   3D Skills Macropad (Video 2 Reference)
   ========================================================================== */
.skills-macropad-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 3.5rem;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.skills-detail-screen {
  display: flex;
  flex-direction: column;
}

.skills-hint {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.active-skill-name {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.active-skill-category {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.active-skill-desc {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
  min-height: 80px;
}

.skill-percentage-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-pct-label-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.skill-pct-bar-bg {
  width: 100%;
  height: 10px;
  background-color: var(--bg-surface-elevated);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.skill-pct-bar-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent-primary);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* 3D Macropad Keyboard Simulation */
.macropad-isometric-stage {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.macropad-case {
  background-color: #0c0f17;
  border: 3px solid #232b3b;
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transform: rotateX(25deg) rotateZ(-12deg);
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.macropad-case:hover {
  transform: rotateX(20deg) rotateZ(-8deg);
}

.keycaps-grid {
  display: grid;
  grid-template-columns: repeat(5, 68px);
  grid-template-rows: repeat(2, 68px);
  gap: 12px;
}

.keycap {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 0 #07090d, 0 10px 10px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.keycap:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #07090d, 0 14px 14px rgba(0, 0, 0, 0.5);
}

.keycap:active,
.keycap.pressed {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #07090d, 0 4px 6px rgba(0, 0, 0, 0.5);
}

.keycap-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.keycap-key-hint {
  font-size: 0.6875rem;
  opacity: 0.85;
}

/* ==========================================================================
   Portfolio & Achievements Section (Video 1 Reference)
   ========================================================================== */
.portfolio-tab-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.portfolio-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  transition: all 0.15s ease;
}

.portfolio-tab-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
}

.portfolio-tab-btn.active {
  color: var(--accent-text);
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.project-thumbnail-wrap {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: #07090d;
}

.project-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-thumbnail {
  transform: scale(1.05);
}

.project-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.project-card-summary {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.project-tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1.5rem;
}

.tech-badge-solid {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 6px;
}

.project-details-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.project-details-btn:hover {
  background-color: var(--bg-surface-active);
  border-color: var(--border-strong);
}

/* Certificates Grid */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.cert-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cert-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

.cert-image {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}

.cert-info {
  padding: 1.25rem;
}

.cert-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.cert-issuer {
  font-size: 0.875rem;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.cert-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Project Details Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: rgba(5, 6, 8, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
}

.modal-body {
  padding: 1.5rem;
}

.modal-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.modal-desc-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.modal-footer-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Developer Dashboard Section (Video 3 Reference)
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.dash-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.dash-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-card-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Umami Chart */
.umami-summary-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.umami-stat-box {
  display: flex;
  flex-direction: column;
}

.umami-stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-success);
}

.umami-stat-lbl {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.umami-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 120px;
  padding-top: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.umami-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.umami-bar-fill {
  width: 100%;
  background-color: var(--accent-success);
  border-radius: 4px 4px 0 0;
  transition: height 0.4s ease;
}

.umami-bar-month {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* GitHub Heatmap Grid */
.github-stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.gh-metric {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.gh-metric-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-success);
}

.gh-metric-lbl {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.github-squares-grid {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  grid-template-rows: repeat(7, 10px);
  gap: 3px;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.gh-square {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background-color: #1a2332;
}

.gh-square.lvl-1 {
  background-color: #0e4429;
}

.gh-square.lvl-2 {
  background-color: #006d32;
}

.gh-square.lvl-3 {
  background-color: #26a641;
}

.gh-square.lvl-4 {
  background-color: #39d353;
}

/* Wakatime & Monkeytype */
.waka-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.waka-lbl {
  color: var(--text-secondary);
}

.waka-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.waka-lang-bar-wrap {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 1.25rem 0;
  border: 1px solid var(--border-subtle);
}

.waka-lang-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.waka-lang-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

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

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

.monkey-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.monkey-val {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: #eab308;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.monkey-lbl {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Skeleton Loading Elements */
.skeleton-box {
  background-color: var(--bg-surface-elevated);
  border-radius: 6px;
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.9;
  }

  100% {
    opacity: 0.5;
  }
}

/* ==========================================================================
   Contact & Guestbook Section
   ========================================================================== */
.contact-guestbook-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
}

.form-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 2.25rem;
}

.form-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-subheading {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.8125rem 1rem;
  font-size: 0.9375rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}

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

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

.form-notice {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 1rem;
  display: none;
}

.form-notice.success {
  display: block;
  background-color: var(--accent-success);
  color: #ffffff;
}

.form-notice.error {
  display: block;
  background-color: #ef4444;
  color: #ffffff;
}

/* Guestbook List */
.guestbook-feed {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.guestbook-item {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
}

.guest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.guest-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.guest-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.guest-comment {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer-wrap {
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 1.5rem 2.5rem 1.5rem;
  background-color: var(--bg-surface);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

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

.back-to-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  transition: all 0.15s ease;
}

.back-to-top-btn:hover {
  background-color: var(--bg-surface-active);
  border-color: var(--border-strong);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

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

  .hero-actions,
  .social-strip {
    justify-content: center;
  }

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

  .about-photo-wrapper {
    position: static;
    max-width: 360px;
    margin: 0 auto;
  }

  .skills-macropad-wrapper {
    grid-template-columns: 1fr;
  }

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

  .contact-guestbook-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .floating-navbar {
    padding: 0.35rem 0.5rem;
  }

  .nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
  }

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

  .timeline-two-cols {
    grid-template-columns: 1fr;
  }

  .stats-three-grid {
    grid-template-columns: 1fr;
  }

  .keycaps-grid {
    grid-template-columns: repeat(5, 54px);
    grid-template-rows: repeat(2, 54px);
    gap: 8px;
  }

  .keycap {
    width: 54px;
    height: 54px;
  }

  .keycap-icon {
    width: 20px;
    height: 20px;
  }

  .spotify-track-view {
    grid-template-columns: 60px 1fr;
  }

  .spotify-controls {
    grid-column: span 2;
    justify-content: center;
  }
}