@font-face {
  font-family: RobotoMono;
  src: url('assets/RobotoMono-Regular.ttf');
}

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

:root {
  --bg: #f5f4f0;
  --surface: #eeecea;
  --border: #d8d5d0;
  --text: #1a1a1a;
  --muted: #888;
  --accent: #3a6ea5;
  --accent-hover: #2a5a8f;
  --active-bg: #1a1a1a;
  --active-text: #f5f4f0;
  --card-bg: #ffffff;
  --card-bg-hover: #f8f7f5;
}

.dark {
  --bg: #141414;
  --surface: #1e1e1e;
  --border: #2e2e2e;
  --text: #e8e6e2;
  --muted: #666;
  --accent: #6ea8d8;
  --accent-hover: #8dbde8;
  --active-bg: #e8e6e2;
  --active-text: #141414;
  --card-bg: #1e1e1e;
  --card-bg-hover: #272727;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: RobotoMono, monospace;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.2s, color 0.2s;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:visited {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.noselect {
  -webkit-user-select: none;
  user-select: none;
}

/* ── Header ── */
header {
  padding: 2rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.05em;
}

header .subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  flex: 1;
}

header nav {
  display: flex;
  gap: 1.2rem;
  font-size: 0.82rem;
}

header nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

header nav a:hover {
  color: var(--text);
  border-color: var(--text);
  text-decoration: none;
}

#github-link {
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.15s;
}

#github-link:hover {
  color: var(--text);
  text-decoration: none;
}

#dark-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

#dark-toggle:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ── Two-panel layout ── */
.split-layout {
  display: flex;
  height: calc(100vh - 80px);
}

/* ── Left skill list ── */
.skill-list {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
}

.skill-list-label {
  margin: 0 0 0.6rem 1.2rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.skill-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-item {
  padding: 0.55rem 1.2rem;
  font-size: 0.82rem;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  color: var(--text);
}

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

.skill-item.active {
  border-left-color: var(--active-bg);
  background: var(--surface);
  font-weight: bold;
}

/* ── Right project panel ── */
.project-panel {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

#project-display {
  animation: fadeIn 0.2s ease;
}

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

.panel-header {
  margin-bottom: 1.5rem;
}

.panel-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.panel-header p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.project-cards {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.project-card:hover {
  border-color: var(--accent);
  background: var(--card-bg-hover);
  text-decoration: none;
  color: inherit;
}

.project-card:visited {
  color: inherit;
}

.project-card-title {
  font-size: 0.88rem;
  font-weight: bold;
  color: var(--accent);
}

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

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  white-space: nowrap;
}

/* language tags — blue */
.tag-lang { background: #d0e4f7; color: #1a4a7a; }
/* framework/tool tags — teal */
.tag-tool { background: #cdf0e8; color: #0f5a42; }
/* project-type tags — amber */
.tag-type { background: #fde9c4; color: #7a4a00; }

.dark .tag-lang { background: #1a3a5c; color: #8dbde8; }
.dark .tag-tool { background: #0e3328; color: #5ecaaa; }
.dark .tag-type { background: #3d2800; color: #f0b955; }

.project-card-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 640px) {
  header {
    padding: 1rem 1.2rem 0.9rem;
    gap: 0.6rem;
  }

  header h1 {
    font-size: 1.3rem;
  }

  header .subtitle {
    width: 100%;
    flex: unset;
  }

  /* Stack layout vertically on mobile */
  .split-layout {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 60px);
  }

  /* Skill list becomes a horizontal scrollable strip */
  .skill-list {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0 0;
    flex-direction: column;
  }

  .skill-list-label {
    margin: 0 0 0.4rem 1rem;
  }

  .skill-list ul {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding: 0 0.5rem 0.6rem;
    gap: 0.3rem;
    /* hide scrollbar but keep scrollability */
    scrollbar-width: none;
  }

  .skill-list ul::-webkit-scrollbar {
    display: none;
  }

  .skill-item {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.35rem 0.8rem;
    border-radius: 4px 4px 0 0;
    font-size: 0.78rem;
  }

  .skill-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--active-bg);
  }

  .project-panel {
    padding: 1.2rem 1rem;
    overflow-y: unset;
  }
}
