:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --secondary-bg: #111827;
  --panel: #1b2430;
  --panel-strong: #1b2430;
  --text: #f8fafc;
  --muted: #94a3b8;
  --quiet: #64748b;
  --line: #2a3441;
  --accent: #2563eb;
  --accent-strong: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ── Page Loader ─────────────────────────────────────────────────── */
.page-loader {
  align-items: center;
  background: #0b0f14;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 9999;
  transition: opacity 600ms ease, visibility 600ms ease;
}

.page-loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
  text-align: center;
  width: min(380px, 90vw);
}

/* Pulsing circuit dots */
.loader-circuit {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  height: 2.6rem;
  margin-bottom: 0.25rem;
}

.loader-circuit span {
  background: #3b82f6;
  border-radius: 3px;
  display: block;
  width: 6px;
  animation: loader-pulse 1.1s ease-in-out infinite;
}

.loader-circuit span:nth-child(1) { animation-delay: 0s;    height: 16px; }
.loader-circuit span:nth-child(2) { animation-delay: 0.1s;  height: 28px; }
.loader-circuit span:nth-child(3) { animation-delay: 0.2s;  height: 20px; }
.loader-circuit span:nth-child(4) { animation-delay: 0.3s;  height: 36px; }
.loader-circuit span:nth-child(5) { animation-delay: 0.2s;  height: 24px; }
.loader-circuit span:nth-child(6) { animation-delay: 0.1s;  height: 14px; }

@keyframes loader-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.65); }
  50%       { opacity: 1;   transform: scaleY(1); }
}

.loader-label {
  color: #f8fafc;
  font-family: Urbanist, Inter, system-ui, sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin: 0;
}

.loader-label em {
  color: #3b82f6;
  font-style: normal;
}

/* Progress bar */
.loader-bar-track {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  height: 4px;
  overflow: hidden;
  width: 100%;
}

.loader-bar-fill {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6, #93c5fd);
  border-radius: 999px;
  height: 100%;
  transition: width 250ms ease;
  width: 0%;
}

/* Sub-label (phase text) */
.loader-sub {
  color: #64748b;
  font-family: Urbanist, Inter, system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0;
  min-height: 1.2em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .loader-circuit span { animation: none; opacity: 1; }
  .page-loader { transition: none; }
  .loader-bar-fill { transition: none; }
}
/* ── /Page Loader ────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--scroll-bg, #0b0f14);
  color: var(--text);
  font-family: Urbanist, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: 80px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  padding-top: 1.5rem;
}

.scroll-progress {
  background: var(--accent);
  height: 3px;
  left: 0;
  position: fixed;
  top: 0;
  transform: scaleX(0);
  transform-origin: left;
  width: 100%;
  z-index: 30;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

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

/* ── Dynamic Island Navbar wrapper ─────────────────────────────────── */
.nav-island-wrap {
  left: 0;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem) 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
  pointer-events: none;   /* let clicks fall through the padding area */
}

.site-header {
  align-items: center;
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  background: rgba(10, 14, 26, 0.50) !important;
  border: 1px solid var(--nav-border, rgba(255,255,255,0.14));
  border-radius: 999px;
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav-links header-right";
  margin: 0 auto;
  max-width: 1100px;
  padding: 0.6rem 1.1rem 0.6rem 0.75rem;
  pointer-events: all;
  transition: padding 280ms ease, box-shadow 280ms ease, max-width 280ms ease, border-color 350ms ease;
  width: 100%;
}

.site-header.scrolled {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
  max-width: 920px;
  padding: 0.45rem 1rem 0.45rem 0.65rem;
}

/* Adjustments for the scrolled (shrunken) navbar state */
.site-header.scrolled .brand-role {
  display: none; /* Hide sub-text to save space */
}

.site-header.scrolled .nav-links {
  gap: 0.7rem; /* Tighter gap between links */
}

.site-header.scrolled .nav-links a,
.site-header.scrolled .header-cta {
  font-size: 0.8rem; /* Smaller font for all links and buttons */
}

.site-header.scrolled .header-cta {
  padding: 0.45rem 0.75rem; /* Tighter padding on the Resume button */
}

.header-right {
  grid-area: header-right;
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

/* ── Hamburger button ──────────────────────────────────────────────── */
.hamburger {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  display: none;
  flex-direction: column;
  gap: 5px;
  height: 2.4rem;
  justify-content: center;
  padding: 0.5rem 0.6rem;
  width: 2.6rem;
  transition: background 200ms ease, border-color 200ms ease, transform 150ms ease;
}

.hamburger:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--accent);
}

.hamburger:active {
  transform: scale(0.93);
}

.hamburger[aria-expanded="true"] {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent);
}

.hamburger-bar {
  background: var(--text);
  border-radius: 2px;
  display: block;
  height: 2px;
  transition: transform 280ms ease, opacity 280ms ease, width 280ms ease;
  width: 100%;
}

/* Animated X state */
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.brand {
  grid-area: brand;
  align-items: center;
  color: var(--nav-text, var(--text));
  display: flex;
  font-size: 1.03rem;
  font-weight: 800;
  gap: 0.5rem;
  letter-spacing: 0.01em;
  transition: color 350ms ease;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.brand-name {
  font-size: 0.97rem;
  font-weight: 800;
  color: var(--nav-text, var(--text));
  transition: color 350ms ease;
}

.brand-role {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--nav-accent, var(--accent-strong));
  letter-spacing: 0.03em;
  transition: color 350ms ease;
}

