/* EK — minimal edition. Single reading column, EB Garamond, gray scale.
   Layout language: 640px column, 24px gutter, flat surfaces, list rows. */

:root {
  --bg: #fcfcfc;
  --text-1: #1c1c1c;
  --text-2: #646464;
  --text-3: #8d8d8d;
  --border: #e8e8e8;
  --fill-hover: #f0f0f0;
  --tile: #f0f0f0;
  --select: #1c1c1c;
  --select-text: #fcfcfc;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;

  --col: 40rem;
  --gutter: 1.5rem;

  --serif: "EB Garamond", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: var(--serif);
  --mono: var(--serif);
}

html.dark {
  --bg: #111111;
  --text-1: #eeeeee;
  --text-2: #b4b4b4;
  --text-3: #7b7b7b;
  --border: #2a2a2a;
  --fill-hover: #1f1f1f;
  --tile: #222222;
  --select: #eeeeee;
  --select-text: #111111;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --bg: #111111;
    --text-1: #eeeeee;
    --text-2: #b4b4b4;
    --text-3: #7b7b7b;
    --border: #2a2a2a;
    --fill-hover: #1f1f1f;
    --tile: #222222;
    --select: #eeeeee;
    --select-text: #111111;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
/* art may bleed past the column, never past the viewport */
html, body { overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--serif);
  font-size: 1.0625rem;      /* 17px: Garamond has a small x-height */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-feature-settings: "liga", "kern";
}

::selection { background: var(--select); color: var(--select-text); }

a { color: inherit; text-decoration: none; }
p a, li a:not(.xp__role), .inline-link {
  color: var(--text-1);
  text-decoration: underline;
  text-decoration-color: var(--text-3);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
p a:hover, .inline-link:hover { text-decoration-color: var(--text-1); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--text-1);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

/* ---------- column ---------- */
.page {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  padding: 4rem var(--gutter) 5rem;
}

/* ---------- intro (home): 3D mark at center stage, then dissolves ---------- */
.intro-canvas {
  image-rendering: pixelated;
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  pointer-events: none;
}
.intro-veil {
  image-rendering: pixelated;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 40;
  pointer-events: none;
}
/* hidden only until the veil has painted; the veil then does the revealing */
body.is-intro:not(.is-veiled) main > *, body.is-intro:not(.is-veiled) .footer { opacity: 0; }

/* ---------- identity ---------- */
.identity { margin-bottom: 1.5rem; }
.mark {
  display: inline-block;
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}
.mark sup { font-size: 0.42em; letter-spacing: 0; vertical-align: 0.9em; font-weight: 400; margin-left: 0.05em; }
.identity h1, .identity .name {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.5;
}
.identity .role { color: var(--text-2); line-height: 1.5; }

/* ---------- prose ---------- */
.lead p, .prose p { color: var(--text-2); }
.lead p + p, .prose p + p { margin-top: 1rem; }
.prose { margin-top: 0.75rem; }
.prose strong { color: var(--text-1); font-weight: 500; }
.prose ul { margin-top: 0.75rem; }
.prose ul li {
  position: relative;
  padding-left: 1.125rem;
  color: var(--text-2);
}
.prose ul li + li { margin-top: 0.375rem; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.62em;
  width: 5px; height: 5px;
  border-radius: 1px;
  background: var(--text-3);
}

/* actions line under lead */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin-top: 1.25rem;
}
.actions .sep { color: var(--text-3); }
.actions a { padding: 0.25rem 0; }
.actions .quiet { color: var(--text-2); text-decoration: none; }
.actions .quiet:hover { color: var(--text-1); }

/* ---------- sections ---------- */
.section { margin-top: 2.5rem; }
.section-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-2);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}
.section-label svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.section-label a { color: inherit; }
.section-label a:hover { color: var(--text-1); }

