/* Layout: a river. One teal channel with numbered stations carries the z-nile pipeline and the career timeline. */
:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --ink: #12211f;
  --muted: #566764;
  --line: #d3dedb;
  --water: #0b6f72;
  --water-deep: #084f52;
  --water-soft: #e0efee;
  --sand: #9a6a14;
  --sand-soft: #f6ecd8;
  --code-bg: #eaf0ef;
  --on-water: #ffffff;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --maxw: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1514; --surface: #131f1d; --ink: #e2ebe8; --muted: #93a6a2; --line: #26403c;
    --water: #4cc0b8; --water-deep: #7ad6cf; --water-soft: #15302d; --sand: #e2b45c; --sand-soft: #2e2512;
    --code-bg: #1a2a28; --on-water: #06201e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1514; --surface: #131f1d; --ink: #e2ebe8; --muted: #93a6a2; --line: #26403c;
  --water: #4cc0b8; --water-deep: #7ad6cf; --water-soft: #15302d; --sand: #e2b45c; --sand-soft: #2e2512;
  --code-bg: #1a2a28; --on-water: #06201e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.12; }
p { margin: 0; }
a { color: var(--water); text-underline-offset: 3px; }
a:hover { color: var(--water-deep); }
:focus-visible { outline: 2px solid var(--water); outline-offset: 3px; border-radius: 4px; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

.wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.eyebrow {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--water); font-weight: 500;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.brand .mark {
  width: 28px; height: 28px; border-radius: 50%; background: var(--water); color: var(--on-water);
  display: grid; place-items: center; font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.92rem; padding: 8px 0; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; font-family: var(--body); font-weight: 600; font-size: 0.95rem; text-decoration: none;
  border: 1.5px solid var(--water); color: var(--water); background: transparent; white-space: nowrap;
  transition: background-color .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--water-soft); color: var(--water-deep); }
.btn.solid { background: var(--water); color: var(--on-water); }
.btn.solid:hover { background: var(--water-deep); border-color: var(--water-deep); color: var(--on-water); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 0.88rem; }
.btn .arr { font-family: var(--mono); }

