/* ============================================================
   GITHUB
   ============================================================ */

.github-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: var(--grid-gap-lg);
}


/* ============================================================
   GITHUB PROFILE CARD
   ============================================================ */

.github-profile-card {
  position: relative;
  overflow: hidden;

  background:
    linear-gradient(145deg,
      var(--card),
      var(--card2));

  border: 1px solid var(--border);
  border-radius: var(--r-lg);

  padding: var(--space-7) var(--space-6);

  text-align: center;

  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.18);

  transition:
    border-color 0.25s var(--ease-out),
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}

.github-profile-card::before {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(135deg,
      rgba(255, 0, 60, 0.06),
      transparent 35%,
      transparent 70%,
      rgba(255, 0, 60, 0.025));

  pointer-events: none;
}

.github-profile-card::after {
  content: "";

  position: absolute;

  top: 0;
  left: 15%;
  right: 15%;

  height: 1px;

  background:
    linear-gradient(90deg,
      transparent,
      var(--red),
      transparent);

  opacity: 0.7;
}

.github-profile-card:hover {
  border-color: var(--border-red);

  transform: translateY(-2px);

  box-shadow:
    0 16px 50px rgba(0, 0, 0, 0.25),
    0 0 35px rgba(255, 0, 60, 0.05);
}


/* ============================================================
   GITHUB AVATAR
   ============================================================ */

.github-avatar {
  position: relative;
  z-index: 1;

  width: 86px;
  height: 86px;

  object-fit: cover;

  border-radius: var(--r-full);

  display: block;

  margin: 0 auto var(--space-4);

  background: var(--card2);

  border: 2px solid var(--border-red);

  box-shadow:
    0 0 0 5px rgba(255, 0, 60, 0.04),
    0 0 30px rgba(255, 0, 60, 0.12);

  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.github-profile-card:hover .github-avatar {
  transform: scale(1.04);

  box-shadow:
    0 0 0 6px rgba(255, 0, 60, 0.05),
    0 0 38px rgba(255, 0, 60, 0.18);
}


/* ============================================================
   USERNAME
   ============================================================ */

.github-username {
  position: relative;
  z-index: 1;

  font-family: var(--font-mono);
  font-size: var(--text-base);

  color: var(--red);

  margin-bottom: var(--space-2);

  font-weight: 600;

  letter-spacing: 0.02em;
}


/* ============================================================
   BIO
   ============================================================ */

.github-bio {
  position: relative;
  z-index: 1;

  max-width: 240px;

  margin:
    0 auto var(--space-6);

  font-size: var(--text-sm);

  color: var(--muted);

  line-height: var(--lh-relaxed);
}


/* ============================================================
   GITHUB STATS
   ============================================================ */

.github-stats {
  position: relative;
  z-index: 1;

  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 8px;

  margin-bottom: var(--space-6);
}


/* ============================================================
   STAT CARD
   ============================================================ */

.gh-stat {
  position: relative;

  min-width: 0;

  background:
    linear-gradient(145deg,
      var(--card2),
      var(--card));

  border: 1px solid var(--border);

  border-radius: var(--r-md);

  padding:
    var(--space-4) var(--space-3);

  text-align: center;

  overflow: hidden;

  transition:
    border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}

.gh-stat::before {
  content: "";

  position: absolute;

  top: 0;
  left: 20%;
  right: 20%;

  height: 1px;

  background: var(--red);

  opacity: 0;

  transition: opacity 0.2s ease;
}

.gh-stat:hover {
  border-color: var(--border-red);

  transform: translateY(-2px);

  background: var(--card);
}

.gh-stat:hover::before {
  opacity: 0.65;
}


/* ============================================================
   STAT NUMBER
   ============================================================ */

.gh-stat-num {
  font-family: var(--font-display);

  font-size: clamp(var(--text-lg),
      2vw,
      var(--text-xl));

  line-height: 1;

  font-weight: 700;

  color: var(--red);

  font-variant-numeric: tabular-nums;

  text-shadow:
    0 0 20px rgba(255, 0, 60, 0.12);
}


/* ============================================================
   STAT LABEL
   ============================================================ */

.gh-stat-label {
  margin-top: 7px;

  font-family: var(--font-mono);

  font-size: 9px;

  color: var(--muted);

  letter-spacing: var(--ls-wider);

  text-transform: uppercase;
}


/* ============================================================
   CONTRIBUTION GRAPH
   ============================================================ */

.contrib-graph {
  position: relative;

  background:
    linear-gradient(145deg,
      var(--card),
      var(--card2));

  border: 1px solid var(--border);

  border-radius: var(--r-lg);

  padding: var(--space-6);

  margin-bottom: var(--space-6);

  overflow: hidden;
}

.contrib-graph::before {
  content: "";

  position: absolute;

  top: 0;
  left: 10%;
  right: 10%;

  height: 1px;

  background:
    linear-gradient(90deg,
      transparent,
      var(--border-red),
      transparent);
}


/* ============================================================
   CONTRIBUTION HEADER
   ============================================================ */

.contrib-title {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: var(--space-4);

  font-family: var(--font-mono);

  font-size: var(--text-xs);

  color: var(--muted);

  letter-spacing: var(--ls-wider);

  margin-bottom: var(--space-5);

  text-transform: uppercase;
}

.contrib-title::before {
  content: ">";
  color: var(--red);
}


/* ============================================================
   CONTRIBUTION CELLS
   ============================================================ */

.contrib-cells {
  display: grid;

  grid-template-columns:
    repeat(52, minmax(8px, 1fr));

  grid-template-rows:
    repeat(7, minmax(8px, 1fr));

  grid-auto-flow: column;

  gap: 4px;

  min-width: 700px;
}

.contrib-cell {
  aspect-ratio: 1;

  min-width: 8px;

  border-radius: 2px;

  background: var(--card2);

  border: 1px solid transparent;

  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    filter 0.15s ease;
}

.contrib-cell:hover {
  transform: scale(1.35);

  border-color: rgba(255, 0, 60, 0.6);

  filter:
    drop-shadow(0 0 5px rgba(255, 0, 60, 0.35));

  position: relative;
  z-index: 2;
}


/* ============================================================
   CONTRIBUTION LEVELS
   ============================================================ */

.contrib-cell[data-level="1"] {
  background: rgba(255, 0, 60, 0.16);
}

.contrib-cell[data-level="2"] {
  background: rgba(255, 0, 60, 0.32);
}

.contrib-cell[data-level="3"] {
  background: rgba(255, 0, 60, 0.55);
}

.contrib-cell[data-level="4"] {
  background: var(--red);

  box-shadow:
    0 0 8px rgba(255, 0, 60, 0.12);
}


/* ============================================================
   REPOSITORIES GRID
   ============================================================ */

.repos-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: var(--space-4);
}


