/* ============================================
   site.css — Jawad Alsahlani portfolio
   Light, document-like layout with glass panels.
   Breakpoints: 720px (mid), 1024px (wide), 1100px (nav)
   ============================================ */

/* ---------- tokens ---------- */
:root {
  --navy: #081D5F;
  --ink: #414b5c;
  --muted: #5f6b7d;
  --faint: #7889a0;
  --brand: #2C66AB;
  --brand-hover: #22579A;
  --accent: #49A1DD;
  --wash: #e9f4fb;
  --line: #e4ecf3;
  --line-soft: rgba(8, 29, 95, 0.08);
  --line-glass: rgba(8, 29, 95, 0.1);

  --font-display: Outfit, Inter, sans-serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 72px;
  --pad-x: 20px;
  --max: 1240px;

  --h1: min(48px, calc((100vw - 40px) / 7.4));  /* keeps the name on one line on small phones */
  --h2: 30px;
  --lead: 20px;
  --section-gap: 112px;

  --shadow-glass: 0 12px 60px rgba(44, 102, 171, 0.2), inset 0 0 0 1px rgba(214, 226, 234, 0.55);
}

@media (min-width: 720px) {
  :root { --pad-x: 32px; --h1: 68px; --h2: 36px; --lead: 24px; }
}
@media (min-width: 1024px) {
  :root { --h1: 88px; }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, figure { margin: 0; }
img, video, canvas, iframe { display: block; }

::selection { background: var(--wash); color: var(--navy); }

a { color: var(--brand); text-decoration: none; transition: color 150ms; }
a:hover { color: var(--brand-hover); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: inherit;
}
button:disabled { cursor: default; }

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

strong { font-weight: 500; color: var(--navy); }

kbd {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--wash);
  color: inherit;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 9999px;
  background: var(--navy);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform 250ms var(--ease);
}
.skip-link:focus { transform: none; color: #ffffff; }

.noscript {
  position: relative;
  z-index: 20;
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--pad-x);
  font-size: 15px;
}

/* ---------- shared bits ---------- */
.glass {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: var(--shadow-glass);
}

.glass-pill {
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--brand);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  transition: background-color 150ms, transform 250ms var(--ease);
}
.btn:hover { background: var(--brand-hover); color: #ffffff; }
.btn:active { transform: scale(0.98); }
.btn--sm { min-height: 44px; padding: 10px 20px; font-size: 14px; flex-shrink: 0; }
.btn--lg { min-height: 56px; padding: 16px 28px; font-size: 16px; }
.btn--block { display: flex; width: 100%; }

.text-link--strong {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--navy);
  box-shadow: inset 0 -2px 0 var(--accent);
  transition: color 150ms, box-shadow 250ms var(--ease);
}
.text-link--strong:hover { color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); }

/* Inline tech list: "React, TypeScript, Supabase" where known skills are links */
.tags {
  margin-top: 16px;
  max-width: 64ch;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}
.tag { color: var(--muted); white-space: nowrap; }
.tag--link {
  color: var(--ink);
  box-shadow: inset 0 -1px 0 rgba(73, 161, 221, 0.45);
  transition: color 150ms, box-shadow 200ms;
}
.tag--link:hover { color: var(--brand); box-shadow: inset 0 -1px 0 var(--brand); }
.tags__toggle { font-weight: 500; color: var(--brand); transition: color 150ms; }
.tags__toggle:hover { color: var(--brand-hover); }

.related {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}
.related__link { font-weight: 500; color: var(--brand); transition: color 150ms; }
.related__link:hover { color: var(--brand-hover); }

.minor-title { font-size: 14px; font-weight: 600; color: var(--navy); }
.minor-sub { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---------- backdrop + particles ---------- */
.backdrop {
  pointer-events: none;
  position: fixed;
  inset: 0 0 auto 0;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  background: radial-gradient(110% 90% at 50% 10%, var(--wash) 0%, #ffffff 60%);
}
.backdrop__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 600ms ease;
}
.backdrop__canvas.is-live { opacity: 1; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-header__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--navy);
  white-space: nowrap;
}
.site-header__name:hover { color: var(--navy); }

.site-nav {
  position: relative;
  display: none;
  align-items: center;
  gap: 28px;
}
@media (min-width: 1100px) { .site-nav { display: flex; } }

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 150ms;
}
.site-nav__link:hover,
.site-nav__link.is-active { color: var(--navy); }

.site-nav__line {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0;
  transition: transform 420ms var(--ease), width 420ms var(--ease), opacity 250ms ease;
}
.site-nav__line.is-on { opacity: 1; }
.site-nav__line.no-anim { transition: opacity 250ms ease; }

.site-header__end { display: flex; align-items: center; gap: 4px; }
/* "Get in touch" lives in the header; on very small phones it moves into the menu */
@media (max-width: 369px) { .site-header__cta { display: none; } }
@media (min-width: 370px) { .site-menu__cta { display: none; } }

