/* ============================================
   N++ Inspired Design System
   Color palette & typography derived from the
   minimalist platformer aesthetic of N++
   ============================================ */

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

:root {
  /* N++ Color Palette */
  --bg-dark: #3b3b2e;
  --bg-medium: #4a4a3a;
  --bg-light: #6e6e5c;
  --bg-lighter: #8a8a76;

  --accent-gold: #d4a800;
  --accent-gold-bright: #f0c800;

  --text-primary: #e8e8d8;
  --text-secondary: #a0a090;
  --text-muted: #787868;

  --surface-dark: #33332a;
  --surface-card: #44443a;
  --surface-hover: #52524a;

  --border-color: #5a5a4a;

  /* Typography */
  --font-main: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-gold);
  color: var(--bg-dark);
}

/* --- Header --- */
.header {
  padding: 2rem 2.5rem 0;
}

.site-title {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* --- Tab Navigation (N++ style) --- */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 3px solid var(--accent-gold);
  position: relative;
}

.tab {
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.6rem 1.8rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
}

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

.tab.active {
  background: var(--accent-gold);
  color: var(--bg-dark);
}

/* --- Progress Bar (N++ timer bar) --- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-medium);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gold-bright);
  transition: width 0.6s ease;
}

/* --- Main Content --- */
.content {
  flex: 1;
  padding: 2rem 2.5rem;
}

.section {
  display: none;
  animation: fadeIn 0.35s ease;
}

.section.active {
  display: block;
}

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

/* --- Section Grid (Credits-style layout) --- */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.col {}

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

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

.role-list {
  list-style: none;
}

.role-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.15rem 0;
}

.bio {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.about-text {
  max-width: 700px;
}

/* --- About Layout (bio + sidebar) --- */
.about-layout {
  display: flex;
  gap: 3rem;
}

.about-sidebar {
  flex-shrink: 0;
  width: 240px;
}

/* --- Last.fm Widget --- */
.lastfm-widget {
  background: var(--surface-card);
  padding: 1rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--accent-gold);
}

.lastfm-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  color: var(--text-muted);
}

.lastfm-icon {
  flex-shrink: 0;
}