.brand-avatar {
  border-radius: 50%;
  height: 34px;
  object-fit: cover;
  object-position: top center;
  width: 34px;
  border: 2px solid var(--accent, #6c63ff);
  flex-shrink: 0;
}

.nav-links {
  grid-area: nav-links;
  display: flex;
  gap: clamp(0.8rem, 2vw, 1.4rem);
  justify-content: center;
}

.nav-links a,
.header-cta {
  color: var(--nav-muted, var(--muted));
  font-size: 0.86rem;
  font-weight: 600;
  position: relative;
  transition:
    background 250ms ease,
    border-color 250ms ease,
    color 350ms ease;
}

.nav-links a::after {
  background: var(--nav-accent, var(--accent));
  border-radius: 999px;
  bottom: -0.42rem;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms ease;
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active,
.header-cta:hover,
.card-links a:hover,
.resource-grid a:hover,
.research-list a:hover {
  color: var(--nav-accent, var(--accent-strong));
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.header-cta {
  background: transparent;
  border: 1px solid var(--nav-border, var(--line));
  border-radius: 12px;
  color: var(--nav-text, var(--text));
  padding: 0.55rem 0.95rem;
  transition: background 250ms ease, border-color 350ms ease, color 350ms ease;
}

.header-cta:hover {
  background: var(--panel);
}

.section-shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: clamp(4.5rem, 7vw, 7rem) clamp(1rem, 4vw, 3rem);
}

.hero {
  align-items: center;
  display: grid;
  gap: clamp(3rem, 6vw, 6rem);
  grid-template-columns: minmax(0, 0.98fr) minmax(0, 0.78fr);
  min-height: min(880px, calc(100vh - 70px));
  padding-bottom: clamp(3.5rem, 6vw, 5.75rem);
  padding-top: clamp(2.75rem, 5vw, 4.6rem);
  position: relative;
}

.hero::before {
  background: linear-gradient(180deg, rgba(27, 36, 48, 0.58), rgba(17, 24, 39, 0.34));
  border: 1px solid var(--line);
  border-radius: 20px;
  content: "";
  inset: 1.8rem clamp(1rem, 4vw, 3rem) 1.8rem;
  opacity: 1;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.hero-copy {
  max-width: 45rem;
}

.eyebrow,
.card-topline {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.65rem, 5vw, 4.35rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.98;
  margin-bottom: 1.25rem;
  max-width: 13ch;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.85rem, 3vw, 2.75rem);
  letter-spacing: 0;
  line-height: 1.1;
  margin-bottom: 1rem;
  max-width: 14ch;
  text-wrap: balance;
}

h3 {
  font-size: 1.06rem;
  line-height: 1.32;
  margin-bottom: 0.7rem;
  text-wrap: balance;
}

.hero-text,
.section-copy,
.project-card p,
.research-list p,
.skills-grid p,
.experience-body p,
.experience-panel > div > p,
.site-footer {
  color: var(--muted);
}

/* Override experience text to be more visible */
.experience-body p,
.experience-panel > div > p {
  color: #CBD5E1;
}

.section-copy {
  max-width: 44rem;
}

.project-card p,
.research-list p,
.resource-grid p,
.skills-grid p {
  line-height: 1.62;
}

.hero-text {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.75;
  max-width: 40rem;
}

.hero-actions,
.contact-actions,
.card-links,
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  align-items: center;
  border-radius: 12px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.76rem 1.1rem;
  transition:
    background 250ms ease,
    border-color 250ms ease,
    color 250ms ease,
    transform 250ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--accent);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

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

.quick-stats {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 2.25rem 0 0;
}

.quick-stats div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.quick-stats dt {
  color: var(--quiet);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-stats dd {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0.15rem 0 0;
}

.hero-visual {
  border-radius: 20px;
  isolation: isolate;
  position: relative;
  transition: transform 250ms ease;
}

.portrait-frame {
  margin-inline: auto;
  margin-top: -1.35rem;
  max-width: min(23rem, 100%);
  padding: 0.75rem;
}

.portrait-frame::before,
.portrait-frame::after {
  border-radius: inherit;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.portrait-frame::before {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: -2;
}

.portrait-frame::after {
  border: 1px solid rgba(248, 250, 252, 0.08);
  z-index: 4;
}

.portrait-card {
  background: #111827;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.portrait-card::after {
  background: linear-gradient(180deg, transparent 64%, rgba(11, 15, 20, 0.18));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.portrait-card img {
  aspect-ratio: 4 / 5;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
  width: 100%;
}

.split-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  grid-template-columns: minmax(0, 0.68fr) minmax(0, 1fr);
}

.section-copy p:last-child,
.project-card p:last-child,
.research-list p:last-child,
.skills-grid p:last-child {
  margin-bottom: 0;
}

.section-heading {
  display: block;
  margin-bottom: 1.8rem;
}

.project-heading {
  align-items: end;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
}

.experience-stack {
  display: grid;
  gap: 1rem;
}

.experience-panel {
  background: #151C2C;
  border: 1px solid #2E3A4E;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45);
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  padding: clamp(1.5rem, 3vw, 2rem);
  position: relative;
  overflow: hidden;
  transition: border-color 250ms ease, transform 250ms ease, box-shadow 250ms ease;
}

.experience-panel:hover {
  border-color: rgba(59,130,246,0.4);
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
}

.compact-panel {
  background: #151C2C;
}

.experience-org {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
}

.experience-org img {
  background: #ffffff;
  border: 1px solid #2E3A4E;
  border-radius: 16px;
  box-shadow: none;
  flex: 0 0 auto;
  height: 3.35rem;
  object-fit: contain;
  padding: 0.42rem;
  width: 3.35rem;
}

.experience-org p {
  color: #E2E8F0;
}

.experience-panel h3 {
  color: #F1F5F9;
}

.experience-body p {
  color: #CBD5E1;
}

.experience-panel::before {
  display: none;
}

.reveal-section.in-view .experience-panel::before {
  animation: none;
}

.check-list {
  color: #CBD5E1;
  margin: 1rem 0 0;
  padding-left: 1.15rem;
}

.check-list li + li {
  margin-top: 0.45rem;
}

.filter-button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  min-height: 2.4rem;
  padding: 0.55rem 0.9rem;
}

.filter-button.active,
.filter-button:hover {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--text);
}

.project-grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card,
.research-list article,
.resource-grid article,
.skills-grid div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 26rem;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition:
    background 250ms ease,
    border-color 250ms ease,
    box-shadow 250ms ease,
    opacity 250ms ease,
    transform 250ms ease;
}

