:root {
  --accent: #155eef;
  color-scheme: light;
}

.tech-stack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 32px;
}

.tech-stack article {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.tech-stack img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
  transition: transform 220ms ease;
}

.tech-stack div { min-width: 0; }
.tech-stack strong,
.tech-stack span { display: block; }
.tech-stack strong { font-size: .78rem; line-height: 1.25; }
.tech-stack span { margin-top: 3px; color: var(--muted); font-size: .66rem; line-height: 1.25; }
.tech-stack small { display: none; }

@media (hover: hover) {
  .tech-stack article:hover { z-index: 1; transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 8px 20px rgba(0, 0, 0, .1); }
  .tech-stack article:hover img { transform: scale(1.08); }
}

@media (max-width: 1000px) {
  .tech-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .tech-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-stack article:last-child { grid-column: 1 / -1; width: calc(50% - 4px); justify-self: center; }
  .tech-stack article { min-height: 70px; padding: 11px; }
  .tech-stack img { width: 30px; height: 30px; flex-basis: 30px; }
}

/* Compact launcher that clears the footer links when they enter view. */
.chat-widget {
  transition: transform 240ms ease-out;
}

.chat-widget.footer-visible {
  transform: translateY(-64px);
}

.chat-toggle {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border-color: rgba(17, 17, 17, .65);
  border-radius: 50%;
  background: rgba(17, 17, 17, .76);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: .72rem;
  line-height: 1.15;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.chat-toggle:hover,
.chat-toggle:focus-visible {
  background: rgba(255, 255, 255, .94);
  color: #111;
  transform: translateY(-2px);
}

.chat-panel {
  bottom: 68px;
}

html[data-theme="dark"] .chat-toggle {
  border-color: rgba(243, 244, 246, .7);
  background: rgba(243, 244, 246, .76);
  color: #101113;
}

html[data-theme="dark"] .chat-toggle:hover,
html[data-theme="dark"] .chat-toggle:focus-visible {
  background: rgba(16, 17, 19, .94);
  color: #f3f4f6;
}

@media (max-width: 540px) {
  .chat-widget.footer-visible {
    transform: translateY(-92px);
  }

  .chat-panel {
    bottom: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-widget,
  .chat-toggle {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-stack article,
  .tech-stack img { transition: none; }
}

.education-gallery {
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
}

.team-leader-timeline {
  margin-top: 36px;
}

.leadership-gallery { margin-top: 22px; }
.leadership-gallery-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.leadership-gallery-heading strong { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.leadership-gallery-heading span { font-size: .7rem; }
.leadership-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.leadership-photos figure { aspect-ratio: 3 / 4; margin: 0; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.leadership-photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.leadership-photos figure:first-child img { object-position: center 28%; }
.leadership-photos-mixed { grid-template-columns: repeat(2, 1fr); }
.leadership-photos-mixed figure:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.leadership-photos-mixed figure:first-child img { object-position: center; }
.encoding-photos,
.education-photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: row;
  gap: 8px;
}

.encoding-photos figure,
.education-photo {
  aspect-ratio: 3 / 4;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
}

.encoding-photos figure:first-child,
.education-photo:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.encoding-photos figure {
  aspect-ratio: 95 / 192;
}

.encoding-photos img,
.education-photo img {
  display: block;
  width: 100%;
  height: 100%;
}

.encoding-photos img {
  object-fit: contain;
}

.education-gallery-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.education-gallery-heading h3 {
  margin: 0;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.education-gallery-heading span {
  color: var(--muted);
  font-size: .72rem;
}

.education-photo img {
  object-fit: cover;
  object-position: center;
}

.leadership-photos figure,
.encoding-photos figure,
.education-photo {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 360ms ease-out, transform 360ms ease-out, border-color 220ms ease, box-shadow 220ms ease;
}

.reveal.visible .leadership-photos figure,
.reveal.visible .encoding-photos figure,
.reveal.visible .education-photo {
  opacity: 1;
  transform: translateY(0);
}

.reveal.visible :is(.leadership-photos, .encoding-photos, .education-photos) figure:nth-child(2) { transition-delay: 55ms; }
.reveal.visible :is(.leadership-photos, .encoding-photos, .education-photos) figure:nth-child(3) { transition-delay: 110ms; }
.reveal.visible :is(.leadership-photos, .encoding-photos, .education-photos) figure:nth-child(4) { transition-delay: 165ms; }
.reveal.visible :is(.leadership-photos, .encoding-photos, .education-photos) figure:nth-child(5) { transition-delay: 220ms; }

.leadership-photos img,
.encoding-photos img,
.education-photo img {
  transition: transform 280ms ease-out;
}

@media (hover: hover) {
  .leadership-photos figure:hover,
  .encoding-photos figure:hover,
  .education-photo:hover {
    z-index: 1;
    transform: translateY(-4px);
    border-color: var(--ink);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
    transition-delay: 0ms;
  }

  .leadership-photos figure:hover img,
  .encoding-photos figure:hover img,
  .education-photo:hover img {
    transform: scale(1.025);
  }
}

@media (max-width: 540px) {
  .leadership-gallery-heading { display: block; }
  .leadership-gallery-heading span { display: block; margin-top: 4px; }
  .education-gallery-heading {
    display: block;
  }

  .education-gallery-heading span {
    display: block;
    margin-top: 5px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .leadership-photos figure,
  .encoding-photos figure,
  .education-photo,
  .leadership-photos img,
  .encoding-photos img,
  .education-photo img {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.theme-toggle {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
}

.theme-toggle:hover {
  border-color: var(--ink);
  background: var(--soft);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.availability {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
}

.availability span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(21, 94, 239, .12);
}

.button-secondary {
  border-color: var(--ink);
  background: var(--white);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--soft);
}

.wordmark span,
h1 span,
.site-nav a.active {
  color: var(--accent);
}

.site-nav a.active {
  border-color: var(--accent);
}

.project-lead {
  min-height: 4.4em;
}

.case-study {
  margin: 22px 0 0;
  border-top: 1px solid var(--line);
}

.case-study div {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.case-study dt {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.case-study dd {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}

.project-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.project-actions > span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.chat-privacy {
  margin: 0;
  padding: 0 16px 10px;
  color: #626262;
  font-size: .65rem;
  line-height: 1.4;
}

.back-to-top {
  right: 24px;
  bottom: 24px;
  left: auto;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  stroke: var(--ink);
  transition: transform 180ms ease, stroke 180ms ease;
}

.back-to-top:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
}

.back-to-top:hover svg {
  stroke: var(--white);
  transform: translateY(-2px);
}

.back-to-top.footer-visible {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
}

@media (max-width: 800px) {
  .theme-toggle {
    order: 2;
  }

  .menu-toggle { order: 1; }
  .site-nav { order: 3; }

  .portrait-frame {
    order: initial;
  }
}

html[data-theme="dark"] {
  --ink: #f3f4f6;
  --muted: #a7abb3;
  --line: #34363a;
  --soft: #1a1b1e;
  --white: #101113;
  --accent: #76a7ff;
  color-scheme: dark;
}

html[data-theme="dark"] .site-header {
  background: rgba(16, 17, 19, .94);
}

html[data-theme="dark"] .contact-section {
  background: #08090a;
  color: #f7f7f7;
}

html[data-theme="dark"] .contact-inner p:not(.eyebrow) {
  color: #c8cbd0;
}

html[data-theme="dark"] .button-light {
  border-color: #f7f7f7;
  background: #f7f7f7;
  color: #111;
}

html[data-theme="dark"] .button-light:hover {
  background: transparent;
  color: #f7f7f7;
}

html[data-theme="dark"] .portrait-frame img {
  opacity: .9;
}

html[data-theme="dark"] .availability span {
  box-shadow: 0 0 0 4px rgba(118, 167, 255, .16);
}

html[data-theme="dark"] .chat-toggle,
html[data-theme="dark"] .chat-form button {
  border-color: #f3f4f6;
  background: #f3f4f6;
  color: #101113;
}

html[data-theme="dark"] .chat-toggle:hover,
html[data-theme="dark"] .chat-toggle:focus-visible,
html[data-theme="dark"] .chat-form button:hover {
  background: #101113;
  color: #f3f4f6;
}

html[data-theme="dark"] .chat-panel,
html[data-theme="dark"] .chat-form input,
html[data-theme="dark"] .chat-close,
html[data-theme="dark"] .chat-suggestions button {
  border-color: #f3f4f6;
  background: #101113;
  color: #f3f4f6;
}

html[data-theme="dark"] .chat-panel {
  box-shadow: 8px 8px 0 #f3f4f6;
}

html[data-theme="dark"] .chat-panel header,
html[data-theme="dark"] .chat-form,
html[data-theme="dark"] .chat-suggestions {
  border-color: #34363a;
}

html[data-theme="dark"] .chat-panel header span,
html[data-theme="dark"] .chat-privacy {
  color: #a7abb3;
}

html[data-theme="dark"] .chat-messages {
  background: #1a1b1e;
}

html[data-theme="dark"] .chat-message.bot {
  border-color: #34363a;
  background: #101113;
}

html[data-theme="dark"] .chat-message.user {
  background: #f3f4f6;
  color: #101113;
}

html[data-theme="dark"] .chat-suggestions button:hover,
html[data-theme="dark"] .chat-close:hover {
  background: #2a2c30;
  color: #fff;
}

html[data-theme="dark"] .back-to-top {
  border-color: rgba(255, 255, 255, .35);
  background: #161719;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .6);
}

html[data-theme="dark"] .back-to-top svg {
  stroke: #ffffff;
}

html[data-theme="dark"] .back-to-top:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #111111;
  box-shadow: 0 6px 22px rgba(255, 255, 255, .3);
}

html[data-theme="dark"] .back-to-top:hover svg {
  stroke: #111111;
  transform: translateY(-2px);
}

@media (max-width: 540px) {
  .hero-actions {
    align-items: stretch;
  }

  .hero-actions .button {
    width: 100%;
  }

  .project-lead {
    min-height: 0;
  }

  .back-to-top {
    right: 18px;
    bottom: 18px;
    left: auto;
  }
}

html[data-theme="dark"] .chat-toggle {
  border-color: rgba(243, 244, 246, .7);
  background: rgba(243, 244, 246, .76);
  color: #101113;
}

html[data-theme="dark"] .chat-toggle:hover,
html[data-theme="dark"] .chat-toggle:focus-visible {
  background: rgba(16, 17, 19, .94);
  color: #f3f4f6;
}

/* ==========================================================================
   Minimalist, Big-Impact Portfolio Enhancements & GitHub Activity Center
   ========================================================================== */

/* Availability & Micro-Pulse Dot */
.availability {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
}

.availability span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulseGreen 2.2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  display: inline-block;
  flex-shrink: 0;
}

@keyframes pulseGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Section Header Typography */
.activity-section {
  padding-top: 100px;
}

.activity-heading-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 36px;
}

.section-title-impact {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
  font-weight: 800;
  margin: 12px 0 0;
  color: var(--ink);
}

.section-title-impact span {
  color: var(--muted);
}

.section-subtitle-impact {
  max-width: 440px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   4-Column High-Impact Metric Strip
   ========================================================================== */

.impact-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 22px 24px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 125px;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms ease, box-shadow 220ms ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .06);
}

html[data-theme="dark"] .stat-card:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  border-color: rgba(255, 255, 255, 0.25);
}

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.stat-value {
  font-size: clamp(2.2rem, 3.8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1.05;
  color: var(--ink);
  margin: 10px 0 4px;
  font-feature-settings: "tnum";
}

.stat-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.stat-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
}

.stat-status-badge strong {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulseGreen 2.2s infinite;
  display: inline-block;
}

.stat-meta-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color 180ms ease;
}

.stat-meta-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ==========================================================================
   Featured / Pinned Bento Cards
   ========================================================================== */

.github-pinned-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.pinned-repo-card {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 26px 28px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms ease, box-shadow 220ms ease;
}

.pinned-repo-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .06);
}

