/* ============================================================
   jessie james m. bote — portfolio
   editorial column + fixed sidebar, monochrome, Geist type
   ============================================================ */

@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/GeistMono-latin.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Pixel";
  src: url("assets/fonts/GeistPixel-Square.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --g50: #fafafa;
  --g100: #f5f5f5;
  --g200: #e9e9e9;
  --g300: #d4d4d4;
  --g400: #a3a3a3;
  --g500: #737373;
  --g600: #525252;
  --g700: #404040;
  --line: #e9e9e9;
  --line-strong: #d4d4d4;
  --muted: #737373;
  /* small mono labels need 4.5:1 on --bg, --g400 only reaches 2.5:1 */
  --label: #6e6e6e;
  --card: #ffffff;
  /* paper: the white a certificate is printed on, reused by issuer stamps */
  --paper: #ffffff;
  --card-gradient: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
  --shadow-sm: 0 8px 22px -16px rgba(10, 10, 10, 0.24);
  --shadow-md: 0 24px 50px -30px rgba(10, 10, 10, 0.32);
  --halftone: rgba(10, 10, 10, 0.85);
  --grid-line: rgba(10, 10, 10, 0.05);
  --heat-0: #ebebeb;
  --heat-1: #d6d6d6;
  --heat-2: #a8a8a8;
  --heat-3: #5c5c5c;
  --heat-4: #0a0a0a;
  --sidebar-w: 15rem;
  --content-w: 42rem;
  --radius: 1rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0c0c0f;
  --ink: #f4f4f5;
  --g50: #18181b;
  --g100: #1e1e22;
  --g200: #2a2a30;
  --g300: #3a3a42;
  --g400: #8a8a92;
  --g500: #a0a0a8;
  --g600: #b8b8c0;
  --g700: #ceced4;
  --line: #232327;
  --line-strong: #35353c;
  --muted: #a0a0a8;
  --label: #9c9ca4;
  --card: #111114;
  /* paper dims to the value a sheet reads at under dark-room light; still
     paper, but no longer the brightest thing in the card */
  --paper: #f2f2f5;
  --card-gradient: linear-gradient(180deg, #16161a 0%, #111114 100%);
  --shadow-sm: 0 8px 28px -16px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 28px 60px -30px rgba(0, 0, 0, 0.8);
  --halftone: rgba(244, 244, 245, 0.5);
  --grid-line: rgba(244, 244, 245, 0.065);
  --heat-0: #1b1b20;
  --heat-1: #2f2f36;
  --heat-2: #4d4d56;
  --heat-3: #8f8f98;
  --heat-4: #f4f4f5;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scrollbar-gutter: stable;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open,
body.cert-open {
  overflow: hidden;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

h1, h2, h3, p, dl, dd, figure {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

button {
  font: inherit;
  color: inherit;
}

.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;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.55rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--bg);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Fixed grid backdrop ──────────────────────────────────── */

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 95% 85% at 50% 32%, #000 0%, rgba(0, 0, 0, 0.75) 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 95% 85% at 50% 32%, #000 0%, rgba(0, 0, 0, 0.75) 55%, transparent 100%);
  pointer-events: none;
}

/* ── Halftone texture ─────────────────────────────────────── */

.halftone {
  background-image: radial-gradient(circle at center, var(--halftone) 1px, transparent 1.5px);
  background-size: 9px 9px;
  pointer-events: none;
}

.hero-halftone {
  position: absolute;
  top: -1rem;
  right: -3rem;
  width: 19rem;
  height: 19rem;
  opacity: 0.14;
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 68%);
  z-index: 0;
}

.contact-halftone {
  position: absolute;
  right: -1.5rem;
  bottom: -1.5rem;
  width: 10rem;
  height: 10rem;
  opacity: 0.13;
  -webkit-mask-image: radial-gradient(circle at 60% 60%, #000 0%, transparent 70%);
  mask-image: radial-gradient(circle at 60% 60%, #000 0%, transparent 70%);
}

.halftone-rule {
  height: 1.5rem;
  margin-block: 0.5rem;
  opacity: 0.16;
  background-image: radial-gradient(circle at center, var(--halftone) 1px, transparent 1.5px);
  background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
  pointer-events: none;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.sidebar {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.45rem;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0;
  background: var(--g50);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  border-color: var(--line-strong);
  background: var(--g50);
  color: var(--ink);
}

.sidebar-toggle svg {
  width: 0.95rem;
  height: 0.95rem;
}

.sidebar-dock {
  display: none;
}

.sidebar-scrim {
  display: none;
}

.brand:hover .brand-mark,
.brand:focus-visible .brand-mark {
  border-color: var(--ink);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin-top: 2.5rem;
  font-family: "Geist Mono", monospace;
  font-size: 12.5px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.nav-group a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  color: var(--muted);
  transition: color 0.18s ease;
}

.nav-group a:hover,
.nav-group a:focus-visible,
.nav-group a[aria-current="true"],
.nav-group a[aria-current="page"] {
  color: var(--ink);
}

.nav-num {
  font-size: 9.5px;
  color: var(--label);
  letter-spacing: 0.02em;
  transition: color 0.18s ease;
}

.nav-group a[aria-current="true"] .nav-num,
.nav-group a[aria-current="page"] .nav-num {
  color: var(--ink);
}

.nav-rule {
  height: 1px;
  width: 100%;
  background: var(--line);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: auto;
  padding-top: 1.5rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--g50);
}

.theme-toggle svg {
  width: 0.9rem;
  height: 0.9rem;
}

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

.side-note {
  margin-top: 1.1rem;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-note-soft {
  margin-top: 0.75rem;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--label);
}

.side-email {
  display: block;
  margin-top: 0.15rem;
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.1rem;
  transition: border-color 0.18s ease;
  overflow-wrap: anywhere;
}

.side-email span {
  display: block;
}

.side-email:hover,
.side-email:focus-visible {
  border-color: var(--ink);
}

/* ── Mobile header / nav ──────────────────────────────────── */

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.5rem;
  padding-inline: 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mobile-actions .theme-toggle {
  width: 2.75rem;
  height: 2.75rem;
}

.mobile-actions .theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  border-color: var(--line-strong);
  background: var(--g50);
}

.menu-bars {
  position: relative;
  display: block;
  width: 0.9rem;
  height: 0.55rem;
}

.menu-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), top 0.25s var(--ease), opacity 0.2s ease;
}

