/* === Themes: color tokens only ============================ */
:root,
[data-theme="terminal"] {
  --bg:        #0e0d0b;
  --bg-2:      #15130f;
  --bg-3:      #1c1a15;
  --rule:      #2a2620;
  --rule-soft: #1f1c17;
  --fg:        #ece6d6;
  --fg-dim:    #a39d8c;
  --fg-mute:   #6e6a5d;
  --fg-faint:  #45413a;
  --accent:    #7ee787;
  --accent-2:  #d3b673;
  --accent-red:#e07a5f;
  --link:      #8fb8ff;
  --selection: #2d4a32;
}
[data-theme="dracula"] {
  --bg:        #282a36;
  --bg-2:      #21222c;
  --bg-3:      #1e1f29;
  --rule:      #44475a;
  --rule-soft: #343746;
  --fg:        #f8f8f2;
  --fg-dim:    #bfbfb8;
  --fg-mute:   #8a8c97;
  --fg-faint:  #56586a;
  --accent:    #50fa7b;
  --accent-2:  #f1fa8c;
  --accent-red:#ff5555;
  --link:      #8be9fd;
  --selection: #44475a;
}
[data-theme="gruvbox"] {
  --bg:        #1d2021;
  --bg-2:      #282828;
  --bg-3:      #32302f;
  --rule:      #3c3836;
  --rule-soft: #2c2826;
  --fg:        #ebdbb2;
  --fg-dim:    #bdae93;
  --fg-mute:   #928374;
  --fg-faint:  #665c54;
  --accent:    #b8bb26;
  --accent-2:  #fabd2f;
  --accent-red:#fb4934;
  --link:      #83a598;
  --selection: #3c3836;
}
[data-theme="nord"] {
  --bg:        #2e3440;
  --bg-2:      #272b35;
  --bg-3:      #3b4252;
  --rule:      #434c5e;
  --rule-soft: #384050;
  --fg:        #eceff4;
  --fg-dim:    #d8dee9;
  --fg-mute:   #8a93a3;
  --fg-faint:  #5d6678;
  --accent:    #a3be8c;
  --accent-2:  #ebcb8b;
  --accent-red:#bf616a;
  --link:      #88c0d0;
  --selection: #434c5e;
}
[data-theme="paper"] {
  --bg:        #f4f1e8;
  --bg-2:      #ebe8de;
  --bg-3:      #e2dfd4;
  --rule:      #c9c4b3;
  --rule-soft: #d8d3c2;
  --fg:        #2a2620;
  --fg-dim:    #564f43;
  --fg-mute:   #857d6e;
  --fg-faint:  #a8a293;
  --accent:    #2e7d4f;
  --accent-2:  #a06820;
  --accent-red:#c84a3d;
  --link:      #1f5fa8;
  --selection: #dde5d4;
}

/* === Non-color tokens ===================================== */
:root {
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --col: 78ch;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
html { transition: background .25s ease; }
body {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  padding-bottom: 24px;
  transition: color .25s ease, background .25s ease;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in oklab, var(--accent) 6%, transparent), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, color-mix(in oklab, var(--accent-2) 6%, transparent), transparent 60%);
}
::selection { background: var(--selection); color: var(--fg); }

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--link) 40%, transparent);
  transition: .15s ease;
}
a:hover { color: color-mix(in oklab, var(--link) 70%, white); border-bottom-color: color-mix(in oklab, var(--link) 70%, white); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-bottom-color: transparent;
}

/* === Skip link ============================================ */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--bg-2); color: var(--accent);
  padding: 8px 12px; border: 1px solid var(--rule);
  z-index: 99;
}
.skip:focus { left: 8px; top: 8px; }

