/* ==========================================================================
   Concept G — "Workspace": an IDE shell.
   Fixed app chrome; each section is a file opened in a tab. Only the editor
   pane scrolls, so the profile, resume and contact never move.
   Layered on top of main.css.
   ========================================================================== */

:root {
  --activity-w: 3rem;
  --sidebar-w: 17.5rem;
  --titlebar-h: 2.65rem;
  --statusbar-h: 1.65rem;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;

  --shadow-lg: 0 16px 48px -12px rgb(1 4 9 / 0.85);
}

/* ==========================================================================
   Catppuccin — Mocha (dark) / Latte (light), selected by html[data-theme].
   ========================================================================== */

:root {
  --bg:#1e1e2e; --bg-alt:#181825; --chrome:#181825; --chrome-2:#11111b;
  --surface:#313244; --surface-2:#3a3c51; --surface-hover:#45475a;
  --border:#45475a; --border-strong:#585b70;
  --fg:#cdd6f4; --fg-muted:#a6adc8; --fg-subtle:#7f849c;
  --accent:#cba6f7; --accent-hover:#ddbbff; --accent-soft:#2a2440; --accent-fg:#1e1e2e; --accent-2:#f5c2e7;
  --green:#a6e3a1; --amber:#f9e2af; --purple:#cba6f7; --orange:#fab387; --red:#f38ba8; --pink:#f5c2e7; --cyan:#94e2d5;
  --grad:linear-gradient(135deg,#cba6f7 0%,#f5c2e7 50%,#94e2d5 100%);
  --grad-text:linear-gradient(110deg,#94e2d5 0%,#cba6f7 50%,#f5c2e7 100%);
  --glow:0 0 24px -6px rgba(203,166,247,.5);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:#eff1f5; --bg-alt:#e6e9ef; --chrome:#e6e9ef; --chrome-2:#dce0e8;
  --surface:#ffffff; --surface-2:#eff1f5; --surface-hover:#e6e9ef;
  --border:#ccd0da; --border-strong:#bcc0cc;
  --fg:#4c4f69; --fg-muted:#5c5f77; --fg-subtle:#8c8fa1;
  --accent:#8839ef; --accent-hover:#6c28c9; --accent-soft:#e9e1fb; --accent-fg:#ffffff; --accent-2:#ea76cb;
  --green:#40a02b; --amber:#df8e1d; --purple:#8839ef; --orange:#fe640b; --red:#d20f39; --pink:#ea76cb; --cyan:#179299;
  --grad:linear-gradient(135deg,#8839ef 0%,#ea76cb 50%,#179299 100%);
  --grad-text:linear-gradient(110deg,#179299 0%,#8839ef 50%,#ea76cb 100%);
  --glow:0 0 24px -8px rgba(136,57,239,.32);
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   App shell — the page never scrolls, only the editor pane does
   -------------------------------------------------------------------------- */

html, body { height: 100%; }

/* The shell is fixed furniture: nothing outside .panes may ever scroll, and a
   fragment jump must not be able to nudge it. */
html {
  overflow: hidden;
  scroll-behavior: auto;
  max-width: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  max-width: 100%;
  background: var(--bg-alt);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
}

.titlebar {
  position: relative;
  z-index: 300; /* the palette popover must paint above the workbench */
  flex: none;
  height: var(--titlebar-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-inline: 0.75rem;
  /* NOT overflow:hidden — that clipped the popover. The title text truncates
     on its own via min-width:0 + text-overflow below. */
  max-width: 100%;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--fg-muted);
}
.titlebar__dots { display: flex; gap: 0.45rem; flex: none; }
.titlebar__dots .dot {
  width: 0.78rem;
  height: 0.78rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 0.15s var(--ease), transform 0.15s var(--ease);
}
.titlebar__dots .dot:hover { filter: brightness(1.15); }
.titlebar__dots .dot:active { transform: scale(0.88); }
.dot--red { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green { background: #28c840; }
.titlebar__name {
  margin-inline: auto;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The button was exactly as tall as the bar, so it sat flush against both
   edges. Shrink it and let the bar breathe around it. */
.titlebar__actions { display: flex; align-items: center; gap: 0.35rem; margin-left: 0.25rem; }
.titlebar .icon-btn {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 5px;
  border-color: transparent;
  background: transparent;
  color: var(--fg-subtle);
}
.titlebar .icon-btn:hover { background: var(--surface-hover); color: var(--fg); border-color: var(--border); }
.titlebar .icon-btn svg { width: 0.95rem; height: 0.95rem; }

.workbench {
  flex: 1;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden; /* each pane scrolls itself; the shell never does */
  display: grid;
  grid-template-columns: var(--activity-w) var(--sidebar-w) minmax(0, 1fr);
}

/* ---------- activity bar ---------- */

.activity {
  background: var(--chrome-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding-block: 0.5rem;
}
.activity__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: none;
  color: var(--fg-subtle);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.activity__btn svg { width: 1.25rem; height: 1.25rem; }
.activity__btn:hover { color: var(--fg); }
.activity__btn.is-active { color: var(--fg); }
.activity__btn.is-active::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.activity__spacer { margin-top: auto; }

/* ---------- sidebar ---------- */

.sidebar {
  background: var(--chrome-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Flex children shrink by default; without flex:none the profile card gets
   squeezed and its own overflow:hidden crops the last button off. */
.sidebar > * { flex: none; }

.sidebar__title {
  padding: 0.6rem 1rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

/* Profile card — built around the headshot: the photo runs full-bleed to the
   card edges and fades into the surface, with the name sitting in the fade. */
.profile {
  margin: 0 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.profile__avatar {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  border: 0;
  background: var(--surface-2);
}
.profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
}
/* fade the portrait into the card so there is no hard photo edge */
.profile__avatar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 46%;
  background: linear-gradient(to top, var(--surface) 12%, transparent 100%);
  pointer-events: none;
}

.profile__meta {
  position: relative;
  margin-top: -1.9rem;
  padding: 0 0.9rem 0.95rem;
  text-align: center;
}

.profile__name { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.025em; color: var(--fg); }
.profile__role {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.profile__org {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--fg-muted);
}
.profile__org img { width: 1.1rem; height: 1.1rem; border-radius: 3px; background: #fff; padding: 1px; }

.profile__cta { display: grid; gap: 0.4rem; margin-top: 0.9rem; }
.profile__cta .btn { width: 100%; font-size: 0.74rem; padding: 0.55rem 0.75rem; }

/* file tree */
.tree { padding: 0.25rem 0.5rem 1rem; font-family: var(--font-mono); font-size: 0.78rem; }

.tree__folder {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.4rem;
  color: var(--fg-muted);
  font-weight: 500;
}
.tree__folder svg { width: 0.85rem; height: 0.85rem; }

.tree__file {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.3rem 0.4rem 0.3rem 1.35rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--fg-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tree__file:hover { background: var(--surface-hover); color: var(--fg); }
.tree__file.is-active { background: var(--surface-hover); color: var(--fg); }
.tree__dot { width: 0.5rem; height: 0.5rem; border-radius: 2px; flex: none; }

/* file-type colours, like an editor's icon theme */
.ft-md { background: var(--cyan); }
.ft-json { background: var(--amber); }
.ft-dir { background: var(--orange); }
.ft-bib { background: var(--pink); }
.ft-yml { background: var(--red); }
.ft-sh { background: var(--green); }

/* ---------- editor ---------- */

.editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* A grid item defaults to min-height:auto, which would let .panes grow to its
     content height and never scroll. This is what keeps long documents (e.g.
     projects/) scrollable inside the shell. */
  min-height: 0;
  background: var(--bg);
}

.tabs {
  flex: none;
  display: flex;
  overflow-x: auto;
  background: var(--chrome-2);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover { background: var(--surface-hover); color: var(--fg-muted); }
.tab.is-active {
  background: var(--bg);
  color: var(--fg);
  border-bottom: 1px solid var(--bg);
  margin-bottom: -1px;
}
.tab.is-active::before {
  content: "";
  position: absolute;
  margin-top: -1.65rem;
  width: 0;
}

.breadcrumb {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-subtle);
}
.breadcrumb svg { width: 0.7rem; height: 0.7rem; }

.panes {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.pane { display: none; }
.pane.is-active { display: block; animation: pane-in 0.22s var(--ease); }
@keyframes pane-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- status bar ---------- */

.statusbar {
  position: relative;
  flex: none;
  height: var(--statusbar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-inline: 0.85rem;
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
}
.statusbar svg { opacity: 0.8; }

.tab.is-active { box-shadow: inset 0 2px 0 var(--accent); }
.btn--primary { box-shadow: var(--glow); }
.btn--primary:hover { box-shadow: 0 0 28px -4px color-mix(in srgb, var(--accent) 65%, transparent); }
.brand__mark, .activity__btn.is-active::before { box-shadow: var(--glow); }
/* Flex children default to min-width:auto; without this the nowrap items below
   refuse to shrink and widen the whole shell past the viewport. */
.statusbar { overflow: hidden; }
.statusbar__item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.statusbar__item svg { width: 0.75rem; height: 0.75rem; }
.statusbar__push { margin-left: auto; }
.statusbar a { color: var(--accent-fg); text-decoration: none; }
.statusbar a:hover { text-decoration: underline; color: var(--accent-fg); }

/* --------------------------------------------------------------------------
   Content inside the editor
   -------------------------------------------------------------------------- */

.panes .section { padding-block: clamp(1.5rem, 3vw, 2.5rem); border: 0; background: transparent; }
/* Documents fill the editor; only long-form text keeps a readable measure,
   so cards and grids use the width instead of leaving it empty. */
.panes .wrap { max-width: 74rem; margin-inline: 0; padding-inline: clamp(1.25rem, 3vw, 2.5rem); }
.prose p,
.section-sub,
.readme__lede { max-width: 68ch; }
.rm__what { max-width: 84ch; }
.section--alt { background: transparent; }

.eyebrow { font-size: 0.7rem; color: var(--fg-subtle); }
.eyebrow::before { background: var(--accent); opacity: 1; }
.section-title { font-size: clamp(1.4rem, 1.15rem + 1.1vw, 2rem); }
.section-sub { font-size: 0.875rem; }
.section-head { margin-bottom: 1.75rem; }





.stats { margin-top: 0; }
.stat { padding: 0.85rem 1rem; background: var(--surface); }
.stat__value { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
.stat__label { font-size: 0.72rem; }

.card { background: var(--surface); }
.card:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }


.project-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); gap: 1rem; }
.project__title { font-size: 0.92rem; }
.project__desc { font-size: 0.78rem; }
.project__media { aspect-ratio: 16 / 9; }

.tag { font-size: 0.68rem; background: var(--surface-2); }
.btn { font-size: 0.78rem; }
.btn:hover { transform: none; box-shadow: none; }

.pub { padding: 1.1rem 1.25rem; }
.pub__title { font-size: 0.95rem; }
.pub__where { font-size: 0.78rem; }
.edu { padding: 1rem 1.15rem; }
.edu__title { font-size: 0.88rem; }

.info-card, .contact-panel, .archive, .qr-card { background: var(--surface); }
.contact-panel { box-shadow: none; }
.contact-link { background: var(--surface-2); font-size: 0.8rem; }
.contact-link:hover { transform: none; }

.modal { background: var(--surface); }

/* --------------------------------------------------------------------------
   Responsive — the shell folds down but stays an app
   -------------------------------------------------------------------------- */

/* Desktop only: the hamburger and drawer scrim have no job here. */
.titlebar__menu,
.scrim,
.titlebar__resume { display: none; }

/* --------------------------------------------------------------------------
   Tablet & phone — the shell folds into: title bar → tab strip → document,
   with the explorer as an off-canvas drawer.
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  :root {
    --titlebar-h: 3rem;
    --statusbar-h: 2.25rem;
  }

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

  /* the activity bar's links all live in the drawer on small screens */
  .activity { display: none; }

  .titlebar { gap: 0.5rem; padding-inline: 0.5rem; }
  .titlebar__dots { display: none; }
  .titlebar__name {
    margin-inline: 0;
    margin-right: auto;
    font-size: 0.8rem;
    color: var(--fg);
    font-weight: 600;
  }

  .titlebar__menu {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--fg-muted);
    cursor: pointer;
  }
  .titlebar__menu svg { width: 1.25rem; height: 1.25rem; }
  .titlebar__menu:hover { background: var(--surface-hover); color: var(--fg); }

  /* resume stays one tap away even with the drawer shut */
  .titlebar__resume {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
  }
  .titlebar__resume:hover { background: var(--accent-hover); color: #fff; }
  .titlebar__resume svg { width: 0.85rem; height: 0.85rem; }

  /* drawer */
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--titlebar-h);
    bottom: var(--statusbar-h);
    width: min(19rem, 85vw);
    z-index: 70;
    transform: translateX(-105%);
    transition: transform 0.26s var(--ease);
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--border);
  }
  .sidebar.is-open { transform: none; }

  .scrim {
    display: block;
    position: fixed;
    inset: var(--titlebar-h) 0 var(--statusbar-h) 0;
    z-index: 65;
    background: rgb(1 4 9 / 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.26s var(--ease), visibility 0.26s;
    border: 0;
    padding: 0;
    width: 100%;
  }
  .scrim.is-open { opacity: 1; visibility: visible; }

  /* tabs become the primary navigation — bigger touch targets */
  .tabs { -webkit-overflow-scrolling: touch; }
  .tab { padding: 0.8rem 0.95rem; font-size: 0.8rem; }

  /* the tab already names the open file */
  .breadcrumb { display: none; }

  .panes .section { padding-block: 1.5rem; }
  .panes .wrap { padding-inline: 1.15rem; }

  .statusbar { gap: 0.75rem; font-size: 0.7rem; }

  /* --- component reflow: theme-ide's desktop rules must yield on mobile --- */
      .about__grid,
  .contact__grid,
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; padding: 1rem 1.1rem; }
  .pub__num { padding-top: 0; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .qr-card { justify-self: start; max-width: 13rem; }
  .filters { gap: 0.4rem; }
  .filter { padding: 0.5rem 0.9rem; }
}

@media (max-width: 640px) {
  .titlebar__name { font-size: 0.75rem; }
  .statusbar__hide-sm { display: none; }
  /* the git-branch item is decoration — the email is not */
  .statusbar .statusbar__item:first-child { display: none; }
  .panes .wrap { padding-inline: 1rem; }
    .arch-item { grid-template-columns: minmax(0, 1fr) auto; }
  .arch-item__year { display: none; }
  .modal__hero { aspect-ratio: 16 / 9; }
  .modal__meta { grid-template-columns: minmax(0, 1fr); }
}

/* Mobile browser chrome changes height as you scroll; dvh avoids the jump. */
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
}



/* --------------------------------------------------------------------------
   Experience — a rail with nodes, not a stack of boxes
   -------------------------------------------------------------------------- */

.timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* the rail itself, fading out at both ends */
.timeline::before {
  content: "";
  position: absolute;
  left: 1.32rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom, transparent, var(--border) 8%, var(--border) 92%, transparent);
}

.xp {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0 1.15rem;
  padding: 0 0 2rem 0;
}
.xp:last-child { padding-bottom: 0.25rem; }

/* node */
.xp__node {
  position: relative;
  z-index: 1;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--border);
}
.xp__logo {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 5px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}
.xp--current .xp__node { box-shadow: 0 0 0 2px var(--accent), var(--glow); }

/* main.css draws a 3px gradient bar at the item's left edge for the current
   role; the rail owns that space now, so it has to go. */
.xp--current::before { display: none; }
.xp--current { border-color: transparent; }

/* body */
.xp__body {
  padding: 0.15rem 0 0;
  transition: transform 0.2s var(--ease);
}

.xp__head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }

.xp__role {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.xp__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.14rem 0.55rem;
  border-radius: var(--radius-full, 999px);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.xp__badge i {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  animation: xp-pulse 2.2s ease-in-out infinite;
}
@keyframes xp-pulse { 50% { opacity: 0.25; } }

.xp__org {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
}
.xp__org a { color: var(--accent-2); font-weight: 600; }
.xp__dot { margin-inline: 0.45rem; color: var(--fg-subtle); }

.xp__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-subtle);
}
.xp__dur {
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-muted);
}

.xp__points { margin: 0.95rem 0 0; display: grid; gap: 0.55rem; padding: 0; list-style: none; }
/* run wide, but stop 120px short of the right edge rather than butting into it */
.xp__points li { max-width: calc(100% - 120px); }
.xp__points li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--fg-muted);
}
.xp__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  rotate: 45deg;
  background: var(--accent);
  opacity: 0.75;
}
.xp__points strong { color: var(--fg); font-weight: 600; }

