/* colincarter.me
   Plain CSS, no framework. One typeface (Instrument Sans, self-hosted), cool neutral greys,
   one accent (Swiss red) used only for "live", selection and focus. Light and dark. */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 700; font-style: italic; font-display: swap;
}

:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --hover: #ececee;
  --line: #e2e3e7;
  --line-strong: #c9cbd1;
  --text: #17181b;
  --text-2: #4f525a;
  --text-3: #6a6d75;
  --accent: #d52b1e;
  --shadow: 0 1px 0 rgba(16, 17, 20, .04), 0 24px 64px -16px rgba(16, 17, 20, .22);

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --col: 37rem;
  --rail: 15rem;
  --r: 8px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #151619; --surface: #1c1d21; --hover: #25272c; --line: #2a2c31; --line-strong: #3b3e45;
  --text: #ececee; --text-2: #b4b7be; --text-3: #8f929a; --accent: #ff5a4b;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 24px 64px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151619; --surface: #1c1d21; --hover: #25272c; --line: #2a2c31; --line-strong: #3b3e45;
    --text: #ececee; --text-2: #b4b7be; --text-3: #8f929a; --accent: #ff5a4b;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 24px 64px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 1rem; line-height: 1.65; font-feature-settings: "ss01" 0;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.012em; line-height: 1.3; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
    text-decoration-color: var(--line-strong); transition: text-decoration-color .15s; }
a:hover { text-decoration-color: currentColor; }

kbd {
  font-family: var(--mono); font-size: .72rem; line-height: 1; color: var(--text-2);
  padding: .2rem .36rem .22rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface); white-space: nowrap;
}

.skip { position: absolute; left: -999px; top: .75rem; z-index: 50; background: var(--text); color: var(--bg); padding: .5rem .9rem; border-radius: var(--r); text-decoration: none; }
.skip:focus { left: .75rem; }
.js-only, .cmd-open, .theme { display: none; }
.js .js-only { display: inline; }
@media (hover: none) { .js .js-only { display: none; } }
.js .cmd-open, .js .theme { display: inline-flex; }

/* ---------------------------------------------------------------- shell */
.shell { min-height: 100vh; }
.main { padding: 3rem 1.25rem 2.5rem; }
.page, .foot { max-width: var(--col); margin-inline: auto; }

