:root {
  color-scheme: dark;
  --bg: #090907;
  --bg-soft: #15130f;
  --panel: #11100d;
  --panel-strong: #f3ead9;
  --text: #f5efdf;
  --muted: #b8ad99;
  --line: rgba(245, 239, 223, 0.2);
  --accent: #c6ff3d;
  --accent-2: #ffb13d;
  --accent-3: #66e4ff;
  --inverse-text: #11100d;
  --radius: 4px;
  --max: 1240px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3ead9;
  --bg-soft: #fff9ea;
  --panel: #fff9ea;
  --panel-strong: #12110e;
  --text: #12110e;
  --muted: #5f5749;
  --line: rgba(18, 17, 14, 0.2);
  --accent: #12110e;
  --accent-2: #f59e20;
  --accent-3: #007b8f;
  --inverse-text: #fff9ea;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(90deg, var(--bg) 0 50%, var(--bg-soft) 50% 100%);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 118px 118px;
  opacity: 0.18;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

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

button {
  font: inherit;
}

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

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.15;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.025),
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 4px
  );
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  margin: 0;
  padding: 14px max(18px, calc((100vw - var(--max)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 7, 0.86);
  backdrop-filter: blur(18px);
}

:root[data-theme="light"] .site-header {
  background: rgba(243, 234, 217, 0.86);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: #06100e;
  font-size: 0.82rem;
}

:root[data-theme="light"] .brand-mark {
  color: #fff9ea;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.nav-toggle:hover {
  border-color: rgba(198, 255, 61, 0.38);
  transform: translateY(-1px);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: none;
  transition: background 160ms ease, transform 160ms ease;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
  transition: transform 160ms ease;
}

.nav-toggle span::before {
  top: 13px;
}

.nav-toggle span::after {
  bottom: 13px;
}

.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0deg);
  transition: opacity 160ms ease, transform 160ms ease;
}

.site-header.is-nav-open .nav-toggle span {
  background: transparent;
  transform: none;
}

.site-header.is-nav-open .nav-toggle span::before,
.site-header.is-nav-open .nav-toggle span::after {
  opacity: 0;
}

.site-header.is-nav-open .nav-toggle::before {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(45deg);
}

.site-header.is-nav-open .nav-toggle::after {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.nav-links a,
.social-row a,
.project-top a,
.site-footer a {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  padding: 9px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.social-row a:hover,
.project-top a:hover,
.site-footer a:hover {
  color: var(--text);
  background: rgba(198, 255, 61, 0.12);
  transform: translateY(-1px);
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  border-color: rgba(198, 255, 61, 0.38);
  transform: translateY(-1px);
}

.theme-toggle .sun,
.theme-toggle .moon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform 240ms ease, opacity 240ms ease;
}

.theme-toggle .sun::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffb13d;
  box-shadow:
    0 0 0 4px rgba(255, 177, 61, 0.18),
    0 0 16px rgba(255, 177, 61, 0.32);
}

.theme-toggle .moon::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    inset -6px 0 0 var(--panel),
    0 0 14px rgba(198, 255, 61, 0.28);
}

:root[data-theme="dark"] .sun {
  transform: translateY(34px);
  opacity: 0;
}

:root[data-theme="light"] .moon {
  transform: translateY(-34px);
  opacity: 0;
}