.xp__tags { margin-top: 0.95rem; gap: 0.35rem; }
.xp__tags .tag { font-size: 0.66rem; padding: 0.16rem 0.5rem; }

@media (max-width: 640px) {
  .xp { grid-template-columns: 2.1rem minmax(0, 1fr); gap: 0 0.85rem; padding-bottom: 1.6rem; }
  .xp__points li { max-width: none; }
  .xp__node { width: 2.1rem; height: 2.1rem; }
  .xp__logo { width: 1.3rem; height: 1.3rem; }
  .timeline::before { left: 1rem; }
  .xp__role { font-size: 0.95rem; }
}

/* achievement rows that have an icon rather than an institution logo */
.edu__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--accent);
}
.edu__icon svg { width: 1.1rem; height: 1.1rem; }


/* --------------------------------------------------------------------------
   README — hero, impact strip, panels, prose
   -------------------------------------------------------------------------- */

.rm {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  align-content: start;
  max-width: 72rem;
}
.rm__main { display: grid; gap: clamp(1.25rem, 2.5vw, 1.9rem); align-content: start; }

@media (min-width: 1140px) {
  .rm { grid-template-columns: minmax(0, 1fr) 17.5rem; column-gap: 1.5rem; align-items: start; }
  .rm__side { position: sticky; top: 0; }
}