/* ---------- menu (below the width where the nav fits) ---------- */
/* two lines that turn into an X; the lines sit on the content edge */
.menu-btn {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-right: -13px;
  border-radius: 9999px;
  color: var(--navy);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms;
}
@media (hover: hover) { .menu-btn:hover { background: rgba(73, 161, 221, 0.09); } }
.menu-btn span {
  position: absolute;
  left: 13px;
  right: 13px;
  top: calc(50% - 1px);
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 420ms var(--ease);
}
.menu-btn span:first-child { transform: translateY(-4px); }
.menu-btn span:last-child { transform: translateY(4px); }
.menu-btn[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }
@media (min-width: 1100px) { .menu-btn { display: none; } }

.site-menu {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 49;
  visibility: hidden;
  transition: visibility 0s linear 420ms;
}
.site-menu.is-open { visibility: visible; transition: visibility 0s; }
.site-menu__scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 29, 95, 0.12);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  touch-action: none;
  transition: opacity 320ms ease;
}
.site-menu.is-open .site-menu__scrim { opacity: 1; }
/* the panel unrolls from under the header (the clip leaves room for its shadow) */
.site-menu__panel {
  position: relative;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0 28px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(8, 29, 95, 0.14);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 420ms var(--ease);
}
.site-menu.is-open .site-menu__panel { clip-path: inset(0 0 -90px 0); }
.site-menu__link,
.site-menu__foot {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 200ms ease, transform 420ms var(--ease), color 150ms;
}
.site-menu.is-open .site-menu__link,
.site-menu.is-open .site-menu__foot {
  opacity: 1;
  transform: none;
  transition: opacity 320ms ease calc(60ms + var(--i, 0) * 30ms), transform 520ms var(--ease) calc(60ms + var(--i, 0) * 30ms), color 150ms;
}
.site-menu__link {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--navy);
  -webkit-tap-highlight-color: transparent;
}
.site-menu__link span { box-shadow: inset 0 -2px 0 transparent; transition: box-shadow 250ms var(--ease); }
/* the section you're in carries the same accent line as the header nav */
.site-menu__link.is-active span { box-shadow: inset 0 -2px 0 var(--accent); }
@media (hover: hover) { .site-menu__link:hover { color: var(--brand); } }
.site-menu__foot { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }

/* ---------- main stacking ---------- */
main, .site-footer { position: relative; z-index: 10; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
}
.hero__inner { padding-bottom: 96px; }

.hero__name {
  max-width: 14ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--h1);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.hero__lead {
  margin-top: 20px;
  max-width: 46ch;
  font-size: var(--lead);
  line-height: 1.45;
  color: var(--navy);
  text-wrap: pretty;
}
.hero__link {
  color: inherit;
  box-shadow: inset 0 -2px 0 var(--accent);
  transition: color 150ms, box-shadow 200ms;
}
.hero__link:hover { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.hero__bio {
  margin-top: 12px;
  max-width: 58ch;
  font-size: 15px;
  line-height: 1.625;
  text-wrap: pretty;
}
.hero__meta { margin-top: 12px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.hero__actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
}
.hero__cue {
  position: absolute;
  bottom: 20px;
  left: 50%;
  translate: -50% 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--brand);
  animation: cue-pulse 1.8s ease-in-out infinite;
}
.hero__cue:hover { color: var(--brand-hover); }

/* ---------- github activity ---------- */
.activity { position: relative; padding-top: var(--section-gap); }