.project-card:hover {
  background: var(--panel-strong);
  border-color: transparent;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  transform: translateY(-4px);
}

.project-card[hidden] {
  display: none;
}

.learned {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 1rem;
}

.tag-row span {
  background: var(--secondary-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
}

.card-links {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}

.card-links a,
.resource-grid a,
.research-list a {
  color: var(--accent);
  font-weight: 800;
}

.research-list {
  display: grid;
  gap: 1rem;
}

.research-list article,
.resource-grid article,
.skills-grid div {
  padding: 1.5rem;
  transition:
    background 250ms ease,
    border-color 250ms ease,
    box-shadow 250ms ease,
    transform 250ms ease;
}

.research-list article:hover,
.resource-grid article:hover,
.skills-grid div:hover {
  background: var(--card-bg, var(--panel-strong));
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  transform: translateY(-4px);
}

.skills-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ── Skills Tree ───────────────────────────────────────────────────── */
.skills-tree {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.skill-card {
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.skill-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.18);
}

/* ── Purple revolving glow on skill cards (always on) ── */
.skill-card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.skill-card-glow::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: conic-gradient(
    from 0deg,
    transparent   0%,
    transparent  40%,
    #5b21b6      55%,
    #7c3aed      60%,
    #c4b5fd      62%,
    #7c3aed      64%,
    #5b21b6      69%,
    transparent  80%,
    transparent 100%
  );
  animation: skillCardSpin 3.5s linear infinite;
  opacity: 1;
}

/* Inner mask — punches out centre, leaves only the ring */
.skill-card-glow::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--panel, #111827);
  border-radius: 14px;
}

@keyframes skillCardSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Keep card content above the glow layers */
.skill-card > *:not(.skill-card-glow) {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .skill-card-glow::before { animation: none; }
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.skill-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.01em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--tag-bg, rgba(99, 102, 241, 0.08));
  border: 1px solid var(--tag-border, rgba(99, 102, 241, 0.18));
  color: var(--tag-color, #a5b4fc);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
  white-space: nowrap;
  cursor: default;
}

.skill-tag i {
  font-size: 1rem;
  line-height: 1;
  transition: transform 250ms ease;
}

.skill-tag:hover {
  background: rgba(99, 102, 241, 0.20);
  border-color: rgba(99, 102, 241, 0.45);
  color: #818cf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.20);
}

.skill-tag:hover i {
  transform: scale(1.25) rotate(-5deg);
}

.resource-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resource-grid.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.achievement-grid div {
  border-color: var(--card-border, rgba(255,255,255,0.08));
  background: var(--card-bg, rgba(255,255,255,0.03));
}

.contact-section {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  padding-block: 5rem;
}

.contact-card {
  text-align: left;
  max-width: 100%;
  width: 100%;
  background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(139,92,246,0.04) 100%);
  border: 1px solid transparent;
  border-radius: 1.25rem;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.contact-card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.contact-card-glow::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: conic-gradient(
    from 0deg,
    transparent   0%,
    transparent  40%,
    #5b21b6      55%,
    #7c3aed      60%,
    #c4b5fd      62%,
    #7c3aed      64%,
    #5b21b6      69%,
    transparent  80%,
    transparent 100%
  );
  animation: skillCardSpin 4s linear infinite;
  opacity: 1;
}

.contact-card-glow::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--panel, #111827);
  border-radius: 18px;
}

/* Keep card content above the glow layers */
.contact-card > *:not(.contact-card-glow) {
  position: relative;
  z-index: 1;
}

.contact-card:hover {
  box-shadow: 0 8px 32px rgba(139,92,246,0.2), 0 2px 8px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .contact-card-glow::before { animation: none; }
}

.contact-available-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #22c55e;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.contact-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

.contact-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.contact-subtext {
  color: var(--text-muted, #94a3b8);
  font-size: 1rem;
  line-height: 1.7;
  margin: 1rem 0 1.5rem;
  text-align: justify;
}

.contact-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  margin-bottom: 2rem;
}

.contact-roles span {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.85rem;
}

.contact-section .contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
}

.contact-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.contact-email-display {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}