.lastfm-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lastfm-track {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.track-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-loading {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.track-status {
  font-size: 0.65rem;
  color: var(--accent-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* --- Social Links --- */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-main);
  position: relative;
}

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

.social-link:hover svg {
  color: var(--accent-gold-bright);
}

.social-link svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.social-link .copy-toast {
  font-size: 0.65rem;
  margin-left: auto;
}

@media (max-width: 768px) {
  .about-layout {
    flex-direction: column;
    gap: 2rem;
  }

  .about-sidebar {
    width: 100%;
  }
}

.bio.muted {
  color: var(--text-muted);
}

.muted li {
  color: var(--text-muted);
}

/* --- Credits Grid (N++ credits style) --- */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.6rem 2.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.credit-item {
  display: flex;
  align-items: baseline;
  padding: 0.35rem 0;
}

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

.credit-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

/* --- Link Items --- */
.link-item {
  text-decoration: none;
  transition: background 0.15s ease;
  padding: 0.5rem 0.75rem;
  margin: -0.15rem -0.75rem;
  border-radius: 2px;
  font-family: var(--font-main);
  font-size: inherit;
}

button.link-item {
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  display: flex;
  align-items: baseline;
  position: relative;
}

.link-item:hover {
  background: var(--surface-hover);
}

.link-item:hover .credit-name {
  color: var(--accent-gold-bright);
}

/* --- Copy Toast --- */
.copy-toast {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-gold-bright);
  margin-left: 0.75rem;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* --- Project Cards --- */
.project-category {
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.project-category:first-child {
  margin-top: 0;
}

.project-category .name {
  margin-bottom: 0;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.project-card {
  background: var(--surface-card);
  padding: 1.5rem;
  border-left: 3px solid var(--bg-medium);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.project-card:hover {
  border-left-color: var(--accent-gold);
  background: var(--surface-hover);
}

.project-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.project-icon {
  display: flex;
  gap: 3px;
}

.gold-square {
  width: 12px;
  height: 12px;
  background: var(--accent-gold);
  border: 1px solid var(--accent-gold-bright);
}

.project-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.project-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: auto;
}

.status-tag {
  font-size: 0.6rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.project-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-links a {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.55rem;
  background: var(--bg-dark);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.project-links a:hover {
  color: var(--accent-gold-bright);
  border-color: var(--accent-gold);
}

/* --- Skill Bars (N++ progress bar style) --- */
.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.skill-bar-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.skill-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 80px;
  flex-shrink: 0;
}

.skill-track {
  flex: 1;
  height: 6px;
  background: var(--bg-medium);
  position: relative;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: var(--accent-gold);
  width: 0%;
  transition: width 0.8s ease;
}

/* --- Ninja Character (N++ stick figure) --- */
.ninja-scene {
  margin-top: 3rem;
  position: relative;
  height: 120px;
}

.ground {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--bg-medium);
}

.ninja {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 50px;
  animation: ninjaFloat 3s ease-in-out infinite;
}

.ninja-head {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--text-primary);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.ninja-body {
  width: 1.5px;
  height: 20px;
  background: var(--text-primary);
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.ninja-leg {
  width: 1.5px;
  height: 16px;
  background: var(--text-primary);
  position: absolute;
  top: 28px;
  transform-origin: top center;
}

.ninja-leg.left {
  left: 6px;
  transform: rotate(-12deg);
}

.ninja-leg.right {
  right: 6px;
  transform: rotate(12deg);
}

.ninja-arm {
  width: 1.5px;
  height: 14px;
  background: var(--text-primary);
  position: absolute;
  top: 14px;
  transform-origin: top center;
}

.ninja-arm.left {
  left: 4px;
  transform: rotate(-25deg);
}

.ninja-arm.right {
  right: 4px;
  transform: rotate(25deg);
}

@keyframes ninjaFloat {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-8px);
  }
}

/* --- Footer (N++ HUD corners) --- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: var(--bg-medium);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
  .header {
    padding: 1.25rem 1.25rem 0;
  }

  .site-title {
    font-size: 2.25rem;
  }

  .tab {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }

  .content {
    padding: 1.5rem 1.25rem;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

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

  .project-list {
    grid-template-columns: 1fr;
  }

  .name {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .tab {
    font-size: 0.65rem;
    padding: 0.45rem 0.65rem;
    letter-spacing: 0.04em;
  }

  .site-title {
    font-size: 1.75rem;
  }
}

/* --- Config Panel (N++ options menu) --- */
.config-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 22, 0.92);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2rem 2.5rem;
  animation: configIn 0.15s ease;
}

.config-overlay.open {
  display: flex;
}

@keyframes configIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.no-animations .config-overlay {
  animation: none;
}

.config-panel {
  width: 100%;
  max-width: 800px;
}

.config-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.config-header .config-active {
  color: var(--accent-gold);
  font-weight: 700;
}

.config-columns {
  display: flex;
  gap: 3rem;
}

.config-col {
  min-width: 130px;
}

.config-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.config-list {
  list-style: none;
}

.config-item {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.2rem 0;
  cursor: pointer;
  transition: color 0.1s ease;
  user-select: none;
}

.config-item:hover {
  color: var(--text-secondary);
}

.config-item.active {
  color: var(--accent-gold);
  font-weight: 700;
}

.config-item.toggle::before {
  content: '✓ ';
  font-size: 0.7em;
}

.config-item.toggle:not(.active)::before {
  content: '✗ ';
}

.config-footer {
  margin-top: 2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.config-footer span {
  color: var(--text-secondary);
}

.config-footer-sep {
  margin: 0 0.5rem;
  color: var(--text-muted) !important;
}

/* --- Theme Palettes --- */
[data-palette="clean"] {
  --bg-dark: #e8e8e0;
  --bg-medium: #d8d8d0;
  --bg-light: #c0c0b8;
  --bg-lighter: #a8a8a0;
  --text-primary: #2a2a22;
  --text-secondary: #5a5a50;
  --text-muted: #8a8a80;
  --surface-dark: #f0f0e8;
  --surface-card: #deded6;
  --surface-hover: #d0d0c8;
  --border-color: #c0c0b8;
  --accent-gold: #2a7a3a;
  --accent-gold-bright: #38a048;
}

[data-palette="evening"] {
  --bg-dark: #1a1a2e;
  --bg-medium: #24243e;
  --bg-light: #3a3a5c;
  --bg-lighter: #5a5a7c;
  --text-primary: #d8d8f0;
  --text-secondary: #9898b8;
  --text-muted: #686888;
  --surface-dark: #12122a;
  --surface-card: #2a2a44;
  --surface-hover: #34345a;
  --border-color: #3a3a5c;
  --accent-gold: #7878d0;
  --accent-gold-bright: #9898f0;
}

[data-palette="hot"] {
  --bg-dark: #2a1010;
  --bg-medium: #3a1818;
  --bg-light: #5c2828;
  --bg-lighter: #7c3838;
  --text-primary: #f0d0c0;
  --text-secondary: #b88878;
  --text-muted: #886058;
  --surface-dark: #220808;
  --surface-card: #3a1818;
  --surface-hover: #4a2222;
  --border-color: #5c2828;
  --accent-gold: #d43030;
  --accent-gold-bright: #ff4444;
}

[data-palette="oceanographer"] {
  --bg-dark: #0a1a2a;
  --bg-medium: #122838;
  --bg-light: #1e3e52;
  --bg-lighter: #2e5670;
  --text-primary: #c8e0f0;
  --text-secondary: #7eaac8;
  --text-muted: #4e7a98;
  --surface-dark: #061420;
  --surface-card: #142a3a;
  --surface-hover: #1e3848;
  --border-color: #1e3e52;
  --accent-gold: #00b8d4;
  --accent-gold-bright: #00e5ff;
}

[data-palette="retro"] {
  --bg-dark: #2b2b1a;
  --bg-medium: #3a3a26;
  --bg-light: #5a5a3a;
  --bg-lighter: #7a7a52;
  --text-primary: #d8d8a0;
  --text-secondary: #a8a870;
  --text-muted: #787850;
  --surface-dark: #222210;
  --surface-card: #38381e;
  --surface-hover: #44442a;
  --border-color: #5a5a3a;
  --accent-gold: #a8a848;
  --accent-gold-bright: #d0d060;
}

[data-palette="vasquez"] {
  --bg-dark: #1a0a1a;
  --bg-medium: #2a1228;
  --bg-light: #4a2244;
  --bg-lighter: #6a3264;
  --text-primary: #e8c8e0;
  --text-secondary: #b888a8;
  --text-muted: #886078;
  --surface-dark: #120812;
  --surface-card: #2e1428;
  --surface-hover: #3a1e36;
  --border-color: #4a2244;
  --accent-gold: #d450a8;
  --accent-gold-bright: #ff66cc;
}

[data-palette="midnight"] {
  --bg-dark: #0c0c0c;
  --bg-medium: #181818;
  --bg-light: #2a2a2a;
  --bg-lighter: #3a3a3a;
  --text-primary: #e0e0e0;
  --text-secondary: #909090;
  --text-muted: #606060;
  --surface-dark: #060606;
  --surface-card: #1a1a1a;
  --surface-hover: #252525;
  --border-color: #2a2a2a;
  --accent-gold: #c8c8c0;
  --accent-gold-bright: #e8e8e0;
}

/* --- Font overrides --- */
[data-font="mono"] {
  --font-main: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

[data-font="serif"] {
  --font-main: 'Georgia', 'Times New Roman', serif;
}

/* --- No animations mode --- */
.no-animations *,
.no-animations *::before,
.no-animations *::after {
  animation: none !important;
  transition: none !important;
}

/* --- Config Responsive --- */
@media (max-width: 768px) {
  .config-overlay {
    padding: 1.25rem;
  }

  .config-columns {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .config-col {
    min-width: 100px;
  }
}