.menu-bars span:first-child { top: 0; }
.menu-bars span:last-child { top: calc(100% - 1.5px); }

.menu-toggle[aria-expanded="true"] .menu-bars span:first-child {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-bars span:last-child {
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 5rem 1.5rem 2rem;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.75rem);
  transition: opacity 0.28s ease, transform 0.35s var(--ease), visibility 0.28s;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
}

.mobile-nav nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mobile-nav nav a {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding-block: 0.45rem;
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--muted);
  transition: color 0.18s ease;
}

.mobile-nav nav a:hover,
.mobile-nav nav a:focus-visible,
.mobile-nav nav a[aria-current="true"],
.mobile-nav nav a[aria-current="page"] {
  color: var(--ink);
}

.mobile-nav nav .nav-num {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  color: var(--label);
}

.mobile-nav-rule {
  height: 1px;
  background: var(--line);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-family: "Geist Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
}

.mobile-nav-links a:hover,
.mobile-nav-links a:focus-visible {
  color: var(--ink);
}

.mobile-nav-note {
  margin-top: auto;
  padding-top: 1.5rem;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--label);
}

/* Above phone width the menu becomes a compact panel anchored under the
   header instead of a full-screen sheet, so small desktop windows and
   tablets get a menu that feels native to the viewport. */
@media (min-width: 741px) and (max-width: 1023px) {
  .mobile-header {
    padding-inline: 1.75rem;
  }

  .mobile-nav {
    inset: 4.1rem 1.75rem auto auto;
    width: min(23rem, calc(100vw - 3.5rem));
    max-height: min(calc(100dvh - 5.5rem), 32rem);
    padding: 1rem 1.1rem 1.2rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.9rem;
    background: var(--card);
    box-shadow: var(--shadow-md);
    transform: translateY(-0.5rem) scale(0.985);
    transform-origin: top right;
  }

  .mobile-nav.is-open {
    transform: none;
  }

  .mobile-nav-inner {
    max-width: none;
    gap: 1rem;
  }

  .mobile-nav nav {
    gap: 0.1rem;
  }

  .mobile-nav nav a {
    padding: 0.42rem 0.55rem;
    border-radius: 0.4rem;
    font-size: 1.05rem;
    transition: color 0.18s ease, background 0.18s ease;
  }

  .mobile-nav nav a:hover,
  .mobile-nav nav a:focus-visible {
    background: var(--g50);
  }

  .mobile-nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    font-size: 10.5px;
  }

  .mobile-nav-note {
    margin-top: 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
  }
}

/* ── Page shell ───────────────────────────────────────────── */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  overflow-x: clip;
}

