/* jakez.ca */

:root {
  color-scheme: light dark;

  --bg: #FAFAF9;
  --bg-2: #F1F1EF;
  --bg-3: #E9E9E6;
  --fg: #111113;
  --fg-2: #57534E;
  --fg-3: #6E6A65;
  --line: #E4E4E0;
  --line-2: #D2D2CD;
  --accent: #2E5BFF;
  --accent-tint: rgb(46 91 255 / .08);
  --ok: #15803D;
  --shadow: 0 1px 2px rgb(17 17 19 / .04), 0 12px 32px -8px rgb(17 17 19 / .14);

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

  --maxw: 960px;
  --gutter: clamp(16px, 5vw, 32px);
  --radius: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D0C0B;
    --bg-2: #181614;
    --bg-3: #211F1C;
    --fg: #EEEDEA;
    --fg-2: #A8A29E;
    --fg-3: #8F8984;
    --line: #262320;
    --line-2: #383431;
    --accent: #7C9BFF;
    --accent-tint: rgb(124 155 255 / .1);
    --ok: #4ADE80;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -8px rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  --bg: #0D0C0B;
  --bg-2: #181614;
  --bg-3: #211F1C;
  --fg: #EEEDEA;
  --fg-2: #A8A29E;
  --fg-3: #8F8984;
  --line: #262320;
  --line-2: #383431;
  --accent: #7C9BFF;
  --accent-tint: rgb(124 155 255 / .1);
  --ok: #4ADE80;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -8px rgb(0 0 0 / .6);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line-2) transparent;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line-2); transition: color .2s var(--ease), text-decoration-color .2s var(--ease); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

kbd {
  font-family: var(--f-mono); font-size: .75rem; line-height: 1;
  display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 .35em;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px;
  color: var(--fg-2); background: var(--bg);
}

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 60;
  background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 500;
}
.skip:focus { top: 12px; }

.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico--xs { width: 13px; height: 13px; }

.wrap { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ───────── Header ───────── */
.top {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.top.is-scrolled { border-bottom-color: var(--line); }
.top__inner {
  max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter);
  height: 60px; display: flex; align-items: center; gap: 28px;
}
.top__name { font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.top__nav { display: flex; gap: 2px; }
.top__nav a {
  text-decoration: none; color: var(--fg-2); font-size: .9375rem;
  padding: 6px 10px; border-radius: 8px;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.top__nav a:hover { color: var(--fg); background: var(--bg-2); }
.top__nav a[aria-current="true"] { color: var(--fg); }
.top__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.clock { display: inline-flex; gap: 6px; font-size: .8125rem; color: var(--fg-3); margin-right: 6px; white-space: nowrap; }
.clock time { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.icon-btn, .kbd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  height: 34px; min-width: 34px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--fg-2);
  cursor: pointer; font: inherit;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.icon-btn:hover, .kbd-btn:hover { background: var(--bg-2); color: var(--fg); border-color: var(--line-2); }
.kbd-btn__keys { display: inline-flex; gap: 3px; }
.kbd-btn__label { display: none; font-size: .875rem; font-weight: 500; }
.kbd-btn kbd { border: 0; background: transparent; min-width: 0; padding: 0 1px; height: auto; font-size: .8125rem; color: inherit; }
.ico--moon { display: none; }
:root[data-theme="dark"] .ico--sun { display: none; }
:root[data-theme="dark"] .ico--moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico--sun { display: none; }
  :root:not([data-theme="light"]) .ico--moon { display: block; }
}

/* ───────── Intro ───────── */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 56px;
  align-items: start;
  padding-top: clamp(56px, 10vw, 112px);
  padding-bottom: clamp(56px, 8vw, 88px);
}
.intro__name {
  font-size: clamp(2rem, 4.2vw, 2.5rem);
  font-weight: 600; letter-spacing: -.035em; line-height: 1.1;
}
.intro__role { margin-top: 8px; font-size: 1.0625rem; color: var(--fg-2); }
.intro__bio { margin-top: 24px; max-width: 60ch; font-size: 1.0625rem; line-height: 1.65; color: var(--fg-2); }
.intro__bio strong { color: var(--fg); font-weight: 500; }
.intro__bio em { font-style: normal; color: var(--fg); font-weight: 500; box-shadow: inset 0 -.38em 0 var(--accent-tint); }

.status { margin-top: 24px; display: inline-flex; align-items: center; gap: 10px; font-size: .9375rem; color: var(--fg); }
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); flex: none; }

.actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font-size: .9375rem; font-weight: 500; text-decoration: none; color: var(--fg);
  background: var(--bg);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { background: var(--bg-2); border-color: var(--fg-3); }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn--primary:hover { background: var(--fg); border-color: var(--fg); opacity: .86; }
.textlink { display: inline-flex; align-items: center; gap: 2px; font-size: .9375rem; font-weight: 500; color: var(--fg-2); text-decoration: none; min-height: 40px; }
.textlink:hover { color: var(--fg); }
.textlink .ico, .row__link .ico { transition: transform .25s var(--ease); }
.textlink:hover .ico, .row__link:hover .ico { transform: translate(2px, -2px); }