main,
.site-footer {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

[hidden] {
  display: none !important;
}

.section-grid,
.section {
  padding: 84px 0;
}

.hero {
  min-height: calc(100vh - 66px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
  gap: 34px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-kicker,
.label {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(2.35rem, 4.8vw, 4.65rem);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  font-size: clamp(1.85rem, 3.45vw, 3rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.hero-lede,
.intro p,
.timeline-card p,
.project-card p,
.leetcode-card p,
.education-band p,
.contact-section p {
  color: var(--muted);
  font-size: 1rem;
}

.hero-lede {
  max-width: 650px;
  font-size: clamp(1rem, 1.45vw, 1.12rem);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  transition: transform 180ms ease, background 180ms ease;
}

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

.button.primary {
  background: var(--accent);
  color: #06100e;
  border-color: transparent;
}

:root[data-theme="light"] .button.primary {
  color: #fff9ea;
}

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

.availability-strip {
  display: flex;
  flex-wrap: wrap;
  margin-top: 26px;
  border: 1px solid var(--line);
  width: fit-content;
  max-width: 100%;
}

.availability-strip span {
  padding: 10px 13px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.availability-strip span + span {
  border-left: 1px solid var(--line);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.quick-stats div,
.timeline-card,
.project-card,
.skill-block,
.profile-panel,
.leetcode-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.quick-stats div {
  min-height: 112px;
  padding: 16px;
}

.quick-stats strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 1.8rem;
  line-height: 1;
}

.quick-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.profile-panel {
  align-self: stretch;
  min-height: 560px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--panel-strong);
  color: var(--inverse-text);
  position: relative;
  overflow: hidden;
  box-shadow: 14px 14px 0 rgba(198, 255, 61, 0.22);
}

:root[data-theme="light"] .profile-panel {
  box-shadow: 14px 14px 0 rgba(18, 17, 14, 0.14);
}

.profile-panel::before {
  content: "PORTFOLIO";
  position: absolute;
  inset: auto 18px 18px 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(17, 16, 13, 0.18);
  color: rgba(17, 16, 13, 0.45);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  pointer-events: none;
}

:root[data-theme="light"] .profile-panel::before {
  border-color: rgba(255, 249, 234, 0.22);
  color: rgba(255, 249, 234, 0.5);
}

.portrait-wrap {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 12px auto;
  width: min(100%, 330px);
}

.portrait {
  position: relative;
  z-index: 2;
  width: 78%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 8px solid rgba(17, 16, 13, 0.12);
  box-shadow: 12px 12px 0 rgba(17, 16, 13, 0.16);
}

:root[data-theme="light"] .portrait {
  border-color: rgba(255, 249, 234, 0.16);
  box-shadow: 12px 12px 0 rgba(255, 249, 234, 0.16);
}

.orbit-dot {
  position: absolute;
  z-index: 3;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-2);
  border: 2px solid var(--panel-strong);
}

.dot-one {
  top: 12%;
  right: 22%;
}

.dot-two {
  left: 15%;
  bottom: 21%;
  background: var(--accent-3);
}

.profile-meta {
  position: relative;
  z-index: 2;
  padding-bottom: 44px;
}

.profile-meta h2 {
  margin-bottom: 8px;
}

.profile-meta .role {
  color: var(--accent-2);
  font-weight: 900;
}

.profile-meta p,
.profile-meta a {
  color: rgba(17, 16, 13, 0.72);
}

:root[data-theme="light"] .profile-meta p,
:root[data-theme="light"] .profile-meta a {
  color: rgba(255, 249, 234, 0.76);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.intro {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.study-link-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  gap: 24px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.study-link-section p:not(.section-kicker) {
  max-width: 760px;
  color: var(--muted);
}

.study-link-card {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 230px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 82% 16%, rgba(198, 255, 61, 0.28), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  transition: transform 180ms ease, border-color 180ms ease;
}

.study-link-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.study-link-card:hover {
  transform: translateY(-4px);
  border-color: rgba(198, 255, 61, 0.58);
}

.study-link-card span,
.study-link-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.study-link-card strong {
  margin: 10px 0;
  font-size: 1.75rem;
  line-height: 1;
}

.section-heading {
  max-width: 860px;
  margin-bottom: 28px;
}

.timeline {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.time {
  position: sticky;
  top: 86px;
  color: var(--accent-2);
  font-weight: 900;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.timeline-card {
  padding: 24px;
}

.impact-list {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.impact-list li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
}

.impact-list li::before {
  content: "";
  position: absolute;
  top: 0.75em;
  left: 0;
  width: 10px;
  height: 2px;
  background: var(--accent);
}

.split-band,
.leetcode-section,
.github-section,
.skills-section {
  border-top: 1px solid var(--line);
}

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

.project-card {
  min-height: 300px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.project-card::before,
.leetcode-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

.project-card.featured {
  grid-row: span 2;
  min-height: 614px;
  background: var(--panel-strong);
  color: var(--inverse-text);
}

.project-card.featured .label,
.project-card.featured h3,
.project-card.featured p,
.project-card.featured a {
  color: var(--inverse-text);
}

.project-card.featured h3 {
  font-size: clamp(1.95rem, 3.6vw, 3rem);
}

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

.tech-stack,
.achievement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tech-stack span,
.achievement-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-card.featured .tech-stack span {
  color: var(--inverse-text);
  border-color: rgba(17, 16, 13, 0.24);
}

:root[data-theme="light"] .project-card.featured .tech-stack span {
  border-color: rgba(255, 249, 234, 0.24);
}

.leetcode-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 24px;
  align-items: stretch;
  padding: 24px;
  background: var(--panel);
  overflow: hidden;
  position: relative;
}

.leetcode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(198, 255, 61, 0.08) 46%, transparent 56%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 255, 255, 0.035) 23px);
  transform: translateX(-24%);
  animation: codeScan 5.5s ease-in-out infinite;
}

.leetcode-main,
.progress-panel {
  position: relative;
  z-index: 1;
}

.leetcode-main h3 {
  margin-bottom: 16px;
  font-size: clamp(1.9rem, 3.8vw, 3.2rem);
}

.leetcode-main a {
  display: inline-flex;
  margin-top: 20px;
  color: var(--accent-2);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.82rem;
}

.challenge-streak-card {
  display: grid;
  gap: 8px;
  margin-top: 30px;
  max-width: 430px;
}

.challenge-streak-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(198, 255, 61, 0.12), transparent),
    rgba(255, 255, 255, 0.035);
}

.challenge-streak-card .label,
.challenge-streak-card p {
  grid-column: 1 / -1;
}

.challenge-streak-card div {
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.challenge-streak-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: 1.7rem;
  line-height: 1;
}

.challenge-streak-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.progress-panel {
  display: grid;
  gap: 20px;
  align-content: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.progress-ring {
  width: min(210px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 58%, transparent 59%),
    conic-gradient(var(--accent-2) 0 70%, rgba(255, 255, 255, 0.12) 70% 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}

.progress-ring span {
  color: var(--text);
  font-size: 2.25rem;
  font-weight: 900;
}

.progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.progress-top strong {
  color: var(--accent-2);
  font-size: 2rem;
  line-height: 1;
}

.progress-top span,
.progress-copy p {
  color: var(--muted);
  font-weight: 800;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  animation: fillBar 900ms ease both;
}

.leetcode-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.leetcode-breakdown span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.leetcode-breakdown b {
  display: block;
  color: var(--text);
  font-size: 1.12rem;
}

.progress-copy p {
  margin: 12px 0 0;
  font-size: 0.9rem;
}

.activity-card {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}

.activity-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(198, 255, 61, 0.08), transparent 30%, rgba(255, 177, 61, 0.08));
  opacity: 0.6;
}

.activity-head,
.calendar-shell {
  position: relative;
  z-index: 1;
}

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

.activity-head h3 {
  margin-bottom: 0;
}

.activity-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.activity-stats span {
  min-width: 118px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

.activity-stats b {
  display: block;
  color: var(--accent-2);
  font-size: 1.3rem;
}

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

.year-controls button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
}

.year-controls button.is-active {
  background: var(--accent);
  color: #06100e;
  border-color: transparent;
}

.calendar-shell {
  overflow-x: auto;
  padding: 8px 0 2px;
}

.calendar-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 54px;
  gap: 4px;
  min-width: max-content;
  margin: 0 0 10px 20px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 4px;
  min-width: max-content;
}

.calendar-day {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="light"] .calendar-day {
  border-color: rgba(18, 17, 14, 0.18);
  background: rgba(18, 17, 14, 0.1);
}

.calendar-day.level-1 {
  background: rgba(198, 255, 61, 0.28);
}

.calendar-day.level-2 {
  background: rgba(198, 255, 61, 0.5);
}

.calendar-day.level-3 {
  background: rgba(255, 177, 61, 0.72);
}

.calendar-day.level-4 {
  background: var(--accent-2);
}

:root[data-theme="light"] .calendar-day.level-1 {
  border-color: rgba(0, 123, 143, 0.3);
  background: rgba(0, 123, 143, 0.26);
}

:root[data-theme="light"] .calendar-day.level-2 {
  border-color: rgba(0, 123, 143, 0.44);
  background: rgba(0, 123, 143, 0.48);
}

:root[data-theme="light"] .calendar-day.level-3 {
  border-color: rgba(245, 158, 32, 0.62);
  background: rgba(245, 158, 32, 0.72);
}

:root[data-theme="light"] .calendar-day.level-4 {
  border-color: rgba(18, 17, 14, 0.35);
  background: #12110e;
  box-shadow: 0 0 0 1px rgba(18, 17, 14, 0.2);
}

.platform-card {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.platform-card .section-heading {
  margin-bottom: 22px;
}

.platform-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  gap: 14px;
}

.platform-stat-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.platform-stat-card h3 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.gfg-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.gfg-breakdown span {
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.gfg-breakdown b {
  display: block;
  color: var(--accent-2);
  font-size: 1.05rem;
}

.gfg-card a {
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.repo-grid.all-repos {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 30px;
}

.repo-card {
  min-height: 248px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  word-break: break-word;
  box-shadow: 10px 10px 0 rgba(198, 255, 61, 0.16);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

:root[data-theme="light"] .repo-card {
  box-shadow: 10px 10px 0 rgba(18, 17, 14, 0.12);
}

.repo-card:hover {
  transform: translateY(-8px) rotate(0deg);
  border-color: var(--accent);
  box-shadow: 14px 14px 0 rgba(255, 177, 61, 0.22);
}

.repo-card.skeleton {
  cursor: default;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.repo-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.before-honey .repo-grid {
  padding: 18px 10px 22px;
}

.all-repos .repo-card:nth-child(6n + 1),
.repo-card.float-0 {
  transform: translateY(18px) rotate(-1.5deg);
}

.all-repos .repo-card:nth-child(6n + 2),
.repo-card.float-1 {
  transform: translateY(-10px) rotate(1.2deg);
}

.all-repos .repo-card:nth-child(6n + 3),
.repo-card.float-2 {
  transform: translateY(28px) rotate(0.8deg);
}

.all-repos .repo-card:nth-child(6n + 4),
.repo-card.float-3 {
  transform: translateY(-2px) rotate(-0.8deg);
}

.all-repos .repo-card:nth-child(6n + 5),
.repo-card.float-4 {
  transform: translateY(34px) rotate(1.6deg);
}

.all-repos .repo-card:nth-child(6n),
.repo-card.float-5 {
  transform: translateY(8px) rotate(-1.1deg);
}

.all-repos .repo-card:hover,
.repo-card[class*="float-"]:hover {
  transform: translateY(-8px) rotate(0deg);
}

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

.skill-block {
  min-height: 164px;
  padding: 22px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.skill-block:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.skill-block p {
  color: var(--muted);
}

.skill-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.skill-head h3 {
  margin-bottom: 0;
}

.skill-head span {
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 900;
}

.skill-meter {
  height: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.skill-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.education-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.6fr);
  gap: 24px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.achievement-list {
  justify-content: flex-end;
}

.achievement-section {
  border-bottom: 1px solid var(--line);
}

.volunteer-section {
  border-bottom: 1px solid var(--line);
}

.volunteer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 14px;
}

.volunteer-card {
  min-height: 260px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}

.volunteer-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 4px solid var(--accent-2);
  pointer-events: none;
}

.volunteer-card span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.volunteer-card p:not(.label) {
  color: var(--muted);
}

.volunteer-card > :not(.volunteer-logo) {
  position: relative;
  z-index: 1;
}

.volunteer-logo {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 0;
  width: 190px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0.16;
  transform: rotate(-10deg);
  pointer-events: none;
}

.volunteer-logo::before,
.volunteer-logo::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.volunteer-logo::after {
  inset: 34px;
  border-style: dashed;
}

.volunteer-logo strong {
  color: var(--accent-2);
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.volunteer-logo span {
  position: absolute;
  bottom: 46px;
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.alcom-logo {
  color: var(--accent);
  transform: rotate(8deg);
}

.alcom-logo strong {
  color: var(--accent);
  font-size: 1.7rem;
}

.rank-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
  gap: 14px;
  align-items: stretch;
}

.rank-card {
  min-height: 290px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}

.rank-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 16px,
      rgba(198, 255, 61, 0.08) 17px,
      transparent 18px 36px
    );
  opacity: 0.7;
  animation: rankLines 9s linear infinite;
}

.rank-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 177, 61, 0.16), transparent);
  transform: translateX(-120%);
  animation: rankSweep 4.8s ease-in-out infinite;
}

.rank-card > * {
  position: relative;
  z-index: 1;
}

.rank-card h3 {
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.9;
}

.rank-card p {
  color: var(--muted);
}

.rank-meter {
  height: 18px;
  margin: 26px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.rank-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: fillBar 1300ms ease both;
}

.rank-orbit {
  width: min(220px, 62vw);
  aspect-ratio: 1;
  margin: 18px auto 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
}

.rank-orbit span {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-2);
  transform-origin: 0 104px;
  animation: orbitRank 4s linear infinite;
}