.content {
  width: min(100% - 2.5rem, var(--content-w));
  margin-inline: auto;
  padding-bottom: 0;
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 5.5rem) 2rem;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2rem;
}

.portrait-wrap {
  position: relative;
  width: min(100%, 15rem);
  margin-inline: auto;
  padding: 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 1.4rem;
  background: var(--g50);
  box-shadow: var(--shadow-sm);
}

.portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1.05rem;
  filter: grayscale(6%);
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-dot {
  position: relative;
  display: inline-block;
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  opacity: 0.22;
  animation: pulse 2.8s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.3; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

.hero h1 {
  margin-top: 1rem;
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-size: clamp(2rem, 7.2vw, 2.9rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.nowrap {
  white-space: nowrap;
}

.lede {
  max-width: 33rem;
  margin-top: 1rem;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--g600);
}

.lede + .lede {
  margin-top: 0.7rem;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.15rem;
  margin-top: 1.35rem;
  font-family: "Geist Mono", monospace;
  font-size: 11.5px;
  color: var(--g500);
}

.social-row a {
  position: relative;
  transition: color 0.18s ease;
}

.social-row a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.social-row a:hover,
.social-row a:focus-visible {
  color: var(--ink);
}

.social-row a:hover::after,
.social-row a:focus-visible::after {
  transform: scaleX(1);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2.25rem;
  border-block: 1px solid var(--line);
  padding-block: 1.15rem;
}

.stat-strip > div {
  min-width: 0;
  padding-inline: 1rem;
  border-left: 1px solid var(--line);
}

.stat-strip > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.stat-value {
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-size: clamp(1.1rem, 3.2vw, 1.35rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.stat-label {
  margin-top: 0.45rem;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label);
}

.focus-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  color: var(--g500);
}

.focus-label {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.focus-dot {
  color: var(--g300);
}

/* ── Interior page hero ───────────────────────────────────── */

.page-hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) 2rem;
}

.page-hero .hero-copy {
  max-width: 38rem;
}

.page-hero h1 {
  max-width: 18ch;
}

/* The product's own mark, shown above the case-study title. */
.case-logo {
  display: block;
  width: min(260px, 60%);
  height: auto;
  margin-bottom: 1.25rem;
  border-radius: 12px;
}

/* ── Sections ─────────────────────────────────────────────── */

.section {
  position: relative;
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--label);
}

.section-num {
  color: var(--label);
}

.section-link,
.section-note {
  flex: none;
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--label);
  white-space: nowrap;
}

.section-link {
  transition: color 0.18s ease;
}

.section-link:hover,
.section-link:focus-visible {
  color: var(--ink);
}

.section-note {
  color: var(--label);
}

/* ── Skills ───────────────────────────────────────────────── */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.9rem;
}

.skill-group {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.skill-title {
  margin: 0 0 0.85rem;
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--label);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-list li {
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--g600);
  background: var(--g50);
}

/* ── Project cards ────────────────────────────────────────── */

.project-card {
  --pad: 1.1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 11rem;
  padding: var(--pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: transform 0.28s var(--ease), border-color 0.22s ease, box-shadow 0.28s var(--ease);
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

/* the card is clickable through the title link; the ::after layer sits under
   any secondary links so they stay separately reachable */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card-link:focus-visible {
  outline: none;
}

.card-link:focus-visible::after {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

/* ── Project previews ─────────────────────────────────────── */

.project-thumb {
  flex: none;
  margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 1rem;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  background: var(--g50);
}

.project-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* A card whose product has a real mark shows it instead of a mock thumbnail. */
.project-thumb.is-brand {
  display: grid;
  place-items: center;
  background: #040a1b;
}

.project-thumb.is-brand img {
  display: block;
  width: 46%;
  max-width: 104px;
  height: auto;
}

.t-dot { fill: var(--g300); }
.t-chip { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.t-rule { stroke: var(--line); stroke-width: 1; }
.t-bar { fill: var(--g300); }
.t-bar.is-soft { fill: var(--g200); }
.t-accent { fill: var(--ink); }
.t-track { fill: var(--g200); }
.t-folder { fill: var(--g400); }
.t-folder.is-soft { fill: var(--g300); }
.t-file { fill: none; stroke: var(--g300); stroke-width: 1.4; }
.t-node { fill: var(--g400); }
.t-node.is-soft { fill: var(--g300); }
.t-link { stroke: var(--g300); stroke-width: 1.4; }
.t-canvas { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }

.card-links {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.card-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--bg);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--g500);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.card-links a:hover,
.card-links a:focus-visible {
  border-color: var(--line-strong);
  color: var(--ink);
}

.project-card.is-static {
  border-style: dashed;
  background: var(--g50);
}

.project-card.is-static:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: "Geist Mono", monospace;
  font-size: 8.5px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g500);
}

.pill-solid {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.card-arrow {
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  color: var(--g300);
  transition: color 0.2s ease, transform 0.25s var(--ease);
}

.project-card:hover .card-arrow {
  color: var(--ink);
  transform: translate(1px, -1px);
}

.project-card h3 {
  margin-top: 1.15rem;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.project-card p {
  margin-top: 0.4rem;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--g500);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--label);
}

.card-meta span + span::before {
  content: "·";
  margin-right: 0.5rem;
  color: var(--g300);
}

/* ── Certifications ───────────────────────────────────────── */

.cert-card {
  display: flex;
  flex-direction: column;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.2s ease, box-shadow 0.28s var(--ease), transform 0.28s var(--ease);
}

.cert-card:hover,
.cert-card:focus-within {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cert-preview {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--g50);
  overflow: hidden;
  cursor: zoom-in;
}

.cert-preview img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s var(--ease);
}