/* ---------- experience: one line per row, hairlines between ---------- */
.xp { margin-top: 0.25rem; border-top: 1px solid var(--border); }
.xp__row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.5s ease, padding-left 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.xp__row:hover { border-bottom-color: var(--text-2); padding-left: 0.4rem; }
.xp__role { color: var(--text-1); font-weight: 500; min-width: 0; transition: letter-spacing 0.4s ease; }
.xp__row:hover .xp__role { letter-spacing: 0.015em; }
.xp__at { color: var(--text-2); font-weight: 400; transition: color 0.4s ease; }
.xp__row:hover .xp__at { color: var(--text-1); }
.xp__when {
  margin-left: auto;
  color: var(--text-3);
  font-size: 0.9375rem;
  white-space: nowrap;
  font-variant-numeric: oldstyle-nums tabular-nums;
  transition: color 0.4s ease;
}
.xp__row:hover .xp__when { color: var(--text-2); }
@media (max-width: 560px) {
  .xp__when { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .xp__row, .xp__role, .xp__at, .xp__when { transition: none; }
}

/* ---------- footer ---------- */
.footer {
  margin-top: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.125rem; margin-left: -0.375rem; }
.essay .chip { margin-left: -0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 0.5rem;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1;
  white-space: nowrap;
}
.chip { position: relative; transition: color 0.35s ease; }
.chip:hover { color: var(--text-1); }
/* footer links: same ledger hover as the app rows, a ruled hairline */
a.chip::after {
  content: "";
  position: absolute;
  left: 0.5rem; right: 0.5rem; bottom: 2px;
  height: 1px;
  background: var(--text-2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
a.chip:hover::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .chip, a.chip::after { transition: none; } }
.chip svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme { display: flex; gap: 0.125rem; }
.theme .chip { width: 28px; padding: 0; justify-content: center; }
.theme .chip[aria-pressed="true"] { color: var(--text-1); background: var(--fill-hover); }
.theme .chip:hover { background: var(--fill-hover); }

/* ---------- inner pages ---------- */
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  color: var(--text-2);
  font-size: 0.9375rem;
  margin-bottom: 1.75rem;
}
.crumbs a:hover { color: var(--text-1); }
.crumbs svg { width: 12px; height: 12px; stroke: var(--text-3); fill: none; stroke-width: 1.6; }
.crumbs .current { color: var(--text-3); }

.title-block h1 {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.3;
}
.title-block .sub { color: var(--text-2); font-size: 1.125rem; margin-top: 0.5rem; }
.title-block .date { color: var(--text-3); font-size: 0.9375rem; margin-top: 0.375rem; }

.cover {
  margin-top: 1.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--tile);
}
.cover img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.cover--canvas { position: relative; aspect-ratio: 16 / 10; background: var(--bg); }
.cover--bare { border: 0; border-radius: 0; background: transparent; }
.cover--canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}
.meta-grid dt { color: var(--text-2); font-size: 0.9375rem; }
.meta-grid dd { color: var(--text-1); margin-top: 0.125rem; }
.meta-grid dd a { text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 0.18em; }

.article { margin-top: 2.5rem; }
.article h2 {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-1);
  margin-top: 2.5rem;
  margin-bottom: 0.625rem;
  scroll-margin-top: 2rem;
}
.article h2:first-child { margin-top: 0; }
.article p { color: var(--text-2); }
.article p + p { margin-top: 1rem; }
.article ul { margin-top: 0.5rem; }
.article ul li { position: relative; padding-left: 1.125rem; color: var(--text-2); }
.article ul li + li { margin-top: 0.375rem; }
.article ul li::before {
  content: ""; position: absolute; left: 0.25rem; top: 0.62em;
  width: 5px; height: 5px; border-radius: 1px; background: var(--text-3);
}
.article figure { margin-top: 1.25rem; }
.article figure + figure { margin-top: 1.25rem; }
.article figure img {
  width: 100%; height: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--tile);
}
.article figcaption { color: var(--text-3); font-size: 0.9375rem; margin-top: 0.625rem; }
.article .gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.25rem; }
.article .gallery figure { margin-top: 0; }
.article .gallery img { aspect-ratio: 1 / 1; object-fit: cover; }

.credits { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.credits dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.375rem 1.5rem; }
.credits dt { color: var(--text-2); }
.credits dd { color: var(--text-1); }

