/* ───────── Theme (VS Code Dark Modern) ───────── */
:root {
  --bg-editor: #1f1f1f;
  --bg-chrome: #181818;
  --bg-hover: #2a2d2e;
  --bg-active: #37373d;
  --bg-card: #252526;
  --border: #2b2b2b;
  --border-strong: #3c3c3c;
  --text: #cccccc;
  --text-bright: #ffffff;
  --text-dim: #8b8b8b;
  --accent: #0078d4;
  --accent-hover: #026ec1;

  --tok-comment: #6a9955;
  --tok-tag: #569cd6;
  --tok-var: #9cdcfe;
  --tok-str: #ce9178;
  --tok-type: #4ec9b0;
  --tok-key: #c586c0;
  --tok-fn: #dcdcaa;
  --tok-punct: #808080;

  --font-ui: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-code: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg-chrome);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }

.window {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* ───────── Title bar ───────── */
.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 36px;
  flex-shrink: 0;
  background: var(--bg-chrome);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.titlebar-left { display: flex; align-items: center; min-width: 0; }
/* The logo PNG has wide transparent padding, so crop into it */
.app-logo { width: 36px; height: 36px; overflow: hidden; display: grid; place-items: center; flex-shrink: 0; }
.app-logo img { width: 100%; height: 100%; object-fit: cover; transform: scale(.625); }
.menu { display: flex; }
.menu li { padding: 4px 8px; border-radius: 5px; }
.menu li:hover { background: var(--bg-hover); }
.mobile-title { display: none; font-family: var(--font-code); }
.dim { color: var(--text-dim); }
.command-center {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: min(38vw, 480px); height: 24px;
  background: #2a2a2a; border: 1px solid var(--border-strong); border-radius: 6px;
  color: var(--text-dim); font-size: 12px;
}
.window-controls { display: flex; justify-content: flex-end; height: 100%; }
.window-controls span { display: grid; place-items: center; width: 46px; }
.window-controls span:hover { background: var(--bg-hover); }
.window-controls .wc-close:hover { background: #e81123; color: #fff; }

/* ───────── Workbench ───────── */
.workbench { display: flex; flex: 1; min-height: 0; }

.activitybar {
  display: flex; flex-direction: column;
  width: 48px; flex-shrink: 0;
  background: var(--bg-chrome);
  border-right: 1px solid var(--border);
}
.act {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  color: #868686;
  border-left: 2px solid transparent;
}
.act svg { width: 24px; height: 24px; }
.act.active { color: var(--text-bright); border-left-color: var(--accent); }
button.act:hover { color: var(--text-bright); }
.act-bottom { margin-top: auto; }

/* ───────── Sidebar ───────── */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-chrome);
  border-right: 1px solid var(--border);
  user-select: none;
}
.sidebar.collapsed { display: none; }
.sidebar-title {
  padding: 0 20px; height: 35px; line-height: 35px;
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
}
.tree-root {
  display: flex; align-items: center; gap: 2px;
  padding: 0 4px; height: 22px;
  font-size: 11px; font-weight: 700;
}
.tree-item {
  display: flex; align-items: center; gap: 6px;
  height: 22px; padding-left: 28px;
  cursor: pointer;
}
.tree-item:hover { background: var(--bg-hover); }
.tree-item.active { background: var(--bg-active); color: var(--text-bright); }
.tree-chevron { margin-left: -20px; margin-right: -2px; transform: rotate(-90deg); flex-shrink: 0; }
.tree-item.active .tree-chevron { transform: none; }
.file-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ───────── Editor ───────── */
.editor { display: flex; flex-direction: column; flex: 1; min-width: 0; background: var(--bg-editor); }