/* === Chrome bar =========================================== */
.chrome {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
  font-size: 12px; color: var(--fg-mute); letter-spacing: .02em;
}
.chrome .dots { display: inline-flex; gap: 6px; }
.chrome .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); border: 1px solid var(--rule); }
.chrome .dot.r { background: #5a3a36; border-color: #6a4a45; }
.chrome .dot.y { background: #5a4a26; border-color: #6a5a35; }
.chrome .dot.g { background: #2f4a32; border-color: #3f5a42; }
.chrome .path { color: var(--fg-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chrome .path .slash { color: var(--fg-faint); margin: 0 2px; }
.chrome .path .seg { color: var(--fg-dim); }
.chrome .path .seg.last { color: var(--fg); }
.chrome .right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.chrome .meta { color: var(--fg-mute); }
.chrome .clock { color: var(--fg-mute); font-variant-numeric: tabular-nums; }

.chrome .tbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 2px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--fg-dim);
  font-family: var(--mono); font-size: 11px;
  cursor: pointer;
  transition: .15s ease;
  letter-spacing: .02em;
}
.chrome .tbtn:hover { color: var(--fg); border-color: var(--fg-faint); }
.chrome .tbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chrome .tbtn .swatch {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--accent);
  border: 1px solid color-mix(in oklab, var(--fg) 20%, transparent);
}
.chrome .tbtn kbd {
  font-family: var(--mono); font-size: 9.5px;
  padding: 1px 4px; border-radius: 2px;
  background: var(--bg-3); color: var(--fg-mute);
  border: 1px solid var(--rule);
}

.chrome .pulse { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-dim); }
.chrome .pulse::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.chrome .pulse.online::before  { background: var(--accent);     animation: pulse-green 2.2s ease-out infinite; }
.chrome .pulse.gym::before     { background: var(--accent-red); animation: pulse-red 2.2s ease-out infinite; }
.chrome .pulse.weekend::before { background: var(--accent-2);   animation: pulse-amber 2.2s ease-out infinite; }
.chrome .pulse.home::before    { background: var(--accent-red); }
.chrome .pulse.offline::before { background: var(--fg-mute); }
@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0   rgba(126, 231, 135, .5); }
  70%  { box-shadow: 0 0 0 8px rgba(126, 231, 135, 0); }
  100% { box-shadow: 0 0 0 0   rgba(126, 231, 135, 0); }
}
@keyframes pulse-red {
  0%   { box-shadow: 0 0 0 0   rgba(224, 122, 95, .5); }
  70%  { box-shadow: 0 0 0 8px rgba(224, 122, 95, 0); }
  100% { box-shadow: 0 0 0 0   rgba(224, 122, 95, 0); }
}
@keyframes pulse-amber {
  0%   { box-shadow: 0 0 0 0   rgba(211, 182, 115, .5); }
  70%  { box-shadow: 0 0 0 8px rgba(211, 182, 115, 0); }
  100% { box-shadow: 0 0 0 0   rgba(211, 182, 115, 0); }
}

/* === Layout =============================================== */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 28px 80px;
  display: grid;
  grid-template-columns: 1fr minmax(0, var(--col)) 1fr;
  column-gap: 28px;
}
.gutter-l { grid-column: 1; }
.main     { grid-column: 2; }
.gutter-r { grid-column: 3; }

.rail {
  position: sticky; top: 78px;
  text-align: right;
  color: var(--fg-mute);
  font-size: 12px;
  line-height: 1.9;
  padding-right: 18px;
  border-right: 1px solid var(--rule-soft);
}
.rail .k { color: var(--fg-faint); letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; display: block; margin-top: 14px; }
.rail .v { color: var(--fg-dim); }
.rail .v.fg { color: var(--fg); }
.rail .first { margin-top: 0; }
.rail .status { color: var(--accent); }

/* === Scroll-progress nav (right gutter) =================== */
.nav {
  position: sticky; top: 78px;
  padding-left: 18px;
  border-left: 1px solid var(--rule-soft);
  font-size: 11px;
  line-height: 1.7;
}
.nav .nav-track {
  position: absolute; left: -1px; top: 0; bottom: 0; width: 1px;
  background: transparent;
  pointer-events: none;
}
.nav .nav-fill {
  position: absolute; left: -1px; top: 0; width: 1px;
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in oklab, var(--accent) 60%, transparent);
  transition: height .15s linear;
}
.nav a {
  display: block;
  color: var(--fg-faint);
  text-decoration: none; border: 0;
  padding: 4px 0;
  letter-spacing: .06em;
  transition: .15s ease;
  position: relative;
}
.nav a .n { color: var(--fg-faint); margin-right: 8px; font-variant-numeric: tabular-nums; }
.nav a:hover { color: var(--fg-dim); }
.nav a:hover .n { color: var(--fg-dim); }
.nav a.active { color: var(--accent); }
.nav a.active .n { color: var(--accent); }
.nav a.active::before {
  content: ""; position: absolute; left: -22px; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 70%, transparent);
}
.nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* === Hero ================================================= */
.prompt { color: var(--accent); font-size: 13px; letter-spacing: .08em; }
.prompt .dim { color: var(--fg-mute); margin-left: 6px; }
.prompt .cursor {
  display: inline-block;
  width: .55ch; height: 1.05em;
  vertical-align: -2px;
  background: var(--accent);
  margin-left: 6px;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

h1.name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 18px 0 6px;
  color: var(--fg);
}
h1.name .amp { color: var(--accent-2); font-weight: 400; }

