/*!==============================
 * Commitlog — Free Developer Resume Website Template
 * Author: uiCookies
 * License: Free for personal & commercial use — https://uicookies.com/license/
 * Design layer: editor-inspired light/dark palette with syntax-colour accents,
 * Geist for reading, Geist Mono for the code-flavoured details.
 *===============================*/

/* ------------------------------------------------------------------
   1. Design tokens — change these to rebrand
   Light theme is the default; [data-theme="dark"] overrides below.
------------------------------------------------------------------ */
:root {
  --bg:         #f6f6f2;   /* page background (warm paper) */
  --bg-2:       #efefe9;   /* alternate section band */
  --surface:    #ffffff;   /* cards, editor panes */
  --surface-2:  #f3f3ee;   /* inset areas, gutters */
  --line:       #e0e0d8;   /* hairlines */
  --line-2:     #cfcfc5;   /* stronger borders */

  --text:       #23262c;   /* body text */
  --heading:    #0f1115;   /* headings */
  --muted:      #5a616c;   /* secondary text */
  --faint:      #626975;   /* tertiary labels (AA on every light surface) */

  --accent:     #0d7a4a;   /* "commit green" — links, buttons, focus */
  --accent-2:   #0a6640;   /* hover */
  --accent-ink: #ffffff;   /* text on accent */
  --accent-wash: rgba(13, 122, 74, .09);

  /* syntax palette — used for code and small accents */
  --tk-key:     #7c3aed;   /* keywords */
  --tk-fn:      #1d5fd1;   /* functions, properties */
  --tk-str:     #0d7a4a;   /* strings */
  --tk-num:     #b04a0b;   /* numbers, metrics */
  --tk-type:    #0e6f86;   /* types */
  --tk-com:     #626975;   /* comments */

  --heat-0: #e7e7e0; --heat-1: #b7e2c8; --heat-2: #6cc394; --heat-3: #2a9a63; --heat-4: #0d6b40;

  --shadow-sm: 0 1px 2px rgba(15, 17, 21, .05), 0 4px 14px rgba(15, 17, 21, .05);
  --shadow-md: 0 2px 4px rgba(15, 17, 21, .04), 0 18px 48px rgba(15, 17, 21, .10);

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

  --container: 1160px;
  --radius: 10px;
  --radius-sm: 6px;
  --nav-h: 68px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg:         #0d1014;
  --bg-2:       #11151a;
  --surface:    #151a21;
  --surface-2:  #1a2029;
  --line:       #242b35;
  --line-2:     #333c48;

  --text:       #d3d8df;
  --heading:    #f3f5f8;
  --muted:      #98a1ae;
  --faint:      #8a93a0;

  --accent:     #5fd49b;
  --accent-2:   #86e3b5;
  --accent-ink: #06231a;
  --accent-wash: rgba(95, 212, 155, .10);

  --tk-key:     #c6a6ff;
  --tk-fn:      #82b4ff;
  --tk-str:     #8fdcaa;
  --tk-num:     #ffb27a;
  --tk-type:    #6fd3e3;
  --tk-com:     #7f8998;

  --heat-0: #1c232c; --heat-1: #154431; --heat-2: #1f6e4b; --heat-3: #35a571; --heat-4: #6fe0a6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 48px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* ------------------------------------------------------------------
   2. Base
------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  color: var(--heading);
  font-weight: 650;
  letter-spacing: -.022em;
  line-height: 1.12;
  margin: 0 0 .5em;
}
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }
code, kbd, pre, .mono { font-family: var(--mono); }
strong { font-weight: 650; color: var(--heading); }

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; transition: color .2s var(--ease); }
a:hover { color: var(--accent-2); text-decoration: underline; }

::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--container); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 3000;
  background: var(--heading); color: var(--bg);
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .9rem;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; color: var(--bg); text-decoration: none; }

.visually-hidden-focusable:not(:focus) { position: absolute !important; }

/* icons from the inline sprite */
.ico {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -.125em;
}
.ico-fill { fill: currentColor; stroke: none; }

/* syntax tokens */
.tk-k { color: var(--tk-key); }
.tk-f { color: var(--tk-fn); }
.tk-s { color: var(--tk-str); }
.tk-n { color: var(--tk-num); }
.tk-t { color: var(--tk-type); }
.tk-c { color: var(--tk-com); font-style: italic; }
.tk-p { color: var(--muted); }