.cert-preview:hover img,
.cert-preview:focus-visible img {
  transform: scale(1.015);
}

.cert-preview:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.cert-preview-hint {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: "Geist Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g600);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cert-preview:hover .cert-preview-hint,
.cert-preview:focus-visible .cert-preview-hint {
  opacity: 1;
  transform: none;
}

.cert-body {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1;
  min-width: 0;
  padding: 0.85rem 0 0;
}

.cert-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.cert-issuers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

/* Issuer stamps are paper, like the certificate they sit above. The edge is
   drawn with ink, not --line: --line is a near-black hairline in dark mode,
   so it would ring each white chip in black. In light mode it resolves to the
   faint grey edge these already had. */
.cert-issuer-logo {
  display: block;
  flex: none;
  width: auto;
  height: 2rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 0.3rem;
  background: var(--paper);
}

.cert-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--g500);
}

.cert-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.9rem;
}

.cert-date {
  font-family: "Geist Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
}

.cert-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.cert-link {
  flex: none;
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--label);
  transition: color 0.18s ease;
}

.cert-link:hover,
.cert-link:focus-visible {
  color: var(--ink);
}

/* ── Certificate lightbox ─────────────────────────────────── */

.cert-dialog {
  width: min(96vw, 60rem);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

.cert-dialog::backdrop {
  background: rgba(6, 6, 8, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.cert-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  border: 1px solid var(--line-strong);
  border-radius: 0.9rem;
  background: var(--bg);
  overflow: hidden;
}

.cert-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.cert-dialog-title {
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g500);
}

.cert-dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cert-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--bg);
  color: var(--g500);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.cert-dialog-close:hover,
.cert-dialog-close:focus-visible {
  border-color: var(--line-strong);
  color: var(--ink);
}

.cert-dialog-close svg {
  width: 0.9rem;
  height: 0.9rem;
}

.cert-dialog-body {
  padding: 0.8rem;
  background: var(--g50);
  overflow: auto;
}

.cert-dialog-body img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
}

/* ── Listing grid ───────────────────────────────────────────── */

/* The full listing lives on its own page: every project or certificate
   visible at once, ordered by value. */
.sortable-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
}

@media (min-width: 640px) {
  .sortable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

.sortable-grid .project-card,
.sortable-grid .cert-card {
  height: 100%;
}

/* An empty collection's note spans the whole grid. */
.sortable-grid > .deck-note {
  grid-column: 1 / -1;
}

.sort-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
}

.sort-legend b {
  font-weight: 400;
  color: var(--g500);
}

/* A lone project should read as featured, not as a half-empty row. */
@media (min-width: 900px) {
  .projects-page .sortable-grid:has(> .project-card:only-child) {
    grid-template-columns: minmax(0, 34rem);
    justify-content: center;
  }

  .projects-page .sortable-grid:has(> .project-card:only-child) + .sort-legend {
    justify-content: center;
  }
}

/* ── Certification listing ─────────────────────────────────── */

/* Ten credentials: a wider sheet and compact horizontal cards keep the
   whole set scannable without shrinking the type. */
@media (min-width: 1024px) {
  .certs-page .content {
    width: min(100% - 2.5rem, 64rem);
  }

  .certs-page .cert-card {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 1rem;
    align-items: start;
  }

  .certs-page .cert-issuers {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-content: center;
    margin-bottom: 0.55rem;
  }

  .certs-page .cert-preview {
    grid-column: 1;
    grid-row: 2;
  }

  .certs-page .cert-body {
    grid-column: 2;
    grid-row: 2;
    height: 100%;
    padding-top: 0.15rem;
  }
}

