/* Black, white, grey. Nothing else. Light or dark follows the system. */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #737373;
  --faint: #e5e5e5;
  --field: #f5f5f5;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(1rem, 4vw, 3rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --fg: #f5f5f5;
    --muted: #8a8a8a;
    --faint: #262626;
    --field: #171717;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.125rem/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.6; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }
::selection { background: var(--fg); color: var(--bg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Top bar and footer */
.bar, .foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 2rem;
  flex-wrap: wrap;
  padding: 1.25rem var(--gutter);
  font: 400 0.75rem/1.5 var(--mono);
  color: var(--muted);
}
.bar .name { margin: 0; font: inherit; }
.bar .mark { display: inline-flex; flex-direction: column; font: 500 1.0625rem/1.02 var(--serif); color: var(--fg); letter-spacing: -0.01em; }
.bar .mark:hover { opacity: 1; }
.bar { align-items: center; }
.live { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; font-variant-numeric: tabular-nums; }
.live .clock { color: var(--fg); }
.paths, .legal, .status { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; }
.paths a[aria-current="page"], .legal a[aria-current="page"] { color: var(--fg); }

main { width: 100%; min-width: 0; padding: clamp(2.5rem, 8vh, 6rem) var(--gutter) 4rem; }

/* ---------- Home ---------- */
body.home main { display: flex; flex-direction: column; align-items: center; padding-top: 0; padding-bottom: 0; }
.stage { width: min(100%, 60rem); min-height: calc(100svh - 9rem); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6vh 0 4vh; }
.hero {
  margin: 0 0 clamp(2rem, 5vh, 3.5rem);
  font-weight: 400;
  font-size: clamp(2.5rem, 6.4vw, 5.75rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  min-height: 2.1em;
  text-wrap: balance;
}
.hero .rot:hover { opacity: 1; }
.hero .completion { color: var(--muted); }
.caret { display: inline-block; width: 0.045em; height: 0.8em; margin-left: 0.06em; vertical-align: -0.05em; background: var(--fg); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

.ask {
  width: min(100%, 44rem);
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.9rem 0.9rem 0.9rem 1.4rem;
  border: 1px solid var(--faint);
  border-radius: 1.75rem;
  background: var(--field);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.06);
  transition: border-color .2s;
}
.ask:focus-within { border-color: var(--muted); }
.ask textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  outline: 0;
  background: none;
  color: var(--fg);
  font: 400 1.125rem/1.5 var(--sans);
  padding: 0.35rem 0;
  max-height: 9rem;
}
.ask textarea::placeholder { color: var(--muted); }
.ask button {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
}
.ask button:disabled { opacity: 0.2; cursor: default; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 1.1rem 0 0; }
.chip { border: 1px solid var(--faint); border-radius: 999px; background: none; color: var(--muted); font: 400 0.875rem var(--sans); padding: 0.45rem 0.9rem; cursor: pointer; }
.about { margin: 3.5rem 0 0; max-width: 34rem; font: 400 0.9375rem/1.6 var(--serif); color: var(--muted); }
.chip:hover { color: var(--fg); border-color: var(--muted); }

/* Chat. Before the first question: centered. After: sentence small on top, messages stacked, box pinned to the bottom. */
.thread { width: min(100%, 44rem); text-align: left; display: flex; flex-direction: column; gap: 1.75rem; }
.thread:empty { display: none; }
.msg { margin: 0; animation: rise .35s ease both; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.q { align-self: flex-end; max-width: min(85%, 34rem); background: var(--field); border-radius: 1.4rem 1.4rem 0.4rem 1.4rem; padding: 0.65rem 1.1rem; font: 400 1.0625rem/1.5 var(--sans); }
.msg.a { align-self: stretch; font: 400 1.25rem/1.55 var(--serif); }
.msg.a .by { display: block; font: 0.75rem var(--mono); color: var(--muted); margin-bottom: 0.35rem; }
.msg.a.error p { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dots { display: inline-flex; gap: 0.3rem; padding: 0.6rem 0; }
.dots i { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--muted); animation: pulse 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg, .dots i { animation: none; } }

body.chatting .stage { min-height: 0; justify-content: flex-start; padding: 2vh 0 0; }
body.chatting .more, body.chatting .down { display: none; }
body.chatting .hero { font-size: clamp(1.5rem, 3.2vw, 2.25rem); min-height: 0; margin: 0 0 2.5rem; transition: font-size .4s ease; }
body.chatting .chips, body.chatting .about, body.chatting .hero-social { display: none; }
body.chatting .thread { order: 2; margin-bottom: 1.5rem; }
body.chatting .ask {
  order: 3;
  position: sticky;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 2;
  box-shadow: 0 0 0 0.75rem var(--bg), 0 -1.5rem 1.5rem var(--bg), 0 8px 32px rgba(0, 0, 0, 0.08);
}
.hero { transition: font-size .4s ease, margin .4s ease; }

/* ---------- Inner pages ---------- */
.sentence { margin: 0 0 clamp(2.5rem, 6vh, 4.5rem); font-weight: 400; font-size: clamp(2.5rem, 7vw, 5.5rem); line-height: 1.02; letter-spacing: -0.025em; max-width: 16ch; text-wrap: balance; }
.sentence .path { color: var(--muted); }
.sentence s { color: var(--muted); text-decoration-thickness: 0.05em; }

.projects, .essays, .links, .chronicle, .will { list-style: none; margin: 0; padding: 0; max-width: 64rem; }
.projects li { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 2rem; padding: 1.75rem 0; border-top: 1px solid var(--faint); }
.projects .lead { grid-column: 1 / -1; font: 0.75rem var(--mono); color: var(--muted); }
.projects .name { font-size: clamp(1.9rem, 4vw, 3.1rem); letter-spacing: -0.02em; line-height: 1.05; }
.projects .when { font: 0.75rem var(--mono); color: var(--muted); align-self: end; text-align: right; }
.projects .desc { grid-column: 1 / -1; color: var(--muted); max-width: 40rem; }

.essays a, .links a { display: flex; justify-content: space-between; align-items: baseline; gap: 2rem; padding: 1.1rem 0; border-top: 1px solid var(--faint); }
.essays .name, .links .name { font-size: clamp(1.6rem, 3.2vw, 2.4rem); letter-spacing: -0.02em; }
.essays .when, .links .handle { font: 0.75rem var(--mono); color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 1rem; font: 0.75rem var(--mono); }
.filters button { all: unset; cursor: pointer; color: var(--muted); }
.filters button[aria-pressed="true"] { color: var(--fg); text-decoration: underline; text-underline-offset: 0.3em; }
.chronicle [hidden] { display: none; }
.chronicle li.year { position: sticky; top: 0; padding: 2.5rem 0 0.75rem; background: var(--bg); font: 500 0.875rem var(--mono); letter-spacing: 0.04em; border-bottom: 1px solid var(--faint); }
.chronicle .entry { display: grid; grid-template-columns: 11rem 1fr; gap: 0.25rem 2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--faint); }
.chronicle .when { font: 0.75rem/2 var(--mono); color: var(--muted); }
.chronicle .what { min-width: 0; font-size: clamp(1.2rem, 2.4vw, 1.7rem); line-height: 1.3; letter-spacing: -0.01em; }
.chronicle .now-entry .when, .chronicle .k-award .when, .chronicle .k-built .when { color: var(--fg); }
.chronicle .src { color: var(--muted); font-size: 0.8em; }
.chronicle .shots { display: flex; gap: 0.5rem; margin-top: 1rem; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.chronicle .shots::-webkit-scrollbar { display: none; }
.chronicle .shots img { flex: none; height: clamp(9rem, 22vw, 15rem); width: auto; background: var(--field); filter: grayscale(1); }
.chronicle .credit { display: block; margin-top: 0.4rem; font: 0.6875rem var(--mono); color: var(--muted); letter-spacing: 0; }
@media (max-width: 40rem) { .chronicle .entry { grid-template-columns: 1fr; } }

.who { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 32rem); gap: 1.5rem 2.5rem; align-items: end; margin: 0 0 3.5rem; }
.portrait { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.bio p { margin: 0 0 0.6em; font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.4; }
.bio p:last-child { margin: 0; color: var(--muted); }
@media (max-width: 40rem) { .who { grid-template-columns: 1fr; } .portrait { max-width: 12rem; } }

.will-intro { max-width: 36rem; font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.4; color: var(--muted); margin: 0 0 3rem; }
.will li { display: grid; grid-template-columns: 3rem 1fr; gap: 0.5rem 1.5rem; padding: 2rem 0; border-top: 1px solid var(--faint); }
.will .n { font: 0.75rem/2.4 var(--mono); color: var(--muted); }
.will .what { font-size: clamp(1.6rem, 3.6vw, 2.75rem); line-height: 1.1; letter-spacing: -0.02em; }
.will .why { grid-column: 2; color: var(--muted); max-width: 40rem; }

.prose { max-width: 38rem; }
.prose h1 { font-weight: 400; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.025em; line-height: 1.05; margin: 0.5rem 0 2.5rem; }
.prose h2 { font-weight: 400; font-size: 1.3rem; margin: 2.5rem 0 0.5rem; }
.prose p, .prose ul { margin: 0 0 1.2em; }
.prose ul { padding-left: 1.2em; }
.prose a { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 0.2em; }
.prose blockquote { margin: 2rem 0; padding-left: 1.25rem; border-left: 1px solid var(--fg); font-size: 1.5rem; line-height: 1.3; }
.prose code { font-family: var(--mono); font-size: 0.85em; }
.when { font: 0.75rem var(--mono); color: var(--muted); }
.legal-text { font-size: 0.9375rem; color: var(--muted); }
.legal-text h1, .legal-text h2, .legal-text strong { color: var(--fg); }
.quiet { color: var(--muted); }

mark.todo { background: none; color: var(--fg); font: 0.65em var(--mono); letter-spacing: 0.04em; border: 1px dashed currentColor; border-radius: 3px; padding: 0 0.3em; vertical-align: 0.2em; }

@media (max-width: 30rem) { .paths, .live { gap: 0 0.8rem; } }

/* /here: contact */
.section-h { font: 400 0.75rem var(--mono); color: var(--muted); letter-spacing: 0.04em; text-transform: lowercase; margin: 4rem 0 1rem; }
.contact { max-width: 44rem; scroll-margin-top: 2rem; }
.addresses { list-style: none; margin: 0 0 2.5rem; padding: 0; }
.addresses li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--faint); font-size: 1.125rem; }
.addresses .topic { color: var(--muted); }
.addresses a { font-family: var(--mono); font-size: 0.9375rem; }
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; font-family: var(--sans); }
.contact-form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.contact-form legend { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.6rem; padding: 0; }
.topics label { position: relative; }
.topics input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.topics span { display: inline-block; border: 1px solid var(--faint); border-radius: 999px; padding: 0.45rem 0.95rem; font-size: 0.9375rem; color: var(--muted); transition: all .15s; }
.topics input:checked + span { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.topics input:focus-visible + span { outline: 1px solid var(--fg); outline-offset: 3px; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 40rem) { .contact-form .row { grid-template-columns: 1fr; } }
.contact-form label > span { display: block; font-size: 0.875rem; color: var(--muted); margin-bottom: 0.35rem; }
.contact-form input[type=text], .contact-form input[type=email], .contact-form textarea {
  width: 100%; border: 1px solid var(--faint); border-radius: 0.9rem; background: var(--field); color: var(--fg);
  font: 400 1rem/1.5 var(--sans); padding: 0.75rem 1rem; outline: none; transition: border-color .15s;
}
.contact-form textarea { resize: vertical; min-height: 9rem; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--muted); }
.contact-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .send { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.contact-form button { border: 0; border-radius: 999px; background: var(--fg); color: var(--bg); font: 500 1rem var(--sans); padding: 0.75rem 1.6rem; cursor: pointer; }
.contact-form button:disabled { opacity: 0.4; cursor: default; }
.form-status { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.form-status[data-kind="ok"] { color: var(--fg); }
.fine { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.fine a { text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- Home: the sentence, continued (below the first screen) ---------- */
.down { margin-top: clamp(2rem, 6vh, 4rem); font: 1rem var(--mono); color: var(--muted); animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(0.35rem); } }
@media (prefers-reduced-motion: reduce) { .down { animation: none; } }
.more { width: min(100%, 64rem); padding: 0 0 4rem; }
.blk { padding: clamp(4rem, 12vh, 7rem) 0 0; scroll-margin-top: 2rem; }
.blk-h { margin: 0 0 clamp(1.5rem, 4vh, 2.5rem); font-weight: 400; font-size: clamp(2.25rem, 6vw, 4.5rem); line-height: 1.02; letter-spacing: -0.025em; }
.blk-h .path, .blk-h s { color: var(--muted); }
.blk-h s { text-decoration-thickness: 0.05em; }
.blk .all { margin: 1.25rem 0 0; font: 0.75rem var(--mono); color: var(--muted); }
.blk .all a:hover { color: var(--fg); }
.blk .chronicle .when { color: var(--muted); }
.blk .prose { font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.4; }
.blk .prose .when { font: 0.75rem var(--mono); color: var(--muted); }
.blk .will .what { font-size: clamp(1.4rem, 3vw, 2.25rem); }
.blk .addresses { margin: 0; max-width: 40rem; }

/* ---------- /speaking ---------- */
.invite { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 3rem 0 0; font: 0.75rem var(--mono); color: var(--muted); }
.button { display: inline-block; padding: 0.85rem 1.4rem; border-radius: 999px; background: var(--fg); color: var(--bg); font: 500 0.9375rem var(--sans); }
.button:hover { opacity: 0.85; }

/* ---------- Press kit (/here) ---------- */
.facts { margin: 0; max-width: 64rem; }
.facts div { display: grid; grid-template-columns: 11rem 1fr; gap: 0.25rem 2rem; padding: 0.8rem 0; border-top: 1px solid var(--faint); }
.facts dt { font: 0.75rem/1.9 var(--mono); color: var(--muted); }
.facts dd { margin: 0; font-size: 1.0625rem; line-height: 1.45; }
.bios { display: grid; gap: 2rem; margin: 2.5rem 0 1.5rem; max-width: 42rem; }
.bios figure { margin: 0; }
.bios figcaption { font: 0.75rem var(--mono); color: var(--muted); margin-bottom: 0.5rem; }
.bios blockquote { margin: 0; font-size: 1.0625rem; line-height: 1.55; user-select: all; }
@media (max-width: 40rem) { .facts div { grid-template-columns: 1fr; } }

/* ---------- Reach: email, phone, profiles (contact page, home, footer) ---------- */
.reach { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.75rem; max-width: 64rem; }
.reach a { display: flex; flex-direction: column; gap: 0.35rem; height: 100%; padding: 1.25rem 1.4rem; border: 1px solid var(--faint); border-radius: 1rem; transition: border-color .2s, background .2s; }
.reach a:hover { opacity: 1; border-color: var(--fg); background: var(--field); }
.reach .k { font: 0.75rem var(--mono); color: var(--muted); }
.reach .v { font-size: clamp(1.25rem, 2.2vw, 1.6rem); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.social { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; }
.hero-social { justify-content: center; margin-top: 1.5rem; font: 0.8125rem var(--mono); color: var(--fg); }
.hero-social a { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 0.3em; }
.hero-social a:hover { text-decoration-color: var(--fg); opacity: 1; }
.foot-r { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.foot .social a { color: var(--fg); }

/* /was: the whole line is the link */
.chronicle a.line { text-decoration: underline; text-decoration-color: var(--faint); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.chronicle a.line:hover { opacity: 1; text-decoration-color: var(--fg); }
.chronicle a.line .src { color: var(--muted); font-size: 0.8em; }

/* Press kit portrait */
.press .portrait { width: 12rem; margin: 0 0 1.5rem; }
@media (max-width: 40rem) { .reach { grid-template-columns: 1fr; } }
@media (max-width: 40rem) { .reach a { padding: 0.9rem 1.1rem; } }