/* ------------------------------------------------------------------
   3. Buttons, chips, eyebrow, section heads
------------------------------------------------------------------ */
.btn {
  --bs-btn-focus-box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--mono); font-size: .9rem; font-weight: 500;
  padding: .72rem 1.15rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; line-height: 1.2;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-accent:hover, .btn-accent:focus-visible { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn-line { background: var(--surface); color: var(--heading); border-color: var(--line-2); }
.btn-line:hover, .btn-line:focus-visible { border-color: var(--heading); color: var(--heading); background: var(--surface); }
.btn-ghost { background: transparent; color: var(--heading); padding-inline: .6rem; }
.btn-ghost:hover { color: var(--accent); }
.btn-sm { padding: .45rem .75rem; font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .82rem; font-weight: 500;
  color: var(--muted); letter-spacing: .01em;
  margin: 0 0 .9rem;
}
.eyebrow .idx { color: var(--accent); }
.eyebrow .slash { color: var(--tk-com); }

.section { padding: 6rem 0; }
.section-band { background: var(--bg-2); border-block: 1px solid var(--line); }
@media (max-width: 767.98px) { .section { padding: 4.25rem 0; } }

.sec-head { max-width: 820px; margin-bottom: 3rem; }
.sec-head h2 { font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.6rem); }
.sec-head .lead { font-size: 1.1rem; color: var(--muted); margin: 0; }
.sec-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; max-width: none; }
.sec-head-row > div { max-width: 680px; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font-family: var(--mono); font-size: .76rem; line-height: 1;
  padding: .38rem .55rem; border-radius: 4px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}

.metric { font-family: var(--mono); font-weight: 600; color: var(--tk-num); white-space: nowrap; font-size: .95em; }

kbd {
  font-size: .72rem; font-family: var(--mono);
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 4px; padding: .1rem .35rem;
}

/* ------------------------------------------------------------------
   4. Header / navigation
------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), background-color .25s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .navbar { min-height: var(--nav-h); padding: .6rem 0; }

.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--heading); font-family: var(--mono); font-weight: 600; font-size: .98rem; }
.brand:hover { text-decoration: none; color: var(--heading); }
.brand-avatar {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--heading); color: var(--bg); font-size: .8rem; letter-spacing: .02em;
}
.brand-path .tilde { color: var(--accent); }
.caret { display: inline-block; width: .55em; height: 1.05em; background: var(--accent); vertical-align: -.18em; margin-left: .15em; }
.js .caret { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav-menu { gap: .1rem; }
.nav-menu .nav-link {
  font-family: var(--mono); font-size: .86rem; color: var(--muted);
  padding: .45rem .7rem !important; border-radius: var(--radius-sm);
}
.nav-menu .nav-link:hover, .nav-menu .nav-link:focus-visible { color: var(--heading); text-decoration: none; background: var(--surface-2); }
.nav-menu .nav-link.active, .nav-menu .nav-link[aria-current="page"] { color: var(--heading); }
.nav-menu .nav-link.active::before, .nav-menu .nav-link[aria-current="page"]::before { content: "▸ "; color: var(--accent); }
.nav-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 .5rem; }

.nav-tools { display: flex; align-items: center; gap: .4rem; }
.tool-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  height: 38px; min-width: 38px; padding: 0 .65rem; justify-content: center;
  background: var(--surface); color: var(--heading);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .8rem; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.tool-btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.tool-btn .ico { font-size: 1rem; }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: inline; }
.palette-btn .label { color: var(--muted); }
.palette-btn kbd { margin-left: .2rem; }
/* the palette and theme switch need JavaScript */
.palette-btn, .theme-toggle { display: none; }
.js .palette-btn, .js .theme-toggle { display: inline-flex; }

.navbar-toggler {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  width: 42px; height: 38px; padding: 0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--surface);
}
.navbar-toggler:focus { box-shadow: none; }
.toggler-bar { display: block; width: 18px; height: 2px; background: var(--heading); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.navbar-toggler[aria-expanded="true"] .toggler-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.navbar-toggler[aria-expanded="true"] .toggler-bar:nth-child(2) { opacity: 0; }
.navbar-toggler[aria-expanded="true"] .toggler-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 991.98px) {
  .site-header .navbar-collapse { border-top: 1px solid var(--line); margin-top: .6rem; padding: .75rem 0 1rem; }
  .nav-menu .nav-link { padding: .65rem .5rem !important; font-size: .95rem; }
  .nav-sep { display: none; }
  .palette-btn .label, .palette-btn kbd { display: none; }
}

/* ------------------------------------------------------------------
   5. Hero
------------------------------------------------------------------ */
.hero { padding: 4.5rem 0 5rem; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 75% 30%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 60% at 75% 30%, #000 10%, transparent 70%);
  opacity: .55;
}
.hero > .container { position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3.5rem; align-items: center; }

.prompt { font-family: var(--mono); font-size: .9rem; color: var(--muted); margin-bottom: 1.4rem; display: flex; align-items: center; gap: .5rem; min-height: 1.6em; }
.prompt .ps1 { color: var(--accent); }
.prompt .cmd { color: var(--heading); }

.identity { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.25rem; }
.avatar {
  position: relative; width: 84px; height: 84px; flex: none; border-radius: 22px;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: 1.7rem; letter-spacing: -.02em;
  color: #f4fbf7;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,.28), transparent 45%),
    linear-gradient(140deg, #134e3a 0%, #0d7a4a 48%, #1d5fd1 100%);
  box-shadow: var(--shadow-md);
}
.avatar::after {
  content: ""; position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: #2fbf71; border: 4px solid var(--bg);
}
.hero h1 { font-size: clamp(2.4rem, 1.4rem + 3.8vw, 4.1rem); margin: 0; letter-spacing: -.035em; }
.hero .role { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); color: var(--text); max-width: 34ch; margin: 1rem 0 1.5rem; line-height: 1.45; }
.hero .role .hl { color: var(--heading); font-weight: 600; }