.tagline {
  font-size: 16px;
  color: var(--fg-dim);
  max-width: 62ch;
  margin: 18px 0 0;
}
.tagline strong { color: var(--fg); font-weight: 500; }

.hero-foot {
  margin-top: 22px;
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  font-size: 12px; color: var(--fg-mute);
}
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--fg-dim);
  background: var(--bg-2);
  white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; background: var(--accent-2); border-radius: 1px; }
.tag.green::before { background: var(--accent); }

/* === Section ============================================== */
section { margin-top: 64px; }
.sec-head {
  display: flex; align-items: baseline; gap: 14px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 22px;
}
.sec-head .num { color: var(--fg-faint); }
.sec-head .title { color: var(--fg); letter-spacing: .14em; }
.sec-head .rule { flex: 1; height: 1px; background: var(--rule-soft); }

/* === Project cards ======================================== */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  padding: 18px 20px 20px;
  position: relative;
  transition: .18s ease;
}
.card:hover { border-color: var(--fg-faint); transform: translateY(-1px); }
.card .corner {
  position: absolute; top: 8px; right: 10px;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-faint);
}
.card h3 {
  font-family: var(--mono); font-weight: 600;
  font-size: 18px; margin: 4px 0 4px; letter-spacing: -.005em;
  color: var(--fg);
}
.card h3 a { color: var(--fg); border-bottom-color: transparent; }
.card h3 a:hover { border-bottom-color: var(--accent); color: var(--fg); }
.card .lede { font-size: 13.5px; color: var(--fg-dim); line-height: 1.6; margin: 8px 0 14px; }
.card .row {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-mute);
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
}
.card .row .badge { color: var(--fg-dim); }
.card .row .badge .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.card .row .badge.amber .dot { background: var(--accent-2); }

/* === Bio prose ============================================ */
.prose p { margin: 0 0 18px; color: var(--fg); font-size: 15px; line-height: 1.75; max-width: 72ch; }
.prose p.dim { color: var(--fg-dim); }
.prose .pull {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 18px;
  color: var(--fg);
  font-size: 15.5px;
  margin: 6px 0 26px;
  max-width: 64ch;
}
.prose .pull em { color: var(--accent); font-style: normal; }

/* === Stat strip =========================================== */
.strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  margin: 8px 0 4px;
}
.strip .cell { padding: 14px 16px; border-right: 1px solid var(--rule-soft); }
.strip .cell:last-child { border-right: 0; }
.strip .k { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-mute); }
.strip .v { font-family: var(--mono); font-weight: 600; font-size: 22px; margin-top: 6px; color: var(--fg); letter-spacing: -.01em; }
.strip .v .unit { color: var(--fg-mute); font-weight: 400; font-size: 13px; margin-left: 4px; }

/* === Contact ============================================== */
.contact {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0;
  border: 1px solid var(--rule);
}
.contact .ln {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  min-height: 44px;
  border-bottom: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
  transition: .15s;
  background: var(--bg-2);
}
.contact .ln:nth-child(2n) { border-right: 0; }
.contact .ln:nth-last-child(-n+2) { border-bottom: 0; }
.contact .ln:hover,
.contact .ln:focus-within { background: var(--bg-3); }
.contact .ln .k { color: var(--fg-mute); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.contact .ln a { color: var(--fg); border-bottom: 0; font-weight: 500; font-size: 14px; }
.contact .ln a:hover,
.contact .ln a:focus-visible { color: var(--accent); }
.contact .ln a:focus-visible { outline-offset: 4px; }
.contact .ln .arrow { color: var(--fg-faint); margin-left: 8px; transition: .15s; display: inline-block; }
.contact .ln:hover .arrow,
.contact .ln:focus-within .arrow { color: var(--accent); transform: translateX(2px); }

/* === Footer =============================================== */
footer {
  margin-top: 80px;
  padding-top: 18px;
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule-soft);
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-faint);
}
footer .ok { color: var(--accent); }
footer .sep { color: var(--fg-faint); }

