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

body {
  background: #0a0a0a;
  color: #e5e5e5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Nav */
.nav {
  position: static;
  background: #0a0a0a;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

.nav-links {
  display: flex;
  justify-content: space-evenly;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  border: 1px solid #333;
  color: #e5e5e5;
  background: transparent;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s;
  cursor: pointer;
  line-height: 1.5;
}

.btn:hover {
  border-color: #fff;
  color: #fff;
}

/* Page */
.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3.5rem 2rem 0;
}

/* Header (inside column 1) */
.header-section {
  padding: 0;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.875rem;
  color: #a3a3a3;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Section label */
.section-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-transform: none;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

/* Three-column info grid */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  padding: 3rem 0;
  align-items: start;
}

.info-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.info-col.col-offset {
  padding-top: calc(clamp(2.5rem, 5vw, 3.5rem) * 1.1 + 0.5rem + 0.875rem * 1.6 + 1.5rem);
}

/* Card */
.card {
  border: none;
  border-radius: 0.625rem;
  padding: 0;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
}

/* Education */
.edu-school {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.edu-degree {
  font-size: 0.875rem;
  color: #d4d4d4;
  margin-bottom: 0.25rem;
}

.edu-detail {
  font-size: 0.8125rem;
  color: #a3a3a3;
}

/* Organizations */
.org-item {
  font-size: 0.9375rem;
  color: #e5e5e5;
}

/* Hobbies */
.hobbies {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.hobby-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.125rem;
}

.hobby-detail {
  font-size: 0.8125rem;
  color: #a3a3a3;
  line-height: 1.5;
}

/* ─── Static Horizontal Timeline ─── */
.htl-section {
  padding: 3rem 0;
}

.htl-section .section-label {
  margin-bottom: 2rem;
}

.htl-container {
  position: relative;
  height: 300px;
}

/* Central horizontal line */
.htl-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #333;
}

/* Static track — no animation */
.htl-track {
  display: flex;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

/* Each item spans full height */
.htl-item {
  flex: 1;
  min-width: 0;
  height: 100%;
  position: relative;
  cursor: pointer;
}

/* Node (dot on the line) */
.htl-node {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #333;
  border: 2px solid #0a0a0a;
  z-index: 2;
  transition: background 0.2s;
}

/* Vertical stem */
.htl-stem {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: #333;
  z-index: 1;
  transition: background 0.2s;
}

/* Card */
.htl-card {
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1rem;
  border: 1px solid #1a1a1a;
  border-radius: 0.5rem;
  transition: border-color 0.2s;
  background: #0a0a0a;
  z-index: 1;
}

/* Above: card in top half */
.htl-item.above .htl-card {
  bottom: calc(50% + 30px);
}

.htl-item.above .htl-stem {
  bottom: calc(50% + 5px);
  height: 25px;
}

/* Below: card in bottom half */
.htl-item.below .htl-card {
  top: calc(50% + 30px);
}

.htl-item.below .htl-stem {
  top: calc(50% + 5px);
  height: 25px;
}

/* Hover + active */
.htl-item:hover .htl-card {
  border-color: #444;
}

.htl-item.active .htl-card {
  border-color: #fff;
}

.htl-item.active .htl-node {
  background: #fff;
}

.htl-item.active .htl-stem {
  background: #fff;
}

/* Card logo */
.htl-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

/* Card typography */
.htl-date {
  font-size: 0.6875rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.htl-company {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.125rem;
}

.htl-role {
  font-size: 0.8125rem;
  color: #a3a3a3;
  font-style: italic;
}

/* Details panel below timeline */
.htl-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.htl-details.open {
  max-height: 500px;
}

.htl-details-inner {
  padding: 1.5rem 0 0.5rem;
}

.htl-details-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.75rem;
}

.htl-details-list {
  list-style: none;
  padding: 0;
}

.htl-details-list li {
  font-size: 0.875rem;
  color: #d4d4d4;
  line-height: 1.6;
  margin-bottom: 0.375rem;
  padding-left: 1rem;
  position: relative;
}

.htl-details-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: #555;
}

/* Projects (full width) */
.full-section {
  padding: 3rem 0;
}

.project-item {
  margin-bottom: 2rem;
}

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

.project-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gh-icon {
  display: inline-flex;
  align-items: center;
  color: #666;
  transition: color 0.2s;
  flex-shrink: 0;
}

.gh-icon svg {
  width: 16px;
  height: 16px;
}

.gh-icon:hover {
  color: #fff;
}

.project-badge {
  font-size: 0.6875rem;
  color: #a3a3a3;
  font-weight: 400;
  font-style: italic;
}

.project-tech {
  font-size: 0.8125rem;
  color: #a3a3a3;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.875rem;
  color: #d4d4d4;
  line-height: 1.6;
}

.project-desc li {
  margin-bottom: 0.25rem;
}

/* Lists */
.desc-list {
  list-style: none;
  padding: 0;
}

.desc-list li {
  padding-left: 1rem;
  position: relative;
}

.desc-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: #555;
}