.tabs {
  display: flex; flex-shrink: 0;
  height: 35px;
  background: var(--bg-chrome);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 12px;
  border-right: 1px solid var(--border);
  border-top: 1px solid transparent;
  color: var(--text-dim);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.tab.active {
  background: var(--bg-editor); color: var(--text-bright);
  border-top-color: var(--accent);
  /* cover the tab strip's bottom border so the tab joins the editor */
  margin-bottom: -1px; padding-bottom: 1px;
}
.tab-close {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 4px;
  visibility: hidden;
}
.tab-close svg { width: 16px; height: 16px; }
.tab:hover .tab-close, .tab.active .tab-close { visibility: visible; }
.tab-close:hover { background: var(--bg-active); }

.breadcrumbs {
  display: flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 16px; flex-shrink: 0;
  color: var(--text-dim); font-size: 12px;
}
.breadcrumbs .file-icon { width: 14px; height: 14px; }

.panes { flex: 1; min-height: 0; position: relative; }
.pane { display: none; height: 100%; overflow-y: auto; scrollbar-color: #4f4f4f transparent; }
.pane.active { display: block; }

.empty { display: none; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-dim); }
.empty.active { display: flex; }
.empty img { width: 280px; filter: grayscale(1); opacity: .18; }

/* ───────── Page content (index.html, assets) ───────── */
.page { max-width: 960px; margin: 0 auto; padding: 40px 32px 80px; font-size: 15px; line-height: 1.6; }

.comment, .tok-comment { color: var(--tok-comment); }
.comment { font-family: var(--font-code); font-size: 13px; font-weight: 400; }
.tok-tag { color: var(--tok-tag); }
.tok-var { color: var(--tok-var); }
.tok-str { color: var(--tok-str); }
.tok-type { color: var(--tok-type); }
.tok-key { color: var(--tok-key); }
.tok-punct { color: var(--tok-punct); }

h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.1; color: var(--text-bright); font-weight: 600; letter-spacing: -.02em; }
h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 56px 0 20px;
  font-family: var(--font-code); font-size: 20px; font-weight: 500; color: var(--text-bright);
  /* Cascadia Code joins "/>" into one ligature glyph; keep the characters separate */
  font-variant-ligatures: none;
}
h2 .tok-punct { letter-spacing: .15em; }
h3 { font-size: 17px; font-weight: 600; color: var(--text-bright); }
h4 { margin: 20px 0 10px; }
.h-icon { width: 20px; height: 20px; }