.contact-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact-email-display:hover {
  opacity: 0.75;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.reveal-section {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

.reveal-section.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-section.in-view .project-card,
.reveal-section.in-view .resource-grid article,
.reveal-section.in-view .skills-grid div,
.reveal-section.in-view .research-list article {
  animation: rise-in 300ms ease both;
}

.reveal-section.in-view .project-card:nth-child(2),
.reveal-section.in-view .resource-grid article:nth-child(2),
.reveal-section.in-view .skills-grid div:nth-child(2),
.reveal-section.in-view .research-list article:nth-child(2) {
  animation-delay: 90ms;
}

.reveal-section.in-view .project-card:nth-child(3),
.reveal-section.in-view .resource-grid article:nth-child(3),
.reveal-section.in-view .skills-grid div:nth-child(3) {
  animation-delay: 180ms;
}

.reveal-section.in-view .project-card:nth-child(4),
.reveal-section.in-view .skills-grid div:nth-child(4) {
  animation-delay: 270ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .reveal-section {
    opacity: 1;
    transform: none;
  }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 920px)
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 920px) {

  /* ── Header ── */
  .site-header {
    grid-template-columns: 1fr auto;
    row-gap: 0;
    position: relative;   /* anchor for absolute nav dropdown */
    border-radius: 20px;  /* flatten pill → rounded rect on mobile */
    overflow: visible;    /* let the dropdown escape the header box */
  }

  .hamburger { display: flex; }

  /* ── Mobile nav drawer ── */
  .site-header .nav-links {
    /* Pull out of document flow so open/close never causes reflow */
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 999;

    flex-direction: column;
    gap: 0;

    background: var(--bg, #0A0E1A);
    border-radius: 16px;
    box-shadow:
      0 16px 48px rgba(0, 0, 0, 0.45),
      0 2px 8px rgba(0, 0, 0, 0.3),
      0 0 0 1px var(--line) inset;

    padding: 0.4rem 0;
    overflow: hidden;

    /* GPU-only hidden state — NO max-height, NO layout changes */
    display: flex;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top center;
    will-change: opacity, transform;
    transition:
      opacity   220ms cubic-bezier(0.4, 0, 0.2, 1),
      transform 220ms cubic-bezier(0.34, 1.1, 0.64, 1);
  }

  /* Open state — only GPU properties change, zero reflow */
  .site-header .nav-links.nav-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  /* Individual nav links */
  .site-header .nav-links a {
    padding: 0.8rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
    border-bottom: none;
    box-shadow: inset 0 -1px 0 var(--line);
    margin: 0 0.75rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition:
      background  180ms ease,
      color       180ms ease,
      padding-left 180ms ease;
  }

  .site-header .nav-links a:last-child { box-shadow: none; }

  /* Hover & active state */
  .site-header .nav-links a:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-strong);
    padding-left: 1.55rem;
    border-radius: 10px;
  }

  .site-header .nav-links a.active {
    background: rgba(59, 130, 246, 0.10);
    color: var(--accent-strong);
    border-left: 3px solid var(--accent);
    padding-left: calc(1.25rem - 3px);
    border-radius: 10px;
  }

  /* ── Hero ── */
  .hero {
    min-height: auto;
    padding: 2rem 1.25rem;
  }

  .portrait-frame {
    max-width: min(21rem, 82vw);
  }

  .hero-visual { transform: none; }

  /* ── Grids ── */
  .project-grid,
  .resource-grid,
  .resource-grid.three-column,
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skills-tree { grid-template-columns: 1fr; }

  /* ── Experience ── */
  .experience-panel,
  .split-section,
  .contact-card {
    padding: 2rem 1.25rem;
  }

  .experience-org img {
    height: 3rem;
    width: 3rem;
  }

  /* ── Contact ── */
  .contact-section { padding-block: 3rem; }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 640px)
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Base typography ── */
  body { font-size: 15px; }

  h1 {
    font-size: clamp(1.75rem, 7.5vw, 2.4rem);
    max-width: 100%;
    line-height: 1.1;
  }

  h2 {
    font-size: clamp(1.4rem, 5.5vw, 1.9rem);
    max-width: 100%;
    white-space: normal !important;
  }

  h3 { font-size: 1rem; }

  /* ── Global shell ── */
  .section-shell {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-block: clamp(3rem, 6vw, 5rem);
  }

  /* ── Header ── */
  .site-header { padding: 0.75rem 1rem; }

  .brand-role { display: none; }

  .header-cta {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
  }

  /* ── Hero card revolving border ── */
  .revolve-wrap {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
  }

  .revolve-border { border-radius: 0; }
  .revolve-border::after { border-radius: 0; }
  .revolve-wrap .hero { border-radius: 0; }

  /* ── Hero section ── */
  .hero {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem;
    gap: 2rem;
    min-height: auto;
  }

  .hero::before { display: none; }

  .hero-copy {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .hero-text {
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 100%;
  }

  .portrait-frame {
    max-width: min(14rem, 60vw);
    margin-inline: auto;
    order: -1;
  }

  .quick-stats {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.6rem;
  }

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

  /* ── About / Split section ── */
  .split-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2.5rem 1rem;
  }

  /* ── Section headings ── */
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 1.25rem;
  }

  .eyebrow { font-size: 0.7rem; }

  /* ── Experience ── */
  .experience-panel {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 16px;
  }

  .experience-org {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .experience-org img {
    height: 2.75rem;
    width: 2.75rem;
  }

  .check-list {
    font-size: 0.88rem;
    padding-left: 1rem;
  }

  /* ── Project section ── */
  .project-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .filter-group { width: 100%; }

  .filter-button {
    flex: 1;
    text-align: center;
    font-size: 0.82rem;
    padding: 0.45rem 0.5rem;
    min-height: 2.2rem;
  }

  .project-grid,
  .resource-grid,
  .resource-grid.three-column,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: auto;
    padding: 1.25rem;
    border-radius: 16px;
  }

  .tag-row span {
    font-size: 0.72rem;
    padding: 0.22rem 0.5rem;
  }

  .learned { font-size: 0.85rem; }

  /* ── Skills cards ── */
  .skills-tree { grid-template-columns: 1fr; }

  .skill-card {
    padding: 1.25rem;
    border-radius: 14px;
  }

  .skill-card-header h3 { font-size: 0.95rem; }

  .skill-tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
  }

  /* ── Contact section ── */
  .contact-section { padding-block: 2.5rem; }

  .contact-card {
    padding: 1.75rem 1.25rem;
    border-radius: 1rem;
  }

  .contact-card h2 {
    font-size: clamp(1.3rem, 5.5vw, 1.7rem);
    line-height: 1.3;
  }

  .contact-subtext {
    font-size: 0.88rem;
    line-height: 1.65;
  }

  .contact-available-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.65rem;
  }

  .contact-roles {
    gap: 0.35rem;
    margin-bottom: 1.5rem;
  }

  .contact-roles span {
    font-size: 0.72rem;
    padding: 0.22rem 0.6rem;
  }

  .contact-actions {
    flex-direction: column;
    gap: 0.6rem;
  }

  .contact-actions .button {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* ── Documents / resource grid ── */
  .resource-grid article {
    padding: 1.25rem;
    border-radius: 14px;
  }

  /* ── Resume modal ── */
  .resume-modal-box {
    width: 96vw;
    max-height: 90dvh;
    border-radius: 16px;
    padding: 0;
  }

  .resume-modal-header {
    padding: 0.9rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .resume-modal-actions {
    gap: 0.4rem;
  }

  .resume-canvas {
    max-width: 100%;
    height: auto !important;
  }

  /* ── Footer ── */
  .site-footer {
    padding: 1.25rem 1rem;
  }

  .site-footer p { font-size: 0.8rem; }

}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL PHONES  (≤ 420px)
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 420px) {

  body { font-size: 14px; }

  .site-header { padding: 0.65rem 0.875rem; }

  .brand-name { font-size: 0.88rem; }

  .brand-avatar {
    height: 28px;
    width: 28px;
  }

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

  h2 { font-size: clamp(1.2rem, 6vw, 1.6rem); }

  .section-shell {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  .contact-card {
    padding: 1.5rem 1rem;
    border-radius: 0.875rem;
  }

  .contact-card h2 { font-size: 1.2rem; }

  .contact-roles span { font-size: 0.68rem; }

  .project-card { padding: 1rem; }

  .skill-card { padding: 1rem; }

  .filter-button {
    font-size: 0.78rem;
    padding: 0.4rem 0.35rem;
  }

  .experience-org img {
    height: 2.5rem;
    width: 2.5rem;
  }

  .hero-actions .button,
  .contact-actions .button {
    font-size: 0.88rem;
    min-height: 2.6rem;
  }

  .tag-row span { font-size: 0.68rem; }

  .quick-stats { gap: 0.5rem; }
}



/* ── Leadership Timeline ─────────────────────────────────────────── */
.timeline {
  position: relative;
  padding: 1rem 0 2rem;
  max-width: 860px;
  margin: 0 auto;
}

/* The vertical spine line */
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, #7c3aed 100%);
  transform: translateX(-50%);
  opacity: 0.35;
}