.status {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .82rem; color: var(--heading);
  background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: .45rem .8rem .45rem .7rem; border-radius: 999px;
}
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #2fbf71; position: relative; flex: none; }
.js .pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #2fbf71; opacity: 0; animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

.facts { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: 1.35rem 0 1.9rem; font-size: .93rem; color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: .45rem; }
.facts .ico { color: var(--faint); }
.facts time { font-family: var(--mono); color: var(--heading); }

.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.links { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin-top: 1.75rem; font-family: var(--mono); font-size: .84rem; }
.links a { color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.links a:hover { color: var(--heading); }

/* Editor window */
.editor {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md); overflow: hidden; min-width: 0;
}
.editor-bar { display: flex; align-items: center; gap: .9rem; padding: 0 .9rem; border-bottom: 1px solid var(--line); background: var(--surface-2); min-height: 44px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); display: block; }
.editor-tabs { display: flex; gap: 0; align-self: stretch; overflow-x: auto; }
.editor-tab {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  background: transparent; border: 0; border-inline: 1px solid transparent;
  padding: 0 .9rem; display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; white-space: nowrap;
  position: relative;
}
.editor-tab[aria-selected="true"] { color: var(--heading); background: var(--surface); border-inline-color: var(--line); }
.editor-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--surface); }
.editor-tab[aria-selected="true"]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); }
.editor-tab .ext { width: 8px; height: 8px; border-radius: 2px; background: var(--tk-fn); }
.editor-tab .ext.md { background: var(--tk-num); }
.editor-foot {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: .72rem; color: var(--faint);
  border-top: 1px solid var(--line); padding: .45rem .9rem; background: var(--surface-2);
}
.editor-foot .branch { color: var(--accent); }

/* code blocks (shared) */
.code {
  margin: 0; padding: 1.1rem 1.1rem 1.2rem 0;
  font-size: .84rem; line-height: 1.75; color: var(--text);
  background: var(--surface); counter-reset: ln;
  overflow-x: auto; white-space: pre; tab-size: 2;
}
.code code { font-family: inherit; color: inherit; font-size: inherit; }
.code .line { counter-increment: ln; }
.code .line::before {
  content: counter(ln); display: inline-block; width: 3.2em; padding-right: 1.1em; text-align: right;
  color: var(--faint); opacity: .7; -webkit-user-select: none; user-select: none;
}
.code:focus-visible { outline-offset: -2px; }
.tab-panel[hidden] { display: none; }

.now-list { padding: 1.2rem 1.4rem 1.4rem; font-size: .95rem; }
.now-list h3 { font-family: var(--mono); font-size: .95rem; color: var(--tk-num); margin-bottom: .8rem; letter-spacing: 0; }
.now-list li { padding-left: 1.3rem; position: relative; margin-bottom: .55rem; }
.now-list li::before { content: "-"; position: absolute; left: 0; font-family: var(--mono); color: var(--tk-key); }
.now-list p { font-family: var(--mono); font-size: .78rem; color: var(--faint); margin-top: 1rem; }

/* ------------------------------------------------------------------
   6. Summary / about
------------------------------------------------------------------ */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 4rem; align-items: start; }
.about-copy p { font-size: 1.12rem; }
.about-copy p.eyebrow { font-size: .82rem; }
.about-copy p.big { font-size: clamp(1.3rem, 1.1rem + .7vw, 1.6rem); color: var(--heading); line-height: 1.45; letter-spacing: -.01em; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stat { padding: 1.4rem 1.3rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat:nth-child(2n) { border-right: 0; }
.stat:nth-last-child(-n+2) { border-bottom: 0; }
.stat-num { font-family: var(--mono); font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.3rem); font-weight: 600; color: var(--heading); letter-spacing: -.03em; line-height: 1.1; }
.stat-num .u { color: var(--accent); font-size: .6em; margin-left: .1em; }
.stat-label { color: var(--muted); font-size: .9rem; margin-top: .35rem; line-height: 1.4; }
.values { margin-top: 2rem; display: grid; gap: .75rem; }
.values li { display: flex; gap: .8rem; align-items: baseline; font-size: 1rem; }
.values .k { font-family: var(--mono); font-size: .8rem; color: var(--tk-key); flex: none; min-width: 5.5rem; }
.quick-facts { margin-top: 1.25rem; }
.quick-facts .contact-row { grid-template-columns: 7.5rem minmax(0, 1fr); padding: .8rem 1.3rem; }
.quick-facts dd { font-size: .93rem; }

/* ------------------------------------------------------------------
   7. Experience — git log timeline
------------------------------------------------------------------ */
.gitlog { position: relative; }
.commit { display: grid; grid-template-columns: 190px 40px minmax(0, 1fr); gap: 0 1rem; position: relative; padding-bottom: 3rem; }
.commit:last-child { padding-bottom: 0; }
.commit-rail { position: relative; display: flex; justify-content: center; }
.commit-rail::before { content: ""; position: absolute; top: 14px; bottom: -14px; width: 2px; background: var(--line-2); }
.commit:last-child .commit-rail::before { bottom: auto; height: 60%; background: linear-gradient(var(--line-2), transparent); }
.node { position: relative; z-index: 1; width: 16px; height: 16px; margin-top: 6px; border-radius: 50%; background: var(--bg); border: 3px solid var(--line-2); }
.commit.is-head .node { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-wash); }
.section-band .node { background: var(--bg-2); }