/* Draft placeholders — everything dashed/amber still needs real content */
.ph, .ph-inline, .ph-tag, .ph-link, .ph-btn, .ph-code { color: #b89b5e !important; font-style: italic; }
.ph { border-left: 2px dashed #6b5a34; padding-left: 10px; }

/* Hero */
.hero { display: flex; align-items: center; gap: 40px; padding: 24px 0 8px; }
.avatar {
  width: 200px; height: 200px; flex-shrink: 0;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border-strong);
  outline: 1px solid var(--accent); outline-offset: 5px;
}
.hero-text { min-width: 0; }
.role { margin: 10px 0 16px; font-family: var(--font-code); font-size: clamp(15px, 2.200vw, 19px); }
.cursor {
  display: inline-block; width: 2px; height: 1.1em; margin-left: 4px;
  background: var(--text); vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
.bio { max-width: 56ch; }
.edu { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; }
/* Logo has dark artwork, so it sits on a light chip */
.edu-logo { background: #fff; border-radius: 4px; padding: 4px 8px; display: flex; flex-shrink: 0; }
.edu-logo img { height: 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  padding: 7px 16px; border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: #2d2d2d; color: var(--text-bright); font-size: 13px;
}
.btn:hover { background: var(--bg-active); }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.ph-btn { background: none; border-style: dashed; }

/* Projects */
.project {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 20px;
}
.project.featured { margin-bottom: 20px; }
.project-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dates { font-family: var(--font-code); font-size: 12px; }
.badge {
  display: inline-block; margin-bottom: 6px; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-family: var(--font-code);
}
.badge-ds { background: rgba(78, 201, 176, .14); color: var(--tok-type); }
.badge-web { background: rgba(86, 156, 214, .16); color: var(--tok-tag); }

.showcase { display: grid; gap: 12px; }
.showcase.three { grid-template-columns: repeat(3, 1fr); }
.showcase.two { grid-template-columns: repeat(2, 1fr); }
.showcase.device { grid-template-columns: 1fr minmax(0, 190px); align-items: start; }

/* Project media (image/video) */
.media { position: relative; }
.media video, .media img {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border: 1px solid var(--border-strong); border-radius: 4px; background: #000;
}
.media.phone img { aspect-ratio: 392 / 831; object-fit: contain; }
.media figcaption { margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.hover-video { cursor: pointer; }
.play-hint { font-family: var(--font-code); color: var(--tok-fn); margin-right: 6px; }
.media.playing .play-hint { visibility: hidden; }

/* Thesis stats + charts */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.stats div { background: var(--bg-editor); border: 1px solid var(--border-strong); border-radius: 4px; padding: 12px 14px; }
.stats dt { font-size: 12px; color: var(--text-dim); }
.stats dd { font-size: 24px; font-weight: 600; color: var(--text-bright); line-height: 1.3; }

.charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-items: start; }
.chart { background: var(--bg-editor); border: 1px solid var(--border-strong); border-radius: 4px; padding: 14px 16px 16px; }
.chart figcaption { margin-bottom: 12px; }
.chart-title { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.chart-sub { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.chart-note { margin-top: 10px; font-size: 11px; color: var(--text-dim); line-height: 1.4; }
.bars { display: grid; gap: 4px; }
.bar-row {
  display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 10px;
  padding: 2px 0; border-radius: 3px; cursor: default;
}
.bar-row:hover, .bar-row:focus-visible { background: rgba(255,255,255,.04); }
.bar-label { font-size: 12px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Right padding reserves room for the value label so bars scale to the remaining width */
.bar-track { position: relative; display: flex; align-items: center; height: 20px; padding-right: 76px; }
.bar {
  height: 14px; min-width: 2px; flex-shrink: 0;
  background: #3794ff; border-radius: 0 4px 4px 0;
}
.bar.muted { background: #5a5d63; }
.bar.range { border-radius: 4px; }
.bar-value { margin-left: 8px; font-size: 12px; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-axis { display: grid; grid-template-columns: 128px 1fr; gap: 10px; margin-top: 2px; }
.bar-axis div { margin-right: 76px; display: flex; justify-content: space-between; border-top: 1px solid var(--border-strong); padding-top: 3px; font-size: 10px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.chart-tip {
  position: fixed; z-index: 10; pointer-events: none;
  max-width: 240px; padding: 6px 9px;
  background: #252526; border: 1px solid #454545; border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  font-size: 12px; line-height: 1.45; color: var(--text);
  opacity: 0; transition: opacity .1s;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { color: var(--text-bright); font-weight: 600; }

.project-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.tags, .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 1px 8px; border-radius: 3px;
  background: #333; font-family: var(--font-code); font-size: 12px;
}
.links { display: flex; gap: 16px; font-size: 13px; }
.links a { color: #3794ff; }
.links a:hover { text-decoration: underline; }


.project-role { font-family: var(--font-code); font-size: 12px; color: var(--text-dim); }
.points { list-style: disc; padding-left: 20px; margin-top: 8px; font-size: 14px; }
.points li { margin-bottom: 4px; }
.points li::marker { color: var(--tok-punct); }
strong { color: var(--text-bright); font-weight: 600; }

/* Experience */
.timeline { list-style: none; border-left: 1px solid var(--border-strong); margin-left: 6px; }
.timeline > li { position: relative; padding: 0 0 28px 24px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -5px; top: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg-editor); border: 2px solid var(--accent);
}
.job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.job-head .dates { color: var(--text-dim); }
/* Earlier role at the same organization, shown under the later one */
.prior-role { margin-top: 18px; }
.prior-role h3 { font-size: 15px; font-weight: 500; }
.org { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--tok-type); font-size: 14px; }
/* Logos are pre-trimmed copies in Assets/trimmed, so a fixed height keeps each one at its true proportions */
.org-logo { height: 28px; width: auto; flex-shrink: 0; }

/* Assets */
.stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stack-group { background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 6px; padding: 16px 20px 20px; }
.stack-group h4 { margin: 0 0 12px; font-family: var(--font-code); font-size: 13px; font-weight: 500; color: var(--tok-var); }
.chips li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: 4px;
  background: #2f2f2f; border: 1px solid var(--border-strong); font-size: 13px;
}
/* Empty square = drop a logo here */
.chip-icon { width: 20px; height: 20px; border: 1px dashed #666; border-radius: 3px; }

.stack-group.wide { grid-column: 1 / -1; }
.skills { margin-top: 12px; font-size: 13px; color: var(--text-dim); }
.value p:not(.ph) { font-size: 14px; }

.value-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.value { background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 6px; padding: 20px; }
.value-num { font-family: var(--font-code); font-size: 12px; color: var(--tok-fn); }
.value h3 { margin: 4px 0 10px; }
.value .ph { font-size: 14px; }

/* ───────── Code views (.env) ───────── */
.code {
  padding: 12px 0 80px;
  font-family: var(--font-code); font-size: 14px; line-height: 22px;
  counter-reset: line;
  color: #d4d4d4;
}
.ln { display: flex; min-height: 22px; padding-right: 16px; counter-increment: line; white-space: pre-wrap; word-break: break-word; }
.ln::before {
  content: counter(line);
  width: 56px; flex-shrink: 0; padding-right: 20px;
  text-align: right; color: #6e7681; user-select: none;
}
.ln:hover { background: rgba(255,255,255,.035); }
.ln:hover::before { color: var(--text); }
.code a:hover { text-decoration: underline; }

/* ───────── Status bar ───────── */
.statusbar {
  display: flex; justify-content: space-between;
  height: 22px; flex-shrink: 0;
  background: var(--bg-chrome);
  border-top: 1px solid var(--border);
  font-size: 12px; user-select: none;
}
.status-left, .status-right { display: flex; align-items: center; }
.statusbar span { display: flex; align-items: center; gap: 4px; height: 100%; padding: 0 8px; white-space: nowrap; }
.status-remote { background: var(--accent); color: #fff; font-family: var(--font-code); padding: 0 10px !important; }

/* ───────── Mobile nav (hidden on desktop) ───────── */
.mobile-nav { display: none; }

/* Mobile-only pieces: wrappers vanish from the desktop layout, extras are hidden */
.m-avatar-row, .m-term { display: contents; }
.m-status, .m-hero-meta, .m-term-bar, .m-cmdline, .m-metrics, .m-cmd, .m-now-tag,
.m-contact, .m-chart-tabs, .fold-toggle { display: none; }

/* ───────── Tablet ───────── */
@media (max-width: 1000px) {
  .menu { display: none; }
  .sidebar { width: 200px; }
}

/* ───────── Mobile: the editor window gives way to a terminal-style app ───────── */
@media (max-width: 700px) {
  .activitybar, .sidebar, .tabs, .breadcrumbs, .statusbar,
  .command-center, .window-controls, .app-logo, .menu { display: none; }

  /* Title bar reads as a shell prompt */
  .titlebar { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 16px; }
  .titlebar-left { min-width: 0; }
  .mobile-title { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-bright); }
  .m-status {
    display: flex; align-items: center; gap: 7px; margin-left: auto; flex-shrink: 0;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(78, 201, 176, .12); color: var(--tok-type);
    font-family: var(--font-code); font-size: 11px;
  }
  .m-status::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: #3fb950; box-shadow: 0 0 0 3px rgba(63, 185, 80, .2);
  }

  /* Hero: avatar row, then a terminal window answering `whoami` */
  .page { padding: 20px 16px 40px; }
  .hero { flex-direction: column; align-items: stretch; gap: 16px; padding: 4px 0 0; }
  .m-avatar-row { display: flex; align-items: center; gap: 16px; }
  .avatar { width: 64px; height: 64px; border-width: 2px; outline-offset: 3px; }
  .m-hero-meta { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.4; color: var(--text-dim); }
  .m-now { color: var(--text-bright); font-weight: 600; }
  .m-term {
    display: block; padding: 0 16px 16px; overflow: hidden;
    background: #141414; border: 1px solid var(--border-strong); border-radius: 10px;
  }
  .m-term-bar {
    display: flex; align-items: center; gap: 6px;
    margin: 0 -16px 14px; padding: 9px 12px;
    background: #1b1b1b; border-bottom: 1px solid var(--border);
    font-family: var(--font-code); font-size: 11px; color: var(--text-dim);
  }
  .m-term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
  .m-term-bar i:nth-child(2) { background: #febc2e; }
  .m-term-bar i:nth-child(3) { background: #28c840; }
  .m-term-bar span { margin-left: 8px; }
  .m-cmdline { display: block; margin-bottom: 6px; font-family: var(--font-code); font-size: 13px; }
  .hero .comment { display: none; }
  h1 { font-size: 32px; }
  .role { margin: 8px 0 0; font-size: 14px; }
  .hero-text .bio { margin-top: 16px; font-size: 15px; }
  .edu { margin-top: 14px; font-size: 13px; }
  .edu .dim { white-space: nowrap; }
  .edu-logo img { height: 26px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
  .actions .btn { padding: 11px 12px; text-align: center; font-size: 14px; }
  .actions .ph-btn { grid-column: 1 / -1; }

  /* Headline numbers as dashboard tiles */
  .m-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 24px; }
  .m-metrics div {
    display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px;
    padding: 12px 10px;
    background: var(--bg-card); border: 1px solid var(--border-strong); border-top: 2px solid var(--accent); border-radius: 8px;
  }
  .m-metrics dd { font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--text-bright); }
  .m-metrics dt { font-size: 11px; line-height: 1.35; color: var(--text-dim); }

  /* Section headings become shell commands: ❯ ls projects */
  h2 { margin: 40px 0 16px; font-size: 16px; }
  h2::before { content: "❯"; color: var(--tok-comment); }
  h2 .tok-punct, h2 .h-icon { display: none; }
  .m-cmd { display: inline; font-weight: 400; color: var(--tok-fn); }

  /* Projects */
  .project { padding: 16px; border-radius: 10px; }
  .project.featured { margin-bottom: 16px; }
  h3 { font-size: 16px; }
  .project-head { margin-bottom: 8px; }

  /* Folded bullet lists: keeps the first 2 lines (FOLD_KEEP in script.js) */
  .foldable:not(.open) > li:nth-child(n+3) { display: none; }
  .fold-toggle {
    display: inline-flex; margin: 2px 0 0 20px; padding: 4px 9px;
    background: #2d2d2d; border: 1px solid var(--border-strong); border-radius: 4px;
    font-family: var(--font-code); font-size: 12px; color: var(--tok-var);
  }

  /* Thesis charts: one full-width chart at a time, picked with tabs */
  .charts { display: block; }
  .charts > .chart:not(.on) { display: none; }
  .m-chart-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
  .m-chart-tabs::before {
    content: "// tap to switch charts"; grid-column: 1 / -1;
    font-family: var(--font-code); font-size: 12px; color: var(--tok-comment);
  }
  .m-chart-tabs button {
    min-height: 40px; padding: 8px 4px; border-radius: 6px;
    background: #2d2d2d; border: 1px solid #4a4a4a; box-shadow: 0 2px 0 #111;
    font-size: 13px; font-weight: 600; color: var(--text);
  }
  .m-chart-tabs button:active { transform: translateY(1px); box-shadow: 0 1px 0 #111; }
  .m-chart-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

  /* Screenshots stack full width */
  .showcase.two { grid-template-columns: 1fr; gap: 16px; }
  /* Desktop + phone screenshots: one mockup with the phone over the corner */
  .showcase.device { display: block; position: relative; padding-bottom: 36px; }
  .showcase.device .phone figcaption { display: none; }
  .showcase.device .media:first-child figcaption { padding-right: 34%; }
  .showcase.device > .media.phone { position: absolute; right: 10px; bottom: 0; width: 28%; }
  .media.phone img { border: 0; background: none; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .55)); }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stats div { padding: 10px 12px; }
  .stats dd { font-size: 20px; }

  /* Bar labels sit above the bars so the bars get the full width */
  .chart { padding: 14px 14px 12px; border-radius: 8px; }
  .bars { gap: 6px; }
  .bar-row { grid-template-columns: 1fr; gap: 2px; margin: 0 -4px; padding: 2px 4px; }
  .bar-label { text-align: left; color: var(--text-dim); }
  .bar-axis { grid-template-columns: 1fr; }
  .bar-axis > span { display: none; }

  /* Experience: title, then dates; the current role is tagged and its dot filled */
  .timeline { margin-left: 5px; }
  .timeline > li { padding: 0 0 26px 20px; }
  .timeline > li::before { top: 8px; }
  .timeline > li:first-child::before { top: 5px; background: var(--accent); box-shadow: 0 0 0 4px rgba(0, 120, 212, .25); }
  .job-head { display: grid; justify-items: start; gap: 2px; }
  .m-now-tag {
    display: block; padding: 0 7px; border-radius: 3px;
    background: rgba(78, 201, 176, .14); color: var(--tok-type);
    font-family: var(--font-code); font-size: 11px;
  }
  .prior-role { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
  .org { margin-top: 4px; font-size: 13px; }
  .org-logo { height: 22px; }

  /* Assets: tighter groups and chips */
  .stack, .value-grid { grid-template-columns: 1fr; gap: 10px; }
  .stack-group { padding: 14px; border-radius: 8px; }
  .stack-group h4 { margin-bottom: 10px; }
  .chips li { gap: 6px; padding: 4px 10px 4px 6px; font-size: 12.5px; }
  .chip-icon { width: 16px; height: 16px; }
  .skills { font-size: 12.5px; }
  .value { padding: 16px; border-radius: 8px; }

  /* .env: the file, then large tap targets for the same details */
  .code { padding: 12px 0 8px; font-size: 12.5px; line-height: 21px; }
  .ln::before { width: 36px; padding-right: 12px; }
  .m-contact { display: grid; gap: 8px; padding: 12px 16px 32px; }
  .m-contact p { margin-bottom: 2px; font-family: var(--font-code); font-size: 12.5px; }
  .m-contact a {
    display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
    background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 8px;
    font-size: 15px; color: var(--text-bright);
  }
  .m-contact a:first-of-type { border-color: var(--accent); }
  .m-contact a:active { background: var(--bg-active); }
  .m-run { font-family: var(--font-code); font-size: 12px; color: var(--tok-fn); }

  .mobile-nav {
    display: grid; grid-template-columns: repeat(3, 1fr);
    flex-shrink: 0;
    background: var(--bg-chrome);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 8px 4px 7px;
    border-top: 2px solid transparent;
    color: var(--text-dim); font-family: var(--font-code); font-size: 10px;
  }
  .mobile-nav svg { width: 20px; height: 20px; margin-bottom: 3px; }
  .mobile-nav b { font-family: var(--font-ui); font-size: 12px; font-weight: 600; }
  .mobile-nav span { opacity: .75; }
  .mobile-nav a.active { color: var(--text-bright); border-top-color: var(--accent); background: var(--bg-editor); }
}

/* Very narrow phones: keep the file name, drop the folder */
@media (max-width: 380px) {
  .mobile-title .dim { display: none; }
}