.portrait { margin: 6px 0 0; }
.portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line);
}

/* ───────── Blocks ───────── */
.block {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 16px 32px;
  padding-top: 40px;
  padding-bottom: 56px;
  border-top: 1px solid var(--line);
}
.block__body { min-width: 0; }
.block__label {
  font-size: .875rem; font-weight: 500; color: var(--fg-3);
  padding-top: 2px;
  position: sticky; top: 84px; align-self: start;
}
.lede { font-size: 1.0625rem; color: var(--fg-2); max-width: 60ch; }

/* rows */
.rows { display: grid; gap: 4px; }
.row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 4px 24px;
  padding: 14px 0;
  transition: opacity .25s var(--ease);
}
.row__meta { font-family: var(--f-mono); font-size: .8125rem; color: var(--fg-3); padding-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row__meta--inline { padding-top: 0; }
.row__title { font-size: 1rem; font-weight: 500; line-height: 1.45; color: var(--fg); }
.row__at { color: var(--fg-2); font-weight: 400; }
.row__at::before { content: "· "; color: var(--fg-3); }
.row__sub { font-size: .875rem; color: var(--fg-3); margin-top: 1px; }
.row__desc { margin-top: 6px; color: var(--fg-2); max-width: 64ch; }
.row__link { display: inline-flex; align-items: center; gap: 3px; text-decoration: none; }
.row__link:hover { color: var(--accent); }
.row__desc + .row__desc { margin-top: 8px; }
.flag {
  display: inline-block; vertical-align: 1px; margin-left: 8px;
  font-family: var(--f-mono); font-size: .6875rem; line-height: 1; font-weight: 400;
  color: var(--accent); background: var(--accent-tint);
  padding: 4px 7px; border-radius: 5px; white-space: nowrap;
}

.bullets { margin-top: 10px; display: grid; gap: 8px; max-width: 66ch; }
.bullets li { position: relative; padding-left: 18px; color: var(--fg-2); }
.bullets li::before { content: ""; position: absolute; left: 3px; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.bullets strong { color: var(--fg); font-weight: 500; }

.tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  font-family: var(--f-mono); font-size: .75rem; line-height: 1;
  color: var(--fg-2); background: var(--bg-2);
  padding: 5px 8px; border-radius: 6px;
}

@media (hover: hover) and (pointer: fine) {
  .rows[data-dim]:hover > .row:not(:hover) { opacity: .42; }
}

/* tally */
.tally { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.tally__num {
  font-family: var(--f-mono); font-size: clamp(2.75rem, 8vw, 3.5rem); font-weight: 500;
  line-height: .9; letter-spacing: -.04em; color: var(--fg); font-variant-numeric: tabular-nums; flex: none;
}
.tally__lbl { font-size: .9375rem; line-height: 1.45; color: var(--fg-3); }

/* feature */
.feature { padding: 14px 0 36px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.feature__head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; }
.feature__name { font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; }
.feature__desc { margin-top: 8px; color: var(--fg-2); max-width: 66ch; }

.diagram {
  margin: 28px 0 0;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line); border-radius: 14px;
  background:
    radial-gradient(circle at 1px 1px, var(--line-2) 1px, transparent 1.2px) 0 0 / 18px 18px,
    var(--bg);
}
.diagram svg { display: block; width: 100%; height: auto; overflow: visible; }
.diagram .diagram__tall { display: none; }
.dg-edge { fill: none; stroke: var(--fg-3); stroke-width: 1.25; opacity: .7; }
.dg-edge--hot { stroke: var(--accent); stroke-width: 1.75; opacity: 1; }
.dg-edge--dash { stroke-dasharray: 3 4; }
.dg-node rect { fill: var(--bg); stroke: var(--line-2); stroke-width: 1; }
.dg-node text { font: 600 14px var(--f-sans); fill: var(--fg); text-anchor: middle; letter-spacing: -.01em; }
.dg-node .dg-sub { font: 400 11px var(--f-mono); fill: var(--fg-3); letter-spacing: 0; }
.dg-node--solid rect { fill: var(--fg); stroke: var(--fg); }
.dg-node--solid text { fill: var(--bg); }
.dg-node--solid .dg-sub { fill: var(--bg); opacity: .75; }
.dg-node--hot rect { stroke: var(--accent); fill: var(--bg); }
.dg-label { font: 400 11px var(--f-mono); fill: var(--fg-3); }
.dg-label--hot { fill: var(--accent); }
.pk { fill: var(--fg); }
.pk--hot { fill: var(--accent); }
.dg-mid { text-anchor: middle; dominant-baseline: middle; font-size: 12px; }
.dg-dot { fill: var(--fg-3); opacity: .55; }
.dg-dot--near { fill: var(--bg); stroke: var(--accent); stroke-width: 1.75; opacity: 1; }
.dg-rank { font: 500 11px var(--f-mono); fill: var(--accent); text-anchor: middle; dominant-baseline: middle; }
.dg-voice { fill: none; stroke: var(--fg); stroke-width: 1.75; }
.dg-voice--hot { stroke: var(--accent); }
.dg-voice--soft { stroke: var(--fg-3); }
.dg-bars { stroke: var(--fg-3); stroke-width: 4; }
.lede + .diagram--ai { margin-top: 20px; }
.rows--after { margin-top: 24px; }
.facts--after { margin-top: 16px; border-top: 1px dashed var(--line); }
.diagram figcaption { margin-top: 16px; font-size: .875rem; color: var(--fg-3); }
@media (prefers-reduced-motion: reduce) { .dg-packets { display: none; } }

/* facts */
.facts { margin: 0; display: grid; }
.lede + .facts { margin-top: 20px; }
.facts > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 4px 24px; padding: 12px 0; }
.facts > div + div { border-top: 1px dashed var(--line); }
.facts dt { font-size: .875rem; color: var(--fg-3); padding-top: 1px; }
.facts dd { margin: 0; color: var(--fg); max-width: 64ch; }
.facts a:hover { color: var(--accent); }