/* ---- hero ---- */
.rm__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.rm__title {
  font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--fg);
}
.rm__sub {
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rm__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---- lede ---- */
.rm__lede {
  margin: 0;
  max-width: 46rem;
  font-size: clamp(0.98rem, 0.94rem + 0.25vw, 1.12rem);
  line-height: 1.65;
  color: var(--fg-muted);
}

/* ---- panels ---- */
.rm__panel {
  padding: 1.15rem 1.25rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.rm__panel--now { background: var(--surface-2); }

.rm__panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.rm__panel-title svg { width: 0.95rem; height: 0.95rem; color: var(--accent); }

.rm__wins { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.rm__wins li {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: baseline;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}
.rm__wins li:last-child { padding-bottom: 0; border-bottom: 0; }
.rm__win {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-2);
}
.rm__what { font-size: 0.8rem; line-height: 1.55; color: var(--fg-muted); }

.rm__now { display: grid; gap: 0.5rem; margin: 0; }
.rm__now > div { display: grid; grid-template-columns: 5.75rem minmax(0, 1fr); gap: 0.6rem; }
.rm__now dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--fg-subtle); padding-top: 0.1rem; }
.rm__now dd { margin: 0; font-size: 0.82rem; color: var(--fg); }
.rm__mail { width: 100%; margin-top: 1rem; font-size: 0.74rem; }