/* === Terminal ============================================= */
#shell { scroll-margin-bottom: 40px; }
.term-wrap { margin-top: 18px; }
.term {
  border: 1px solid var(--rule);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}
.term .bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule-soft);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  color: var(--fg-mute);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.term .bar .dots { display: inline-flex; gap: 5px; }
.term .bar .dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); }
.term .bar .hint { margin-left: auto; color: var(--fg-faint); text-transform: none; letter-spacing: .02em; }
.term .bar .hint kbd {
  font-family: var(--mono); font-size: 10px;
  padding: 1px 4px; border-radius: 2px;
  background: var(--bg); color: var(--fg-mute);
  border: 1px solid var(--rule);
}
.term .body {
  padding: 14px 16px 12px;
  max-height: 340px; overflow: auto;
  color: var(--fg);
}
.term .body::-webkit-scrollbar { width: 8px; }
.term .body::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }
.term .line { white-space: pre-wrap; word-break: break-word; }
.term .line.cmd { color: var(--fg); }
.term .line.cmd .p { color: var(--accent); margin-right: 8px; }
.term .line.out { color: var(--fg-dim); }
.term .line.err { color: var(--accent-red); }
.term .line.muted { color: var(--fg-mute); }
.term .line.title { color: var(--fg); font-weight: 600; }
.term .line a { color: var(--link); border-bottom: 1px solid color-mix(in oklab, var(--link) 40%, transparent); }
.term .line .k { color: var(--accent-2); }
.term .input-row {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 16px 12px;
  border-top: 1px solid var(--rule-soft);
  min-height: 44px;
}
.term .input-row .p { color: var(--accent); }
.term .input-wrap {
  position: relative;
  flex: 1;
  display: block;
  line-height: 1.55;
}
.term .input-wrap .mirror {
  position: absolute; inset: 0;
  font-family: var(--mono); font-size: 13px;
  line-height: inherit;
  color: transparent;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
}
.term .input-wrap .mirror .m-ghost { color: var(--fg-faint); }
.term .input-wrap .mirror .m-hint {
  color: var(--fg-faint);
  margin-left: 10px;
  font-size: 11px;
  opacity: .7;
}
.term .input-wrap .mirror .m-hint kbd {
  font-family: var(--mono); font-size: 9.5px;
  padding: 0 3px; border-radius: 2px;
  background: var(--bg-3); color: var(--fg-mute);
  border: 1px solid var(--rule);
}
.term .input-row input {
  position: relative; z-index: 1;
  width: 100%;
  background: transparent; border: 0; outline: 0;
  color: var(--fg);
  font-family: var(--mono); font-size: 13px;
  line-height: inherit;
  caret-color: var(--accent);
}
.term .input-row input::placeholder { color: var(--fg-faint); }
.term .input-row input:focus-visible { outline: none; }
.term:focus-within { border-color: var(--fg-faint); }

