/* Tokens */
:root {
  color-scheme: light dark;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --ink: #121212;
  --ink-2: #55544f;
  --ink-3: #6f6e69;
  --line: #e6e5e0;
  --line-strong: #d2d1cb;
  --accent: #2b50e6;
  --accent-soft: #e4e9ff;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -16px rgb(0 0 0 / .18);
  --radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #131315;
    --surface-2: #1b1b1e;
    --ink: #f3f3f1;
    --ink-2: #a9a9a4;
    --ink-3: #85847f;
    --line: #232326;
    --line-strong: #35353a;
    --accent: #8ea4ff;
    --accent-soft: rgb(142 164 255 / .18);
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 16px 40px -20px rgb(0 0 0 / .8);
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 14px;
}
.skip:focus { top: 16px; }

.label {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font: 600 11px/1 var(--mono); letter-spacing: 0;
}
.nav-links { display: flex; align-items: center; gap: 2px; font-size: 14px; }
.nav-links a { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); transition: color .15s, background-color .15s; }
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links .nav-cta { margin-left: 8px; background: var(--ink); color: var(--bg); font-weight: 500; }
.nav-links .nav-cta:hover { background: var(--ink); color: var(--bg); opacity: .85; }

/* Hero */
.hero { position: relative; isolation: isolate; padding-block: clamp(40px, 7vw, 88px) clamp(24px, 4vw, 48px); }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.net-readout { font: 500 11.5px/1.4 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.net-readout span { color: var(--accent); }
.net {
  position: absolute; top: -64px; left: 0; z-index: -1; width: 100%; height: calc(100% + 64px);
  pointer-events: none; opacity: 0; transition: opacity 1.6s ease;
  -webkit-mask-image: linear-gradient(90deg, transparent 46%, #000 68%), linear-gradient(180deg, #000 72%, transparent 96%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 46%, #000 68%), linear-gradient(180deg, #000 72%, transparent 96%);
  mask-composite: intersect;
}
.net.ready { opacity: 1; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font: 500 13px/1 var(--mono); color: var(--ink-2);
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
h1 {
  max-width: 10.5em;
  font-size: clamp(2.6rem, 5.8vw, 4.75rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.045em;
}
h1 em {
  font-family: var(--serif);
  font-size: 1.08em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--ink-2);
}
.hero-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; margin-top: clamp(28px, 3.5vw, 40px); }
.lede { max-width: 30em; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 22px;
  border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: transform .2s, box-shadow .2s, background-color .2s, border-color .2s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { border: 1px solid var(--line-strong); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink-3); }

.credential {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px 32px;
  margin-top: clamp(24px, 4vw, 40px); padding-block: 24px;
  border-block: 1px solid var(--line);
  transition: background-color .25s;
}
.credential img { width: 200px; flex: none; }
.credential-text { flex: 1; min-width: 220px; font-size: 16px; color: var(--ink-2); }
.credential-cta { display: inline-flex; gap: 6px; font-size: 15px; font-weight: 500; transition: color .2s; }
.credential-cta span { display: inline-block; transition: transform .25s; }
.credential:hover .credential-cta { color: var(--accent); }
.credential:hover .credential-cta span { transform: translate(2px, -2px); }
@media (prefers-color-scheme: dark) { .credential img { filter: invert(1); } }

/* Sections */
.section { padding-block: clamp(48px, 7vw, 96px); }
.section-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: clamp(28px, 4vw, 48px); padding-top: 20px; border-top: 1px solid var(--line);
}
.section-head .num { font: 500 13px/1 var(--mono); color: var(--accent); }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 500; line-height: 1.1; letter-spacing: -.035em; }
.section-head .note { margin-left: auto; font-size: 14px; color: var(--ink-3); text-align: right; }

/* Companies */
.co-name { margin-top: 12px; font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 500; line-height: 1.05; letter-spacing: -.04em; }
.co-role { margin-top: 8px; font-size: 15px; font-weight: 500; color: var(--accent); }
.co-desc { margin-top: 18px; font-size: 17px; color: var(--ink-2); max-width: 32em; text-wrap: pretty; }

.feature {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center;
  gap: clamp(32px, 5vw, 64px); padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line); border-radius: 28px; background: var(--surface);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags li { padding: 7px 11px; border-radius: 999px; background: var(--surface-2); font: 500 12.5px/1 var(--mono); color: var(--ink-2); }
.arrow-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 28px; padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong); font-size: 15px; font-weight: 500;
  transition: border-color .2s, color .2s;
}
.arrow-link:hover { color: var(--accent); border-color: var(--accent); }
.arrow-link span, .teach-link span, .row-domain span, .email span, .event-arrow { display: inline-block; transition: transform .25s; }
.arrow-link:hover span, .teach:hover .teach-link span, .rows a:hover .row-domain span, .email:hover span, .events a:hover .event-arrow { transform: translate(2px, -2px); }