.activity__intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 56px;
  align-items: end;
}
.activity__title {
  max-width: 14ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--h2);
  line-height: 1.15;
  color: var(--navy);
}
.activity__stats { font-size: 16px; line-height: 1.65; text-wrap: pretty; }
.activity__stats b { color: var(--navy); font-weight: 600; }
.activity__sub { margin-top: 10px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.activity__sub a { font-weight: 500; }

.graph { position: relative; margin-top: 40px; }
.graph__viewport {
  position: relative;
  height: 320px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 60px rgba(44, 102, 171, 0.16), inset 0 0 0 1px rgba(214, 226, 234, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  cursor: ns-resize;
  touch-action: pan-y;
}
.graph__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 600ms ease; }
.graph__canvas.is-live { opacity: 1; }
.graph__month {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 7px 16px;
  box-shadow: 0 2px 12px rgba(44, 102, 171, 0.12);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.graph__month:empty { display: none; }
.graph__month:not(:empty) { animation: fade-in 400ms ease both; }
.graph__legend {
  position: absolute;
  left: 18px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
}
.graph__legend span:first-child { margin-right: 3px; }
.graph__legend span:last-child { margin-left: 3px; }
.graph__legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.graph__tooltip {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 0s linear 140ms;
  z-index: 5;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(8, 29, 95, 0.92);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 12px 40px rgba(8, 29, 95, 0.25);
}
.graph__tooltip.is-on { opacity: 1; visibility: visible; transition: opacity 140ms ease, visibility 0s; }
.graph__tooltip strong { color: #ffffff; font-weight: 600; }
.graph__fallback { padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }

.activity__details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px 72px;
  padding-top: 48px;
}

/* account tabs: same sliding accent line as the header nav */
.scopes {
  grid-column: 1 / -1;
  position: relative;
  display: flex;
  gap: 26px;
  margin-bottom: -12px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: inset 0 -1px 0 var(--line);
}
.scopes::-webkit-scrollbar { display: none; }
@media (max-width: 719px) {
  /* hint that the row scrolls sideways */
  .scopes { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
}
.scopes[hidden] { display: none; }
.scope {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 150ms;
}
.scope:hover, .scope.is-active { color: var(--navy); }
.scope__count { font-size: 12px; font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; }
.scopes__line {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: transform 420ms var(--ease), width 420ms var(--ease), opacity 250ms ease;
}
.scopes__line.is-on { opacity: 1; }
.scopes__line.no-anim { transition: opacity 250ms ease; }

.avatar {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--wash);
  box-shadow: 0 0 0 1px rgba(8, 29, 95, 0.08);
}
.avatar--sm { width: 16px; height: 16px; border-radius: 4px; }
.avatar--initials {
  display: inline-grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: var(--navy);
}
.avatar--sm.avatar--initials { font-size: 7px; }

/* segments are placed by left + width (set in JS) so they slide and resize between accounts */
.langs__bar {
  position: relative;
  margin-top: 16px;
  height: 8px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
}
.langs__bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--c);
  cursor: pointer;
  transition: left 560ms var(--ease), width 560ms var(--ease), opacity 250ms ease;
}
.langs__bar span[data-lang="Other"] { cursor: default; }
.langs__bar.has-sel span:not(.is-sel) { opacity: 0.25; }
.langs__bar span.is-leaving { opacity: 0; pointer-events: none; }

.langs__legend {
  margin: 14px 0 0 -10px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}
.lang {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  transition: color 150ms, background-color 200ms, box-shadow 200ms, opacity 250ms;
}
.lang:hover { background: rgba(73, 161, 221, 0.09); color: var(--navy); }
.lang[hidden] { display: none; }
.lang.is-sel { background: var(--wash); color: var(--navy); box-shadow: inset 0 0 0 1px rgba(73, 161, 221, 0.35); }
.langs__legend.has-sel .lang:not(.is-sel):not(.lang--more) { opacity: 0.6; }
.langs__legend.has-sel .lang:not(.is-sel):hover { opacity: 1; }
.lang i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.lang__pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.lang--more { font-weight: 500; color: var(--brand); }