.rank-orbit strong {
  color: var(--accent-2);
  font-size: 3rem;
  font-weight: 900;
}

.compact-rank h3 {
  color: var(--accent-2);
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.contact-section {
  text-align: center;
}

.contact-section h2 {
  max-width: 760px;
  margin: 0 auto 18px;
}

.contact-actions {
  justify-content: center;
}

.contact-email {
  font-size: clamp(0.68rem, 2.2vw, 0.8rem);
  text-transform: none;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.site-footer {
  padding: 28px 0 44px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.floating-top {
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  bottom: clamp(18px, 3vw, 34px);
  z-index: 70;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(198, 255, 61, 0.42);
  border-radius: 999px;
  background: rgba(9, 9, 7, 0.78);
  appearance: none;
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
  backdrop-filter: blur(14px);
}

.floating-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

:root[data-theme="light"] .floating-top {
  border-color: rgba(31, 111, 139, 0.24);
  background: rgba(255, 255, 255, 0.74);
  color: #1f6f8b;
  box-shadow: 0 18px 42px rgba(45, 55, 72, 0.14);
}

.floating-top.is-visible:hover {
  background: var(--accent);
  color: #06100e;
  transform: translateY(-2px);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
}

:root[data-theme="light"] .floating-top.is-visible:hover {
  background: linear-gradient(135deg, #1f6f8b, #38a3a5);
  color: #ffffff;
  box-shadow: 0 20px 48px rgba(31, 111, 139, 0.24);
}

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

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: stretch end;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  margin: 12px;
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  box-shadow: -14px 14px 0 rgba(198, 255, 61, 0.2);
}

.modal-content {
  min-width: 0;
}

:root[data-theme="light"] .modal-panel {
  box-shadow: -14px 14px 0 rgba(18, 17, 14, 0.14);
}

.modal-close {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-left: auto;
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 14px;
}

.resume-frame-wrap {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  height: min(76vh, 840px);
}

.resume-frame-wrap.page-frame {
  height: min(82vh, 940px);
  margin-top: 0;
  box-shadow: 12px 12px 0 rgba(198, 255, 61, 0.16);
}

:root[data-theme="light"] .resume-frame-wrap.page-frame {
  box-shadow: 12px 12px 0 rgba(18, 17, 14, 0.12);
}

.resume-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.resume-document {
  max-width: 980px;
  margin: 0 auto;
  padding: 30px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 160px),
    var(--panel);
  box-shadow: 12px 12px 0 rgba(198, 255, 61, 0.16);
  font-family: Georgia, "Times New Roman", serif;
}

:root[data-theme="light"] .resume-document {
  box-shadow: 12px 12px 0 rgba(18, 17, 14, 0.12);
}

.resume-doc-head {
  display: block;
  text-align: center;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--line);
}

.resume-doc-head h2 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.resume-doc-head p,
.resume-doc-section p,
.resume-entry li,
.resume-entry span {
  color: var(--muted);
}

.resume-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-content: start;
  margin-top: 12px;
}