/* === Vim-style status bar ================================= */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; align-items: center; gap: 0;
  height: 24px;
  background: var(--bg-2);
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim); /* brief said --fg-mute; bumped to --fg-dim for WCAG AA on all themes */
  letter-spacing: .02em;
  user-select: none;
}
.statusbar .sb {
  padding: 0 12px; height: 100%;
  display: flex; align-items: center; gap: 6px;
  border-right: 1px solid var(--rule-soft);
  white-space: nowrap;
}
.statusbar .sb:last-child { border-right: 0; }
.statusbar .sb.mode {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  letter-spacing: .08em;
}
[data-theme="paper"] .statusbar .sb.mode { color: #fff; }
.statusbar .sb.section { color: var(--fg); }
.statusbar .sb.section .arrow { color: var(--fg-faint); margin-right: 4px; }
.statusbar .sb.spacer { flex: 1; border: 0; }
.statusbar .sb.pos { font-variant-numeric: tabular-nums; }
.statusbar .sb.theme { color: var(--fg-dim); }
.statusbar .sb.theme .swatch {
  width: 8px; height: 8px; border-radius: 1px;
  background: var(--accent);
  border: 1px solid color-mix(in oklab, var(--fg) 20%, transparent);
  display: inline-block;
}

/* === First-visit boot sequence ============================ */
.boot {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: none; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 14px;
  color: var(--fg);
  opacity: 1;
  transition: opacity .35s ease;
}
/* shown only when the inline <head> gate marks a first visit */
html.booting .boot { display: flex; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot-inner { width: min(640px, 92vw); padding: 24px; }
.boot-head {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 18px;
  display: flex; gap: 12px; align-items: center;
}
.boot-head .pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse-green 1.2s ease-out infinite;
}
.boot-head .skip { margin-left: auto; color: var(--fg-faint); font-size: 10px; }
.boot-head .skip kbd {
  font-family: var(--mono); font-size: 9.5px;
  padding: 1px 4px; border-radius: 2px;
  background: var(--bg-2); color: var(--fg-mute);
  border: 1px solid var(--rule);
}
.boot-log {
  font-family: var(--mono); font-size: 13px;
  line-height: 1.7;
  color: var(--fg-dim);
  min-height: 14em;
}
.boot-log .row {
  opacity: 0;
  animation: bootIn .25s ease-out forwards;
  white-space: nowrap;
}
@keyframes bootIn {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: none; }
}
.boot-log .ok { color: var(--accent); }
.boot-log .dim { color: var(--fg-mute); }
.boot-log .err { color: #ff8080; }
.boot-log .name { color: var(--fg); }
.boot-foot {
  margin-top: 18px;
  height: 2px;
  background: var(--rule-soft);
  overflow: hidden;
  border-radius: 1px;
}
.boot-foot .bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  animation: bootProgress 1.7s linear forwards;
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 60%, transparent);
}
@keyframes bootProgress { from { width: 0; } to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .boot, .boot-log .row, .boot-foot .bar { animation: none !important; transition: none !important; }
  .boot-log .row { opacity: 1; }
  .boot-foot .bar { width: 100%; }
}

