:root, [data-theme="gruvbox"] {
  --bg-dark: #1d2021;
  --bg: #282828;
  --bg-soft: #32302f;
  --bg-hover: #3c3836;
  --fg: #ebdbb2;
  --fg-dim: #a89984;
  --border: #504945;
  --red: #fb4934;
  --green: #b8bb26;
  --yellow: #fabd2f;
  --blue: #83a598;
  --purple: #d3869b;
  --aqua: #8ec07c;
  --orange: #fe8019;
  --shadow: rgba(0, 0, 0, 0.45);
}

[data-theme="catppuccin"] {
  --bg-dark: #11111b;
  --bg: #1e1e2e;
  --bg-soft: #181825;
  --bg-hover: #313244;
  --fg: #cdd6f4;
  --fg-dim: #9399b2;
  --border: #45475a;
  --red: #f38ba8;
  --green: #a6e3a1;
  --yellow: #f9e2af;
  --blue: #89b4fa;
  --purple: #cba6f7;
  --aqua: #94e2d5;
  --orange: #fab387;
  --shadow: rgba(0, 0, 0, 0.55);
}

[data-theme="matrix"] {
  --bg-dark: #000800;
  --bg: #051405;
  --bg-soft: #082008;
  --bg-hover: #0c300c;
  --fg: #20c20e;
  --fg-dim: #138507;
  --border: #138507;
  --red: #ff3333;
  --green: #00ff66;
  --yellow: #88ff88;
  --blue: #33ffbb;
  --purple: #66ff99;
  --aqua: #00ffaa;
  --orange: #55ee55;
  --shadow: rgba(0, 50, 0, 0.5);
}

[data-theme="dracula"] {
  --bg-dark: #1e1f29;
  --bg: #282a36;
  --bg-soft: #21222c;
  --bg-hover: #44475a;
  --fg: #f8f8f2;
  --fg-dim: #6272a4;
  --border: #44475a;
  --red: #ff5555;
  --green: #50fa7b;
  --yellow: #f1fa8c;
  --blue: #8be9fd;
  --purple: #bd93f9;
  --aqua: #8be9fd;
  --orange: #ffb86c;
  --shadow: rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--fg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ======================================================== */
/* 🎬 INTRO VIDEO OVERLAY (Shared)                          */
/* ======================================================== */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 14, 0.95);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.intro-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-container {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}

.intro-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.intro-title {
  color: var(--yellow);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skip-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.skip-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.video-box {
  position: relative;
  width: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
}

#intro-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.play-trigger {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.play-trigger.hidden {
  display: none;
}

.start-btn {
  background: var(--yellow);
  color: var(--bg-dark);
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.start-btn:hover {
  background: var(--aqua);
}

.intro-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-soft);
}

.intro-progress {
  width: 0%;
  height: 100%;
  background: var(--green);
  transition: width 0.1s linear;
}

/* ======================================================== */
/* 🖥️ DESKTOP EXPERIENCE STYLES                             */
/* ======================================================== */
@media (min-width: 769px) {
  body {
    padding: 1.5rem;
    height: 100vh;
  }

  .mobile-only {
    display: none !important;
  }

  .desktop-only {
    display: flex !important;
  }

  .terminal-wrapper {
    width: 100%;
    max-width: 960px;
    height: 88vh;
    min-height: 600px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 40px var(--shadow);
    flex-direction: column;
    overflow: hidden;
  }

  .terminal-header {
    background-color: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    flex-shrink: 0;
  }

  .window-controls {
    display: flex;
    gap: 8px;
  }

  .control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
  }

  .control-dot.close { background-color: var(--red); }
  .control-dot.minimize { background-color: var(--yellow); }
  .control-dot.maximize { background-color: var(--green); }

  .window-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg-dim);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .theme-toggle-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: inherit;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .theme-toggle-btn:hover {
    border-color: var(--aqua);
    color: var(--aqua);
  }

  .quick-nav {
    background-color: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-label {
    font-size: 0.75rem;
    color: var(--fg-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .chip {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--yellow);
    font-family: inherit;
    font-size: 0.8rem;
    padding: 2px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .chip:hover {
    background: var(--yellow);
    color: var(--bg-dark);
    font-weight: 600;
  }

  .terminal-body {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    cursor: text;
  }

  .terminal-body::-webkit-scrollbar {
    width: 7px;
  }
  .terminal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }

  .banner {
    color: var(--yellow);
    white-space: pre;
    font-family: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .history-item {
    margin-bottom: 1.25rem;
  }

  .command-echo {
    display: flex;
    gap: 8px;
    margin-bottom: 0.35rem;
    font-weight: 600;
  }

  .command-echo .cmd {
    color: var(--yellow);
  }

  .prompt {
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
  }

  .prompt .user { color: var(--green); }
  .prompt .at { color: var(--fg-dim); }
  .prompt .host { color: var(--aqua); }
  .prompt .path { color: var(--blue); }
  .prompt .symbol { color: var(--fg-dim); }

  .output {
    color: var(--fg);
    line-height: 1.6;
  }

  .highlight { color: var(--yellow); font-weight: 600; }
  .accent { color: var(--aqua); }
  .tag {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--purple);
    font-size: 0.75rem;
    padding: 1px 7px;
    border-radius: 3px;
  }

  .project-card {
    border-left: 3px solid var(--aqua);
    background: var(--bg-soft);
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    border-radius: 0 6px 6px 0;
  }

  .project-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--yellow);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .project-tags {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .about-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin: 0.5rem 0;
  }

  .profile-avatar {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--aqua);
    display: block;
  }

  .image-viewer-card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.75rem 0;
    max-width: 400px;
  }

  .image-viewer-img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 6px;
  }

  .neofetch-container {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin: 0.75rem 0;
  }

  .neofetch-art {
    color: var(--aqua);
    white-space: pre;
    font-size: 0.75rem;
    line-height: 1.2;
  }

  .neofetch-info {
    list-style: none;
  }

  .help-table {
    width: 100%;
    max-width: 580px;
    margin: 0.5rem 0;
    border-collapse: collapse;
  }

  .help-table td {
    padding: 3px 10px 3px 0;
  }

  .help-table .cmd-col {
    color: var(--yellow);
    font-weight: 600;
  }

  .input-line {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .input-container {
    flex: 1;
    display: flex;
  }

  #terminal-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--yellow);
    font-family: inherit;
    font-size: 15px;
    caret-color: var(--yellow);
  }
}