/* language breakdown: folds open under the legend */
.lang-detail {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 420ms var(--ease), opacity 300ms ease, visibility 0s linear 420ms;
}
.lang-detail.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 420ms var(--ease), opacity 300ms ease, visibility 0s;
}
/* the clip must not cut the panel's shadow: pad it out, then cancel the padding with margins */
.lang-detail__clip { min-height: 0; overflow: hidden; margin: 0 -20px -28px; padding: 0 20px 28px; }
.lang-detail__body {
  margin: 14px 0 4px;
  padding: 16px 18px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 22px rgba(44, 102, 171, 0.12), inset 0 0 0 1px rgba(214, 226, 234, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.lang-detail__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 2px 12px;
}
.lang-detail__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  color: var(--navy);
}
.lang-detail__name i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.lang-detail__meta { grid-column: 1; font-size: 13px; color: var(--muted); }
.lang-detail__close {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: relative;
  width: 32px;
  height: 32px;
  margin: -4px -6px 0 0;
  border-radius: 9999px;
  transition: background-color 150ms, transform 300ms var(--ease);
}
.lang-detail__close:hover { background: rgba(255, 255, 255, 0.9); transform: rotate(90deg); }
.lang-detail__close span {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 15px;
  height: 2px;
  border-radius: 1px;
  background: var(--navy);
  transform: rotate(45deg);
}
.lang-detail__close span + span { transform: rotate(-45deg); }
.lang-detail__rows { margin: 12px 0 0; padding: 0; list-style: none; }
.lang-detail__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(36px, 24%) 46px;
  align-items: center;
  gap: 14px;
  min-height: 36px;
  font-size: 14px;
  border-top: 1px solid var(--line-soft);
}
.lang-detail__track { height: 6px; border-radius: 3px; background: rgba(8, 29, 95, 0.06); overflow: hidden; }
.lang-detail__track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--c);
  transform-origin: left;
  animation: grow 640ms var(--ease) var(--d, 0ms) both;
}
/* the rest of the repos: a fold that eases open, its bars growing as it does */
.lang-detail__more {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 460ms var(--ease), opacity 260ms ease, visibility 0s linear 460ms;
}
.lang-detail__more.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 460ms var(--ease), opacity 320ms ease 60ms, visibility 0s;
}
.lang-detail__more-clip { min-height: 0; overflow: hidden; }
.lang-detail__more .lang-detail__rows { margin-top: 0; }
.lang-detail__more .lang-detail__track i { animation: none; transform: scaleX(0); transition: transform 640ms var(--ease); }
.lang-detail__more.is-open .lang-detail__track i { transform: none; transition-delay: calc(var(--d, 0ms) + 80ms); }
.lang-detail__pct {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.lang-detail__foot { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* repo names: linked ones carry the same underline as linked tags */
.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
  color: var(--navy);
  font-weight: 500;
}
.repo-link > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-link--item > span:last-child,
.repo-link--out > span:last-child { box-shadow: inset 0 -1px 0 rgba(73, 161, 221, 0.45); transition: box-shadow 200ms; }
.repo-link--item:hover, .repo-link--out:hover { color: var(--brand); }
.repo-link--item:hover > span:last-child,
.repo-link--out:hover > span:last-child { box-shadow: inset 0 -1px 0 var(--brand); }

.repos__table {
  margin-top: 6px;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.repos__col-lang { width: 116px; }
.repos__col-num { width: 64px; }
.repos__table tr { border-bottom: 1px solid var(--line); }
.repos__table td { padding: 12px; white-space: nowrap; }
.repos__table td:first-child { padding-left: 0; overflow: hidden; text-overflow: ellipsis; }
.repos__table td:last-child {
  padding-right: 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--navy);
}
.repo__desc { display: none; margin-left: 10px; color: var(--muted); vertical-align: middle; }
.repo__lang { color: var(--muted); }

.is-swapping { opacity: 0 !important; }
/* a box easing to a new height (motion.js) clips what is still arriving or leaving */
.is-easing { overflow: hidden; }

/* ---------- content grid + contact rail ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 72px;
}
.layout__aside {
  grid-row: 1;
  position: relative;
  z-index: 40;
  padding: 72px 0 0;
}
.layout__main { grid-row: 2; min-width: 0; }

.contact-rail { max-width: 560px; }

.contact-card {
  padding: 28px;
  border-radius: 16px;
  transition: box-shadow 400ms var(--ease);
}
.contact-card.is-flash { box-shadow: 0 0 0 3px var(--accent), 0 12px 60px rgba(44, 102, 171, 0.28); }
.contact-card__who { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.contact-card__photo {
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  object-fit: cover;
  background: var(--wash);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(44, 102, 171, 0.3);
}
.contact-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  color: var(--navy);
}
.contact-card__place { font-size: 13px; line-height: 1.5; color: var(--muted); }
.contact-card__rows { margin-top: 20px; border-top: 1px solid var(--line-glass); }
/* rows bleed 12px for the hover fill; the divider stays aligned with the card content */
.contact-card__row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 0 -12px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  transition: background-color 150ms, color 150ms;
}
.contact-card__row::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: var(--line-glass);
}
.contact-card__row:hover { background: rgba(255, 255, 255, 0.6); color: var(--brand); }
.contact-card__handle { font-size: 13px; font-weight: 400; color: var(--muted); transition: color 150ms; }
.contact-card__row:hover .contact-card__handle { color: var(--brand); }
.contact-card__arrow { display: inline-block; margin-left: 2px; color: var(--brand); transition: transform 250ms var(--ease); }
.contact-card__row:hover .contact-card__arrow { transform: translate(2px, -2px); }
.contact-card__note { margin-top: 14px; font-size: 12px; line-height: 1.625; color: var(--muted); }
.contact-card__note strong { font-weight: 600; }

/* ---------- sections ---------- */
.section { padding-top: var(--section-gap); }
.section--first { padding-top: 72px; }
/* nav jumps land the heading 32px under the header, not a whole section gap below it */
.section, .activity { scroll-margin-top: calc(32px - var(--section-gap)); }
.section--first { scroll-margin-top: -40px; }
.section--last { padding-bottom: 128px; }

.section__title {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--navy);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--h2);
  line-height: 1.15;
  color: var(--navy);
}
.section__lead { margin-top: 20px; max-width: 60ch; font-size: 15px; line-height: 1.625; }
.section__lead--tight { margin-bottom: 8px; }

/* ---------- experience ---------- */
.job {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(73, 161, 221, 0);
  box-shadow: 0 0 0 16px rgba(73, 161, 221, 0);
  transition: background-color 700ms ease, box-shadow 700ms ease;
}
.job.is-flash {
  background: rgba(73, 161, 221, 0.1);
  box-shadow: 0 0 0 16px rgba(73, 161, 221, 0.1);
}
.job__when { font-size: 13px; line-height: 1.6; color: var(--muted); font-variant-numeric: tabular-nums; }
.job__dates { color: var(--navy); font-weight: 500; }
.job__head { display: flex; align-items: center; gap: 14px; }
.org-logo {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 3px rgba(8, 29, 95, 0.06);
}
.org-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.org-logo--initials {
  background: var(--wash);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}