.rail {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem .75rem;
  padding: .7rem 1rem .5rem;
  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 var(--line);
}
.me { display: flex; align-items: center; gap: .65rem; text-decoration: none; min-width: 0; border-radius: var(--r); }
.me img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.me > span { display: grid; line-height: 1.25; min-width: 0; }
.me-name { font-weight: 600; font-size: .95rem; }
.me-role { font-size: .8rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { grid-column: 1 / -1; display: flex; gap: .15rem; margin-inline: -.55rem; overflow-x: auto; scrollbar-width: none; }
.nav a {
  padding: .35rem .55rem; border-radius: var(--r); font-size: .925rem; color: var(--text-2);
  text-decoration: none; white-space: nowrap; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; background: var(--hover); }

.tools { display: flex; align-items: center; gap: .35rem; grid-column: 2; grid-row: 1; }
.cmd-open, .theme {
  align-items: center; justify-content: center; gap: .5rem; height: 2rem; min-width: 2rem; padding: 0 .5rem;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text-3);
  cursor: pointer; transition: border-color .12s, color .12s;
}
.cmd-open:hover, .theme:hover { border-color: var(--line-strong); color: var(--text); }
.cmd-open .cmd-label, .cmd-open kbd { display: none; }
.lang { display: flex; align-items: center; height: 2rem; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.lang a, .lang span { display: grid; place-items: center; height: 100%; padding: 0 .45rem; border-radius: 6px; text-decoration: none; color: var(--text-3); }
.lang a:hover { color: var(--text); }
.lang span[aria-current] { background: var(--hover); color: var(--text); }

@media (max-width: 61.99rem) { .me-role { display: none; } }
@media (min-width: 62rem) {
  .shell { display: grid; grid-template-columns: var(--rail) 1fr; }
  .rail {
    height: 100vh; display: flex; flex-direction: column; align-items: stretch; gap: 1.75rem;
    padding: 1.4rem .9rem 1.1rem; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    border-bottom: 0; border-right: 1px solid var(--line);
  }
  .me { padding: .15rem .35rem; }
  .nav { flex-direction: column; margin: 0; gap: .1rem; }
  .nav a { padding: .42rem .6rem; }
  .tools { margin-top: auto; flex-wrap: wrap; }
  .me-role { white-space: normal; }
  .js .cmd-open { flex: 1 0 100%; justify-content: flex-start; padding: 0 .4rem 0 .6rem; height: 2.15rem; margin-bottom: .2rem; }
  .cmd-open .cmd-label { display: inline; font-size: .875rem; flex: 1; text-align: left; }
  .cmd-open kbd { display: inline; }
  .theme { margin-left: auto; }
  .main { padding: clamp(3.5rem, 9vh, 6.5rem) clamp(2rem, 6vw, 5rem) 3rem; }
}

/* ---------------------------------------------------------------- page furniture */
.page-head { margin-bottom: 1.6rem; }
.page-head h1 { font-size: 1.5rem; }
.role { margin: .2rem 0 0; color: var(--text-3); font-size: .975rem; }
.role a { color: inherit; }
.lede p { font-size: 1.0625rem; line-height: 1.7; }
.lede p:last-child { margin-bottom: 0; }
.block { margin-top: 3.25rem; }
.block > h2 { font-size: .9rem; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-bottom: .75rem; }
.more { margin: .6rem 0 0; font-size: .925rem; color: var(--text-2); }
.crumb { margin-bottom: 2rem; font-size: .925rem; }
.crumb a { color: var(--text-3); text-decoration: none; }
.crumb a::before { content: "← "; }
.crumb a:hover { color: var(--text); }
.note { color: var(--text-3); font-size: .95rem; }
.tag { display: inline-block; vertical-align: .1em; margin-left: .35rem; padding: 0 .45rem; border: 1px solid var(--line-strong); border-radius: 99px; font-size: .72rem; font-weight: 500; line-height: 1.6; color: var(--text-3); }
.empty { color: var(--text-3); }

/* ---------------------------------------------------------------- home: intro */
.intro { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.intro h1 { font-size: 1.5rem; }
.avatar { position: relative; width: 64px; height: 64px; margin: 0; flex: none; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease; }
.avatar .sketch { opacity: 0; }

/* key / value rows ("Now", teaching, involvement) */
.kv { margin: 0; }
.kv > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .1rem 1rem; padding: .45rem 0; }
.kv-wide > div { grid-template-columns: 11rem 1fr; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
@media (max-width: 34rem) { .kv > div, .kv-wide > div { grid-template-columns: 1fr; } .kv dt { font-size: .875rem; } }

.coffee dd { position: relative; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.quiet { display: block; color: var(--text-3); font-size: .925rem; }
.live { display: inline-block; width: 7px; height: 7px; margin: 0 .45rem .1em 0; border-radius: 50%; background: var(--accent); vertical-align: middle; position: relative; }
.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; animation: ping 2.4s cubic-bezier(.2, .6, .3, 1) infinite; }
@keyframes ping { 0% { transform: scale(.4); opacity: .7; } 80%, 100% { transform: scale(1.5); opacity: 0; } }

/* work history drawn as a commit graph */
.graph { list-style: none; margin: 0; padding: 0; }
.graph li { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; padding: .5rem 0 .55rem 1.6rem; }
.graph li::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1.5px; background: var(--line-strong); }
.graph li:first-child::before { top: 1.05rem; }
.graph li:last-child::before { bottom: auto; height: 1.05rem; }
.graph li::after { content: ""; position: absolute; left: 0; top: .82rem; width: 9.5px; height: 9.5px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line-strong); }
.graph li.head::after { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.graph .org { font-weight: 600; }
.graph .what { grid-column: 1; color: var(--text-2); font-size: .95rem; }
.graph .when { grid-column: 2; grid-row: 1; color: var(--text-3); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* lists of rows (writing, links, talks, projects) */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
a.row { margin-inline: -.6rem; padding: .48rem .6rem; border-radius: var(--r); text-decoration: none; transition: background .12s; }
a.row:hover { background: var(--hover); }
.row-title { font-weight: 500; min-width: 0; }
.row-meta { flex: none; color: var(--text-3); font-size: .9rem; font-variant-numeric: tabular-nums; }
.stacked > li { padding: .55rem 0; }
.stacked > li > a.row { margin-top: -.48rem; margin-bottom: -.1rem; }
.row-sub { margin: .1rem 0 0; color: var(--text-2); font-size: .95rem; }
.status-dev { color: var(--text-2); }

/* contact */
.email-box { margin-top: 1.6rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; min-height: 2.5rem; }
.email-out { font-size: 1.125rem; font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; height: 2.4rem; padding: 0 1rem; border: 1px solid transparent; border-radius: var(--r);
  background: var(--text); color: var(--bg); font-size: .925rem; font-weight: 500; cursor: pointer; text-decoration: none; transition: opacity .12s;
}
.btn:hover { opacity: .86; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); height: 2rem; padding: 0 .7rem; font-size: .85rem; }
.btn.ghost:hover { opacity: 1; border-color: var(--line-strong); }

/* ---------------------------------------------------------------- long-form text */
.prose { font-size: 1.0125rem; line-height: 1.72; }
.prose h2 { font-size: 1.125rem; margin: 2.6rem 0 .7rem; }
.prose h3 { font-size: 1rem; margin: 1.9rem 0 .5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--text-3); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote { margin: 1.5rem 0; padding: .1rem 0 .1rem 1.1rem; border-left: 2px solid var(--line-strong); color: var(--text-2); }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--hover); border-radius: 4px; padding: .1em .35em; }
.prose pre { margin: 1.4rem 0; padding: 1rem 1.15rem; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; font-size: .82rem; }
.prose img { margin-block: 1.5rem; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.table-scroll { overflow-x: auto; margin: 1.2rem 0 1.6rem; }
.prose table, .facts { width: 100%; border-collapse: collapse; font-size: .935rem; line-height: 1.55; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .6rem .9rem .6rem 0; border-bottom: 1px solid var(--line); }
.prose thead th { font-weight: 600; border-bottom-color: var(--line-strong); }
.facts th[scope="row"] { font-weight: 500; color: var(--text-2); white-space: nowrap; width: 1%; padding-right: 1.4rem; }
.checklist { list-style: none; counter-reset: step; padding: 0 !important; }
.checklist li { counter-increment: step; position: relative; padding-left: 2.2rem; margin-bottom: .7em; }
.checklist li::before {
  content: counter(step); position: absolute; left: 0; top: .15em; width: 1.45rem; height: 1.45rem; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2);
}
.prose .note:first-child { margin-top: -.6rem; }