/* ClearTraced illustration */
.trace {
  position: relative; padding: clamp(20px, 3vw, 32px); border-radius: 20px;
  background-color: var(--surface-2);
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.2px);
  background-size: 18px 18px;
  font-family: var(--mono);
}
.trace-doc, .trace-record { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.trace-doc { margin-right: 14%; padding: 0 20px 20px; }
.trace-record { margin-left: 14%; padding: 0 20px 10px; }
.trace-bar {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 0 -20px 16px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
}
.trace-bar span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.trace-lines { display: grid; gap: 9px; margin: 14px 0; }
.trace-lines i { display: block; height: 6px; width: var(--w, 100%); border-radius: 3px; background: var(--surface-2); }
.trace-text { font: 400 15px/1.55 var(--sans); color: var(--ink-2); }
.trace-text mark {
  padding: 1px 3px; border-radius: 4px; color: var(--ink); font-weight: 500;
  background: linear-gradient(var(--accent-soft), var(--accent-soft)) no-repeat 0 0 / 100% 100%;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.trace-step { display: flex; align-items: center; gap: 10px; margin: 10px 0 10px calc(50% - 1px); height: 44px; font-size: 11.5px; color: var(--accent); }
.trace-step span { width: 1px; height: 100%; background: linear-gradient(var(--accent) 50%, transparent 0) 0 0 / 1px 6px; transform-origin: top; }
.trace-row { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 7px 0; font-size: 13px; }
.trace-row + .trace-row { border-top: 1px dashed var(--line); }
.trace-row dt { color: var(--ink-3); }
.trace-row dd { color: var(--ink); overflow-wrap: anywhere; }
.trace-src { color: var(--accent) !important; }
.trace figcaption { margin-top: 18px; font: 400 12.5px/1.5 var(--sans); color: var(--ink-3); }

/* Other ventures */
.ventures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.venture {
  display: flex; flex-direction: column; padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.venture:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.venture-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.corner {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line); border-radius: 50%; font-size: 15px; color: var(--ink-2);
  transition: background-color .25s, color .25s, border-color .25s;
}
.venture:hover .corner { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.venture .co-name { font-size: clamp(1.7rem, 2.6vw, 2.1rem); }
.venture .co-desc { flex: 1; font-size: 16px; }
.domain { margin-top: 28px; font: 500 13px/1 var(--mono); color: var(--ink-3); }

/* Previously */
.rows li + li a { border-top: 1px solid var(--line); }
.rows a {
  display: grid; grid-template-columns: minmax(0, 1fr) 200px 200px; align-items: center; gap: 24px;
  padding: 24px 0; transition: padding .3s, background-color .3s;
}
.rows { border-bottom: 1px solid var(--line); }
.rows a:hover { padding-inline: 20px; background: var(--surface); }
.row-name { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.2; }
.row-role { font-size: 15px; color: var(--ink-2); }
.row-domain { display: flex; justify-content: flex-end; gap: 8px; font: 500 13px/1 var(--mono); color: var(--ink-3); }
.rows a:hover .row-domain { color: var(--accent); }

/* Apps */
.apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.app {
  display: flex; flex-direction: column; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .25s;
}
.app:hover { border-color: var(--line-strong); }
.app-head { display: flex; align-items: center; gap: 14px; }
.app-head img { width: 56px; height: 56px; flex: none; border-radius: 14px; box-shadow: 0 0 0 1px rgb(0 0 0 / .06), 0 8px 20px -10px rgb(0 0 0 / .4); }
.app-head h3 { font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.app-head .label { margin-top: 3px; font-size: 11.5px; }
.app-desc { flex: 1; margin-top: 18px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.app-stat { display: flex; align-items: baseline; gap: 8px; margin-top: 22px; }
.app-stat strong { font: 400 34px/1 var(--serif); letter-spacing: -.01em; }
.app-stat span { font-size: 13px; color: var(--ink-3); }
.stores { display: flex; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.stores a {
  padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 13px; font-weight: 500; transition: background-color .2s, color .2s, border-color .2s;
}
.stores a:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Teaching & speaking */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: stretch; }
.teach {
  display: flex; flex-direction: column; padding: clamp(28px, 4vw, 40px);
  border-radius: 24px; background: var(--ink); color: var(--bg);
  transition: transform .25s, box-shadow .25s;
}
.teach:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.teach .label { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.teach-stat { margin-top: 36px; font: 400 clamp(4rem, 8vw, 6.5rem)/.9 var(--serif); letter-spacing: -.02em; }
.teach-title { margin-top: 10px; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.teach-desc { flex: 1; margin-top: 12px; font-size: 16px; color: color-mix(in srgb, var(--bg) 68%, transparent); }
.teach-link { display: inline-flex; gap: 6px; margin-top: 32px; font-size: 15px; font-weight: 500; }

.events { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); padding: 8px clamp(20px, 3vw, 32px); }
.events li { flex: 1; display: flex; }
.events li + li { border-top: 1px solid var(--line); }
.event { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 20px 0; }
.event-main { display: flex; flex-direction: column; gap: 4px; }
.event-main h3 { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 500; letter-spacing: -.02em; line-height: 1.25; }
.event-main > span { font-size: 14px; color: var(--ink-2); }
.event-arrow { font-size: 15px; color: var(--ink-3); }
.events a:hover h3 { color: var(--accent); }
.event-date {
  flex: none; padding: 6px 10px; border-radius: 999px; background: var(--accent-soft);
  font: 500 12px/1 var(--mono); color: var(--accent); white-space: nowrap;
}

/* Contact */
.contact { padding-block: clamp(48px, 7vw, 96px) 32px; }
.contact .wrap > .label { padding-top: 20px; border-top: 1px solid var(--line); }
.contact h2 {
  margin-top: 28px; max-width: 14em;
  font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 500; line-height: 1.04; letter-spacing: -.045em; text-wrap: balance;
}
.contact h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; color: var(--ink-2); }
.email {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 36px; padding-bottom: 6px;
  border-bottom: 1px solid var(--ink); font-size: clamp(20px, 2.6vw, 28px); font-weight: 500; letter-spacing: -.02em;
  transition: color .2s, border-color .2s;
}
.email:hover { color: var(--accent); border-color: var(--accent); }
.foot-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: clamp(64px, 10vw, 112px); padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3);
}
#engineer-toggle {
  min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: transparent;
  color: var(--ink-3); font: 500 13px/1 var(--mono); cursor: pointer; transition: color .2s, border-color .2s;
}
#engineer-toggle:hover, #engineer-toggle[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
#engineer-notes {
  margin-top: 16px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  font: 400 13px/1.8 var(--mono); color: var(--ink-2);
}
.notes-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; color: var(--accent); }
.notes-hint { margin-top: 8px; color: var(--ink-3); }

