:root {
  --bg: #0b0b0c;
  --surface: #121214;
  --surface-2: #17171a;
  --line: #242428;
  --line-strong: #34343a;
  --text: #ededee;
  --muted: #9d9da5;
  --faint: #62626a;
  --accent: #e5383b;
  --accent-soft: rgba(229, 56, 59, 0.12);
  --accent-line: rgba(229, 56, 59, 0.45);
  --radius: 14px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --pixel: "Silkscreen", "JetBrains Mono", monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f3f3f0;
  --line: #e5e5e1;
  --line-strong: #d3d3ce;
  --text: #141416;
  --muted: #5a5a62;
  --faint: #9a9aa0;
  --accent: #d0262a;
  --accent-soft: rgba(208, 38, 42, 0.08);
  --accent-line: rgba(208, 38, 42, 0.4);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wrap {
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.brand {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* tab bar: one tap to any section, the current one is boxed in red */
.tabs {
  border-top: 1px solid var(--line);
}

.tabs-track {
  display: flex;
  gap: 4px;
  padding: 7px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}

.tabs-track::-webkit-scrollbar {
  display: none;
}

.tabs-track a {
  flex: none;
  font-family: var(--pixel);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 5px 10px 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.tabs-track a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tabs-track a.active {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

section[id],
#contact,
#top {
  scroll-margin-top: 130px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.icon-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent-line);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.theme-sun {
  display: none;
}

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

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

/* ---------- banner + profile ---------- */

/* the page web: one fixed canvas behind everything */
#web-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* the banner is a clear frame onto the hub of the page web */
.banner {
  position: relative;
  margin-top: 20px;
  height: 172px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  padding: 22px 26px;
}

.banner-label {
  font-family: var(--pixel);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--faint);
  letter-spacing: 0.05em;
}

.terminal {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  max-width: 60%;
}

.prompt {
  color: var(--accent);
}

.caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--accent);
}

.banner-hint {
  position: absolute;
  right: 26px;
  bottom: 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.profile {
  margin-top: -44px;
  position: relative;
  padding: 0 4px;
}

.avatar {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  border: 4px solid var(--bg);
  background: var(--surface-2);
  object-fit: cover;
}

h1 {
  margin: 14px 0 0;
  font-size: clamp(30px, 6vw, 38px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.role {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.meta {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

.meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #22c55e;
  opacity: 0;
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.lead {
  margin: 20px 0 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
}

.lead strong {
  font-weight: 600;
}

.lead .dim {
  color: var(--muted);
}

.actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  background: var(--text);
  border-color: var(--text);
  opacity: 0.9;
}

/* ---------- sections ---------- */

section {
  padding: 56px 0 8px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

h2 {
  margin: 0;
  position: relative;
  padding-bottom: 9px;
  font-family: var(--pixel);
  font-size: 17px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--text);
}

/* red bar under each heading, ending in two pixel squares */
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 3px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 46px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 50px 0 / 5px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 59px 0 / 5px 3px no-repeat;
}

.section-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

/* ---------- proof grid ---------- */

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

.proof-card {
  position: relative;
  display: block;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s;
  overflow: hidden;
}

.proof-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.proof-num {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.proof-num em {
  font-style: normal;
  color: var(--accent);
}

.proof-title {
  margin-top: 10px;
  font-weight: 600;
  font-size: 15px;
}

.proof-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.proof-arrow {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--faint);
  transition: color 0.2s, transform 0.2s;
}

.proof-card:hover .proof-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* ---------- experience ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.job {
  position: relative;
  padding: 0 0 30px 22px;
}

.job:last-child {
  padding-bottom: 4px;
}

.job::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--faint);
}

.job.current::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.job-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.job-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
}

.org-logo {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid;
  place-items: center;
}

.org-logo > img:first-child {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  object-fit: cover;
}

.org-logo .badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  padding: 1px;
  border: 1px solid var(--line);
}

.org-logo.icon {
  color: var(--accent);
}

.org-logo.icon svg {
  width: 20px;
  height: 20px;
}

.job h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.job h3 a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.job h3 a:hover {
  border-color: var(--accent);
}

.when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.job-role {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.job ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 14.5px;
}

.job li {
  margin: 4px 0;
}

.job li::marker {
  color: var(--faint);
}

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

/* ---------- chips + tags ---------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, color 0.15s;
}

.link-chip:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.link-chip .arr {
  color: var(--faint);
  font-size: 11px;
}

/* ---------- carousel ---------- */