.resume-links a,
.resume-skill-list span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: "Inter", system-ui, sans-serif;
}

.resume-doc-section {
  padding: 14px 0;
  border-bottom: 0;
}

.resume-doc-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.resume-doc-section h3 {
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.86rem;
}

.resume-entry {
  display: block;
  padding: 10px 0;
}

.resume-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 7px;
}

.resume-entry h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.resume-entry ul {
  margin: 0;
  padding-left: 20px;
}

.resume-entry li + li {
  margin-top: 5px;
}

.resume-entry li {
  line-height: 1.38;
}

.resume-skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resume-skill-lines p {
  margin: 0 0 7px;
  line-height: 1.38;
}

.modal-repo-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 24px;
}

.modal-repo-head h2 {
  margin-bottom: 10px;
}

.modal-repo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.repo-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.repo-detail-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.repo-detail-grid strong {
  display: block;
  color: var(--accent-2);
  font-size: 1.25rem;
}

.repo-detail-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.repo-deep-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 14px;
  margin: 22px 0;
}

.repo-readme-card,
.repo-side-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.repo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.repo-section-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.readme-content {
  max-height: none;
  overflow: visible;
  padding-right: 0;
  color: var(--muted);
}

.readme-redirect-card {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 260px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 92% 10%, rgba(198, 255, 61, 0.12), transparent 18rem),
    rgba(255, 255, 255, 0.035);
}

