/* ==========================================================================
   Design tokens — GitHub dark palette
   ========================================================================== */

:root {
  --gh-bg: #0d1117;
  --gh-canvas: #161b22;
  --gh-canvas-subtle: #21262d;
  --gh-border: #30363d;
  --gh-text: #e6edf3;
  --gh-text-muted: #8b949e;
  --gh-accent: #58a6ff;
  --gh-accent-muted: #388bfd;
  --gh-accent-subtle: rgba(56, 139, 253, 0.15);
  --gh-green: #3fb950;
  --gh-banner-from: #161b22;
  --gh-banner-to: #0d1117;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --radius: 8px;
  --feed-width: 780px;
  --page-width: 1128px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--gh-bg);
  color: var(--gh-text);
  line-height: 1.5;
  min-height: 100dvh;
}

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

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

/* ==========================================================================
   Layout shell
   ========================================================================== */

.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.feed {
  max-width: var(--feed-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--gh-canvas);
  border-radius: var(--radius);
  border: 1px solid var(--gh-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card__body {
  padding: 16px 24px 24px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gh-text);
  border-bottom: 1px solid var(--gh-border);
  padding-bottom: 8px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-bottom: 24px;
}

.hero__banner {
  height: 200px;
  background:
    radial-gradient(circle at 15% 70%, rgba(88, 166, 255, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(63, 185, 80, 0.08) 0%, transparent 40%),
    linear-gradient(180deg, var(--gh-canvas-subtle) 0%, var(--gh-banner-to) 100%);
  border-bottom: 1px solid var(--gh-border);
}

.hero__profile {
  padding: 0 24px;
  margin-top: -72px;
  position: relative;
}

.hero__avatar {
  width: 152px;
  height: 152px;
  border-radius: 50%;
  border: 4px solid var(--gh-canvas);
  box-shadow: var(--shadow-md);
  background: var(--gh-canvas-subtle);
  object-fit: cover;
}

.hero__info {
  margin-top: 12px;
}

.hero__name {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.hero__headline {
  font-size: 1rem;
  color: var(--gh-text);
  margin-top: 4px;
}

.hero__subtitle {
  font-size: 0.875rem;
  color: var(--gh-text-muted);
  margin-top: 6px;
  max-width: 600px;
}

.hero__location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--gh-text-muted);
  margin-top: 8px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: #238636;
  color: #fff;
  border-color: rgba(240, 246, 252, 0.1);
}

.btn--primary:hover {
  background: #2ea043;
  color: #fff;
}

.btn--linkedin {
  background: #0a66c2;
  color: #fff;
  border-color: rgba(240, 246, 252, 0.1);
}

.btn--linkedin:hover {
  background: #004182;
  color: #fff;
}

.btn--secondary {
  background: var(--gh-canvas-subtle);
  color: var(--gh-text);
  border-color: var(--gh-border);
}

.btn--secondary:hover {
  background: var(--gh-border);
  border-color: var(--gh-text-muted);
  color: var(--gh-text);
}

/* ==========================================================================
   Experience timeline
   ========================================================================== */

.timeline {
  list-style: none;
  position: relative;
  padding-left: 24px;
}

/* Vertical line + dot markers */
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--gh-border);
}

.timeline__item {
  position: relative;
  padding-bottom: 24px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gh-canvas);
  border: 2px solid var(--gh-accent);
}

.timeline__item--current::before {
  background: var(--gh-accent);
}

.timeline__company {
  font-weight: 600;
  font-size: 1rem;
}

.timeline__role {
  font-size: 0.9375rem;
  margin-top: 2px;
  color: var(--gh-text-muted);
}

.timeline__meta {
  font-size: 0.8125rem;
  color: var(--gh-text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   Education
   ========================================================================== */

.edu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edu-list__item {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gh-border);
}

.edu-list__item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.edu-list__school {
  font-weight: 600;
  font-size: 1rem;
}

.edu-list__degree {
  font-size: 0.9375rem;
  margin-top: 2px;
  color: var(--gh-text-muted);
}

.edu-list__dates {
  font-size: 0.8125rem;
  color: var(--gh-text-muted);
  margin-top: 4px;
}

.edu-list__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gh-accent);
  background: var(--gh-accent-subtle);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  border: 1px solid rgba(56, 139, 253, 0.3);
}

/* ==========================================================================
   Skills badges
   ========================================================================== */

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

.skill-badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gh-text);
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: 20px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
  cursor: default;
}

.skill-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gh-accent);
  background: var(--gh-accent-subtle);
  color: var(--gh-accent);
}

/* ==========================================================================
   Project cards
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.projects-grid + .projects-group__title {
  margin-top: 28px;
}

.projects-group__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gh-text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.projects-group__desc {
  font-size: 0.875rem;
  color: var(--gh-text-muted);
  margin: -4px 0 12px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--gh-border);
  border-radius: var(--radius);
  background: var(--gh-canvas-subtle);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  border-top: 3px solid var(--gh-text-muted);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gh-accent-muted);
  text-decoration: none;
  color: inherit;
}

/* Live demo variant */
.project-card--demo {
  border-top-color: var(--gh-green);
}

/* Contributor variant */
.project-card--contributor {
  border-top-color: #a371f7;
}

.project-card--contributor .project-card__icon {
  color: #a371f7;
}

.project-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.project-card__icon {
  flex-shrink: 0;
  color: var(--gh-text-muted);
}

.project-card--demo .project-card__icon {
  color: var(--gh-green);
}

.project-card--game {
  border-top-color: #f0883e;
}

.project-card--game .project-card__icon {
  color: #f0883e;
}

.project-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gh-accent);
}

.project-card:hover .project-card__title {
  text-decoration: underline;
}

.project-card__type {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gh-text-muted);
  margin-left: auto;
}

.project-card__desc {
  font-size: 0.875rem;
  color: var(--gh-text-muted);
  flex-grow: 1;
  margin-bottom: 12px;
  line-height: 1.45;
}

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

.project-tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--gh-accent-subtle);
  color: var(--gh-accent);
  border: 1px solid rgba(56, 139, 253, 0.3);
}

.project-tag--dark {
  background: var(--gh-bg);
  color: var(--gh-text-muted);
  border-color: var(--gh-border);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  max-width: var(--feed-width);
  margin: 24px auto 0;
  padding: 16px 24px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gh-text-muted);
}

.footer a {
  font-weight: 600;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 601px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .hero__banner {
    height: 120px;
  }

  .hero__profile {
    margin-top: -56px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero__avatar {
    width: 112px;
    height: 112px;
  }

  .hero__actions {
    justify-content: center;
  }

  .card__body {
    padding: 16px;
  }
}
