/* ---------- Font: Allo by Josh Puckett (SIL Open Font License, see fonts/OFL.txt) ---------- */
@font-face {
  font-family: Allo;
  src: url(fonts/AlloVariableFriendly.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Allo;
  src: url(fonts/Allo-Oblique.woff2) format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --background: #fafafa;
  --foreground: #0a0a0a;
  --muted: #737373;
  --body: #525252;      /* neutral-600 */
  --divider: #d4d4d4;   /* neutral-300 */
  --row-hover: #f5f5f5; /* neutral-100 */
  --tag-bg: #ececec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --foreground: #fafafa;
    --muted: #e5e5e5;
    --body: #a3a3a3;                     /* neutral-400 */
    --row-hover: rgba(38, 38, 38, 0.5);  /* neutral-800 / 50% */
    --tag-bg: #1f1f1f;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  line-height: 1.5;
}
html, body { max-width: 100vw; overflow-x: hidden; }
body {
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
::selection { color: #fff; background: #000; }

/* ---------- Layout ---------- */
main {
  max-width: 740px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px;
  font-family: Allo, system-ui, sans-serif;
  font-weight: 420;
}
@media (min-width: 768px) {
  main { padding: 96px; }
}

h1, h2 { font-size: 24px; font-weight: 600; }
h1 a { transition: opacity 0.15s ease; }
h1 a:hover { opacity: 0.6; }

.divider {
  width: 48px;
  height: 1px;
  background: var(--divider);
  border-radius: 1px;
  margin: 24px 0;
}

.bio p { color: var(--body); line-height: 1.625; }
.bio p + p { margin-top: 24px; }

section { margin-top: 72px; }

/* Rows: <a> rows get a hover background, <div> rows are static info. */
.list { margin: 0 -16px; }
.list > * {
  display: block;
  border-radius: 12px;
  padding: 14px 16px;
  line-height: 1.625;
  transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.list > a:hover { background: var(--row-hover); }
.list span { display: block; }
.list span:first-of-type { font-weight: 500; }
.list span + span { color: var(--body); }
.list.compact > * { padding: 12px 16px; }
.list.compact > * + * { margin-top: 4px; }

/* Numbered steps: small muted number before the title. */
.list.steps { counter-reset: step; }
.list.steps > * { counter-increment: step; }
.list.steps span:first-of-type::before {
  content: counter(step, decimal-leading-zero);
  display: inline-block;
  width: 32px;
  color: var(--body);
  font-variant-numeric: tabular-nums;
}
.list.steps span + span { padding-left: 32px; }

/* Small status tag after a row title, e.g. "Offline" for retired projects. */
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  vertical-align: 1px;
  color: var(--body);
  background: var(--tag-bg);
}

/* ---------- Subpages ---------- */
.back {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--body);
  transition: color 0.15s ease;
}
.back:hover { color: var(--foreground); }

/* Inline text link used inside paragraphs (e.g. email). */
.text-link {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--divider);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}
.text-link:hover { text-decoration-color: currentColor; }

/* ---------- Company links: brand color on hover ---------- */
.company-link {
  color: var(--foreground);
  transition: color 0.15s ease, filter 250ms ease-out, opacity 250ms ease-out;
}
.company-link:hover { color: var(--brand-color); }
@media (prefers-color-scheme: dark) {
  .company-link.brand-black:hover { color: #fff; }
}

/* ---------- Role hover: focus companies for a role, blur everything else ---------- */
.role-text {
  cursor: default;
  color: var(--foreground);
  transition: color 0.15s ease, filter 250ms ease-out, opacity 250ms ease-out;
}
.filler { transition: color 250ms ease-out, filter 250ms ease-out, opacity 250ms ease-out; }

.role-active .filler,
.role-active .role-text:not(.role-text-active),
.role-active .company-link:not(.role-highlighted) {
  color: var(--muted);
  opacity: 0.5;
  filter: blur(2px);
}

/* ---------- Work previews ---------- */
/* Touch screens: screenshot sits inside each row. */
.work .thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--row-hover);
}
/* Mouse: screenshot floats next to the cursor instead. */
.preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
}
.preview.visible {
  opacity: 1;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(1);
  transition: opacity 0.2s ease, transform 0.08s linear;
}
@media (hover: hover) and (pointer: fine) {
  .work .thumb { display: none; }
}
@media not ((hover: hover) and (pointer: fine)) {
  .preview { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