/* ======================================================== */
/* 📱 MOBILE REDESIGN (Sleek, Modern Native Mobile App UI)  */
/* ======================================================== */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  body {
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    justify-content: flex-start;
  }

  .mobile-view {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    padding-bottom: 2.5rem;
  }

  /* App Bar Header */
  .m-app-header {
    width: 100%;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
  }

  .m-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--fg);
  }

  .m-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--green);
    box-shadow: 0 0 8px var(--green);
  }

  .m-header-tools {
    display: flex;
    gap: 8px;
  }

  .m-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .m-tool-btn:active {
    transform: scale(0.92);
    border-color: var(--aqua);
    color: var(--aqua);
  }

  /* Hero Section */
  .m-hero-card {
    padding: 1.5rem 1.25rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .m-avatar-container {
    position: relative;
    margin-bottom: 1rem;
  }

  .m-avatar-img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 26px;
    border: 3px solid var(--aqua);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    display: block;
  }

  .m-avatar-chip {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background-color: var(--yellow);
    color: var(--bg-dark);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    border: 2px solid var(--bg-dark);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

  .m-hero-name {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--fg);
    margin-bottom: 0.25rem;
  }

  .m-hero-role {
    font-size: 0.88rem;
    color: var(--yellow);
    font-weight: 600;
    margin-bottom: 0.85rem;
  }

  .m-tag-pill-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1.25rem;
  }

  .m-pill {
    background-color: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--fg-dim);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .m-pill i {
    color: var(--aqua);
  }

  .m-action-btns {
    display: flex;
    width: 100%;
    max-width: 320px;
    gap: 10px;
  }

  .m-action-btn {
    flex: 1;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
  }

  .m-action-btn.primary {
    background-color: var(--yellow);
    color: var(--bg-dark);
    box-shadow: 0 4px 14px rgba(250, 189, 47, 0.25);
  }

  .m-action-btn.secondary {
    background-color: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--fg);
  }

  .m-action-btn:active {
    transform: scale(0.96);
  }

  /* Segmented Tab Navigation Bar */
  .m-tab-bar {
    display: flex;
    padding: 0.4rem;
    margin: 0.5rem 1.25rem 1rem 1.25rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    gap: 4px;
  }

  .m-tab-btn {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--fg-dim);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .m-tab-btn i {
    font-size: 0.78rem;
  }

  .m-tab-btn.active {
    background-color: var(--bg-hover);
    color: var(--yellow);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  /* Content Cards */
  .m-tab-content-area {
    padding: 0 1.25rem;
  }

  .m-tab-pane {
    display: none;
    animation: fadeIn 0.25s ease forwards;
  }

  .m-tab-pane.active {
    display: block;
  }

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

  .m-card {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.15rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  }

  .m-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--yellow);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
  }

  .m-card-title i {
    color: var(--aqua);
  }

  .m-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--fg);
  }

  .m-text strong {
    color: var(--aqua);
  }

  .m-divider {
    height: 1px;
    background-color: var(--border);
    margin: 0.85rem 0;
  }

  .m-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .m-list li {
    font-size: 0.86rem;
    color: var(--fg);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
  }

  .m-list li i {
    color: var(--green);
    margin-top: 3px;
    font-size: 0.85rem;
  }

  /* Skills Grid */
  .m-skill-group-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--yellow);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .m-skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .m-skill-badge {
    background-color: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 8px;
  }

  /* Project Cards */
  .m-project-card {
    position: relative;
    transition: transform 0.15s ease;
  }

  .m-project-card:active {
    transform: scale(0.99);
  }

  .m-project-top {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 0.6rem;
  }

  .m-project-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background-color: var(--bg-soft);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aqua);
    font-size: 1rem;
    flex-shrink: 0;
  }

  .m-project-info {
    flex: 1;
  }

  .m-project-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--fg);
    line-height: 1.3;
  }

  .m-project-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--aqua);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
  }

  .m-project-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--yellow);
    font-family: 'JetBrains Mono', monospace;
  }

  .m-project-desc {
    font-size: 0.85rem;
    color: var(--fg-dim);
    line-height: 1.5;
    margin-bottom: 0.75rem;
  }

  .m-project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .m-ptag {
    background-color: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--purple);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
  }

  /* Specs Rows */
  .m-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
  }

  .m-spec-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .m-spec-key {
    color: var(--yellow);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
  }

  .m-spec-val {
    color: var(--fg);
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
    font-size: 0.82rem;
  }
}