.commit-meta { font-family: var(--mono); font-size: .8rem; color: var(--muted); text-align: right; padding-top: .2rem; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.hash { color: var(--tk-num); }
.ref { display: inline-block; font-size: .7rem; padding: .18rem .45rem; border-radius: 4px; background: var(--accent-wash); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.commit-meta .when { color: var(--heading); font-weight: 500; }

.commit-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.7rem; box-shadow: var(--shadow-sm); }
.commit-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; align-items: baseline; }
.commit-body h3 { font-size: 1.35rem; margin: 0; }
.commit-body .where { color: var(--muted); font-size: .93rem; margin: .35rem 0 1.2rem; }
.role-block + .role-block { margin-top: 1.4rem; padding-top: 1.3rem; border-top: 1px dashed var(--line-2); }
.role-title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; align-items: baseline; margin-bottom: .7rem; }
.role-title h4 { font-size: 1.04rem; margin: 0; letter-spacing: -.01em; }
.role-title .dates { font-family: var(--mono); font-size: .78rem; color: var(--faint); }
.wins li { position: relative; padding-left: 1.4rem; margin-bottom: .55rem; font-size: .98rem; }
.wins li::before { content: "+"; position: absolute; left: 0; top: 0; font-family: var(--mono); font-weight: 600; color: var(--accent); }
.commit-body .chips { margin-top: 1.2rem; }