.org-logo--sm { width: 36px; height: 36px; border-radius: 8px; }
.org-logo--sm.org-logo--initials { font-size: 13px; }
.job__company {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.35;
  color: var(--navy);
}
.job__role { margin-top: 2px; font-size: 15px; }
.job__bullets { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }

.prose {
  max-width: 64ch;
  font-size: 15px;
  line-height: 1.625;
  text-wrap: pretty;
}

/* ---------- projects ---------- */
.project { padding: 26px 0; border-bottom: 1px solid var(--line); }
.project__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.4;
  color: var(--navy);
  transition: color 150ms;
}
.project__title:hover { color: var(--brand); }
.project__summary { margin-top: 8px; }
.project .tags { margin-top: 10px; }
.project__actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  font-size: 14px;
  font-weight: 500;
}
.project__actions a { display: inline-flex; align-items: center; min-height: 32px; }
.details-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--navy);
  transition: color 150ms, gap 250ms var(--ease);
}
.details-btn:hover { color: var(--brand); gap: 10px; }

.features {
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 44px 32px;
}
.feature { display: flex; flex-direction: column; }
.feature__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--wash);
  box-shadow: 0 12px 40px rgba(44, 102, 171, 0.14);
  transition: box-shadow 300ms, transform 400ms var(--ease);
}
/* hairline so white pages don't melt into the white page */
.feature__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(8, 29, 95, 0.07);
  pointer-events: none;
}
.feature__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
  transition: transform 700ms var(--ease), opacity 400ms ease;
}
.feature:hover .feature__media { transform: translateY(-3px); box-shadow: 0 18px 50px rgba(44, 102, 171, 0.24); }
.feature:hover .feature__media img { transform: scale(1.015); }
.feature__badge { position: absolute; right: 12px; bottom: 12px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--navy); box-shadow: 0 2px 12px rgba(8, 29, 95, 0.14); }
.feature__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background: radial-gradient(120% 120% at 80% 0%, var(--brand) 0%, var(--navy) 60%);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  text-align: left;
}
.feature__body { margin-top: 18px; }
.feature .tags { margin-top: 10px; }

/* folded list under the featured cards */
.collapse {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 44px;
  border-top: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  overflow-anchor: none;
  transition: grid-template-rows 560ms var(--ease), opacity 360ms ease, visibility 0s linear 560ms;
}
.collapse.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 560ms var(--ease), opacity 360ms ease 80ms, visibility 0s;
}
.collapse__clip { min-height: 0; overflow: hidden; }
.more-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 500;
  color: var(--brand);
  transition: color 150ms;
}
.more-toggle:hover { color: var(--brand-hover); }
.more-toggle[aria-expanded="true"] .plus::after { transform: scaleY(0); }
html.no-anchor { overflow-anchor: none; }

/* ---------- games ---------- */
.games {
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px 32px;
}
.game { display: flex; flex-direction: column; cursor: pointer; }
.game__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--navy);
  box-shadow: 0 12px 40px rgba(44, 102, 171, 0.14);
  transition: box-shadow 300ms, transform 400ms var(--ease);
}
.game:hover .game__media { box-shadow: 0 18px 50px rgba(44, 102, 171, 0.24); transform: translateY(-3px); }
.game__media video,
.game__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.game__media img { transition: opacity 300ms ease; }
.game__media.is-playing img { opacity: 0; }
.game__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background: radial-gradient(120% 120% at 80% 0%, var(--brand) 0%, var(--navy) 60%);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  text-align: left;
}
.game__badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}
.game__caption { margin-top: 16px; }
.game__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.game__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.4;
  color: var(--navy);
  transition: color 150ms;
}
.game__title:hover { color: var(--brand); }
.game__link { flex-shrink: 0; font-size: 14px; font-weight: 500; }
.game__summary { margin-top: 10px; }
.game .tags { margin-top: 10px; cursor: default; }

/* ---------- skills ---------- */
.skills {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
}
.skills__cat { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--navy); }
.skill {
  display: block;
  width: 100%;
  padding: 5px 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  transition: color 150ms;
}
.skill:hover { color: var(--brand); }
/* the count follows the last word, even when the name wraps */
.skill__count { margin-left: 4px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- coursework ---------- */
.course { border-bottom: 1px solid var(--line); }
.course__head {
  width: 100%;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 20px;
  align-items: baseline;
  gap: 4px 32px;
  padding: 16px 0;
  color: var(--navy);
  transition: color 150ms;
}
.course__head:hover { color: var(--brand); }
.course__code { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.course__name { font-size: 16px; font-weight: 500; }
.plus {
  position: relative;
  width: 12px;
  height: 12px;
  align-self: center;
  color: var(--brand);
}
.plus::before,
.plus::after {
  content: "";
  position: absolute;
  border-radius: 1px;
  background: currentColor;
}
.plus::before { left: 0; right: 0; top: 5px; height: 2px; }
.plus::after { top: 0; bottom: 0; left: 5px; width: 2px; transition: transform 300ms var(--ease); }
.is-open > .course__head .plus::after { transform: scaleY(0); }

.course__body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 420ms var(--ease), opacity 320ms ease, visibility 0s linear 420ms;
}
.course.is-open .course__body {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 420ms var(--ease), opacity 320ms ease, visibility 0s;
}
.course__clip { min-height: 0; overflow: hidden; }
.course__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px 32px;
  padding-bottom: 24px;
}
.course__spacer { display: none; }
.course .tags { margin-top: 0; }
.course__project { margin-top: 14px; }
.course__project-title { margin-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--navy); }
.course__project .prose { margin-bottom: 4px; line-height: 1.6; }
.course .related { margin-top: 14px; }