/* ---------------------------------------------------------------- footer */
.foot { margin-top: 5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .825rem; color: var(--text-3); }
.foot p { margin: 0 0 .35rem; }
.foot-row { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.foot a { color: var(--text-2); }
.foot kbd { font-size: .68rem; }

/* ---------------------------------------------------------------- command menu */
.cmdk {
  width: min(36rem, calc(100vw - 1.5rem)); max-height: min(30rem, 80vh); margin: 12vh auto auto; padding: 0;
  display: none; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.cmdk[open] { display: flex; animation: cmdk-in .14s ease-out; }
.cmdk::backdrop { background: rgba(12, 13, 16, .32); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@keyframes cmdk-in { from { opacity: 0; transform: scale(.985) translateY(-4px); } }
.cmdk-bar { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); color: var(--text-3); }
.cmdk-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 1rem; }
.cmdk-bar input::placeholder { color: var(--text-3); }
.cmdk-esc { border: 0; background: none; padding: 0; cursor: pointer; }
#cmdk-list { list-style: none; margin: 0; padding: .35rem; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.cmdk-group { padding: .65rem .65rem .3rem; font-size: .75rem; font-weight: 500; color: var(--text-3); }
.cmdk [role="option"] { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .65rem; border-radius: var(--r); cursor: pointer; font-size: .95rem; }
.cmdk [role="option"][aria-selected="true"] { background: var(--hover); }
.cmdk-meta { color: var(--text-3); font-family: var(--mono); font-size: .75rem; white-space: nowrap; }
.cmdk-empty { margin: 0; padding: 1.4rem 1rem 1.6rem; text-align: center; color: var(--text-3); font-size: .925rem; }
.cmdk-foot { display: flex; justify-content: space-between; padding: .55rem 1rem; border-top: 1px solid var(--line); font-size: .75rem; color: var(--text-3); }
.cmdk-foot kbd { margin-right: .2rem; }
@media (max-width: 34rem) { .cmdk { margin-top: 4.5rem; } .cmdk-foot { display: none; } }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; z-index: 60; transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  padding: .5rem .9rem; border-radius: 99px; background: var(--text); color: var(--bg); font-size: .875rem; font-weight: 500;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .rail, .foot, .cmdk { display: none !important; }
  .shell { display: block; }
}