/* hero */
.hero { padding-block: clamp(40px, 8vw, 96px) clamp(36px, 6vw, 72px); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero h1 { font-size: clamp(2.6rem, 7.4vw, 5.4rem); font-weight: 700; letter-spacing: -0.025em; line-height: 0.98; }
.hero h1 .x { color: var(--water); }
.hero .thesis { font-size: clamp(1.1rem, 2vw, 1.32rem); color: var(--muted); max-width: 54ch; line-height: 1.5; }
.hero .thesis strong { color: var(--ink); font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.avail { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.avail i { width: 9px; height: 9px; border-radius: 50%; background: var(--water); box-shadow: 0 0 0 4px var(--water-soft); }
.portrait { position: relative; justify-self: end; width: min(100%, 360px); }
.portrait img { border-radius: 28px 28px 28px 120px; aspect-ratio: 1; object-fit: cover; width: 100%; border: 1px solid var(--line); }
.portrait::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; border-radius: 28px 28px 28px 120px;
  background: var(--water-soft); z-index: -1;
}
.portrait figcaption {
  position: absolute; right: -6px; bottom: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-family: var(--mono); font-size: 0.74rem; color: var(--muted); line-height: 1.4;
}
.portrait figcaption b { color: var(--ink); font-weight: 500; display: block; }

/* proof numbers */
.proof { border-block: 1px solid var(--line); background: var(--surface); }
.proof ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.proof li { padding: 26px 18px 24px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.proof li + li { border-left: 1px solid var(--line); }
.proof b {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 2.9vw, 2.4rem); line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap;
}
.proof b.long { font-size: clamp(1.3rem, 2.35vw, 1.95rem); line-height: 1.24; }
.proof b small { font-size: 0.55em; color: var(--water); font-weight: 500; font-family: var(--mono); letter-spacing: 0; padding: 0 2px; }
.proof span { font-size: 0.88rem; color: var(--muted); line-height: 1.4; }
.proof em { font-style: normal; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--water); }

/* sections */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { display: grid; gap: 10px; max-width: 68ch; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 700; letter-spacing: -0.015em; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.band { background: var(--surface); border-block: 1px solid var(--line); }

/* z-nile feature */
.zn-grid { display: grid; gap: 28px; }
.river { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.river::before { content: ""; position: absolute; left: 13px; right: 10%; top: 10px; height: 6px; background: var(--water-soft); border-radius: 3px; }
.river::after {
  content: ""; position: absolute; left: 13px; top: 10px; height: 6px; width: 0; background: var(--water); border-radius: 3px; opacity: .55;
}
.river.flow::after { animation: flow 2.2s cubic-bezier(.4, 0, .2, 1) .2s forwards; }
@keyframes flow { to { width: calc(90% - 13px); } }
.river li { position: relative; display: grid; gap: 4px; padding-right: 16px; min-width: 0; align-content: start; }
.dot {
  position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; background: var(--water); color: var(--on-water);
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500; display: grid; place-items: center;
}
.river h3 { font-size: 1.2rem; font-weight: 700; margin-top: 8px; }
.river .cmd { font-family: var(--mono); font-size: 0.78rem; color: var(--water); }
.river p { font-size: 0.9rem; color: var(--muted); line-height: 1.45; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); list-style: none; }
.facts li { display: flex; align-items: baseline; gap: 7px; font-size: 0.9rem; color: var(--muted); }
.facts b { font-family: var(--mono); font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 1.02rem; }
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 28px; margin: 0; padding: 0; list-style: none; }
.points li { display: grid; gap: 4px; padding-top: 12px; border-top: 2px solid var(--water-soft); align-content: start; }
.points b { font-family: var(--display); font-size: 1.04rem; line-height: 1.25; }
.points span { color: var(--muted); font-size: 0.92rem; }
.term {
  background: var(--ink); color: var(--bg); border-radius: 12px; padding: 16px 18px; font-family: var(--mono); font-size: 0.84rem;
  line-height: 1.7; overflow-x: auto; white-space: pre;
}
.term .p { color: var(--water-soft); opacity: .6; }
.term .ok { color: #6fd6c4; }
.term .dim { opacity: .6; }

/* what I do */
.do { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.do article { padding: 24px 24px 8px 0; display: grid; gap: 10px; align-content: start; min-width: 0; }
.do article + article { padding-left: 24px; border-left: 1px solid var(--line); }
.do h3 { font-size: 1.25rem; }
.do p { color: var(--muted); font-size: 0.96rem; }
.do .res { font-family: var(--mono); font-size: 0.8rem; color: var(--sand); background: var(--sand-soft); padding: 6px 10px; border-radius: 6px; justify-self: start; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 36px; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 6px; background: var(--water-soft); border-radius: 3px; }
.timeline > li { position: relative; padding-left: 52px; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 28px; }
.timeline > li::before {
  content: ""; position: absolute; left: 3px; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--water); border: 4px solid var(--surface);
}
.timeline > li.now::before { box-shadow: 0 0 0 4px var(--water-soft); }
.when { font-family: var(--mono); font-size: 0.84rem; color: var(--muted); padding-top: 3px; font-variant-numeric: tabular-nums; }
.role { display: grid; gap: 8px; min-width: 0; }
.role h3 { font-size: 1.3rem; }
.role h3 span { color: var(--muted); font-weight: 500; }
.role p { color: var(--muted); max-width: 70ch; }
.role p strong { color: var(--ink); font-weight: 600; }
.stack { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); opacity: .9; }
details.earlier { margin-top: 36px; padding-left: 52px; }
details.earlier summary { cursor: pointer; font-family: var(--mono); font-size: 0.86rem; color: var(--water); padding: 10px 0; min-height: 44px; }
.earlier dl { margin: 12px 0 0; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px 28px; }
.earlier dt { font-family: var(--mono); font-size: 0.84rem; color: var(--muted); }
.earlier dd { margin: 0; color: var(--muted); font-size: 0.95rem; }
.earlier dd b { color: var(--ink); font-weight: 600; }

/* quotes */
.quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.quotes figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 22px; display: grid; gap: 16px; align-content: space-between; min-width: 0; }
.band .quotes figure { background: var(--bg); }
.quotes blockquote { margin: 0; font-size: 1.02rem; line-height: 1.55; }
.quotes blockquote::before { content: "\201C"; font-family: var(--display); font-size: 3rem; line-height: 0.6; color: var(--water); display: block; margin-bottom: 6px; }
.quotes figure.lead { grid-column: 1 / -1; }
.quotes figure.lead blockquote { font-family: var(--display); font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.3; font-weight: 500; max-width: 34ch; max-width: 46ch; }
.quotes figcaption { font-size: 0.88rem; color: var(--muted); }
.quotes figcaption b { color: var(--ink); font-weight: 600; display: block; }