/* Each row */
.tl-item {
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  align-items: center;
  gap: 0;
  margin-bottom: 2.5rem;
  position: relative;
}

/* Content box */
.tl-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.3rem;
  transition: border-color 250ms, transform 250ms, box-shadow 250ms;
}

.tl-content:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
  transform: translateY(-3px);
}

/* Left item: content left, node center, spacer right */
.tl-left .tl-content { text-align: right; }
.tl-left .tl-content .tl-number { justify-content: flex-end; }

/* Right item: spacer left, node center, content right */
.tl-right .tl-content { text-align: left; }

/* Spacer fills the empty side */
.tl-spacer { /* just takes up the grid column */ }

/* Circular logo node on the spine */
.tl-node {
  align-items: center;
  background: var(--secondary-bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), var(--shadow);
  display: flex;
  height: 56px;
  justify-content: center;
  justify-self: center;
  overflow: hidden;
  position: relative;
  width: 56px;
  z-index: 2;
  flex-shrink: 0;
}

.tl-node img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.tl-node-emoji {
  font-size: 1.5rem;
  background: rgba(37, 99, 235, 0.1);
}

/* Number badge */
.tl-number {
  color: var(--accent-strong);
  display: flex;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.tl-title {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.tl-desc {
  color: var(--muted);
  font-size: 0.845rem;
  line-height: 1.65;
  margin: 0;
}

/* ── Responsive: stack to single column on mobile ── */
@media (max-width: 640px) {
  .timeline::before { left: 28px; }

  .tl-item,
  .tl-item.tl-left,
  .tl-item.tl-right {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto;
  }

  .tl-left .tl-content,
  .tl-right .tl-content {
    text-align: left;
    grid-column: 2;
    grid-row: 1;
  }

  .tl-node {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
  }

  .tl-spacer { display: none; }

  .tl-left .tl-number,
  .tl-right .tl-number {
    justify-content: flex-start;
  }
}


/* ── Revolving blue glow around hero card ────────────────────────── */
.revolve-wrap {
  position: relative;
  border-radius: 28px;
  margin: 0 clamp(0.5rem, 2vw, 1.5rem) 1.5rem;
  padding-top: 1rem;
  isolation: isolate;
}

/* Hero sits normally inside */
.revolve-wrap .hero {
  position: relative;
  z-index: 1;
  border-radius: 26px;
}

/* Spinning layer behind the card */
.revolve-border {
  position: absolute;
  inset: -3px;
  border-radius: 30px;
  z-index: 0;
  overflow: hidden;
}

/* The actual spinning conic — fills the whole box, then we mask to a ring */
.revolve-border::before {
  content: "";
  position: absolute;
  /* Make it big enough to spin without clipping corners */
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: conic-gradient(
    from 0deg,
    transparent   0%,
    transparent  40%,
    #1d4ed8      55%,
    #3b82f6      60%,
    #93c5fd      62%,
    #3b82f6      64%,
    #1d4ed8      69%,
    transparent  80%,
    transparent 100%
  );
  animation: spinGlow 3s linear infinite;
}

/* Mask: only show a ~3px ring around the edge */
.revolve-border::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--bg);
  border-radius: 26px;
}

@keyframes spinGlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Soft outer glow */
.revolve-wrap::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 36px;
  background: transparent;
  box-shadow: 0 0 25px 4px rgba(59, 130, 246, 0.25);
  animation: glowPulse 3s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .revolve-border::before { animation: none; }
  .revolve-wrap::before   { animation: none; opacity: 0.5; }
}

/* ── Revolving blue glow on project card hover ───────────────────── */
/* A .card-glow span is injected into each card via JS */
.card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.card-glow::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: conic-gradient(
    from 0deg,
    transparent   0%,
    transparent  42%,
    #1d4ed8      56%,
    #3b82f6      60%,
    #bfdbfe      62%,
    #3b82f6      64%,
    #1d4ed8      68%,
    transparent  80%,
    transparent 100%
  );
  opacity: 0;
  animation: cardSpin 2.2s linear infinite;
  animation-play-state: paused;
  transition: opacity 0.3s ease;
}

/* Solid fill punches out center — only ring shows */
.card-glow::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--panel);
  border-radius: 18px;
}

.project-card:hover .card-glow::before,
.experience-panel:hover .card-glow::before {
  opacity: 1;
  animation-play-state: running;
}

/* Make sure card content stays above the glow layer */
.project-card > *:not(.card-glow),
.experience-panel > *:not(.card-glow) {
  position: relative;
  z-index: 1;
}

@keyframes cardSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .card-glow::before { animation: none !important; opacity: 0 !important; }
}