.readme-redirect-card h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.readme-redirect-card p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.readme-redirect-card .button {
  width: fit-content;
}

.readme-content h2,
.readme-content h3,
.readme-content h4 {
  color: var(--text);
}

.readme-content code,
.clone-box code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent-2);
  overflow-wrap: anywhere;
}

.repo-languages {
  margin: 0 0 22px;
}

.files-head {
  margin-top: 18px;
}

.repo-files {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.repo-files a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.repo-files a span {
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 900;
}

.clone-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.clone-box .button {
  width: 100%;
  margin-top: 12px;
}

.subpage {
  min-height: calc(100vh - 65px);
  padding: 76px 0;
}

.subpage-header {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  margin-bottom: 34px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.subpage-header .button {
  width: fit-content;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 650ms ease, transform 650ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fillBar {
  from {
    width: 0;
  }
}

@keyframes codeScan {
  0%,
  100% {
    transform: translateX(-36%);
  }
  50% {
    transform: translateX(36%);
  }
}

@keyframes rankLines {
  to {
    background-position: 120px 0;
  }
}

@keyframes rankSweep {
  0%,
  28% {
    transform: translateX(-120%);
  }
  62%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes orbitRank {
  from {
    rotate: 0deg;
  }
  to {
    rotate: 360deg;
  }
}

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

@media (min-width: 1440px) {
  :root {
    --max: 1320px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.45fr);
  }

  .section-grid,
  .section {
    padding: 96px 0;
  }

  .repo-grid,
  .skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .site-header {
    gap: 12px;
  }

  .nav-links a {
    padding-inline: 8px;
    font-size: 0.7rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.52fr);
    gap: 26px;
  }

  h1 {
    font-size: clamp(2.25rem, 4.5vw, 4rem);
  }

  .profile-panel {
    min-height: 520px;
  }

  .portrait-wrap {
    width: min(100%, 292px);
  }

  .repo-grid,
  .repo-grid.all-repos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 920px) {
  body {
    background: var(--bg);
  }

  .site-header {
    position: sticky;
  }

  .nav-toggle {
    display: grid;
    margin-left: auto;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 12px;
    right: 12px;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(9, 9, 7, 0.96);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
  }

  :root[data-theme="light"] .nav-links {
    background: rgba(243, 234, 217, 0.98);
  }

  .site-header.is-nav-open .nav-links {
    display: grid;
  }

  .nav-links a {
    display: flex;
    justify-content: center;
    padding: 12px 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
  }

  .hero,
  .intro,
  .study-link-section,
  .timeline-item,
  .education-band,
  .rank-showcase,
  .volunteer-grid,
  .leetcode-card {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 56px;
    gap: 34px;
    min-height: auto;
  }

  .profile-panel {
    order: -1;
  }

  .profile-panel {
    min-height: auto;
  }

  .quick-stats,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid,
  .repo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card.featured {
    min-height: 380px;
  }

  .time {
    position: static;
  }

  .achievement-list {
    justify-content: flex-start;
  }

  .repo-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repo-deep-grid {
    grid-template-columns: 1fr;
  }

  .modal-shell {
    place-items: stretch;
  }

  .modal-panel {
    width: calc(100vw - 20px);
  }

  .subpage-header {
    grid-template-columns: 1fr;
  }

  .resume-entry-head {
    display: block;
  }

  .activity-head {
    align-items: start;
    flex-direction: column;
  }

  .activity-stats {
    justify-content: flex-start;
  }

  .platform-grid {
    grid-template-columns: 1fr;
  }

  .gfg-breakdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .section-grid,
  .section {
    padding: 72px 0;
  }

  .quick-stats,
  .skills-grid,
  .repo-grid,
  .repo-grid.all-repos,
  .leetcode-breakdown {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    box-shadow: 8px 8px 0 rgba(198, 255, 61, 0.2);
  }

  :root[data-theme="light"] .profile-panel {
    box-shadow: 8px 8px 0 rgba(18, 17, 14, 0.14);
  }

  .project-card,
  .project-card.featured {
    min-height: 280px;
  }

  .repo-card,
  .all-repos .repo-card:nth-child(n),
  .repo-card[class*="float-"] {
    transform: none;
  }

  .repo-card:hover,
  .all-repos .repo-card:hover,
  .repo-card[class*="float-"]:hover {
    transform: translateY(-4px);
  }

  .modal-repo-head {
    flex-direction: column;
  }

  .subpage {
    padding: 62px 0;
  }
}

@media (max-width: 560px) {
  main,
  .site-footer {
    width: min(100% - 24px, var(--max));
  }

  .site-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .brand span:last-child {
    display: none;
  }

  .section-grid,
  .section {
    padding: 54px 0;
  }

  h1 {
    font-size: clamp(1.86rem, 9vw, 2.72rem);
  }

  h2 {
    font-size: clamp(1.46rem, 7.5vw, 2.1rem);
  }

  .hero {
    padding-top: 28px;
    gap: 22px;
  }

  .hero-lede,
  .intro p,
  .timeline-card p,
  .project-card p,
  .leetcode-card p,
  .education-band p,
  .contact-section p {
    font-size: 0.94rem;
    line-height: 1.58;
  }

  .profile-panel {
    padding: 16px;
  }

  .portrait-wrap {
    width: min(100%, 238px);
  }

  .profile-meta h2 {
    font-size: 1.8rem;
  }

  .availability-strip,
  .hero-actions,
  .contact-actions,
  .site-footer {
    flex-direction: column;
  }

  .availability-strip {
    width: 100%;
  }

  .availability-strip span + span {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .button {
    width: 100%;
  }

  .floating-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }

  .quick-stats div,
  .timeline-card,
  .project-card,
  .repo-card,
  .skill-block,
  .leetcode-card,
  .progress-panel {
    padding: 16px;
  }

  .leetcode-breakdown,
  .gfg-breakdown,
  .repo-detail-grid,
  .repo-deep-grid {
    grid-template-columns: 1fr;
  }

  .modal-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    margin: 8px;
    padding: 12px;
  }

  .resume-document {
    padding: 14px;
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 7px 7px 0 rgba(198, 255, 61, 0.13);
    font-size: 0.88rem;
    overflow-wrap: anywhere;
  }

  .resume-doc-head h2 {
    font-size: 1.62rem;
  }

  .resume-doc-head p {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .resume-links {
    gap: 6px;
  }

  .resume-links a,
  .resume-skill-list span {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 0.66rem;
  }

  .resume-entry-head h4,
  .resume-doc-section h3 {
    font-size: 1rem;
  }

  .resume-entry li {
    line-height: 1.45;
  }

  .resume-frame-wrap {
    height: 70vh;
  }
}

@media (max-width: 380px) {
  main,
  .site-footer {
    width: min(100% - 14px, var(--max));
  }

  .section-grid,
  .section {
    padding: 58px 0;
  }

  h1 {
    font-size: 2rem;
  }

  .button,
  .modal-close {
    min-height: 44px;
    font-size: 0.72rem;
  }

  .portrait-wrap {
    width: min(100%, 260px);
  }

  .profile-meta {
    padding-bottom: 38px;
  }
}

/* Final mobile polish for spacing and compact controls. */
.modal-close {
  display: grid;
  place-items: center;
}

@media (max-width: 920px) {
  .site-header {
    padding: 10px 14px;
  }

  .nav-links {
    left: 14px;
    right: 14px;
  }
}

@media (max-width: 560px) {
  main,
  .site-footer {
    width: min(100% - 24px, var(--max));
  }

  .site-header {
    padding: 9px 12px;
  }

  .nav-toggle,
  .theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .nav-links {
    left: 12px;
    right: 12px;
    grid-template-columns: 1fr;
    padding: 10px;
    border-radius: 16px;
  }

  .section-grid,
  .section {
    padding: 50px 0;
  }

  .hero {
    padding-top: 22px;
  }

  .quick-stats div,
  .timeline-card,
  .project-card,
  .repo-card,
  .skill-block,
  .leetcode-card,
  .progress-panel,
  .profile-panel {
    border-radius: 18px;
  }

  .modal-close {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  .modal-close::before {
    content: "X";
    font-size: 0.84rem;
    line-height: 1;
  }
}