html[data-theme="dark"] .pinned-repo-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
  border-color: rgba(255, 255, 255, 0.25);
}

.pinned-repo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.repo-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.repo-badge-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}

.repo-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.repo-name:hover {
  text-decoration: underline;
}

.badge-public {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.repo-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 14px 0 20px;
  line-height: 1.55;
}

.repo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.repo-lang {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 600;
}

.lang-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.repo-link {
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.arrow-lift {
  display: inline-block;
  transition: transform 180ms ease;
}

.pinned-repo-card:hover .arrow-lift {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   Contribution Calendar Command Center
   ========================================================================== */

.github-calendar-panel {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 28px 32px;
  border-radius: 8px;
  margin-bottom: 28px;
  transition: border-color 200ms ease;
}

.calendar-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.calendar-headline-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-headline {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.calendar-subtext {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Segmented Year Switcher */
.year-selector {
  display: inline-flex;
  gap: 2px;
  background: var(--soft);
  padding: 3px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.year-btn {
  background: transparent;
  border: 0;
  padding: 6px 15px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 180ms ease;
}

.year-btn:hover {
  color: var(--ink);
}

.year-btn.active {
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

html[data-theme="dark"] .year-btn.active {
  background: #f3f4f6;
  color: #101113;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}

/* Calendar Matrix Layout */
.calendar-mobile-hint {
  display: none;
}

.calendar-scroll-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.calendar-scroll-wrapper::-webkit-scrollbar {
  height: 5px;
}

.calendar-scroll-wrapper::-webkit-scrollbar-track {
  background: var(--soft);
  border-radius: 4px;
}

.calendar-scroll-wrapper::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.calendar-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.calendar-stage {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: max-content;
  min-width: 100%;
}

.calendar-skeleton {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 45px 0;
  font-weight: 500;
}

.calendar-table {
  border-collapse: separate;
  border-spacing: 3.5px;
  margin: 0 auto;
}

.calendar-month-row th {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  padding-bottom: 8px;
  height: 20px;
}

.calendar-weekday-header {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  padding-right: 8px;
  width: 28px;
}

.calendar-day-cell {
  width: 12px;
  height: 12px;
  border-radius: 2.5px;
  transition: transform 120ms ease, box-shadow 120ms ease;
  outline: none;
}

.calendar-day-cell:hover,
.calendar-day-cell:focus-visible {
  transform: scale(1.45);
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--ink);
  z-index: 10;
  position: relative;
}

/* Contributions Levels (Light Mode) */
.level-0 { background-color: #ebedf0; }
.level-1 { background-color: #9be9a8; }
.level-2 { background-color: #40c463; }
.level-3 { background-color: #30a14e; }
.level-4 { background-color: #216e39; }

/* Contributions Levels (Dark Mode) */
html[data-theme="dark"] .level-0 { background-color: #161b22; }
html[data-theme="dark"] .level-1 { background-color: #0e4429; }
html[data-theme="dark"] .level-2 { background-color: #006d32; }
html[data-theme="dark"] .level-3 { background-color: #26a641; }
html[data-theme="dark"] .level-4 {
  background-color: #39d353;
  box-shadow: 0 0 8px rgba(57, 211, 83, 0.45);
}

.calendar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

.calendar-info-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 180ms ease;
}

.calendar-info-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.calendar-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-text {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

.legend-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  display: inline-block;
}

/* ==========================================================================
   Monthly Activity Breakdown Panel
   ========================================================================== */

.github-activity-panel {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 28px 32px;
  border-radius: 8px;
}

.activity-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.activity-panel-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.activity-panel-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.activity-month-pill {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink);
  letter-spacing: 0.04em;
}

.activity-stat-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.activity-stat-summary .git-commit-icon {
  color: #10b981;
}

.activity-repos-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-repo-item {
  display: grid;
  grid-template-columns: minmax(200px, 2.5fr) minmax(80px, 1fr) 2fr;
  align-items: center;
  gap: 20px;
}

.activity-repo-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.activity-repo-name:hover {
  text-decoration: underline;
}

.activity-commits-count {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
  font-feature-settings: "tnum";
}

.activity-bar-track {
  width: 100%;
  height: 6px;
  background: var(--soft);
  border-radius: 3px;
  overflow: hidden;
}

.activity-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #22c55e);
  border-radius: 3px;
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glassmorphic Floating Tooltip */
.calendar-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: rgba(17, 17, 19, 0.92);
  color: #ffffff;
  padding: 7px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translate(-50%, -100%) translateY(-8px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.calendar-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(-12px);
}

html[data-theme="dark"] .calendar-tooltip {
  background: rgba(28, 30, 35, 0.94);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f3f4f6;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .impact-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .activity-heading-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .github-pinned-grid {
    grid-template-columns: 1fr;
  }

  .activity-repo-item {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .activity-bar-track {
    grid-column: 1 / -1;
  }

  .calendar-headline {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {
  .calendar-mobile-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 12px;
    letter-spacing: 0.01em;
  }

  .calendar-mobile-hint svg {
    flex-shrink: 0;
    opacity: 0.8;
  }
}

@media (max-width: 640px) {
  .calendar-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 16px;
  }

  .calendar-headline {
    font-size: 1.18rem;
    line-height: 1.25;
  }

  .calendar-subtext {
    font-size: 0.78rem;
  }

  .year-selector {
    display: flex;
    width: 100%;
  }

  .year-btn {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 0.82rem;
  }

  .github-calendar-panel {
    padding: 20px 16px;
    border-radius: 10px;
  }

  .calendar-table {
    border-spacing: 2.8px;
  }

  .calendar-day-cell {
    width: 11px;
    height: 11px;
    border-radius: 2px;
  }

  .calendar-weekday-header {
    width: 24px;
    font-size: 0.65rem;
    padding-right: 6px;
  }

  .calendar-month-row th {
    font-size: 0.7rem;
    padding-bottom: 6px;
  }
}

@media (max-width: 480px) {
  .impact-stats-strip {
    grid-template-columns: 1fr;
  }

  .github-calendar-panel,
  .github-activity-panel {
    padding: 16px 12px;
  }

  .calendar-table {
    border-spacing: 2.3px;
  }

  .calendar-day-cell {
    width: 10px;
    height: 10px;
  }

  .calendar-footer {
    flex-direction: column-reverse;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
  }

  .calendar-legend {
    width: 100%;
    justify-content: center;
  }

  .calendar-info-link {
    font-size: 0.78rem;
  }
}