/* Motion (only when JS and motion are allowed) */
@media (prefers-reduced-motion: no-preference) {
  .hero .status, .hero h1, .hero .hero-foot, .hero .credential { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero h1 { animation-delay: .08s; }
  .hero .hero-foot { animation-delay: .18s; }
  .hero .credential { animation-delay: .28s; }

  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
  .js [data-reveal].in { opacity: 1; transform: none; }
  .js .apps [data-reveal]:nth-child(2), .js .ventures [data-reveal]:nth-child(2), .js .split [data-reveal]:nth-child(2) { transition-delay: .08s; }
  .js .apps [data-reveal]:nth-child(3) { transition-delay: .16s; }
  .js .apps [data-reveal]:nth-child(4) { transition-delay: .24s; }

  .js .trace mark { transition: background-size .7s .5s ease; }
  .js .trace:not(.play) mark { background-size: 0 100%; box-shadow: none; }
  .js .trace-step span { transition: transform .5s 1.2s ease; }
  .js .trace:not(.play) .trace-step span { transform: scaleY(0); }
  .js .trace-step, .js .trace-record { transition: opacity .5s 1.4s, transform .6s 1.4s cubic-bezier(.2, .7, .2, 1); }
  .js .trace:not(.play) .trace-step, .js .trace:not(.play) .trace-record { opacity: 0; transform: translateY(10px); }
  .js .trace-row { transition: opacity .4s; }
  .js .trace-row:nth-of-type(2) { transition-delay: 1.8s; }
  .js .trace-row:nth-of-type(3) { transition-delay: 1.95s; }
  .js .trace-row:nth-of-type(4) { transition-delay: 2.1s; }
  .js .trace-row:nth-of-type(5) { transition-delay: 2.25s; }
  .js .trace:not(.play) .trace-row { opacity: 0; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* Responsive */
@media (max-width: 1000px) {
  .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rows a { grid-template-columns: minmax(0, 1fr) auto auto; }
}
@media (max-width: 860px) {
  .net-readout { display: none; }
  .feature { grid-template-columns: 1fr; }
  .hero-foot { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { padding-top: 250px; }
  .net {
    -webkit-mask-image: linear-gradient(180deg, #000 280px, transparent 340px);
    mask-image: linear-gradient(180deg, #000 280px, transparent 340px);
  }
  .ventures { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links .hide-sm { display: none; }
  .section-head { flex-wrap: wrap; row-gap: 8px; }
  .section-head .note { margin-left: 0; width: 100%; text-align: left; }
  .rows a { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 20px 0; }
  .rows a:hover { padding-inline: 0; background: none; }
  .row-role { grid-column: 1; grid-row: 2; font-size: 14px; }
  .row-domain { grid-column: 2; grid-row: 1 / 3; }
  .trace-doc { margin-right: 0; }
  .trace-record { margin-left: 0; }
  .event { flex-wrap: wrap; }
  .feature { padding: 20px; border-radius: 22px; }
  .trace { padding: 16px; }
  .trace-doc, .trace-record { padding-inline: 16px; }
  .trace-bar { margin-inline: -16px; padding-inline: 16px; }
  .trace-row { grid-template-columns: 58px 1fr; font-size: 12px; }
}
@media (max-width: 560px) {
  .apps { grid-template-columns: 1fr; }
  .brand-mark { display: none; }
  .nav-links a { padding: 8px 10px; }
  .actions .btn { flex: 1; }
}