/* ── Card decks ───────────────────────────────────────────── */

/* A hand of cards: one card in front, the neighbours peeking out at an
   angle behind it. Rotate with the arrows, a swipe, or by clicking a
   neighbour. */
.deck {
  --deck-fan: 5deg;
  --deck-shift: 3.5%;
  --deck-w: 30rem;
}

.deck-stage {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  padding-block: 1.5rem 2.7rem;
  touch-action: pan-y;
  outline: none;
}

.deck-stage:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 8px;
  border-radius: var(--radius);
}

/* A one-card deck has nothing to rotate; the arrows and counter go away. */
.deck.is-single .deck-bar {
  display: none;
}

.deck-card {
  --deck-t: translate3d(0, 0, 0) rotate(0deg) scale(1);
  grid-area: 1 / 1;
  width: min(76%, var(--deck-w));
  transform: var(--deck-t);
  transform-origin: 50% 100%;
  transition: transform 0.55s var(--ease), opacity 0.4s ease, visibility 0.4s ease;
  will-change: transform;
}

/* the card keeps its own hover lift, the deck owns the transform */
.deck-card:hover,
.deck-card:focus-within {
  transform: var(--deck-t);
}

/* Neighbours show their paper and artwork, never their text: clipped
   sentences in the fan read as a bug, not as a stack. */
.deck-card > * {
  transition: opacity 0.35s ease;
}

.deck-card[data-deck-pos="left"] > :not(.cert-preview):not(.cert-issuers):not(.project-thumb),
.deck-card[data-deck-pos="right"] > :not(.cert-preview):not(.cert-issuers):not(.project-thumb) {
  opacity: 0;
}

.deck-card[data-deck-pos="front"] {
  z-index: 3;
}

.deck-card[data-deck-pos="right"] {
  --deck-t: translate3d(var(--deck-shift), -0.9rem, 0) rotate(var(--deck-fan)) scale(0.95);
  z-index: 2;
  cursor: pointer;
}

.deck-card[data-deck-pos="left"] {
  --deck-t: translate3d(calc(var(--deck-shift) * -1), -0.9rem, 0) rotate(calc(var(--deck-fan) * -1)) scale(0.95);
  z-index: 1;
  cursor: pointer;
}

.deck-card[data-deck-pos="back"] {
  --deck-t: translate3d(0, 2.6rem, 0) scale(0.9);
  opacity: 0;
  visibility: hidden;
  z-index: 0;
  pointer-events: none;
}

.deck-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.deck-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--g500);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.deck-btn:hover,
.deck-btn:focus-visible {
  border-color: var(--line-strong);
  background: var(--g50);
  color: var(--ink);
}

.deck-btn svg {
  width: 1rem;
  height: 1rem;
}

.deck-status {
  min-width: 3.5rem;
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--label);
  font-variant-numeric: tabular-nums;
}

.deck-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.15rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--label);
}

.deck-note-mark {
  letter-spacing: 0.2em;
}

/* On phones the fan becomes a tight stack: the neighbours peek above the
   front card instead of rotating under it, so no card text can escape. */
@media (max-width: 740px) {
  .deck {
    --deck-fan: 0deg;
    --deck-shift: 0;
  }

  .deck-card {
    width: min(92%, var(--deck-w));
  }

  .deck-card[data-deck-pos="right"] {
    --deck-t: translate3d(0.4rem, -0.55rem, 0) scale(1);
  }

  .deck-card[data-deck-pos="left"] {
    --deck-t: translate3d(-0.4rem, -0.55rem, 0) scale(1);
  }
}

/* ── Long-form case study ─────────────────────────────────── */

.prose p {
  margin: 0 0 0.85rem;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--g600);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

code {
  padding: 0.08em 0.32em;
  border: 1px solid var(--line);
  border-radius: 0.28rem;
  background: var(--g50);
  font-family: "Geist Mono", monospace;
  font-size: 0.87em;
  color: var(--ink);
  white-space: nowrap;
}

.pullquote {
  margin: 0 0 1.25rem;
  padding: 0.15rem 0 0.15rem 1.15rem;
  border-left: 2px solid var(--ink);
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0 0 1.15rem 2.7rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15rem;
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--label);
}