/* ---------- footer ---------- */
.site-footer { background: #ffffff; border-top: 1px solid var(--line); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  padding-bottom: 32px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { font-weight: 500; }

/* ---------- modal ---------- */
.modal {
  --mpx: 22px;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 0 0;
}
.modal[hidden] { display: none; }

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 29, 95, 0.14);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  backdrop-filter: blur(8px) saturate(1.1);
  opacity: 0;
  transition: opacity 320ms ease;
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: var(--modal-w, 680px);
  max-height: calc(100vh - 12px);
  max-height: calc(100dvh - 12px);
  display: flex;
  flex-direction: column;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 30px 90px rgba(8, 29, 95, 0.26), 0 2px 8px rgba(8, 29, 95, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 260ms ease, transform 460ms var(--ease);
}

.modal.is-open .modal__scrim { opacity: 1; }
.modal.is-open .modal__panel { opacity: 1; transform: none; }

.modal__bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px 0 var(--mpx);
}
.modal__bar-start { min-width: 0; display: flex; align-items: center; transition: opacity 170ms ease; }
.modal__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-left: -12px;
  padding: 0 14px 0 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  transition: background-color 150ms, gap 250ms var(--ease);
}
.modal__back:hover { background: rgba(255, 255, 255, 0.7); gap: 4px; }
.modal__back[hidden] { display: none; }
.modal__back-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(36ch, 38vw); }
.modal__kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.modal__kicker--inline { display: block; margin-bottom: 6px; }

.modal__close {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 10px rgba(44, 102, 171, 0.12);
  transition: background-color 150ms, transform 300ms var(--ease);
}
.modal__close:hover { background: #ffffff; transform: rotate(90deg); }
.modal__close span {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--navy);
  transform: rotate(45deg);
}
.modal__close span + span { transform: rotate(-45deg); }

.modal__scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(8, 29, 95, 0.18) transparent;
  padding: 6px var(--mpx) 36px;
}
/* content moves the way you navigate: sideways for previous/next, down for deeper */
.modal__content { transition: opacity 200ms ease, transform 380ms var(--ease); }
.modal__content.no-anim { transition: none; }
.modal__content.is-out-deep,
.modal__content.is-in-deep { opacity: 0; transform: translateY(8px); }
.modal__content.is-out-next,
.modal__content.is-in-prev { opacity: 0; transform: translateX(-28px); }
.modal__content.is-out-prev,
.modal__content.is-in-next { opacity: 0; transform: translateX(28px); }

.modal__bar-end { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.modal__pager { display: flex; align-items: center; gap: 2px; }
.modal__pager[hidden] { display: none; }
.modal__pos {
  margin-right: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: opacity 170ms ease;
}
.modal__step {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  color: var(--navy);
  transition: background-color 150ms, color 150ms, transform 250ms var(--ease);
}
.modal__step:hover { background: rgba(255, 255, 255, 0.75); color: var(--brand); }
.modal__step[data-step="-1"]:active { transform: translateX(-2px); }
.modal__step[data-step="1"]:active { transform: translateX(2px); }

.m-pager {
  position: relative;
  margin: 36px -14px 0;
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
/* buttons bleed 14px for their hover fill; the rule stays on the content edges */
.m-pager::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--line-soft);
}
.m-pager__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  transition: background-color 150ms;
}
.m-pager__btn:hover { background: rgba(255, 255, 255, 0.65); }
.m-pager__btn--next { align-items: flex-end; text-align: right; }
.m-pager__dir { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.m-pager__title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  color: var(--navy);
  transition: color 150ms;
}
.m-pager__btn:hover .m-pager__title { color: var(--brand); }

.m-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--wash);
  box-shadow: inset 0 0 0 1px rgba(8, 29, 95, 0.06);
}
.m-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.m-thumb--initials {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}

.m-shot {
  position: relative;
  display: block;
  margin-top: 24px;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--wash);
  box-shadow: 0 12px 40px rgba(8, 29, 95, 0.18);
}
.m-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; transition: transform 700ms var(--ease), opacity 400ms ease; }
.m-shot:hover img { transform: scale(1.015); }
.m-shot__badge { position: absolute; right: 12px; bottom: 12px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--navy); box-shadow: 0 2px 12px rgba(8, 29, 95, 0.14); }