/* ── Resume Preview Modal ────────────────────────────────────────── */
.resume-modal {
  inset: 0;
  position: fixed;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.resume-modal[hidden] {
  display: none;
}

.resume-modal-backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  inset: 0;
  position: absolute;
  z-index: 0;
  cursor: pointer;
}

.resume-modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  max-width: 860px;
  position: relative;
  width: 100%;
  z-index: 1;
  animation: modal-in 220ms ease both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.resume-modal-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  flex-shrink: 0;
}

.resume-modal-title {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.resume-modal-actions {
  align-items: center;
  display: flex;
  gap: 0.6rem;
}

.resume-download-btn {
  font-size: 0.83rem;
  min-height: 2.2rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
}

.resume-modal-close {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  height: 2.2rem;
  justify-content: center;
  transition: background 200ms, color 200ms;
  width: 2.2rem;
}

.resume-modal-close:hover {
  background: var(--secondary-bg);
  color: var(--text);
}

.resume-modal-body {
  flex: 1;
  overflow: hidden;
  border-radius: 0 0 20px 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.resume-iframe {
  border: none;
  flex: 1;
  height: 100%;
  width: 100%;
  min-height: 70vh;
  border-radius: 0 0 20px 20px;
  display: block;
}

.resume-pdfjs-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #525659;
  border-radius: 0 0 20px 20px;
  padding: 1rem;
  min-height: 70vh;
}

.resume-canvas {
  max-width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border-radius: 4px;
}

.resume-loading {
  color: #ccc;
  font-size: 1rem;
  margin: auto;
  padding: 2rem;
}

.resume-fallback {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
  min-height: 40vh;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .resume-modal {
    padding: 0;
    align-items: flex-end;
  }

  .resume-modal-box {
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
  }

  .resume-iframe {
    min-height: 60vh;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   PORTFOLIO CHATBOT
   ═══════════════════════════════════════════════════════════════════ */

/* ── Floating Action Button ──────────────────────────────────────── */
.chat-fab {
  align-items: center;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  bottom: 1.75rem;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 3.25rem;
  justify-content: center;
  position: fixed;
  right: 1.75rem;
  transition: background 250ms, box-shadow 250ms, transform 250ms;
  width: 3.25rem;
  z-index: 200;
}

.chat-fab:hover {
  background: var(--accent-strong);
  box-shadow: 0 12px 36px rgba(59, 130, 246, 0.55);
  transform: translateY(-3px) scale(1.05);
}

.chat-fab-icon { transition: opacity 180ms, transform 180ms; }
.chat-fab-icon--close { display: none; }

.chat-fab.is-open .chat-fab-icon--open  { display: none; }
.chat-fab.is-open .chat-fab-icon--close { display: block; }

/* ── Chat Window ─────────────────────────────────────────────────── */
.chat-window {
  background: #0d1117;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 20px;
  bottom: 6rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59,130,246,0.1);
  display: none;
  flex-direction: column;
  height: min(560px, calc(100dvh - 8rem));
  position: fixed;
  right: 1.75rem;
  width: min(380px, calc(100vw - 2rem));
  z-index: 199;
}

.chat-window.is-open {
  display: flex;
  animation: chat-in 200ms ease both;
}

.chat-window[hidden] { display: none; }

@keyframes chat-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Header ──────────────────────────────────────────────────────── */
.chat-header {
  align-items: center;
  background: linear-gradient(135deg, #0f1923 0%, #111827 100%);
  border-bottom: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  flex-shrink: 0;
}

.chat-header-info { align-items: center; display: flex; gap: 0.65rem; }

.chat-avatar {
  align-items: center;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 0.9rem;
  font-weight: 800;
  height: 2.1rem;
  justify-content: center;
  width: 2.1rem;
  flex-shrink: 0;
  overflow: hidden;
}

/* When avatar is an image */
.chat-avatar--img {
  background: none;
  object-fit: cover;
  object-position: top center;
}

.chat-header-name {
  color: #f8fafc;
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.chat-header-sub {
  color: #64748b;
  font-size: 0.72rem;
  margin: 0;
  line-height: 1.3;
}

.chat-close-btn {
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  height: 1.9rem;
  justify-content: center;
  transition: background 200ms, color 200ms;
  width: 1.9rem;
}
.chat-close-btn:hover { background: rgba(255,255,255,0.1); color: #f8fafc; }

/* ── Messages area ───────────────────────────────────────────────── */
.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Individual message bubbles */
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 88%;
}

.chat-msg--user { align-self: flex-end; align-items: flex-end; }
.chat-msg--bot  { align-self: flex-start; align-items: flex-start; }

.chat-bubble {
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.6;
  padding: 0.65rem 0.9rem;
  word-break: break-word;
}

.chat-msg--user .chat-bubble {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-bottom-right-radius: 4px;
  color: #fff;
}

.chat-msg--bot .chat-bubble {
  background: #1b2430;
  border: 1px solid rgba(255,255,255,0.07);
  border-bottom-left-radius: 4px;
  color: #e2e8f0;
}

/* Typing indicator */
.chat-typing .chat-bubble {
  align-items: center;
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
}

.chat-typing-dot {
  animation: typing-bounce 1.2s ease-in-out infinite;
  background: #64748b;
  border-radius: 50%;
  height: 6px;
  width: 6px;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Suggestion chips ────────────────────────────────────────────── */
.chat-suggestions {
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  flex-shrink: 0;
}

.chat-suggestions button {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 999px;
  color: #93c5fd;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  transition: background 200ms, border-color 200ms, color 200ms;
  white-space: nowrap;
}

.chat-suggestions button:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
  color: #fff;
}

/* Hide suggestions once first user message is sent */
.chat-suggestions.is-hidden { display: none; }

/* ── Input row ───────────────────────────────────────────────────── */
.chat-input-row {
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.07);
  border-radius: 0 0 20px 20px;
  background: #0d1117;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}

.chat-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #f8fafc;
  flex: 1;
  font-family: inherit;
  font-size: 0.84rem;
  min-width: 0;
  outline: none;
  padding: 0.55rem 0.75rem;
  transition: border-color 200ms;
}
.chat-input::placeholder { color: #475569; }
.chat-input:focus { border-color: rgba(59, 130, 246, 0.5); }

.chat-send-btn {
  align-items: center;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: 2.1rem;
  justify-content: center;
  transition: background 200ms, transform 150ms;
  width: 2.1rem;
}
.chat-send-btn:hover  { background: var(--accent-strong); transform: scale(1.08); }
.chat-send-btn:disabled { background: #1e293b; cursor: not-allowed; transform: none; }

/* ── Responsive Chatbot ──────────────────────────────────────────── */

/* Tablet (≤ 768px): slightly smaller window */
@media (max-width: 768px) {
  .chat-window {
    width: min(360px, calc(100vw - 1.5rem));
    right: 0.75rem;
    bottom: 5.5rem;
  }

  .chat-fab {
    bottom: 1.5rem;
    right: 1rem;
    height: 3rem;
    width: 3rem;
  }
}

/* Mobile (≤ 640px): full-width bottom sheet */
@media (max-width: 640px) {
  /* FAB: smaller, tucked into corner */
  .chat-fab {
    bottom: 1rem;
    right: 1rem;
    height: 3rem;
    width: 3rem;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  }

  /* Window: full-width bottom sheet */
  .chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    height: min(75dvh, 560px);
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
    /* Slide up from bottom */
    animation: chat-slide-up 220ms ease both;
  }

  @keyframes chat-slide-up {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Header: rounded top, slightly larger touch targets */
  .chat-header {
    border-radius: 20px 20px 0 0;
    padding: 1rem 1rem;
  }

  .chat-header-name { font-size: 0.92rem; }
  .chat-header-sub  { font-size: 0.74rem; }

  .chat-avatar {
    height: 2.25rem;
    width: 2.25rem;
  }

  .chat-close-btn {
    height: 2.2rem;
    width: 2.2rem;
  }

  /* Hide the FAB entirely when chat is open on mobile */
  .chat-fab.is-open {
    display: none;
  }

  /* Messages: more padding for thumb reach */
  .chat-messages {
    padding: 0.875rem 1rem;
    gap: 0.8rem;
  }

  .chat-msg { max-width: 92%; }

  .chat-bubble {
    font-size: 0.86rem;
    padding: 0.7rem 0.95rem;
    line-height: 1.65;
  }

  /* Suggestion chips: allow wrapping, larger touch targets */
  .chat-suggestions {
    padding: 0.6rem 0.875rem;
    gap: 0.45rem;
  }

  .chat-suggestions button {
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
    white-space: normal;
    text-align: left;
    line-height: 1.4;
  }

  /* Input row: full width, easier to tap */
  .chat-input-row {
    padding: 0.75rem 0.875rem;
    gap: 0.5rem;
    border-radius: 0;
  }

  .chat-input {
    font-size: 0.88rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
  }

  .chat-send-btn {
    height: 2.4rem;
    width: 2.4rem;
    border-radius: 12px;
    flex-shrink: 0;
  }
}

/* Small phones (≤ 420px): further tightened */
@media (max-width: 420px) {
  .chat-fab {
    bottom: 0.875rem;
    right: 0.875rem;
    height: 2.75rem;
    width: 2.75rem;
  }

  .chat-window {
    height: min(80dvh, 540px);
  }

  .chat-header {
    padding: 0.875rem;
  }

  .chat-header-name { font-size: 0.88rem; }

  .chat-avatar {
    height: 2rem;
    width: 2rem;
  }

  .chat-messages { padding: 0.75rem 0.875rem; }

  .chat-bubble {
    font-size: 0.83rem;
    padding: 0.6rem 0.85rem;
  }

  .chat-suggestions { padding: 0.5rem 0.75rem; }

  .chat-suggestions button {
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
  }

  .chat-input-row { padding: 0.65rem 0.75rem; }

  .chat-input {
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
  }

  .chat-send-btn {
    height: 2.2rem;
    width: 2.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-window { animation: none; }
  .chat-typing-dot { animation: none; opacity: 0.6; }
}
/* ═══════════════════════════════════════════════════════════════════ */

/* ── GitHub Activity Heatmap ─────────────────────────────────────── */

/* Section subtitle */
.github-section-sub {
  margin-top: 0.55rem;
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.6;
}

/* Stat pills row */
.github-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.github-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: border-color 220ms ease, color 220ms ease;
}

.github-stat-pill svg {
  opacity: 0.7;
  flex-shrink: 0;
}

.github-stat-pill:hover {
  border-color: rgba(34,197,94,0.45);
  color: var(--accent-strong);
}

/* Main card */
.github-heatmap-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.75rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.1rem;
  transition: border-color 250ms ease, box-shadow 250ms ease;
  position: relative;
  isolation: isolate;
}

/* Subtle top accent line */
.github-heatmap-wrap::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(34,197,94,0.55) 40%, rgba(16,185,129,0.4) 70%, transparent 100%);
  border-radius: 20px 20px 0 0;
}

.github-heatmap-wrap:hover {
  border-color: rgba(34,197,94,0.4);
  box-shadow: 0 16px 48px rgba(0,0,0,0.22), 0 0 0 1px rgba(34,197,94,0.12);
}

/* Chart card header */
.github-heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.github-heatmap-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.github-heatmap-title-row svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.github-heatmap-chart-label {
  font-family: "SF Mono", "Fira Code", "Fira Mono", monospace;
  opacity: 0.85;
}

.github-heatmap-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.28);
  color: var(--accent-strong);
  white-space: nowrap;
}