.steps strong {
  display: block;
  margin-bottom: 0.18rem;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.steps span {
  display: block;
  font-size: 13px;
  line-height: 1.65;
  color: var(--g600);
}

.boundary {
  display: grid;
  gap: 0.7rem;
}

.boundary-card {
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.boundary-card.is-ok {
  background: var(--g50);
}

.boundary-card .tag {
  display: block;
  margin-bottom: 0.4rem;
  font-family: "Geist Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
}

.boundary-card h3 {
  margin-bottom: 0.3rem;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.boundary-card p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--g600);
}

.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.spec th,
.spec td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.spec th {
  font-family: "Geist Mono", monospace;
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
}

.spec td {
  line-height: 1.55;
  color: var(--g600);
}

.spec td:first-child {
  color: var(--ink);
}

@media (max-width: 640px) {
  .spec,
  .spec tbody,
  .spec tr,
  .spec td {
    display: block;
    width: 100%;
  }

  .spec thead {
    display: none;
  }

  .spec tr {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
  }

  .spec td {
    padding: 0 0 0.35rem;
    border: none;
  }

  .spec td:first-child {
    padding-bottom: 0.45rem;
    font-weight: 600;
  }
}

/* ── Learning rows ────────────────────────────────────────── */

.row-list {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.35rem 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}

.row-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  grid-column: 1;
  grid-row: 1;
  font-family: "Geist Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
}

.row-main {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

.row-status .status-dot {
  width: 4px;
  height: 4px;
}

.row-status .status-dot::after {
  display: none;
}

.row-main h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  margin-right: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--g50);
  color: var(--g500);
  vertical-align: -0.25rem;
}

.row-icon svg {
  width: 0.78rem;
  height: 0.78rem;
}

.row-main p {
  margin-top: 0.15rem;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--g500);
}

.row-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 0.1rem;
}

.row-link {
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
  white-space: nowrap;
  transition: color 0.18s ease;
}

.row-link:hover,
.row-link:focus-visible {
  color: var(--ink);
}

.stack-block {
  margin-top: 1.5rem;
}

.stack-label {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.chip {
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--g600);
}

/* ── GitHub contributions ─────────────────────────────────── */

.contrib-card {
  margin: 0;
  padding: 1rem 1.1rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.contrib-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.contrib-total {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: -0.01em;
}

.contrib-total span:last-child {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
}

.contrib-range {
  flex: none;
  font-family: "Geist Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
  white-space: nowrap;
}

.heatmap-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.heatmap-scroll::-webkit-scrollbar {
  height: 4px;
}

.heatmap-scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
}

.heatmap-scroll:focus-visible {
  outline-offset: 2px;
}

.heatmap {
  --cell: 9px;
  --cell-gap: 2px;
  --day-col: 22px;
  width: max-content;
  min-width: 100%;
  padding-block: 0.1rem 0.2rem;
}

.heatmap-months {
  display: grid;
  grid-template-columns: repeat(53, var(--cell));
  gap: var(--cell-gap);
  height: 0.9rem;
  margin-left: calc(var(--day-col) + 6px);
  font-family: "Geist Mono", monospace;
  font-size: 8px;
  line-height: 1;
  color: var(--label);
}

.heatmap-months span {
  white-space: nowrap;
}

.heatmap-body {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.heatmap-days {
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  gap: var(--cell-gap);
  width: var(--day-col);
  flex: none;
  font-family: "Geist Mono", monospace;
  font-size: 7.5px;
  line-height: var(--cell);
  color: var(--label);
  text-align: right;
}

.heatmap-days span {
  visibility: hidden;
}

.heatmap-days span:nth-child(2),
.heatmap-days span:nth-child(4),
.heatmap-days span:nth-child(6) {
  visibility: visible;
}

.heatmap-weeks {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--cell));
  grid-auto-columns: var(--cell);
  gap: var(--cell-gap);
  flex: none;
}

.heat-cell {
  display: block;
  width: var(--cell);
  height: var(--cell);
  border-radius: 2px;
  background: var(--heat-0);
}

.heat-cell[data-level="0"] { background: var(--heat-0); }
.heat-cell[data-level="1"] { background: var(--heat-1); }
.heat-cell[data-level="2"] { background: var(--heat-2); }
.heat-cell[data-level="3"] { background: var(--heat-3); }
.heat-cell[data-level="4"] { background: var(--heat-4); }

.heatmap-weeks .heat-cell:hover {
  outline: 1px solid var(--ink);
  outline-offset: 1px;
}