.m-title {
  max-width: 22ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  text-wrap: balance;
}
.m-sub { margin-top: 10px; max-width: 60ch; font-size: 15px; line-height: 1.6; text-wrap: pretty; }

.m-video { margin-top: 24px; }
.m-video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--navy);
  box-shadow: 0 12px 40px rgba(8, 29, 95, 0.2);
}
.m-video__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 200ms ease; }
.m-clips {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.m-clip { display: flex; flex-direction: column; gap: 8px; }
.m-clip__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--navy);
  box-shadow: 0 0 0 2px transparent;
  opacity: 0.7;
  transition: box-shadow 250ms, opacity 250ms;
}
.m-clip__thumb img { width: 100%; height: 100%; object-fit: cover; }
.m-clip:hover .m-clip__thumb { opacity: 0.9; }
.m-clip__caption { font-size: 12px; line-height: 1.4; color: var(--muted); transition: color 250ms; }
.m-clip.is-active .m-clip__thumb { box-shadow: 0 0 0 2px var(--brand); opacity: 1; }
.m-clip.is-active .m-clip__caption { color: var(--navy); }

.m-frame {
  margin-top: 24px;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 12px 40px rgba(8, 29, 95, 0.2);
}
.m-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.m-note { margin-top: 10px; font-size: 12px; color: var(--muted); }

.m-paras { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.m-paras .prose { line-height: 1.65; }
.m-para-head { margin: 8px 0 4px; font-size: 15px; font-weight: 600; color: var(--navy); }

.m-links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.m-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 9999px;
  border: 1px solid rgba(8, 29, 95, 0.2);
  background: rgba(255, 255, 255, 0.6);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  transition: background-color 150ms, border-color 150ms;
}
.m-link:hover { background: #ffffff; border-color: var(--brand); color: var(--navy); }
.m-link--primary { background: var(--brand); border-color: var(--brand); color: #ffffff; }
.m-link--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #ffffff; }

.m-group { margin-top: 28px; }
.m-label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.m-list { border-top: 1px solid var(--line-soft); }
/* hover fill bleeds 12px past the text; the divider lines up with the list's top rule */
.m-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: calc(100% + 24px);
  min-height: 52px;
  margin: 0 -12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background-color 150ms;
}
.m-item::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: var(--line-soft);
}
.m-item:hover { background: rgba(255, 255, 255, 0.65); }
.m-item__text { flex: 1; min-width: 0; }
.m-item__label { display: block; font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--navy); }
.m-item__sub { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.m-item__arrow { flex-shrink: 0; font-size: 15px; color: var(--brand); transition: transform 250ms var(--ease); }
.m-item:hover .m-item__arrow { transform: translateX(3px); }
.m-item:hover .m-item__arrow--down { transform: translateY(3px); }

.m-chips-wrap { margin-top: 28px; }
.m-chips-wrap .m-label { margin-bottom: 10px; }
.m-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.m-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 4px rgba(44, 102, 171, 0.1);
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  transition: background-color 150ms, color 150ms, transform 250ms var(--ease);
}
.m-chip:hover { background: #ffffff; color: var(--brand); transform: translateY(-1px); }

/* ---------- contact form (inside the modal) ---------- */
.c-form { margin-top: 28px; display: grid; gap: 20px; }
.c-row { display: grid; gap: 20px; }
.c-field { min-width: 0; }
.c-topics { min-width: 0; margin: 0; padding: 0; border: 0; }
.c-label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.c-optional { margin-left: 6px; font-weight: 400; color: var(--muted); }

.c-input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-glass);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 2px rgba(8, 29, 95, 0.04);
  font: inherit;
  font-size: 16px;                      /* below 16px, iOS zooms the page on focus */
  line-height: 1.5;
  color: var(--navy);
  transition: border-color 150ms, background-color 150ms, box-shadow 200ms;
}
textarea.c-input { min-height: 148px; max-height: 44vh; resize: none; }
.c-input:hover { border-color: rgba(8, 29, 95, 0.22); }
.c-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(73, 161, 221, 0.22);
}
.c-field.is-bad .c-input { border-color: #b3261e; }
.c-field.is-bad .c-input:focus { box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.14); }