/* ============================================================
   REPOSITORY CARD
   ============================================================ */

.repo-card {
  position: relative;

  display: flex;

  flex-direction: column;

  min-width: 0;

  background:
    linear-gradient(145deg,
      var(--card),
      var(--card2));

  border: 1px solid var(--border);

  border-radius: var(--r-lg);

  padding: var(--space-5);

  overflow: hidden;

  transition:
    border-color 0.25s var(--ease-out),
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}

.repo-card::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 0;
  height: 2px;

  background: var(--red);

  transition:
    width 0.3s var(--ease-out);
}

.repo-card:hover {
  border-color: var(--border-red);

  transform: translateY(-4px);

  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.22);
}

.repo-card:hover::before {
  width: 100%;
}


/* ============================================================
   REPOSITORY HEADER
   ============================================================ */

.repo-card-header {
  display: flex;

  align-items: flex-start;

  gap: var(--space-3);

  margin-bottom: var(--space-4);
}

.repo-icon {
  flex: 0 0 auto;

  width: 36px;
  height: 36px;

  display: grid;

  place-items: center;

  border-radius: var(--r-md);

  background: rgba(255, 0, 60, 0.06);

  border: 1px solid var(--border);

  color: var(--red);

  font-size: 15px;

  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.repo-card:hover .repo-icon {
  background: rgba(255, 0, 60, 0.1);

  border-color: var(--border-red);
}

.repo-title-wrapper {
  min-width: 0;
}


/* ============================================================
   REPOSITORY NAME
   ============================================================ */

.repo-name {
  margin: 0 0 5px;

  font-family: var(--font-mono);

  font-size: var(--text-sm);

  font-weight: 600;

  color: var(--red);

  line-height: 1.4;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;
}


/* ============================================================
   REPOSITORY VISIBILITY
   ============================================================ */

.repo-visibility {
  display: inline-flex;

  align-items: center;

  padding:
    2px 7px;

  border: 1px solid var(--border);

  border-radius: 999px;

  font-family: var(--font-mono);

  font-size: 8px;

  color: var(--muted);

  text-transform: uppercase;

  letter-spacing: 0.08em;
}


/* ============================================================
   REPOSITORY DESCRIPTION
   ============================================================ */

.repo-description,
.repo-desc {
  font-size: var(--text-sm);

  color: var(--muted);

  line-height: var(--lh-relaxed);

  margin:
    0 0 var(--space-5);

  display: -webkit-box;

  -webkit-line-clamp: 3;

  -webkit-box-orient: vertical;

  overflow: hidden;

  min-height: 3.9em;
}


/* ============================================================
   REPOSITORY META
   ============================================================ */

.repo-meta {
  display: flex;

  align-items: center;

  gap: var(--space-4);

  flex-wrap: wrap;

  margin-top: auto;

  padding-top: var(--space-4);

  border-top: 1px solid var(--border);
}


/* ============================================================
   LANGUAGE
   ============================================================ */

.repo-language,
.repo-lang {
  display: flex;

  align-items: center;

  gap: 7px;

  font-family: var(--font-mono);

  font-size: var(--text-xs);

  color: var(--muted);
}

.repo-lang-dot {
  width: 7px;
  height: 7px;

  flex: 0 0 auto;

  border-radius: var(--r-full);

  background: var(--red);

  box-shadow:
    0 0 7px rgba(255, 0, 60, 0.3);
}


/* ============================================================
   STARS / FORKS
   ============================================================ */

.repo-stars,
.repo-forks {
  display: inline-flex;

  align-items: center;

  gap: 4px;

  font-family: var(--font-mono);

  font-size: var(--text-xs);

  color: var(--muted);
}

.repo-stars {
  color: var(--text);
}


/* ============================================================
   REPOSITORY LINK
   ============================================================ */

.repo-link {
  display: inline-flex;

  align-items: center;

  justify-content: space-between;

  width: 100%;

  margin-top: var(--space-4);

  padding-top: var(--space-3);

  border-top: 1px solid transparent;

  color: var(--muted);

  font-family: var(--font-mono);

  font-size: var(--text-xs);

  text-decoration: none;

  transition:
    color 0.2s ease,
    padding-left 0.2s ease;
}

.repo-link::after {
  content: "↗";

  color: var(--red);

  transition:
    transform 0.2s ease;
}

.repo-link:hover {
  color: var(--red);

  padding-left: 3px;
}

.repo-link:hover::after {
  transform: translate(2px, -2px);
}


/* ============================================================
   LOADING STATE
   ============================================================ */

.github-loading {
  grid-column: 1 / -1;

  min-height: 180px;

  display: grid;

  place-items: center;

  border: 1px dashed var(--border);

  border-radius: var(--r-lg);

  color: var(--muted);

  font-family: var(--font-mono);

  font-size: var(--text-xs);

  text-transform: uppercase;

  letter-spacing: var(--ls-wider);
}

.github-loading::before {
  content: "//";

  margin-right: 8px;

  color: var(--red);
}


/* ============================================================
   EMPTY STATE
   ============================================================ */

.github-empty {
  grid-column: 1 / -1;

  padding: var(--space-8);

  text-align: center;

  border: 1px dashed var(--border);

  border-radius: var(--r-lg);

  color: var(--muted);

  font-family: var(--font-mono);

  font-size: var(--text-sm);
}


/* ============================================================
   ERROR STATE
   ============================================================ */

.github-error {
  grid-column: 1 / -1;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: var(--space-2);

  min-height: 180px;

  padding: var(--space-6);

  text-align: center;

  border: 1px solid var(--border);

  border-radius: var(--r-lg);

  background: var(--card);

  color: var(--muted);

  font-family: var(--font-mono);

  font-size: var(--text-xs);
}

.github-error strong {
  color: var(--red);

  font-size: var(--text-sm);
}

.github-error a {
  margin-top: var(--space-3);

  color: var(--red);

  text-decoration: none;

  transition: opacity 0.2s ease;
}

.github-error a:hover {
  opacity: 0.75;
}