/* Header right side: total pill + badge */
.github-heatmap-header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* Total contributions pill */
.github-total-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.28);
  color: #22c55e;
  white-space: nowrap;
  transition: background 200ms ease;
}

.github-total-pill svg { opacity: 0.8; flex-shrink: 0; }

/* Month filter buttons */
.github-month-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: 0.25rem;
}

.gmf-btn {
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.gmf-btn:hover {
  border-color: rgba(34,197,94,0.4);
  color: #22c55e;
}

.gmf-btn--active {
  border-color: #22c55e;
  background: rgba(34,197,94,0.12);
  color: #22c55e;
}

/* Grid wrapper */
.github-grid-wrap {
  position: relative;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

/* Month labels row */
.github-grid-months {
  display: flex;
  margin-left: 28px; /* align with grid (day-label width) */
  margin-bottom: 4px;
  min-width: max-content;
}

.ggm-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.65;
  letter-spacing: 0.04em;
  white-space: nowrap;
  /* width set dynamically via JS */
}

/* The grid itself: CSS grid of day cells */
.github-grid {
  display: flex;
  gap: 3px;
  min-width: max-content;
}

/* Day-of-week label column */
.gg-day-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-right: 4px;
}

.gg-day-label {
  width: 20px;
  height: 11px;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--muted);
  opacity: 0.5;
  text-align: right;
  line-height: 11px;
}