/* ---- prose ---- */
.rm__prose { columns: 2; column-gap: 2.5rem; }
.rm__prose p {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--fg-muted);
  break-inside: avoid;
}
.rm__prose p:last-child { margin-bottom: 0; }

.rm__tip { margin: 0; font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-subtle); }
.rm__tip kbd {
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
  font: inherit;
  color: var(--fg-muted);
}

@media (max-width: 1080px) {
  .rm__tip { display: none; }
}
@media (max-width: 640px) {
  .rm__wins li { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .rm__hero { align-items: flex-start; }
  .rm__actions .btn { flex: 1; }
}

/* --------------------------------------------------------------------------
   GitHub contribution graph
   -------------------------------------------------------------------------- */

.gh[hidden] { display: none; }

.gh__head { display: grid; gap: 0.3rem; }
.gh__head .rm__panel-title { margin-bottom: 0; }

.gh__link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
}
.gh__link span { color: var(--accent); font-weight: 600; }
.gh__link:hover { color: var(--fg); }
.gh__link svg { width: 0.7rem; height: 0.7rem; }

.gh__chart { display: grid; gap: 0.32rem; margin-top: 1rem; }

.gh__row {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) 2.1rem;
  gap: 0.5rem;
  align-items: center;
  cursor: default;
}