.carousel {
  position: relative;
  outline: none;
}

.carousel-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.counter {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  min-width: 56px;
  text-align: center;
}

.counter b {
  color: var(--text);
  font-weight: 500;
}

.stage {
  position: relative;
  padding-top: 34px;
  touch-action: pan-y;
}

/* the silk thread each card hangs from */
.thread {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 36px;
  background: linear-gradient(var(--line), var(--accent-line));
  transform-origin: top center;
}

.thread::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg);
}

.slide {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px 22px 20px;
  transform-origin: 50% -34px;
  will-change: transform;
}

.slide::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.slide-index {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.pill {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.slide h3 {
  margin: 14px 0 0;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.slide-period {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.slide-summary {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.metrics {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metrics li {
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 500;
}

.metrics li::before {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-bottom: 7px;
}

.prose {
  margin-top: 16px;
  font-size: 14.5px;
  line-height: 1.7;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.prose p {
  margin: 0 0 10px;
}

.prose ul,
.prose ol {
  margin: 0 0 10px;
  padding-left: 18px;
}

.prose li {
  margin: 4px 0;
}

.prose li::marker {
  color: var(--faint);
}

.prose h3,
.prose h4,
.prose h5 {
  margin: 16px 0 6px;
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.prose a {
  color: var(--text);
  border-bottom: 1px solid var(--accent-line);
}

.prose a:hover {
  color: var(--accent);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.prose pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.prose pre code {
  border: 0;
  padding: 0;
  background: none;
}

.prose blockquote {
  margin: 0 0 10px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.slide-links {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.carousel-foot {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.jump {
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.jump:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.jump[aria-current="true"] {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.hint {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface);
}

.loading {
  padding: 40px 0;
  text-align: center;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
}

/* ---------- lists (open source, more, talks) ---------- */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.row-main {
  min-width: 0;
}

.row-title {
  font-weight: 600;
  font-size: 15px;
}

.row-title a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

.row-title a:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

.row-text {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.row-text a {
  color: var(--text);
  border-bottom: 1px solid var(--accent-line);
}

.row-side {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.amp {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--accent);
}

.pod-intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

#podcast .job-links {
  margin-top: 16px;
}

/* ---------- skills ---------- */

.skills {
  display: grid;
  gap: 14px;
}

.skill-group {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  align-items: baseline;
}

.skill-group dt {
  font-size: 13.5px;
  color: var(--muted);
}

.skill-group dd {
  margin: 0;
}

.skill-group .tags {
  margin: 0;
}

/* ---------- contact ---------- */

.contact {
  margin-top: 64px;
  padding: 34px 26px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.contact h2 {
  margin-bottom: 14px;
}

.contact-line {
  margin: 0;
  font-size: clamp(22px, 4.5vw, 28px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.contact-line span {
  color: var(--muted);
}

.contact .actions {
  margin-top: 22px;
}

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

footer {
  padding: 40px 0 56px;
  color: var(--faint);
  font-size: 12.5px;
  font-family: var(--mono);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--accent);
}

/* ---------- HUD corner brackets ---------- */

.hud {
  --c: var(--accent);
  --s: 12px;
  --t: 2px;
}

.hud::after {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--s) var(--t),
    linear-gradient(var(--c), var(--c)) top left / var(--t) var(--s),
    linear-gradient(var(--c), var(--c)) top right / var(--s) var(--t),
    linear-gradient(var(--c), var(--c)) top right / var(--t) var(--s),
    linear-gradient(var(--c), var(--c)) bottom left / var(--s) var(--t),
    linear-gradient(var(--c), var(--c)) bottom left / var(--t) var(--s),
    linear-gradient(var(--c), var(--c)) bottom right / var(--s) var(--t),
    linear-gradient(var(--c), var(--c)) bottom right / var(--t) var(--s);
  background-repeat: no-repeat;
  opacity: 0.9;
}

/* ---------- about ---------- */

.about {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 18px;
  align-items: start;
}

.player {
  position: relative;
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.emblem {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
}

.player-info {
  margin: 16px 0 0;
  display: grid;
  gap: 7px;
}

.player-info div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.player-info dt {
  font-family: var(--pixel);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 2px;
}

.player-info dd {
  margin: 0;
  text-align: right;
}

.meters {
  list-style: none;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 11px;
}

.meters li {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label num" "bar bar";
  gap: 5px 8px;
  align-items: center;
}

.meter-label {
  grid-area: label;
  font-family: var(--pixel);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}

.meter-num {
  grid-area: num;
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--accent);
}

.meter {
  grid-area: bar;
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.meter i {
  flex: 1;
  height: 9px;
  background: var(--surface-2);
  border-radius: 1px;
}

.meter i.on {
  background: var(--accent);
  animation: fill-in 0.5s steps(3) both;
}

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

.lf-stats {
  display: block;
  margin-top: 16px;
  padding: 12px 12px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
  transition: border-color 0.15s;
}

.lf-stats:hover {
  border-color: var(--accent);
}

.lf-title {
  display: block;
  font-family: var(--pixel);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}

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

.lf-row span {
  display: grid;
  font-size: 12px;
  color: var(--muted);
}

.lf-row b {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
  color: var(--text);
}

.lf-note {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
}

/* GitHub contribution chart */
.contrib {
  display: block;
  margin-bottom: 18px;
  padding: 16px 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s;
}

.contrib:hover {
  border-color: var(--line-strong);
}

.contrib-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 14px;
  color: var(--muted);
}

.contrib-head b {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 18px;
  color: var(--text);
}

.contrib-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.contrib-scroll {
  display: block;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.contrib-grid {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  grid-auto-flow: column;
  grid-auto-columns: 10px;
  gap: 3px;
  width: max-content;
}

.contrib-grid i,
.contrib-legend i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--gh-0);
}

.contrib [data-l="1"] { background: var(--gh-1); }
.contrib [data-l="2"] { background: var(--gh-2); }
.contrib [data-l="3"] { background: var(--gh-3); }
.contrib [data-l="4"] { background: var(--gh-4); }

.contrib-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--faint);
}

.contrib-legend i {
  margin: 0 1px;
}

:root {
  --gh-0: #1b1f24;
  --gh-1: #0e4429;
  --gh-2: #006d32;
  --gh-3: #26a641;
  --gh-4: #39d353;
}

:root[data-theme="light"] {
  --gh-0: #ebedf0;
  --gh-1: #9be9a8;
  --gh-2: #40c463;
  --gh-3: #30a14e;
  --gh-4: #216e39;
}

.clients a {
  color: var(--text);
  border-bottom: 1px solid var(--accent-line);
}

.clients a:hover {
  color: var(--accent);
}

.story p {
  margin: 0 0 14px;
  font-size: 15.5px;
}

.story p:first-child {
  margin-top: 2px;
}

.story code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.milestones {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.milestones li {
  position: relative;
  padding: 0 0 14px 20px;
  display: grid;
  gap: 1px;
}

.milestones li:last-child {
  padding-bottom: 0;
}

.milestones li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.ms-when {
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
}

.ms-what {
  font-size: 14px;
  color: var(--muted);
}

/* ---------- carousel extras ---------- */

.slide {
  border-top: 3px solid var(--accent);
}

.slide h3 {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.link-chip.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.link-chip.primary .arr {
  color: #fff;
}

.link-chip.primary:hover {
  color: #fff;
  filter: brightness(1.08);
}

.prose.folded {
  max-height: 240px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}

.more {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-family: var(--pixel);
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
}

.more:hover {
  text-decoration: underline;
}

.segments {
  margin-top: 14px;
  display: flex;
  gap: 4px;
}

.segments button {
  flex: 1;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: background 0.2s;
}

.segments button.on {
  background: var(--accent);
  box-shadow: none;
}

.brand {
  font-family: var(--pixel);
  font-size: 14px;
  text-transform: uppercase;
}

.proof-num {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 32px;
}

/* ---------- spider mascot ---------- */

.spider-mascot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  z-index: 60;
  will-change: transform;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }

  .banner {
    height: 132px;
    margin-top: 14px;
    padding: 16px 18px;
  }

  .terminal {
    font-size: 12.5px;
    max-width: 100%;
  }

  .banner-hint {
    display: none;
  }

  .profile {
    margin-top: -38px;
  }

  .avatar {
    width: 80px;
    height: 80px;
  }

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

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

  .slide h3 {
    font-size: 19px;
  }

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

  .metrics li {
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .metrics li::before {
    margin: 0;
    flex: none;
  }

  .slide {
    padding: 18px 16px 16px;
  }

  .skill-group {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .row {
    flex-direction: column;
    gap: 2px;
  }

  .contact {
    padding: 26px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
