:root {
  --bg: #f5f8ff;
  --ink: #141a33;
  --card: #ffffff;
  --soft: #e3ebff;
  --blue: #4c7df0;
  --tag: #2f5fd0;
  --onblue: #ffffff;
  --line: #141a33;
  --shadow: #141a33;
  --muted: #3a4260;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1224;
    --ink: #e6ebfa;
    --card: #151a33;
    --soft: #1b2347;
    --blue: #7b9dff;
    --tag: #7b9dff;
    --onblue: #0e1224;
    --line: #e6ebfa;
    --shadow: #7b9dff;
    --muted: #b3bcda;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1224;
  --ink: #e6ebfa;
  --card: #151a33;
  --soft: #1b2347;
  --blue: #7b9dff;
  --tag: #7b9dff;
  --onblue: #0e1224;
  --line: #e6ebfa;
  --shadow: #7b9dff;
  --muted: #b3bcda;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  overflow-x: hidden;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: 4px;
  width: 0;
  background: var(--blue);
  transform-origin: left;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Fredoka", "Comic Sans MS", "Chalkboard SE", sans-serif;
  font-size: 1.08rem;
  line-height: 1.55;
  transition: background 0.25s, color 0.25s;
  background-image: radial-gradient(var(--soft) 2px, transparent 2.5px);
  background-size: 26px 26px;
}

h1, h2, h3, .logo {
  font-family: "Lilita One", "Chalkboard SE", "Comic Sans MS", sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.05;
}

a { color: inherit; }

:focus-visible {
  outline: 4px dashed var(--blue);
  outline-offset: 3px;
}

.wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px;
}

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px;
  padding: 14px 20px;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 3px solid var(--line);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--shadow) 25%, transparent);
  backdrop-filter: blur(10px);
}

.logo {
  font-size: 1.6rem;
  text-decoration: none;
  background: var(--blue);
  color: var(--onblue);
  padding: 4px 14px;
  border: 3px solid var(--line);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--shadow);
  transform: rotate(-2deg);
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 7px;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--shadow);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

nav a {
  text-decoration: none;
  font-weight: 600;
  padding: 4px 12px;
  border: 3px solid transparent;
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

nav a:hover {
  border-color: var(--line);
  background: var(--card);
  transform: translateY(-1px);
}

.toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 34px;
  padding: 5px;
  cursor: pointer;
  color: var(--ink);
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--shadow);
}

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

.theme-moon { display: none; }
:root[data-theme="dark"] .theme-sun { display: none; }
:root[data-theme="dark"] .theme-moon { display: block; }

.nav-tool {
  display: inline-grid;
  place-items: center;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 6px;
  width: 34px;
  height: 30px;
  padding: 4px;
}

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

.toggle:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 34px 0 56px;
  display: grid;
  gap: 30px;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
}

.code-float {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.code-symbol {
  position: absolute;
  color: var(--blue);
  opacity: 0.42;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 0 12px color-mix(in srgb, var(--blue) 40%, transparent);
  animation: float-code 7s ease-in-out infinite;
}

.code-one { top: 12%; right: 9%; animation-delay: -1s; }
.code-two { top: 28%; right: 22%; animation-delay: -4s; }
.code-three { top: 48%; right: 3%; animation-delay: -2s; }
.code-four { top: 68%; right: 17%; animation-delay: -6s; }
.code-five { top: 82%; right: 5%; animation-delay: -3s; }

.eyebrow {
  color: var(--tag);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: #35b86b;
  box-shadow: 0 0 0 4px color-mix(in srgb, #35b86b 20%, transparent);
}

.hero-role {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.hero-role span { color: var(--blue); }
.hero-role strong { display: inline-block; color: var(--ink); transition: opacity 0.18s, transform 0.18s; }
.hero-role strong.role-changing { opacity: 0; transform: translateY(4px); }
.scroll-cue { display: inline-flex; gap: 8px; margin-top: 28px; color: var(--muted); font-weight: 600; text-decoration: none; }
.scroll-cue span { color: var(--blue); animation: nudge 1.6s ease-in-out infinite; }

@keyframes float-code {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg); }
  50% { transform: translate3d(-12px, -10px, 0) rotate(2deg); }
}
@keyframes nudge { 50% { transform: translateY(5px); } }

.hero h1 {
  font-size: clamp(3rem, 10vw, 6.4rem);
  text-shadow: 5px 5px 0 var(--blue);
}

.bubble {
  position: relative;
  margin-top: 22px;
  max-width: 30rem;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 16px 20px;
  box-shadow: 6px 6px 0 var(--shadow);
}

.bubble::after {
  content: "";
  position: absolute;
  left: 34px;
  top: -18px;
  width: 26px;
  height: 26px;
  background: var(--card);
  border-left: 3px solid var(--line);
  border-top: 3px solid var(--line);
  transform: rotate(45deg);
}

.btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-family: "Lilita One", "Comic Sans MS", sans-serif;
  font-size: 1.2rem;
  padding: 8px 22px;
  border: 3px solid var(--line);
  border-radius: 16px;
  background: var(--blue);
  color: var(--onblue);
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn.alt {
  background: var(--card);
  color: var(--ink);
}

.text-btn {
  align-self: center;
  font-weight: 600;
  text-decoration: none;
  color: var(--tag);
}

.pixel-arrow {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-left: 0.28em;
  border-top: 0.17em solid currentColor;
  border-right: 0.17em solid currentColor;
  transform: translateY(0.06em) rotate(45deg);
  image-rendering: pixelated;
}

.pixel-arrow-inline {
  width: 0.55em;
  height: 0.55em;
  margin: 0 0.2em;
}

.pixel-arrow-down {
  border: 0;
  border-right: 0.17em solid currentColor;
  border-bottom: 0.17em solid currentColor;
  transform: translateY(-0.1em) rotate(45deg);
}

.pixel-arrow-up {
  margin: 0;
  border: 0;
  border-left: 0.17em solid currentColor;
  border-top: 0.17em solid currentColor;
  transform: translateY(0.1em) rotate(45deg);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--shadow);
}