/* patents */
.pat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pat article { border-top: 2px solid var(--water); padding-top: 14px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.pat .id { font-family: var(--mono); font-size: 0.78rem; color: var(--water); }
.pat h3 { font-size: 1.12rem; line-height: 1.25; }
.pat p { color: var(--muted); font-size: 0.93rem; }

/* how I work */
.work { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(28px, 5vw, 64px); }
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.principles li { display: grid; gap: 2px; }
.principles b { font-family: var(--display); font-size: 1.15rem; }
.principles span { color: var(--muted); }
.rules { background: var(--ink); color: var(--bg); border-radius: 14px; padding: 22px 24px; font-family: var(--mono); font-size: 0.86rem; line-height: 1.9; align-self: start; }
.rules ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; }
.rules li { break-inside: avoid; padding-left: 2ch; text-indent: -2ch; }
.rules li::before { content: "> "; opacity: .5; }
.rules .never { margin-top: 14px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--bg) 25%, transparent); }
.rules .never li { color: var(--sand-soft); }
:root[data-theme="dark"] .rules .never li { color: var(--sand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rules .never li { color: var(--sand); } }
:root[data-theme="dark"] .rules, :root[data-theme="dark"] .term { background: var(--code-bg); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rules, :root:not([data-theme="light"]) .term { background: var(--code-bg); color: var(--ink); } }

/* off the clock */
.off { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.off img { border-radius: 120px 20px 20px 20px; width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); }
.off-copy { display: grid; gap: 16px; }
.off-copy p { color: var(--muted); max-width: 60ch; }
.chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-family: var(--mono); font-size: 0.78rem; padding: 5px 11px; border-radius: 999px; background: var(--water-soft); color: var(--water); }

/* contact */
.contact { background: var(--water); color: var(--on-water); }
.contact .wrap { padding-block: clamp(56px, 8vw, 96px); display: grid; gap: 28px; }
.contact h2 { font-size: clamp(2rem, 5.5vw, 3.6rem); letter-spacing: -0.02em; max-width: 18ch; }
.contact p { max-width: 56ch; opacity: .9; font-size: 1.08rem; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid color-mix(in srgb, var(--on-water) 30%, transparent); }
.contact-list li { padding: 18px 16px 0 0; display: grid; gap: 4px; min-width: 0; }
.contact-list span { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: .75; }
.contact-list a { color: var(--on-water); font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; min-height: 32px; }
.contact-list a:hover { color: var(--on-water); text-decoration-thickness: 2px; }
.contact .btn { border-color: var(--on-water); color: var(--on-water); justify-self: start; }
.contact .btn:hover { background: color-mix(in srgb, var(--on-water) 15%, transparent); color: var(--on-water); }
.contact :focus-visible { outline-color: var(--on-water); }

footer.site { padding-block: 22px; color: var(--muted); font-size: 0.84rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* reveal: only hides when JS is running and motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
  .hero-copy > * { animation: rise .7s ease both; }
  .hero-copy > *:nth-child(2) { animation-delay: .08s; }
  .hero-copy > *:nth-child(3) { animation-delay: .16s; }
  .hero-copy > *:nth-child(4) { animation-delay: .24s; }
  .hero-copy > *:nth-child(5) { animation-delay: .32s; }
  .portrait { animation: rise .9s ease .15s both; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } }
}
@media (prefers-reduced-motion: reduce) {
  .river::after { width: calc(90% - 13px); }
}

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .proof ul { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .proof li { grid-column: span 2; }
  .proof li:nth-child(n+4) { grid-column: span 3; border-top: 1px solid var(--line); }
  .proof li:nth-child(4) { border-left: 0; }
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pat { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .portrait { justify-self: start; width: min(72%, 280px); order: -1; }
  .portrait figcaption { right: -24%; }
  .proof ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof li, .proof li:nth-child(n+4) { grid-column: auto; padding: 20px 14px 18px; border-left: 0; border-top: 1px solid var(--line); }
  .proof li:nth-child(even) { border-left: 1px solid var(--line); }
  .proof li:nth-child(-n+2) { border-top: 0; }
  .proof li:last-child { grid-column: 1 / -1; border-left: 0; }
  .river { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .river::before { left: 10px; right: auto; top: 6px; bottom: 6px; width: 6px; height: auto; }
  .river::after { display: none; }
  .river li { grid-template-columns: 26px minmax(0, 1fr); column-gap: 16px; padding-right: 0; }
  .river li > :not(.dot) { grid-column: 2; }
  .river h3 { margin-top: 0; }
  .points, .do, .quotes, .work, .off { grid-template-columns: minmax(0, 1fr); }
  .do article, .do article + article { padding: 22px 0 6px; border-left: 0; }
  .do article + article { border-top: 1px solid var(--line); }
  .do { gap: 16px; }
  .timeline > li { grid-template-columns: minmax(0, 1fr); padding-left: 40px; }
  details.earlier { padding-left: 40px; }
  .earlier dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .earlier dd { margin-bottom: 12px; }
  .rules ul { columns: 1; }
  .contact-list { grid-template-columns: minmax(0, 1fr); }
  .contact-list li { padding: 14px 0; border-bottom: 1px solid color-mix(in srgb, var(--on-water) 22%, transparent); }
  .btn.small.hide-s { display: none; }
}