/* the line is always there, so a message appearing doesn't jump the form */
.c-error {
  display: grid;
  grid-template-rows: 0fr;
  font-size: 13px;
  line-height: 1.5;
  color: #b3261e;
  opacity: 0;
  transition: grid-template-rows 260ms var(--ease), opacity 200ms ease;
}
.c-error span { min-height: 0; overflow: hidden; }
.c-field.is-bad .c-error { grid-template-rows: 1fr; padding-top: 6px; opacity: 1; }
.c-count { margin-top: -12px; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.c-count[hidden] { display: none; }

.c-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.c-chip { position: relative; display: inline-flex; cursor: pointer; }
.c-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.c-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 4px rgba(44, 102, 171, 0.1);
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  transition: background-color 150ms, border-color 150ms, color 150ms, transform 250ms var(--ease);
}
@media (hover: hover) { .c-chip:hover span { background: #ffffff; color: var(--brand); transform: translateY(-1px); } }
.c-chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #ffffff; transform: none; }
.c-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* a field people never see or reach; filled in only by bots */
.c-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.c-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 4px; }
.c-send { min-width: 184px; gap: 10px; }
.c-send:disabled { cursor: default; background: var(--brand-hover); }
.c-send__spin {
  width: 0;
  height: 16px;
  margin-right: -10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  opacity: 0;
  transition: width 250ms var(--ease), margin 250ms var(--ease), opacity 200ms ease;
}
.c-send.is-busy .c-send__spin { width: 16px; margin-right: 0; opacity: 1; animation: spin 700ms linear infinite; }
.c-note { font-size: 13px; line-height: 1.5; color: var(--muted); }
.c-status { font-size: 14px; line-height: 1.6; color: #b3261e; }
.c-status:empty { display: none; }
.c-status a { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

.c-done {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(44, 102, 171, 0.3);
  animation: pop 520ms var(--ease) 120ms both;
}
.c-done path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: draw 420ms var(--ease) 380ms forwards; }
.c-again { cursor: pointer; }

@media (min-width: 560px) {
  .c-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 559px) {
  .c-send { width: 100%; }
  .c-note { width: 100%; text-align: center; }
}

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } }

.fade-img { opacity: 0; transition: opacity 400ms ease; }
.fade-img.is-loaded { opacity: 1; }
@keyframes cue-pulse {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(6px); }
}

.js [data-enter] { animation: rise 900ms var(--ease) var(--d, 0s) both; }

.reveal-pending { opacity: 0; transform: translateY(24px); }
.reveal-pending.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 800ms var(--ease) var(--stagger, 0ms), transform 800ms var(--ease) var(--stagger, 0ms);
}

/* ---------- mid (>= 720px) ---------- */
@media (min-width: 720px) {
  .graph__viewport { height: 420px; }

  .job { grid-template-columns: 160px minmax(0, 1fr); }

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

  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature:first-child { grid-column: 1 / -1; }
  .feature:first-child .feature__media { aspect-ratio: 16 / 9; }

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

  .course__head,
  .course__inner { grid-template-columns: 160px minmax(0, 1fr) 20px; }
  .course__spacer { display: block; }

  .modal { --mpx: 32px; align-items: center; padding: 48px 24px; }
  .modal__panel {
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    border-radius: 20px;
    transform: translateY(18px) scale(0.98);
  }
  .m-title { font-size: 32px; }
}

/* ---------- wide (>= 1024px) ---------- */
@media (min-width: 1024px) {
  .activity__intro { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .activity__details { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .repo__desc { display: inline; }

  .layout { grid-template-columns: minmax(0, 1fr) 380px; }
  .layout__aside { grid-column: 2; grid-row: 1; padding: var(--section-gap) 0 128px; }
  .layout__main { grid-column: 1; grid-row: 1; }
  .contact-rail {
    max-width: none;
    position: sticky;
    top: max(88px, calc(50vh + 36px - var(--card-h, 28rem) / 2));
  }
  .section--first { padding-top: var(--section-gap); scroll-margin-top: calc(32px - var(--section-gap)); }
}

/* ---------- reduced motion ---------- */
@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;
    transition-delay: 0s !important;
  }
  .reveal-pending { opacity: 1; transform: none; }
}

/* ---------- small links added in the detail pass ---------- */
.stat-link {
  color: inherit;
  box-shadow: inset 0 -1px 0 rgba(73, 161, 221, 0.55);
  transition: color 150ms, box-shadow 200ms;
}
.stat-link:hover { color: var(--brand); box-shadow: inset 0 -1px 0 var(--brand); }

.org-link { display: block; border-radius: 10px; transition: transform 250ms var(--ease), box-shadow 250ms; }
.org-link:hover { transform: translateY(-1px); }
.job__site { color: inherit; }
.job__site:hover { color: var(--brand); }
.job__site-arrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--brand);
  opacity: 0;
  transform: translate(-4px, 2px);
  transition: opacity 200ms, transform 250ms var(--ease);
}
.job__site:hover .job__site-arrow,
.job__site:focus-visible .job__site-arrow { opacity: 1; transform: translate(0, 0); }

.skill__name { transition: box-shadow 200ms; }
.skill:hover .skill__name { box-shadow: inset 0 -1px 0 var(--brand); }

/* studio credit, same pattern as the JJ Site Design client sites */
.site-footer a.site-footer__credit { color: inherit; font-weight: 500; box-shadow: inset 0 -1px 0 rgba(73, 161, 221, 0.45); transition: color 150ms, box-shadow 200ms; }
.site-footer a.site-footer__credit:hover { color: var(--brand); box-shadow: inset 0 -1px 0 var(--brand); }