/* ------------------------------------------------------------------
   8. Skills matrix
------------------------------------------------------------------ */
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-family: var(--mono); font-size: .78rem; color: var(--muted); margin-bottom: 1.5rem; }
.legend li { display: inline-flex; align-items: center; gap: .45rem; }
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.skill-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skill-card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.skill-card-head h3 { font-family: var(--mono); font-size: .88rem; font-weight: 500; margin: 0; letter-spacing: 0; color: var(--heading); }
.skill-card-head h3 .ext { color: var(--tk-com); }
.skill-card-head span { font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.skill-table { width: 100%; border-collapse: collapse; }
.skill-table th, .skill-table td { padding: .62rem 1.2rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.skill-table tr:last-child th, .skill-table tr:last-child td { border-bottom: 0; }
.skill-table thead th { font-family: var(--mono); font-size: .7rem; font-weight: 500; color: var(--faint); text-transform: lowercase; padding-block: .5rem; }
.skill-table tbody th { font-weight: 550; color: var(--heading); font-size: .96rem; text-align: left; }
.skill-table .lvl { white-space: nowrap; }
.skill-table .yrs { font-family: var(--mono); font-size: .8rem; color: var(--muted); text-align: right; white-space: nowrap; }
.meter { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: .55rem; }
.meter i { width: 14px; height: 8px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--line-2); display: block; }
.meter i.on { background: var(--accent); border-color: var(--accent); }
.lvl-word { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.learning { margin-top: 1.5rem; font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.learning .tk-k { font-style: normal; }

/* ------------------------------------------------------------------
   9. Open source — heatmap + repo cards
------------------------------------------------------------------ */
.activity { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem 1.1rem; margin-bottom: 2rem; }
.activity-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; font-size: .92rem; color: var(--muted); }
.activity-head strong { font-family: var(--mono); }
.heatmap { overflow-x: auto; padding-bottom: .25rem; }
.heatmap svg { display: block; min-width: 760px; width: 100%; height: auto; }
.heatmap rect[data-l="0"] { fill: var(--heat-0); }
.heatmap rect[data-l="1"] { fill: var(--heat-1); }
.heatmap rect[data-l="2"] { fill: var(--heat-2); }
.heatmap rect[data-l="3"] { fill: var(--heat-3); }
.heatmap rect[data-l="4"] { fill: var(--heat-4); }
.heatmap text { fill: var(--faint); font-family: var(--mono); font-size: 9px; }
.heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-family: var(--mono); font-size: .72rem; color: var(--faint); margin-top: .5rem; }
.heat-legend i { width: 11px; height: 11px; border-radius: 2px; display: block; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: 1.4rem; }
.filter-bar .label { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-right: .3rem; }
.filter-btn {
  font-family: var(--mono); font-size: .8rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .8rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
}
.filter-btn:hover { border-color: var(--line-2); color: var(--heading); }
.filter-btn[aria-pressed="true"] { background: var(--heading); color: var(--bg); border-color: var(--heading); }
.filter-status { font-family: var(--mono); font-size: .78rem; color: var(--faint); margin-left: auto; }
.filter-bar[hidden] { display: none; }

.repo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.repo {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.1rem; display: flex; flex-direction: column; gap: .7rem;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.repo:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .repo:hover { transform: none; } }
.repo[hidden] { display: none; }
.repo h3 { font-family: var(--mono); font-size: .98rem; font-weight: 500; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: .5rem; }
.repo h3 .owner { color: var(--muted); font-weight: 400; }
.repo h3 a { color: var(--heading); }
.repo h3 a:hover { color: var(--accent); }
.repo h3 a::after { content: ""; position: absolute; inset: 0; }
.repo { position: relative; }
.repo p { font-size: .94rem; color: var(--text); margin: 0; flex: 1; }
.repo-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.repo-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lang-go { background: #00a7c8; }
.lang-rust { background: #c4693d; }
.lang-ts { background: #3178c6; }
.lang-py { background: #d6a91a; }
.lang-sh { background: #6aa84f; }
.badge-tag { font-family: var(--mono); font-size: .68rem; padding: .12rem .4rem; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------------
   10. Talks & writing
------------------------------------------------------------------ */
.pubs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
.pubs-col h3 { font-family: var(--mono); font-size: .9rem; font-weight: 500; color: var(--muted); letter-spacing: 0; display: flex; align-items: center; gap: .5rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.pub { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 1rem; padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.pub time { font-family: var(--mono); font-size: .78rem; color: var(--faint); padding-top: .2rem; }
.pub h4 { font-size: 1.05rem; margin: 0 0 .3rem; letter-spacing: -.01em; line-height: 1.35; }
.pub h4 a { color: var(--heading); }
.pub h4 a:hover { color: var(--accent); }
.pub p { font-size: .9rem; color: var(--muted); margin: 0; }
.pub .extra { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-family: var(--mono); font-size: .76rem; margin-top: .45rem; }
.pub .extra a { display: inline-flex; align-items: center; gap: .3rem; }

/* ------------------------------------------------------------------
   11. Education & certifications
------------------------------------------------------------------ */
.edu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.edu-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.3rem; }
.edu-card .ico-wrap { width: 40px; height: 40px; border-radius: 8px; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 1rem; }
.edu-card h3 { font-size: 1.08rem; margin-bottom: .25rem; letter-spacing: -.01em; line-height: 1.3; }
.edu-card .org { color: var(--muted); font-size: .92rem; margin-bottom: .6rem; }
.edu-card .yrs { font-family: var(--mono); font-size: .76rem; color: var(--faint); }
.edu-card p.note { font-size: .9rem; margin: .7rem 0 0; }
.cert-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line-2); font-size: .93rem; }
.cert-list li:last-child { border-bottom: 0; }
.cert-list .yrs { flex: none; }

/* ------------------------------------------------------------------
   12. Contact
------------------------------------------------------------------ */
.contact-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 3.5rem; align-items: start; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.contact-card dl { margin: 0; }
.contact-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; padding: .95rem 1.3rem; border-bottom: 1px solid var(--line); align-items: center; }
.contact-row:last-child { border-bottom: 0; }
.contact-row dt { font-family: var(--mono); font-size: .76rem; font-weight: 400; color: var(--faint); }
.contact-row dd { margin: 0; color: var(--heading); font-size: .95rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.contact-row dd.mono { font-size: .8rem; word-break: break-all; color: var(--muted); }
.copy-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: .2rem .5rem; cursor: pointer;
}
.copy-btn:hover { color: var(--heading); border-color: var(--line-2); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }
.copy-btn[hidden] { display: none; }

.form-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow-sm); }
.form-label { font-family: var(--mono); font-size: .8rem; color: var(--heading); margin-bottom: .4rem; }
.form-label .opt { color: var(--faint); }
.form-control, .form-select {
  background-color: var(--bg); color: var(--heading); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: .7rem .85rem; font-size: 1rem; font-family: var(--sans);
}
.form-control::placeholder { color: var(--faint); opacity: 1; }
.form-control:focus, .form-select:focus { background-color: var(--bg); color: var(--heading); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
[data-theme="dark"] .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2398a1ae' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
textarea.form-control { min-height: 150px; height: auto; resize: vertical; }
.form-control.is-invalid, .form-select.is-invalid { border-color: #d64545; background-image: none; padding-right: .85rem; }
.field-error { display: none; color: #c53030; font-size: .84rem; margin-top: .35rem; font-family: var(--mono); }
[data-theme="dark"] .field-error { color: #ff8f8f; }
[data-theme="dark"] .form-control.is-invalid, [data-theme="dark"] .form-select.is-invalid { border-color: #ff8f8f; }
.field-error.show { display: block; }
.field-hint { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--mono); font-size: .74rem; color: var(--faint); margin-top: .35rem; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: space-between; margin-top: 1.4rem; }
.form-foot p { font-size: .82rem; color: var(--muted); margin: 0; max-width: 34ch; }
.form-success {
  display: none; font-family: var(--mono); font-size: .84rem; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: .9rem 1rem; margin-bottom: 1.3rem; color: var(--heading);
}
.form-success.show { display: block; }
.form-success .ok { color: var(--accent); }

/* ------------------------------------------------------------------
   13. Footer
------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); padding: 2.6rem 0 2.2rem; font-size: .9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.2rem 2rem; }
.footer-log { font-family: var(--mono); font-size: .8rem; }
.footer-log .hash { margin-right: .4rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-family: var(--mono); font-size: .82rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--heading); }
.footer-credit { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); font-size: .82rem; }
.footer-credit a { color: var(--heading); }

/* ------------------------------------------------------------------
   14. Command palette (<dialog>)
------------------------------------------------------------------ */
.palette {
  width: min(560px, calc(100vw - 32px)); max-height: min(520px, calc(100vh - 120px));
  margin: 12vh auto auto; padding: 0;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-md);
  overflow: hidden;
}
.palette[open] { display: flex; flex-direction: column; }
.palette::backdrop { background: rgba(8, 10, 14, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.palette-search { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.palette-search .ico { color: var(--faint); font-size: 1.1rem; }
.palette-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--heading); font-family: var(--mono); font-size: .95rem; }
.palette-search input::placeholder { color: var(--faint); }
.palette-list { overflow-y: auto; padding: .4rem; margin: 0; }
.palette-group { font-family: var(--mono); font-size: .7rem; color: var(--faint); padding: .6rem .7rem .3rem; }
.palette-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 7px; cursor: pointer; color: var(--heading); font-size: .95rem; }
.palette-item .ico { color: var(--faint); }
.palette-item .hint { margin-left: auto; font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.palette-item[aria-selected="true"] { background: var(--accent-wash); }
.palette-item[aria-selected="true"] .ico { color: var(--accent); }
.palette-empty { padding: 1.2rem; font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.palette-foot { display: flex; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--line); font-family: var(--mono); font-size: .72rem; color: var(--faint); background: var(--surface-2); }

/* ------------------------------------------------------------------
   15. Reveal animation (only with JS, respects reduced motion)
------------------------------------------------------------------ */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .caret, .js .pulse::after { animation: none; }
}

/* ------------------------------------------------------------------
   16. Projects page — case studies
------------------------------------------------------------------ */
.page-hero { padding: 4rem 0 3rem; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2.2rem, 1.5rem + 2.6vw, 3.4rem); letter-spacing: -.03em; margin-bottom: 1rem; }
.page-hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 0; }
.crumbs { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin-bottom: 1.2rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--faint); margin: 0 .35rem; }

.cases-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3.5rem; padding: 3.5rem 0 5rem; }
.toc { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; }
.toc p { font-family: var(--mono); font-size: .75rem; color: var(--faint); margin-bottom: .7rem; }
.toc ol { counter-reset: toc; border-left: 1px solid var(--line); }
.toc li { counter-increment: toc; }
.toc ol a { display: block; padding: .5rem 0 .5rem 1rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: .92rem; line-height: 1.35; }
.toc ol a::before { content: "0" counter(toc) " "; font-family: var(--mono); font-size: .75rem; color: var(--faint); }
.toc ol a:hover { color: var(--heading); text-decoration: none; }
.toc ol a.active { color: var(--heading); border-left-color: var(--accent); }
.toc .toc-cta { margin-top: 1.5rem; }

.case { padding-bottom: 4.5rem; margin-bottom: 4.5rem; border-bottom: 1px solid var(--line); }
.case:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.case-cover { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 2rem; aspect-ratio: 15 / 8; background: var(--surface-2); }
.case-cover img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) contrast(1.02); }
.case-cover .tag { position: absolute; left: 1rem; top: 1rem; font-family: var(--mono); font-size: .75rem; background: rgba(13, 16, 20, .82); color: #e9edf2; padding: .35rem .6rem; border-radius: 6px; }
.case h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); margin-bottom: .7rem; }
.case .case-lead { font-size: 1.12rem; color: var(--muted); margin-bottom: 1.8rem; }
.case-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0 0 2.4rem; }
.case-meta div { padding: .9rem 1.1rem; border-right: 1px solid var(--line); }
.case-meta div:last-child { border-right: 0; }
.case-meta dt { font-family: var(--mono); font-size: .72rem; font-weight: 400; color: var(--faint); margin-bottom: .2rem; }
.case-meta dd { margin: 0; color: var(--heading); font-size: .93rem; font-weight: 500; line-height: 1.4; }
.case-section { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.case-section h3 { font-family: var(--mono); font-size: .85rem; font-weight: 500; color: var(--tk-key); letter-spacing: 0; padding-top: .3rem; margin: 0; }
.case-section p, .case-section li { font-size: 1.02rem; }
.case-section ol.steps { counter-reset: step; }
.case-section ol.steps li { counter-increment: step; position: relative; padding-left: 2rem; margin-bottom: .7rem; }
.case-section ol.steps li::before { content: counter(step); position: absolute; left: 0; top: .15rem; width: 1.4rem; height: 1.4rem; border-radius: 4px; display: grid; place-items: center; font-family: var(--mono); font-size: .72rem; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--heading); }