/* contact */
.mail { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mail__addr {
  font-size: clamp(1.375rem, 3.4vw, 2rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.25;
  text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1.5px; text-underline-offset: 6px;
  overflow-wrap: anywhere;
}
.mail__addr:hover { text-decoration-color: currentColor; }
.mail__copy {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg);
  color: var(--fg-2); font: 500 .8125rem var(--f-sans); cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.mail__copy:hover { color: var(--fg); background: var(--bg-2); }
.mail__copy .ico { width: 14px; height: 14px; }
.mail__copy .ico--check { display: none; }
.mail__copy.is-done { color: var(--ok); border-color: currentColor; }
.mail__copy.is-done .ico--copy { display: none; }
.mail__copy.is-done .ico--check { display: block; }

/* footer */
.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  padding-top: 28px; padding-bottom: 48px;
  border-top: 1px solid var(--line);
  font-size: .875rem; color: var(--fg-3);
}
.foot__hint { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.foot__hint:hover { color: var(--fg); }
.foot__hint kbd { font-size: .75rem; }

/* ───────── Command palette ───────── */
.palette {
  width: min(560px, calc(100vw - 32px));
  margin: min(18vh, 160px) auto auto;
  padding: 0;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--bg); color: var(--fg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.palette::backdrop { background: rgb(12 12 14 / .32); }
.palette[open] { animation: pal-in .18s var(--ease); }
@keyframes pal-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .palette[open] { animation: none; } }
.palette__search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--fg-3); }
.palette__input {
  flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: transparent;
  font: 400 1rem var(--f-sans); color: var(--fg);
}
.palette__input::placeholder { color: var(--fg-3); }
.palette__list { max-height: min(360px, 52vh); overflow-y: auto; padding: 6px; }
.palette__group { padding: 10px 10px 4px; font-size: .75rem; color: var(--fg-3); }
.palette__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--fg-2);
}
.palette__item .ico { color: var(--fg-3); }
.palette__item[aria-selected="true"] { background: var(--bg-2); color: var(--fg); }
.palette__item[aria-selected="true"] .ico { color: var(--fg); }
.palette__hint { margin-left: auto; font-family: var(--f-mono); font-size: .75rem; color: var(--fg-3); }
.palette__empty { padding: 20px 16px 24px; color: var(--fg-3); font-size: .9375rem; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg);
  font-size: .875rem; font-weight: 500; padding: 9px 14px; border-radius: 10px;
  box-shadow: var(--shadow);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ───────── Responsive ───────── */
@media (hover: none), (max-width: 820px) {
  .kbd-btn__keys { display: none; }
  .kbd-btn__label { display: inline; }
  .kbd-btn { padding: 0 12px; }
}

@media (max-width: 820px) {
  .clock { display: none; }
  .top__inner { gap: 16px; }
  .block { grid-template-columns: 1fr; gap: 14px; padding-top: 44px; padding-bottom: 44px; }
  .block__label { position: static; font-size: .9375rem; font-weight: 600; color: var(--fg); }
  .intro { grid-template-columns: minmax(0, 1fr) 150px; gap: 28px; }
}

@media (max-width: 700px) {
  .top__nav { display: none; }
}

@media (max-width: 600px) {
  .intro { grid-template-columns: 1fr; gap: 24px; padding-top: 40px; }
  .portrait { order: -1; width: 104px; margin: 0; }
  .portrait img { border-radius: 10px; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; padding: 12px 0; }
  .row__main { display: contents; }
  .row__title { order: 1; flex-basis: 100%; }
  .row__meta { order: 2; padding-top: 2px; font-size: .75rem; }
  .row__sub { order: 3; }
  .row__meta + .row__main > .row__sub::before { content: "· "; color: var(--fg-3); }
  .row__main > :not(.row__title):not(.row__sub) { order: 4; flex-basis: 100%; }
  .actions .btn { flex: 1 1 calc(50% - 5px); justify-content: center; }
  .row__at { display: block; }
  .row__at::before { content: none; }
  .diagram .diagram__wide { display: none; }
  .diagram .diagram__tall { display: block; max-width: 340px; margin: 0 auto; }
  .foot { flex-direction: column; }
  .foot__hint { display: none; }
}