/* === Reduced motion ======================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    transition-duration: .001s !important;
  }
}

/* === Responsive =========================================== */
@media (max-width: 980px) {
  .wrap { grid-template-columns: 1fr; padding: 36px 22px 60px; }
  .gutter-l, .gutter-r { display: none; }
  .main { grid-column: 1; }
  .cards { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip .cell:nth-child(2) { border-right: 0; }
  .strip .cell:nth-child(1),
  .strip .cell:nth-child(2) { border-bottom: 1px solid var(--rule-soft); }
  .contact { grid-template-columns: 1fr; }
  .contact .ln { border-right: 0; }
  .contact .ln:nth-last-child(2) { border-bottom: 1px solid var(--rule-soft); }
  .chrome .tbtn kbd { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14px; line-height: 1.6; }
  .chrome {
    padding: 9px 12px; gap: 8px;
    padding-top: max(9px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .chrome .meta.hide-sm { display: none; }
  .chrome .path { font-size: 11.5px; max-width: 40vw; }
  .chrome .pulse { font-size: 11px; }
  .chrome .tbtn { font-size: 10.5px; padding: 3px 6px; }
  .chrome .tbtn .swatch { width: 9px; height: 9px; }

  .wrap { padding: 28px 18px 48px; }

  .prompt { font-size: 12px; }
  h1.name {
    font-size: clamp(34px, 11vw, 48px);
    line-height: 1.04;
    letter-spacing: -.025em;
    margin-top: 14px;
    word-break: break-word;
  }
  .tagline { font-size: 14.5px; margin-top: 14px; }
  .hero-foot { gap: 6px 8px; margin-top: 18px; }
  .tag { font-size: 11px; padding: 3px 8px; }

  section { margin-top: 48px; }
  .sec-head { gap: 10px; font-size: 10.5px; letter-spacing: .16em; margin-bottom: 16px; }
  .sec-head .num { font-size: 10.5px; }
  .sec-head .rule { min-width: 24px; }

  .card { padding: 16px 16px 18px; }
  .card .corner { position: static; display: block; margin-bottom: 6px; }
  .card h3 { font-size: 17px; }
  .card .lede { font-size: 13px; }
  .card .row { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 10.5px; }

  .prose p { font-size: 14.5px; line-height: 1.7; }
  .prose .pull { font-size: 14.5px; padding-left: 14px; }

  .strip .cell { padding: 12px 14px; }
  .strip .v { font-size: 19px; }
  .strip .v .unit { font-size: 12px; }

  .contact .ln { padding: 14px 14px; flex-wrap: wrap; gap: 4px; min-height: 48px; }
  .contact .ln a { font-size: 13.5px; }

  footer { gap: 6px 14px; font-size: 10px; }
  footer .sep { display: none; }

  /* Terminal on mobile */
  .term { font-size: 12.5px; }
  .term .bar { padding: 7px 10px; gap: 8px; flex-wrap: wrap; }
  .term .bar .hint { font-size: 10px; }
  .term .bar .hint kbd { padding: 0 3px; }
  .term .body { padding: 12px 12px 10px; max-height: 280px; }
  .term .input-row { padding: 8px 12px 10px; min-height: 44px; }
  .term .input-row input { font-size: 14px; } /* iOS would zoom under 16px without viewport meta; meta is set */
  .term .input-wrap .mirror { font-size: 14px; } /* keep ghost aligned with the 14px input */

  .statusbar { font-size: 10px; }
  .statusbar .sb { padding: 0 8px; gap: 4px; }
  .statusbar .sb.hide-sm { display: none; }
}
@media (max-width: 420px) {
  .chrome { padding: 8px 10px; gap: 6px; }
  .chrome .path { max-width: 32vw; }
  .chrome .tbtn { font-size: 10px; }
  .term .bar > span:nth-child(2) { display: none; }
  .term .bar .hint { display: none; }
}
@media (max-width: 380px) {
  .strip { grid-template-columns: 1fr; }
  .strip .cell { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .strip .cell:last-child { border-bottom: 0; }
}

/* === Print: CV mode ======================================= */
@media print {
  :root, :root[data-theme] {
    --bg: #fff; --bg-2: #fff; --bg-3: #fff;
    --fg: #1a1612; --fg-dim: #2a2620; --fg-mute: #5a5447; --fg-faint: #7a6438;
    --rule: #c9c4b3; --rule-soft: #c9c4b3;
    --accent: #7a6438; --accent-2: #7a6438; --accent-red: #1a1612;
    --link: #1a1612; --selection: transparent;
  }

  @page { margin: 18mm 16mm; }

  html, body { background: #fff; }
  body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11pt;
    line-height: 1.45;
    background-image: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* hide interactive chrome */
  .chrome, .gutter-l, .gutter-r, .nav, .skip,
  #shell, .pulse, .prompt .cursor, .statusbar { display: none; }
  body { padding-bottom: 0; }

  /* elements that stay monospaced */
  .prompt, .sec-head, .tag, .card .corner,
  .contact, .contact .ln, .contact .ln a, footer {
    font-family: var(--mono);
  }

  /* layout reset */
  .wrap { display: block; max-width: none; margin: 0; padding: 0; }
  .main { grid-column: auto; }
  .cards { display: grid; grid-template-columns: 1fr 1fr; }
  .strip { display: grid; grid-template-columns: repeat(4, 1fr); }

  /* name */
  h1.name {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: 32pt;
    color: var(--fg);
  }

  /* cards become bordered blocks */
  .card {
    border: 1px solid #c9c4b3;
    background: #fff;
    transform: none;
  }
  .card .corner {
    position: static;
    display: block;
    margin-bottom: 6px;
  }

  /* pull quote → serif italic, keep left rule */
  .prose .pull { border-left: 2px solid #7a6438; }
  .prose .pull em {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    color: #7a6438;
  }

  /* contact: expand URLs inline for paper */
  .contact .ln a[href^="http"]::after {
    content: " (" attr(href) ")";
    color: #5a5447;
    font-size: 9pt;
  }
  .contact .ln .arrow { display: none; }

  /* page-break safety */
  section { page-break-inside: avoid; break-inside: avoid; }
  .card { page-break-inside: avoid; break-inside: avoid; }

  /* no motion on paper */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