.snippet { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); margin: .5rem 0 0; }
.snippet-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem .5rem .45rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.snippet-bar .file { font-family: var(--mono); font-size: .78rem; color: var(--heading); display: inline-flex; align-items: center; gap: .5rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet-bar .lang { font-family: var(--mono); font-size: .7rem; color: var(--faint); margin-left: .25rem; }
.snippet figcaption { font-size: .88rem; color: var(--muted); padding: .8rem 1rem; border-top: 1px solid var(--line); background: var(--surface-2); }

.outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.4rem; }
.outcome { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.outcome .num { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; color: var(--heading); letter-spacing: -.03em; line-height: 1.1; }
.outcome .num .delta { color: var(--accent); font-size: .65em; margin-left: .25rem; }
.outcome .lbl { font-size: .86rem; color: var(--muted); margin-top: .3rem; line-height: 1.4; }

.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem 1rem; margin: 0; }
.chart-title { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin-bottom: .8rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.chart-key { display: inline-flex; gap: 1rem; }
.chart-key span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart-key .k-before { background: var(--line-2); }
.chart-key .k-after { background: var(--accent); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg .bar-before { fill: var(--line-2); }
.chart svg .bar-after { fill: var(--accent); }
.chart svg text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.chart svg text.val { fill: var(--heading); font-weight: 600; }
.chart-table { width: 100%; font-family: var(--mono); font-size: .82rem; border-collapse: collapse; }
.chart-table th, .chart-table td { padding: .35rem .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.chart-table caption { caption-side: top; font-size: .75rem; color: var(--faint); padding: 0 0 .4rem; }
.js .chart.is-drawn .chart-table { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.next-case { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-top: 2.5rem; }
.next-case p { margin: 0; font-family: var(--mono); font-size: .85rem; color: var(--muted); }

/* ------------------------------------------------------------------
   17. Resume page (screen)
------------------------------------------------------------------ */
.resume-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 2rem 0 1.4rem; }
.resume-tools h1 { font-size: 1.3rem; margin: 0; letter-spacing: -.01em; }
.resume-tools .sub { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin: .25rem 0 0; }
.tools-right { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; font-family: var(--mono); font-size: .8rem; color: var(--muted); padding: .55rem .8rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--heading); color: var(--bg); }
.seg-label { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.print-only-js { display: none; }
.js .print-only-js { display: inline-flex; }

.sheet-wrap { padding: 0 0 4rem; overflow-x: auto; }
.sheet {
  --paper: #ffffff; --ink: #16181c; --ink-2: #3c414a; --ink-3: #5f6672; --rule: #dcdcd4; --hi: #0d7a4a; --num: #a14309;
  width: 210mm; min-height: 297mm; margin: 0 auto; background: var(--paper); color: var(--ink-2);
  padding: 13mm 14mm; box-shadow: var(--shadow-md); border-radius: 4px;
  font-size: 9.4pt; line-height: 1.45;
}
.sheet[data-paper="letter"] { width: 215.9mm; min-height: 279.4mm; }
.sheet h2, .sheet h3, .sheet h4, .sheet strong { color: var(--ink); }
.cv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6mm; align-items: end; padding-bottom: 4mm; border-bottom: 1.5pt solid var(--ink); }
.cv-name { font-size: 24pt; font-weight: 650; letter-spacing: -.03em; line-height: 1; margin: 0 0 1.6mm; color: var(--ink); }
.cv-role { font-family: var(--mono); font-size: 9pt; color: var(--hi); margin: 0; }
.cv-contact { font-family: var(--mono); font-size: 7.8pt; line-height: 1.6; text-align: right; color: var(--ink-2); }
.cv-contact a { color: var(--ink-2); }
.cv-summary { margin: 4mm 0 0; font-size: 9.6pt; color: var(--ink-2); }
.cv-cols { display: grid; grid-template-columns: minmax(0, 1fr) 60mm; gap: 7mm; margin-top: 5mm; }
.cv-sec { margin-bottom: 4.5mm; }
.cv-sec:last-child { margin-bottom: 0; }
.cv-sec > h2 { font-family: var(--mono); font-size: 8pt; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--hi); margin: 0 0 2.4mm; padding-bottom: 1.2mm; border-bottom: .6pt solid var(--rule); }
.cv-job { margin-bottom: 3.4mm; break-inside: avoid; }
.cv-job:last-child { margin-bottom: 0; }
.cv-job-head { display: flex; justify-content: space-between; gap: 3mm; align-items: baseline; }
.cv-job h3 { font-size: 10.2pt; margin: 0; letter-spacing: -.01em; line-height: 1.3; }
.cv-job h3 span { font-weight: 400; color: var(--ink-3); }
.cv-dates { font-family: var(--mono); font-size: 7.6pt; color: var(--ink-3); white-space: nowrap; }
.cv-job ul { margin-top: 1.2mm; }
.cv-job li { position: relative; padding-left: 3.6mm; margin-bottom: .7mm; }
.cv-job li::before { content: ""; position: absolute; left: .4mm; top: 2.1mm; width: 1.3mm; height: 1.3mm; background: var(--hi); border-radius: 1px; }
.cv-job .m { font-family: var(--mono); font-weight: 600; color: var(--num); font-size: .92em; }
.cv-skill { margin-bottom: 2.2mm; }
.cv-skill h3 { font-size: 8.6pt; margin: 0 0 .6mm; }
.cv-skill p { margin: 0; font-size: 8.6pt; color: var(--ink-2); }
.cv-skill .lv { font-family: var(--mono); font-size: 7.4pt; color: var(--ink-3); }
.cv-list li { margin-bottom: 1.6mm; font-size: 8.6pt; line-height: 1.4; }
.cv-list li strong { display: block; font-size: 8.8pt; }
.cv-list .meta { font-family: var(--mono); font-size: 7.4pt; color: var(--ink-3); }
.cv-list a { color: var(--ink); }

.cv-foot { margin-top: 4mm; padding-top: 2mm; border-top: .6pt solid var(--rule); font-family: var(--mono); font-size: 7pt; color: var(--ink-3); display: flex; justify-content: space-between; gap: 4mm; }

/* the paper scales down on narrow screens instead of overflowing */
@media screen and (max-width: 860px) {
  .sheet, .sheet[data-paper="letter"] { width: 100%; min-height: 0; padding: 7vw 6vw; font-size: 9.6pt; }
  .cv-head { grid-template-columns: 1fr; gap: 3mm; }
  .cv-contact { text-align: left; }
  .cv-cols { grid-template-columns: 1fr; }
}
@media screen and (max-width: 480px) {
  .cv-job-head { flex-direction: column; gap: .5mm; }
}

/* ------------------------------------------------------------------
   18. Responsive
------------------------------------------------------------------ */
@media (max-width: 1199.98px) {
  .repo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .hero { padding: 3rem 0 4rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.75rem; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .commit { grid-template-columns: 28px minmax(0, 1fr); gap: 0 .9rem; }
  .commit-meta { grid-column: 2; grid-row: 1; flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; gap: .3rem .7rem; padding: 0 0 .6rem; }
  .commit-rail { grid-column: 1; grid-row: 1 / span 2; }
  .commit-body { grid-column: 2; }
  .commit-rail::before { bottom: -14px; }
  .skills-grid, .pubs-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr 1fr; }
  .cases-layout { grid-template-columns: 1fr; gap: 0; padding-top: 2rem; }
  .toc { position: static; margin-bottom: 2.5rem; }
  .toc ol { display: flex; flex-wrap: wrap; gap: .4rem; border-left: 0; }
  .toc ol a { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; margin: 0; background: var(--surface); font-size: .85rem; }
  .toc ol a.active { border-color: var(--accent); }
  .toc .toc-cta { display: none; }
}
@media (max-width: 767.98px) {
  .repo-grid, .edu-grid, .outcomes { grid-template-columns: 1fr; }
  .case-meta { grid-template-columns: 1fr 1fr; }
  .case-meta div:nth-child(2) { border-right: 0; }
  .case-meta div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .case-section { grid-template-columns: 1fr; gap: .5rem; }
  .commit-body { padding: 1.25rem 1.2rem; }
  .form-panel { padding: 1.3rem; }
  .pub { grid-template-columns: 1fr; gap: .3rem; }
  .filter-status { width: 100%; margin-left: 0; }
}
@media (max-width: 575.98px) {
  .identity { gap: .9rem; }
  .avatar { width: 64px; height: 64px; border-radius: 18px; font-size: 1.3rem; }
  .avatar::after { width: 18px; height: 18px; border-width: 3px; }
  .stat { padding: 1.1rem 1rem; }
  .skill-table th, .skill-table td { padding-inline: .9rem; }
  .meter i { width: 10px; }
  .contact-row { grid-template-columns: 1fr; gap: .2rem; }
  .code { font-size: .78rem; }
  .hero-actions .btn { flex: 1 1 auto; }
  .status { border-radius: 14px; align-items: flex-start; }
  .status .pulse { margin-top: .4rem; }
  /* skills table becomes a two-line list on phones */
  .skill-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .skill-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: .6rem .95rem; border-bottom: 1px solid var(--line); gap: .2rem .8rem; }
  .skill-table tbody tr:last-child { border-bottom: 0; }
  .skill-table th, .skill-table td { padding: 0 !important; border: 0 !important; }
  .skill-table .lvl { grid-column: 1 / -1; grid-row: 2; }
  .skill-table .yrs { grid-column: 2; grid-row: 1; }
}

/* ------------------------------------------------------------------
   19. Print — resume.html (and a sensible fallback for other pages)
   Paper size is set by an injected @page rule (A4 by default);
   see the paper toggle on resume.html.
------------------------------------------------------------------ */
@page { size: A4; margin: 0; }
@media print {
  :root, [data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --text: #222; --heading: #000; --muted: #444; --line: #ccc; }
  html, body { background: #fff !important; color: #222; }
  body { font-size: 10pt; }
  .site-header, .site-footer, .skip-link, .resume-tools, .palette, .no-print, .toc, .hero-actions, .filter-bar, .copy-btn { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .sheet-wrap { padding: 0; overflow: visible; }
  .sheet, .sheet[data-paper="letter"] { box-shadow: none; border-radius: 0; margin: 0; min-height: 0; width: auto; }
  .sheet { padding: 12mm 13mm; }
  /* print link targets after body links; contact links already show their URL */
  .sheet a[href^="http"]:not(.url-shown)::after { content: attr(href); display: block; font-family: var(--mono); font-size: 6pt; line-height: 1.5; color: #5f6672; font-weight: 400; overflow-wrap: anywhere; }
  .sheet a { text-decoration: none; }
  .cv-head { break-inside: avoid; }
}