.btn:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--shadow);
}

.mascot {
  justify-self: center;
  width: min(100%, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--blue);
  border: 4px solid var(--line);
  border-radius: 50%;
  box-shadow: 9px 9px 0 var(--shadow);
  animation: bob 3.2s ease-in-out infinite;
  overflow: hidden;
}

.mascot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 43%;
  display: block;
}

@keyframes bob {
  50% { transform: translateY(-10px) rotate(2deg); }
}

.stickers {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.sticker {
  font-weight: 600;
  padding: 2px 14px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.sticker:nth-child(odd) { transform: rotate(-2deg); }
.sticker:nth-child(even) { transform: rotate(2deg); }

section { padding: 46px 0; }

h2 {
  font-size: clamp(2rem, 6vw, 3rem);
  display: inline-block;
  background: var(--blue);
  color: var(--onblue);
  padding: 4px 20px;
  border: 3px solid var(--line);
  border-radius: 16px;
  box-shadow: 5px 5px 0 var(--shadow);
  transform: rotate(-1.5deg);
  margin-bottom: 28px;
}

.card {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: 7px 7px 0 var(--shadow);
}

.about p { margin: 0 0 10px; }
.about p:last-child { margin: 0; }

.section-intro {
  max-width: 50rem;
  margin: -12px 0 24px;
  color: var(--muted);
}

.research-card h3 {
  max-width: 46rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.research-authors {
  margin: 10px 0;
  color: var(--tag);
  font-weight: 600;
}

.research-card > p:not(.eyebrow):not(.research-authors):not(.citation-line) {
  max-width: 58rem;
}

.research-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.citation-line {
  margin: 0;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.copy-citation {
  margin: 8px 0 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
}

.copy-citation:hover { background: var(--blue); color: var(--onblue); }

.skills, .projects, .mini, .two {
  display: grid;
  gap: 18px;
}

.skills { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.skills h3 { font-size: 1.4rem; margin-bottom: 10px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.chips li {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 1px 11px;
  border: 2.5px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.projects {
  gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.project-toolbar, .skill-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -10px 0 24px;
}

.filter, .project-details {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

.filter:hover, .filter.active, .project-details:hover {
  color: var(--onblue);
  background: var(--blue);
}

.project.is-hidden, .skill-card.is-hidden { display: none; }
.project-details { color: var(--onblue); background: var(--blue); }

.project { display: flex; flex-direction: column; gap: 10px; }
.project h3 { font-size: 1.8rem; }
.project .tag { margin: 0; font-weight: 600; color: var(--tag); }
.project ul { margin: 0; padding-left: 20px; color: var(--muted); }
.project li { margin-bottom: 6px; }
.project .stack { font-size: 0.9rem; }

.links {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.links a {
  font-weight: 600;
  text-decoration: none;
  padding: 2px 14px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--blue);
  color: var(--onblue);
  box-shadow: 3px 3px 0 var(--shadow);
}

.links a:hover { transform: translate(-1px, -1px); }
.mini { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-top: 26px; }
.mini h3 { font-size: 1.3rem; }
.mini p { margin: 4px 0 8px; color: var(--muted); }
.skill-note { margin: -4px 0 12px; color: var(--muted); font-size: 0.92rem; }
.two { gap: 26px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.trophy { display: flex; gap: 14px; align-items: flex-start; }
.pixel-trophy {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  shape-rendering: crispEdges;
}
.pixel-outline { fill: var(--line); }
.pixel-gold { fill: #ffd21a; }
.pixel-highlight { fill: #fff3a1; }
.certs h3 { font-size: 1.3rem; margin: 12px 0 8px; }
.certs h3:first-child { margin-top: 0; }
.certs ul { margin: 0; padding-left: 20px; }
.certs li { margin-bottom: 4px; }
.contact { text-align: center; }
.contact .card { background: var(--blue); color: var(--onblue); padding: 34px 20px; }
.contact h2 { background: var(--card); color: var(--ink); }
.contact .btn { background: var(--card); color: var(--ink); }
.contact p { max-width: 34rem; margin: 0 auto 18px; }

.terminal {
  overflow: hidden;
  padding: 0;
  background: #111827;
  color: #d7e2ff;
  border-color: #29385e;
  box-shadow: 7px 7px 0 var(--shadow);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #1b2642;
  color: #a9b9dd;
  font-size: 0.85rem;
}

.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #ff6b6b; }
.terminal-bar span:nth-child(2) { background: #ffd166; }
.terminal-bar span:nth-child(3) { background: #56d364; }
.terminal-bar strong { margin-left: 8px; }
.terminal-output { min-height: 150px; padding: 16px; font-family: Consolas, monospace; font-size: 0.9rem; }
.terminal-output p { margin: 0 0 8px; }
.terminal-output .command { color: #8ab4ff; }
.terminal-output .error { color: #ff9f9f; }
.terminal-form { display: flex; gap: 8px; padding: 0 16px 16px; color: #56d364; font-family: Consolas, monospace; }
.terminal-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; }

.github-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.github-card h3 { margin-bottom: 8px; font-size: 1.45rem; }
.github-card p { color: var(--muted); margin: 0 0 12px; }
.repo-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 0.9rem; }
.loading-card { min-height: 120px; animation: pulse 1.4s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: 0.55; } }

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 680px;
  margin: 24px auto;
  text-align: left;
}

.contact-form label { display: grid; gap: 5px; font-weight: 600; }
.contact-form input, .contact-form textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--card);
  font: inherit;
}
.contact-form .full-field, .contact-form button, .form-status { grid-column: 1 / -1; }
.form-status { margin: 0; font-size: 0.9rem; }

.project-modal, .command-palette {
  max-width: min(680px, calc(100% - 28px));
  width: 100%;
  color: var(--ink);
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 10px 10px 0 var(--shadow);
}

.project-modal::backdrop, .command-palette::backdrop { background: rgb(10 15 35 / 70%); backdrop-filter: blur(4px); }
.project-modal h2, .command-palette h2 { margin-bottom: 18px; }
.project-modal h2 { font-size: 2.4rem; }
.modal-close { position: absolute; top: 12px; right: 16px; border: 0; background: none; color: var(--ink); font-size: 2rem; cursor: pointer; }
.project-modal ul { padding-left: 20px; }
.command-palette input { width: 100%; padding: 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
.palette-results { display: grid; gap: 6px; margin-top: 12px; }
.palette-results button { text-align: left; border: 0; border-radius: 8px; padding: 10px; background: var(--soft); color: var(--ink); font: inherit; cursor: pointer; }
.palette-results button:hover, .palette-results button:focus { background: var(--blue); color: var(--onblue); }
.back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 15; display: none; border: 3px solid var(--line); border-radius: 50%; width: 44px; height: 44px; background: var(--blue); color: var(--onblue); font-size: 1.4rem; cursor: pointer; box-shadow: 3px 3px 0 var(--shadow); }
.back-to-top.visible { display: block; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s, transform 0.5s; }
.reveal.visible { opacity: 1; transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

footer {
  text-align: center;
  padding: 30px 0 40px;
  font-weight: 500;
}

.not-found {
  max-width: 680px;
  margin: 0 auto;
  padding: 18vh 24px;
  text-align: center;
}

.not-found h1 {
  margin: 14px 0;
  font-size: clamp(3rem, 9vw, 6rem);
  text-shadow: 5px 5px 0 var(--blue);
}

.not-found p:not(.eyebrow) { margin: 0 auto 24px; color: var(--muted); }

.trademark {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.award-note { margin: 6px 0 0; }
.certificates { grid-column: 1 / -1; }
.certificate-links { padding-top: 14px; }
.contact-actions { justify-content: center; }

.contribution-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 14;
  width: min(390px, calc(100vw - 40px));
  padding: 16px;
  color: var(--ink);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  border: 3px solid var(--line);
  border-radius: 18px;
  box-shadow: 7px 7px 0 var(--shadow);
  backdrop-filter: blur(12px);
}
.contribution-widget.is-hidden { display: none; }
.contribution-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 14;
  display: none;
  align-items: center;
  gap: 7px;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--blue);
  color: var(--onblue);
  box-shadow: 4px 4px 0 var(--shadow);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.contribution-toggle.is-visible { display: inline-flex; }
.contribution-toggle-icon { font-size: 1.15rem; line-height: 1; }
.contribution-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.contribution-header .eyebrow { margin: 0 0 3px; font-size: 0.7rem; }
.contribution-header h2 { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; transform: none; background: none; color: var(--ink); font-size: 1.15rem; }
.contribution-close { border: 0; background: none; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.contribution-summary { display: flex; align-items: baseline; gap: 5px; margin: 12px 0 10px; }
.contribution-summary strong { font-family: "Lilita One", sans-serif; font-size: 1.5rem; color: var(--tag); }
.contribution-summary span { color: var(--muted); font-size: 0.82rem; }
.contribution-grid-wrap { overflow-x: auto; padding-bottom: 4px; }
.contribution-months { display: grid; grid-template-columns: repeat(12, 1fr); min-width: 336px; margin: 0 0 4px 20px; color: var(--muted); font-size: 0.62rem; }
.contribution-grid { display: grid; grid-template-rows: repeat(7, 10px); grid-auto-flow: column; grid-auto-columns: 10px; gap: 3px; min-width: 336px; }
.contribution-cell { width: 10px; height: 10px; border-radius: 2px; background: var(--soft); }
.contribution-cell.level-1 { background: #b6d6ff; }
.contribution-cell.level-2 { background: #6fa7f7; }
.contribution-cell.level-3 { background: #3f7de0; }
.contribution-cell.level-4 { background: #2456b8; }
.contribution-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.contribution-error { margin: 8px 0; color: var(--muted); font-size: 0.78rem; }
.contribution-error a { color: var(--tag); font-weight: 600; }
.contribution-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; color: var(--muted); font-size: 0.62rem; }
.contribution-legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--soft); }
.contribution-legend .level-1 { background: #b6d6ff; }
.contribution-legend .level-2 { background: #6fa7f7; }
.contribution-legend .level-3 { background: #3f7de0; }
.contribution-legend .level-4 { background: #2456b8; }
.contribution-link { display: inline-block; margin-top: 10px; color: var(--tag); font-size: 0.82rem; font-weight: 600; text-decoration: none; }
@media (max-width: 760px) {
  .wrap { padding: 0 14px; }
  header.top {
    margin: 0 -14px;
    padding: 8px 14px;
    flex-wrap: nowrap;
    align-items: center;
    position: relative;
  }
  .menu-toggle { display: block; margin-left: auto; }
  nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 14px;
    right: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    border: 3px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 5px 5px 0 var(--shadow);
  }
  nav.is-open {
    display: flex;
  }
  nav a, nav .toggle, nav .nav-tool {
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    font-size: 0.95rem;
  }
  nav .toggle {
    width: 38px;
    height: 34px;
    padding: 5px;
    align-self: flex-start;
    text-align: center;
  }
  nav .nav-tool {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    height: auto;
  }
  nav .shortcut-icon { width: 19px; }
  nav a:hover { transform: none; }
  nav .toggle { border-radius: 10px; }
  nav .nav-tool { border-radius: 10px; }
  .logo { z-index: 1; }
  .hero { grid-template-columns: 1fr; padding: 24px 0 40px; gap: 24px; }
  .hero h1 { font-size: clamp(2.8rem, 16vw, 5rem); }
  .hero-role { font-size: 0.95rem; }
  .mascot { width: min(270px, 75vw); order: -1; }
  section { padding: 34px 0; }
  .card { padding: 18px; }
  .btns { gap: 10px; }
  .btn { flex: 1 1 180px; text-align: center; }
  .trophy { gap: 10px; }
  .scroll-cue { margin-top: 20px; }
  .contact-form { grid-template-columns: 1fr; }
  .contact-form .full-field, .contact-form button, .form-status { grid-column: auto; }
  .project-modal, .command-palette { padding: 22px 18px; }
  .contribution-widget { right: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); }
  .contribution-toggle { right: 12px; bottom: 12px; }
  .back-to-top { left: 12px; right: auto; bottom: 12px; }
}

@media (max-width: 420px) {
  .logo { display: none; }
  body { font-size: 1rem; }
  h2 { padding: 4px 14px; }
  .bubble { padding: 14px 16px; }
  .sticker { padding: 2px 10px; }
  .btn { font-size: 1.1rem; }
}

@media (max-width: 600px) {
  .logo { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .code-symbol { animation: none; }
}