.heatmap-skeleton {
  width: 100%;
  height: 4.7rem;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, var(--g100) 25%, var(--g200) 50%, var(--g100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.heatmap-error {
  padding: 1.4rem 0.25rem;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--g500);
}

.heatmap-error a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 683px) {
  /* Fit the full year at every width. Size from the card's content box
     (container query units), not 100vw, so a classic scrollbar cannot
     eat the headroom. 53 columns + 52 one-pixel gaps. */
  .contrib-card {
    container-type: inline-size;
  }

  .heatmap {
    /* Fallback for browsers without container query units. */
    --cell: clamp(3px, calc((100vw - 136px) / 53), 9px);
    --cell-gap: 1px;
  }

  @supports (container-type: inline-size) {
    .heatmap {
      --cell: clamp(3px, calc((100cqw - 56px) / 53), 10px);
    }
  }

  .heat-cell {
    border-radius: 1px;
  }

  .heatmap-body {
    gap: 0;
  }

  .heatmap-days {
    display: none;
  }

  .heatmap-months {
    margin-left: 0;
    font-size: 7px;
  }
}

.contrib-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.contrib-note {
  font-family: "Geist Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: "Geist Mono", monospace;
  font-size: 8px;
  color: var(--label);
}

.heatmap-legend span:first-child { margin-right: 3px; }
.heatmap-legend span:last-child { margin-left: 3px; }

.heatmap-legend .heat-cell {
  width: 8px;
  height: 8px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ── Contact ──────────────────────────────────────────────── */

.contact-section {
  border-top: 0;
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--card-gradient);
}

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

.contact-card h2 {
  margin-top: 0.7rem;
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-size: clamp(1.45rem, 5vw, 2.05rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.contact-lede {
  max-width: 28rem;
  margin-top: 0.7rem;
  font-size: 13px;
  line-height: 1.65;
  color: var(--g500);
}

.contact-email {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.35rem;
}

.contact-email a {
  font-size: clamp(13px, 3.4vw, 16px);
  font-weight: 600;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.1rem;
  overflow-wrap: anywhere;
  transition: border-color 0.18s ease;
}

.contact-email a:hover,
.contact-email a:focus-visible {
  border-color: var(--ink);
}

.copy-btn {
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g500);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.copy-btn:hover,
.copy-btn:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
}

.copy-btn[disabled] {
  cursor: default;
  color: var(--label);
}

.contact-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label);
}

.contact-meta a {
  transition: color 0.18s ease;
}

.contact-meta a:hover,
.contact-meta a:focus-visible {
  color: var(--ink);
}

.contact-dot {
  color: var(--g300);
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  padding-block: 1.4rem 2rem;
  border-top: 1px solid var(--line);
  font-family: "Geist Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--label);
}

/* ── Reveal animation ─────────────────────────────────────── */

.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease, transform 0.65s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

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

@media (min-width: 560px) {
  .hero h1 {
    font-size: clamp(2.2rem, 5.4vw, 2.9rem);
  }
}

@media (min-width: 640px) {
  .content {
    width: min(100% - 4rem, var(--content-w));
  }

  .hero {
    padding-block: 5rem 2.25rem;
  }

  .hero-grid {
    grid-template-columns: 13rem minmax(0, 1fr);
    align-items: start;
    gap: 2.4rem;
  }

  .portrait-wrap {
    width: 100%;
    margin-inline: 0;
  }

  .hero h1 {
    margin-top: 0.85rem;
  }

  .row {
    grid-template-columns: 7.5rem minmax(0, 1fr) auto;
    grid-template-rows: auto;
    gap: 1rem;
    align-items: center;
    padding-block: 1.05rem;
  }

  .row-status {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .row-main {
    grid-column: 2;
    grid-row: 1;
  }

  .row-links {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    margin-top: 0;
    flex-wrap: nowrap;
  }

  .section {
    padding-block: 3rem;
  }

  .section-head {
    margin-bottom: 1.75rem;
  }

  .project-card {
    --pad: 1.2rem;
  }

  .cert-card {
    padding: 0.65rem 0.65rem 0.9rem;
  }
}

@media (min-width: 1024px) {
  .mobile-header,
  .mobile-nav {
    display: none;
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    left: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    padding: 2rem 1.6rem 1.6rem;
    border-right: 1px solid var(--line);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.35s var(--ease), visibility 0s linear 0.35s;
  }

  body.is-sidebar-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.35s var(--ease), visibility 0s;
  }

  .deck {
    --deck-fan: 8deg;
    --deck-shift: 6%;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(6, 6, 8, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.is-sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-dock {
    position: fixed;
    top: 1.15rem;
    left: 1.15rem;
    z-index: 46;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.8rem 0.45rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s, border-color 0.18s ease;
  }

  .sidebar-dock-main {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
  }

  /* a 44px hit area without growing the pill */
  .sidebar-dock-main::after {
    content: "";
    position: absolute;
    inset: -6px -4px;
    border-radius: 0.7rem;
  }

  .sidebar-dock:hover,
  .sidebar-dock:focus-within {
    border-color: var(--line-strong);
  }

  body.is-sidebar-open .sidebar-dock {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .sidebar-dock-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.45rem;
    background: var(--g50);
    font-family: "Geist Mono", monospace;
    font-size: 9.5px;
  }

  .theme-toggle-dock {
    position: relative;
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-color: var(--line);
    background: var(--bg);
  }

  .theme-toggle-dock::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
  }

  .sidebar-dock-label {
    font-family: "Geist Mono", monospace;
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--g500);
  }

  .nav-group {
    gap: 0.15rem;
  }

  .nav-group a {
    width: calc(100% + 1rem);
    margin-inline: -0.5rem;
    padding: 0.32rem 0.5rem;
    border-radius: 0.4rem;
    transition: color 0.18s ease, background 0.18s ease;
  }

  .nav-group a:hover,
  .nav-group a:focus-visible,
  .nav-group a[aria-current="true"],
  .nav-group a[aria-current="page"] {
    background: var(--g50);
  }

  .nav-rule {
    margin-block: 0.9rem;
  }

  .page {
    margin-left: 0;
  }

  .content {
    width: min(100% - 4rem, var(--content-w));
    padding-bottom: 0;
  }

  .hero {
    padding-block: 4.5rem 2.25rem;
  }

  .hero-halftone {
    right: -5rem;
    width: 22rem;
    height: 22rem;
  }

  .section {
    padding-block: 3.25rem;
  }

  .contact-section {
    padding-top: 1rem;
  }
}