/* One column = one week */
.gg-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* One cell = one day */
.gg-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 120ms ease, outline 120ms ease, opacity 200ms ease;
  outline: 1px solid transparent;
}

.gg-cell:hover {
  transform: scale(1.35);
  outline: 1px solid rgba(255,255,255,0.35);
  z-index: 2;
}

/* Contribution level colors — green scale */
.gg-cell[data-level="0"] { background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.18); }
.gg-cell[data-level="1"] { background: rgba(34,197,94,0.38); }
.gg-cell[data-level="2"] { background: rgba(34,197,94,0.60); }
.gg-cell[data-level="3"] { background: rgba(34,197,94,0.80); }
.gg-cell[data-level="4"] { background: rgba(34,197,94,1.00); }

/* Dimmed state when a month is selected */
.gg-cell--dimmed {
  opacity: 0.12;
  pointer-events: none;
}

/* Loading spinner */
.github-grid-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1.5rem 0;
  opacity: 0.7;
}

.github-grid-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(34,197,94,0.2);
  border-top-color: #22c55e;
  border-radius: 50%;
  animation: gg-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes gg-spin {
  to { transform: rotate(360deg); }
}

/* Tooltip */
.github-tooltip {
  position: fixed;
  z-index: 9999;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #f1f5f9;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  line-height: 1.5;
}

.github-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer: legend + link */
.github-heatmap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

/* Contribution legend */
.github-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--quiet);
  letter-spacing: 0.02em;
}

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

.lc-0 { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.15); }
.lc-1 { background: rgba(34,197,94,0.22); }
.lc-2 { background: rgba(34,197,94,0.42); }
.lc-3 { background: rgba(34,197,94,0.65); }
.lc-4 { background: rgba(34,197,94,0.90); }

/* CTA link */
.github-heatmap-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: gap 200ms ease, opacity 200ms ease;
}

.github-heatmap-link:hover {
  gap: 0.65rem;
  opacity: 0.85;
}

/* ── Live Stats Row (streak + commit history) ─────────────────── */
.github-live-stats {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  align-items: start;
}

/* Streak card */
.github-streak-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.22);
  border-radius: 14px;
  min-height: 88px;
  transition: border-color 220ms ease, background 220ms ease;
}

.github-streak-card:hover {
  border-color: rgba(59,130,246,0.45);
  background: rgba(59,130,246,0.10);
}

.gsc-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(251,146,60,0.5));
}

.gsc-body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.gsc-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

.gsc-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-strong);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.gsc-sub {
  font-size: 0.7rem;
  color: var(--quiet, var(--muted));
  opacity: 0.75;
  line-height: 1.3;
}

/* Commit history panel */
.github-commit-panel {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  overflow: hidden;
}

.gcp-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  opacity: 0.8;
}

.gcp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Each commit row */
.gcp-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  line-height: 1.35;
  animation: gcp-slide-in 280ms ease both;
}

@keyframes gcp-slide-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.gcp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-strong);
  flex-shrink: 0;
  opacity: 0.7;
}

.gcp-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.gcp-repo {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-strong);
  font-family: "SF Mono", "Fira Code", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.gcp-msg {
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.77rem;
  font-weight: 500;
}

.gcp-time {
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  align-self: start;
  padding-top: 1px;
}

/* Loading placeholder */
.gcp-loading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.6;
}

.gcp-loading .gcp-dot {
  animation: gcp-pulse 1.2s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes gcp-pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.9; }
}

/* Error state */
.gcp-error {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.6;
  padding: 0.25rem 0;
}

@media (max-width: 640px) {
  .github-heatmap-wrap { padding: 1.25rem 1rem; }
  .github-heatmap-header { flex-direction: column; align-items: flex-start; }
  .github-heatmap-footer { flex-direction: column; align-items: flex-start; }
  .github-stats-row { gap: 0.5rem; }
  .github-stat-pill { font-size: 0.72rem; padding: 0.38rem 0.8rem; }
  .github-live-stats { grid-template-columns: 1fr; }
  .github-streak-card { min-height: unset; }
}

/* ── Page Transitions ────────────────────────────────────────────── */
body {
  animation: page-fade-in 350ms ease both;
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.page-leaving {
  animation: page-fade-out 280ms ease forwards;
  pointer-events: none;
}

@keyframes page-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* ── Water Ripple System ─────────────────────────────────────────── */
#ripple-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: screen;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  #ripple-canvas { display: none; }
}
/* ── /Water Ripple System ────────────────────────────────────────── */

/* ── Page Transitions ────────────────────────────────────────────── */
main, .page-hero, .tl-wrap {
  animation: page-fade-in 380ms ease both;
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body.page-leaving main,
body.page-leaving .page-hero,
body.page-leaving .tl-wrap {
  animation: page-fade-out 260ms ease forwards;
  pointer-events: none;
}

@keyframes page-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  main, .page-hero, .tl-wrap,
  body.page-leaving main,
  body.page-leaving .page-hero,
  body.page-leaving .tl-wrap { animation: none; }
}
