@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-500.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-500.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-600.woff2') format('woff2');
}

/* ============================================================
   jeremystevenson.me — shared terminal/blueprint design system
   Dark + light themes via html[data-theme]. Loaded on every page.
   ============================================================ */

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0d0a;
  --bg-2: #14120f;
  --surface: #1d1a16;
  --surface-2: #292622;
  --text: #ecebe7;
  --text-dim: #a19e98;
  --text-mute: #66635c;
  --line: rgba(236, 235, 231, 0.10);
  --line-soft: rgba(236, 235, 231, 0.05);
  --line-strong: rgba(236, 235, 231, 0.24);
  --signal: #52c374;
  --signal-soft: rgba(82, 195, 116, 0.14);
  --ok: #5cc47a;
  --grain-opacity: 0.22;
  --guide-opacity: 0.4;
  --dock-bg: rgba(20, 18, 15, 0.78);
  --shadow-pop: 0 18px 44px rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f9f8f5;
  --bg-2: #f3f1ec;
  --surface: #ece9e2;
  --surface-2: #e0ddd4;
  --text: #1c1a15;
  --text-dim: #6b6961;
  --text-mute: #a3a09a;
  --line: rgba(28, 26, 21, 0.14);
  --line-soft: rgba(28, 26, 21, 0.07);
  --line-strong: rgba(28, 26, 21, 0.32);
  --signal: #2c8a4e;
  --signal-soft: rgba(44, 138, 78, 0.12);
  --ok: #2f8f52;
  --grain-opacity: 0.3;
  --guide-opacity: 0.5;
  --dock-bg: rgba(249, 248, 245, 0.8);
  --shadow-pop: 0 18px 44px rgba(28, 26, 21, 0.18);
}

:root {
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --col: min(760px, calc(100vw - 40px));
  --ease-swift: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 240ms var(--ease-swift), color 240ms var(--ease-swift);
}

::selection { background: rgba(203, 194, 74, 0.28); }

/* ---- film grain (inline SVG noise, no request) ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='128' height='128' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ---- column guides: dotted rails + ruler ticks ---- */
.rails {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--guide-opacity);
  width: calc(var(--col) + 48px);
  margin: 0 auto;
}
.rails .rail {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line-strong) 0 2px,
    transparent 2px 5px
  );
}
.rails .rail-l { left: 0; }
.rails .rail-r { right: 0; }
.rails .ticks {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    to right,
    var(--line-strong) 0 1px,
    transparent 1px 24px
  );
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
}

/* ---- layout column ---- */
.page {
  width: var(--col);
  margin: 0 auto;
  padding: clamp(48px, 9vh, 96px) 0 140px;
}

/* ---- section tag: // LABEL + pixel pair ---- */
.stag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 26px;
}
section, .section { margin-top: clamp(72px, 11vh, 120px); scroll-margin-top: 32px; }

/* ---- prose ---- */
.prose p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  max-width: 62ch;
}
.prose p + p { margin-top: 18px; }
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }

/* dotted-underline link: highlighted green by default */
.u-link {
  color: var(--signal);
  text-decoration: none;
  border-bottom: 1px dotted var(--signal);
  padding-bottom: 1px;
  transition: border-color 140ms var(--ease-swift), color 140ms var(--ease-swift), background-color 140ms var(--ease-swift);
}
.u-link:hover { border-bottom-style: solid; background: var(--signal-soft); }

/* signal button */
.btn-signal {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--signal);
  padding: 12px 20px;
  background: transparent;
  transition: background-color 160ms var(--ease-swift), color 160ms var(--ease-swift);
}
.btn-signal:hover { background: var(--signal); color: #0f0d0a; }

/* ---- spec nameplate (dl) ---- */
.spec {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}
.spec > div {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 16px;
  padding: 13px 2px;
}
.spec > div + div { border-top: 1px solid var(--line-soft); }
.spec dt {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding-top: 2px;
}
.spec dd {
  font-size: 0.82rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---- hairline row list (projects, writing) ---- */
.rows { border-top: 1px solid var(--line); }
.row-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
  transition: background-color 140ms var(--ease-swift);
}
.row-item:hover { background: var(--line-soft); }
.row-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.row-title { font-size: 0.95rem; font-weight: 500; color: var(--text); }
.row-arrow { color: var(--text-mute); font-family: var(--mono); font-size: 0.8rem; transition: color 140ms, transform 140ms; }
.row-item:hover .row-arrow { color: var(--signal); transform: translate(2px, -2px); }
.row-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  white-space: nowrap;
}
.row-tag.live { color: var(--ok); }
.row-tag.signal { color: var(--signal); }
.row-sub { font-family: var(--mono); font-size: 0.72rem; color: var(--text-mute); margin-bottom: 6px; }
.row-desc { font-size: 0.9rem; line-height: 1.65; color: var(--text-dim); max-width: 60ch; }

/* ---- framed photo card ---- */
.frame {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 10px;
}
.frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.88) contrast(1.03);
}
.frame figcaption {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding-top: 9px;
  display: flex;
  justify-content: space-between;
}
/* corner ticks */
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
}
.frame::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--text-mute);
  border-left: 1px solid var(--text-mute);
}
.frame::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--text-mute);
  border-right: 1px solid var(--text-mute);
}

/* ---- masonry ---- */
.masonry { columns: 2; column-gap: 12px; }
.masonry > * { break-inside: avoid; margin-bottom: 12px; }
@media (max-width: 560px) { .masonry { column-gap: 10px; } .masonry > * { margin-bottom: 10px; } }

/* ---- dock ---- */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 0px) + 12px);
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--dock-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  box-shadow: var(--shadow-pop);
}
.dock a,
.dock button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 140ms var(--ease-swift), background-color 140ms var(--ease-swift);
}
.dock a:hover,
.dock button:hover { color: var(--text); background: var(--line-soft); }
.dock svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dock .avatar {
  width: 40px;
  height: 40px;
}
.dock .avatar img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9);
}
.dock .divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 5px;
}
.dock .active { color: var(--text); }
.dock .active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--signal);
}
.dock .avatar.active::after { bottom: 0; }

/* ---- settings popover ---- */
.dock-pop {
  position: fixed;
  z-index: 101;
  right: max(18px, calc(50vw - var(--col) / 2));
  bottom: calc(max(18px, env(safe-area-inset-bottom, 0px) + 12px) + 66px);
  min-width: 230px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms var(--ease-swift), transform 160ms var(--ease-swift);
}
.dock-pop.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dock-pop .pop-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 10px;
}
.theme-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--line-soft);
}
.theme-seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 140ms var(--ease-swift), color 140ms var(--ease-swift);
}
.theme-seg button svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.theme-seg button:hover { color: var(--text); }
.theme-seg button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
}

/* ---- reveal on scroll ---- */
@media (prefers-reduced-motion: no-preference) {
  .rv { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease-swift), transform 600ms var(--ease-swift); }
  .rv.in { opacity: 1; transform: none; }
}

/* ---- scrollbar ---- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---- footer ---- */
.site-foot {
  margin-top: clamp(80px, 12vh, 130px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.site-foot .built {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.site-foot .built svg { width: 12px; height: 12px; }
.site-foot .built a { color: inherit; }
.site-foot .built a:hover { color: var(--signal); }