@media (min-width: 1280px) {
  :root {
    --content-w: 46rem;
  }

  .hero-grid {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 2.75rem;
  }

  /* the column can afford to be wider here, but prose should not */
  .content p {
    max-width: 68ch;
  }
}

@media (min-width: 1600px) {
  :root {
    --content-w: 50rem;
  }

  .deck {
    --deck-w: 34rem;
  }
}

@media (max-width: 380px) {
  .content {
    width: min(100% - 2rem, var(--content-w));
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .stat-strip > div {
    padding-inline: 0.6rem;
  }

  .stat-label {
    font-size: 9.5px;
    letter-spacing: 0.07em;
  }

  .contrib-card {
    padding: 0.9rem 0.8rem 0.8rem;
  }

  .contrib-head {
    gap: 0.5rem;
  }

  .contrib-range {
    font-size: 8px;
  }
}

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

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── Projects sub-navigation ───────────────────────────────── */

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin: 0 0 1.6rem;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.subnav-link {
  color: var(--g400);
  text-decoration: none;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid transparent;
}

.subnav-link:hover,
.subnav-link:focus-visible {
  color: var(--ink);
}

.subnav-link.is-current {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ── Practice write-ups ─────────────────────────────────────── */

.toc {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 2.2rem;
  padding: 0 0 1.2rem;
  border-bottom: 1px solid var(--line);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
}

.toc a {
  color: var(--g400);
  text-decoration: none;
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--ink);
}

.detail-head {
  margin: 0 0 2rem;
}

.detail-head h1 {
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-size: clamp(2rem, 7.2vw, 2.9rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0.5rem 0 0.6rem;
}

.detail-head .card-meta {
  margin-top: 0.9rem;
}

.readme {
  max-width: 46rem;
  font-size: 0.95rem;
  line-height: 1.72;
}

.readme h1,
.readme h2,
.readme h3 {
  font-family: "Geist Pixel", "Geist Mono", monospace;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 1.8rem 0 0.5rem;
}

.readme h3 {
  color: var(--label);
}

.readme p {
  margin: 0 0 0.9rem;
}

.readme ul,
.readme ol {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
}

.readme pre {
  background: var(--g50);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.8rem 1rem;
  overflow-x: auto;
  font-family: "Geist Mono", monospace;
  font-size: 0.8rem;
}

.readme code {
  font-family: "Geist Mono", monospace;
  font-size: 0.85em;
}

.readme table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.readme th,
.readme td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.readme blockquote {
  margin: 0 0 0.9rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line-strong);
  color: var(--g400);
}

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.4rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
}

.page-nav a {
  color: var(--ink);
  text-decoration: none;
}

/* ── Print ────────────────────────────────────────────────── */

@media print {
  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .grid-bg,
  .sidebar-dock,
  .mobile-header,
  .mobile-nav,
  .deck-btn,
  .deck-status,
  .skip-link {
    display: none !important;
  }
}