/* tags (about page) */
.tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.tag {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 0.5rem;
  border-radius: var(--r-sm);
  background: var(--tile);
  color: var(--text-2);
  font-size: 0.9375rem;
}

/* ---------- app wordmark in place of the title, one image per theme ---------- */
.wordmark { line-height: 0; }
.wordmark__img { display: block; height: 2.75rem; width: auto; }
.wordmark__img--ondark { display: none; }
html.dark .wordmark__img--onlight { display: none; }
html.dark .wordmark__img--ondark { display: block; }
@media (prefers-color-scheme: dark) {
  html:not(.light) .wordmark__img--onlight { display: none; }
  html:not(.light) .wordmark__img--ondark { display: block; }
}
.title-block--busher .wordmark__img { height: 4.75rem; }
.title-block--busher + .essay { margin-top: 1.25rem; }

/* ---------- plates: the app on Apple's iPad Pro bezel, one finish per theme ---------- */
.plates { margin-top: 3rem; }
.plate { margin: 0; }
.plate + .plate { margin-top: 2.75rem; }
.plate__img { display: block; width: 100%; height: auto; }
.plate__img--ondark { display: none; }
html.dark .plate__img--onlight { display: none; }
html.dark .plate__img--ondark { display: block; }
@media (prefers-color-scheme: dark) {
  html:not(.light) .plate__img--onlight { display: none; }
  html:not(.light) .plate__img--ondark { display: block; }
}
.plate figcaption { color: var(--text-1); font-size: 0.9375rem; margin-top: 0.75rem; text-align: center; }

/* phones: two to a row on Apple's iPhone bezel, one below 560px */
.plates--phones { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem 1.5rem; }
.plates--phones .plate + .plate { margin-top: 0; }
.plates--phones figcaption { text-wrap: balance; }
@media (max-width: 560px) { .plates--phones { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ---------- essay and colophon (app and work pages) ---------- */
.essay { margin-top: 2.5rem; }
.essay p { color: var(--text-1); }
.essay p + p { margin-top: 1.1rem; }
.essay > p:first-of-type::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.82;
  padding: 0.08em 0.1em 0 0;
  font-weight: 500;
}
.essay h2 { margin-top: 2.25rem; font-size: 1.375rem; font-weight: 500; color: var(--text-1); }
.essay h2 + p, .essay h2 + table { margin-top: 1rem; }
.essay ul, .essay ol { margin-top: 1.1rem; padding-left: 1.25rem; color: var(--text-1); }
.essay li + li { margin-top: 0.5rem; }
.essay strong { font-weight: 600; }
.essay a { text-decoration: underline; text-underline-offset: 0.15em; }
.essay table { width: 100%; border-collapse: collapse; margin-top: 1.1rem; font-size: 0.9375rem; }
.essay th, .essay td { text-align: left; padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.essay th { color: var(--text-2); font-weight: 500; }
.essay td { color: var(--text-1); }
.essay figure { margin-top: 1.75rem; }
.essay .gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.75rem; }
.essay .gallery figure { margin-top: 0; }
.essay figure img { width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--tile); }
.essay .gallery img { aspect-ratio: 1 / 1; object-fit: cover; }
.essay figcaption { color: var(--text-3); font-size: 0.9375rem; margin-top: 0.625rem; text-align: center; }

.colophon {
  margin-top: 3.5rem;
  text-align: center;
  color: var(--text-3);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.colophon::before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: var(--text-3);
  margin: 0 auto 1.25rem;
  opacity: 0.6;
}
.colophon p { margin: 0; }
.colophon__mark {
  display: inline-block;
  color: var(--text-1);
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  margin-bottom: 0.375rem;
  text-decoration: none;
}
.colophon__mark sup { font-size: 0.42em; vertical-align: 0.9em; font-weight: 400; margin-left: 0.05em; }
@media (max-width: 560px) { .essay .gallery { grid-template-columns: 1fr; } }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .page { padding-top: 3rem; padding-bottom: 4rem; }
  .meta-grid { grid-template-columns: 1fr; gap: 0.875rem; }
  .article .gallery { grid-template-columns: 1fr; }
  .footer { flex-direction: column; align-items: flex-start; }
}