.gh__year { font-family: var(--font-mono); font-size: 0.64rem; color: var(--fg-subtle); }

.gh__track {
  height: 0.6rem;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}

.gh__bar {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 45%, var(--surface-2));
  transition: background-color 0.18s var(--ease);
}
.gh__bar.is-peak { background: var(--accent); }
.gh__row:hover .gh__bar { background: var(--accent); }
.gh__row:hover .gh__val,
.gh__row:hover .gh__year { color: var(--accent); }

.gh__val {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--fg-subtle);
  text-align: right;
}

.gh__note {
  margin: 0.9rem 0 0;
  font-size: 0.7rem;
  color: var(--fg-subtle);
}


/* --------------------------------------------------------------------------
   Wide-screen density: cards were leaving half their width empty
   -------------------------------------------------------------------------- */

/* publications + blog posts, two up */
@media (min-width: 1000px) {
  .pub-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .pub { padding: 1.15rem 1.25rem; }
  .pub-list + .section-head + .contact-links,
  #publications .contact-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* about: bio and the details card side by side, skills underneath */
@media (min-width: 1000px) {
    .prose p { max-width: none; }
}

/* education + achievements already two up via .two-col; keep the cards tight */
@media (min-width: 1000px) {
  .edu { padding: 0.95rem 1.1rem; }
}

@media (min-width: 1000px) {
  .blog-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
}

/* --------------------------------------------------------------------------
   GitHub rail: fills the column height, with a loading skeleton
   -------------------------------------------------------------------------- */

@media (min-width: 1140px) {
  .rm { align-items: stretch; }
  .rm__side { display: flex; }
  .gh { display: flex; flex-direction: column; width: 100%; }
  /* rows share the leftover height so the chart reaches the bottom */
  .gh__chart { flex: 1; grid-auto-rows: 1fr; align-content: stretch; }
  .gh__note { margin-top: auto; padding-top: 0.9rem; }
}

/* skeleton */
.gh__row--skel { pointer-events: none; }
.gh__row--skel .gh__year,
.gh__row--skel .gh__val {
  border-radius: 3px;
  background: var(--surface-2);
  height: 0.55rem;
}
.gh__row--skel .gh__bar {
  background: var(--surface-hover);
  animation: gh-pulse 1.4s ease-in-out infinite;
}
.gh__row--skel .gh__year,
.gh__row--skel .gh__val { animation: gh-pulse 1.4s ease-in-out infinite; }
.gh__row--skel:nth-child(2n) .gh__bar { animation-delay: 0.12s; }
.gh__row--skel:nth-child(3n) .gh__bar { animation-delay: 0.24s; }

@keyframes gh-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .gh__row--skel .gh__bar,
  .gh__row--skel .gh__year,
  .gh__row--skel .gh__val { animation: none; }
}