/* Tech Stack */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.tech-category {
  grid-column: span 2;
}

.tech-category:nth-child(4) {
  grid-column: 2 / span 2;
}

.tech-category:nth-child(5) {
  grid-column: 4 / span 2;
}

.tech-heading {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.625rem;
}

.tech-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tech-list li {
  font-size: 0.8125rem;
  color: #a3a3a3;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tech-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #444;
}

/* Now Playing */
.now-playing {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.now-playing.error {
  opacity: 0.5;
}

.np-art {
  width: 48px;
  height: 48px;
  border-radius: 0.25rem;
  object-fit: cover;
  flex-shrink: 0;
}

.np-info {
  flex: 1;
  min-width: 0;
}

.np-track {
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-track a {
  color: inherit;
  text-decoration: none;
}

.np-track a:hover {
  text-decoration: underline;
}

.np-artist {
  font-size: 0.8125rem;
  color: #a3a3a3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-state-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #a3a3a3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.125rem;
}

.np-time {
  font-size: 0.75rem;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.np-label {
  font-size: 0.8125rem;
  color: #a3a3a3;
}

.np-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  flex-shrink: 0;
}

.np-bar {
  width: 3px;
  background: #1db954;
  border-radius: 1px;
}

.np-bar:nth-child(1) { animation: bar1 1s ease-in-out infinite; }
.np-bar:nth-child(2) { animation: bar2 1.1s ease-in-out infinite; }
.np-bar:nth-child(3) { animation: bar3 0.9s ease-in-out infinite; }

@keyframes bar1 {
  0%, 100% { height: 6px; }
  50% { height: 16px; }
}

@keyframes bar2 {
  0%, 100% { height: 10px; }
  50% { height: 14px; }
}

@keyframes bar3 {
  0%, 100% { height: 8px; }
  50% { height: 16px; }
}

/* Heatmap */
.heatmap-total {
  font-size: 0.875rem;
  color: #a3a3a3;
  margin-bottom: 0.75rem;
}

.heatmap-total strong {
  color: #fff;
  font-weight: 600;
}

.heatmap-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.heatmap-grid {
  display: inline-grid;
  grid-template-rows: repeat(7, 11px);
  grid-auto-flow: column;
  grid-auto-columns: 11px;
  gap: 3px;
}

.heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: #161b22;
}

.heatmap-cell[data-level="1"] { background: #0e4429; }
.heatmap-cell[data-level="2"] { background: #006d32; }
.heatmap-cell[data-level="3"] { background: #26a641; }
.heatmap-cell[data-level="4"] { background: #39d353; }

.heatmap-months {
  display: flex;
  font-size: 0.6875rem;
  color: #666;
  margin-top: 0.375rem;
  user-select: none;
}

.heatmap-months span {
  flex-shrink: 0;
}

.heatmap-fallback {
  font-size: 0.875rem;
  color: #666;
}

/* Footer */
footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid #1a1a1a;
}

footer p {
  font-size: 0.8125rem;
  color: #666;
}

/* Mobile */
@media (max-width: 768px) {
  .nav-inner {
    padding: 0.75rem 1.25rem;
  }

  .btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }

  .page {
    padding: 3rem 1.25rem 0;
  }

  h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 0;
  }

  .info-col.col-offset {
    padding-top: 0;
  }

  /* Timeline: stack vertically on mobile */
  .htl-container {
    height: auto;
  }

  .htl-line {
    display: none;
  }

  .htl-track {
    flex-direction: column;
    gap: 1rem;
  }

  .htl-item {
    height: auto;
  }

  .htl-stem,
  .htl-node {
    display: none;
  }

  .htl-card {
    position: static;
  }

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

  .tech-category,
  .tech-category:nth-child(4),
  .tech-category:nth-child(5) {
    grid-column: span 1;
  }
}