/* --------------------------------------------------------------------------
   about.md
   -------------------------------------------------------------------------- */

.ab { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); align-content: start; }
.ab .section-head { margin-bottom: 0; }

.ab__lede {
  margin: 0;
  max-width: 72ch;
  font-size: clamp(0.95rem, 0.92rem + 0.2vw, 1.06rem);
  line-height: 1.7;
  color: var(--fg-muted);
}
.ab__lede strong { color: var(--fg); font-weight: 600; }

/* three pillars instead of three walls of text */
.ab__pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
}

.ab__card {
  padding: 1.15rem 1.25rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.ab__card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.ab__card-title svg { width: 0.95rem; height: 0.95rem; color: var(--accent); }

.ab__list { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.ab__list li {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--fg-muted);
}
.ab__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  rotate: 45deg;
  background: var(--accent);
  opacity: 0.8;
}

/* skills as aligned rows rather than seven identical boxes */
.ab__heading {
  margin: 0 0 0.9rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.skills { display: grid; gap: 0; margin: 0; }

.skills__row {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.skills__row:last-child { border-bottom: 1px solid var(--border); }

.skills__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg);
}
.skills__label svg { width: 0.9rem; height: 0.9rem; color: var(--accent); flex: none; }

.skills__tags { margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.skills__tags .tag { font-size: 0.68rem; padding: 0.16rem 0.5rem; }

.ab__cta { margin: 0; font-size: 0.88rem; color: var(--fg-muted); }
.ab__cta a { color: var(--accent); font-weight: 600; }

@media (max-width: 760px) {
  .skills__row { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
}
