/* Magazine layout: a wide editorial grid with a numbered margin column,
   one display face (Bricolage Grotesque), one text face (Geist), one cobalt accent. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --text: #0d0f1a;
  --muted: #555a6c;
  --line: #e3e5ec;
  --rule: #0d0f1a;
  --accent: #2b45d6;
  --accent-soft: #eef0fd;
  --surface: #f6f7fa;
  --display: "Bricolage Grotesque", "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: max(1rem, env(safe-area-inset-left, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c14;
    --text: #eef0f8;
    --muted: #a3a8bb;
    --line: #252838;
    --rule: #eef0f8;
    --accent: #95a4ff;
    --accent-soft: #171b36;
    --surface: #12141f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c14;
  --text: #eef0f8;
  --muted: #a3a8bb;
  --line: #252838;
  --rule: #eef0f8;
  --accent: #95a4ff;
  --accent-soft: #171b36;
  --surface: #12141f;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

strong {
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  text-decoration: none;
}
.skip:focus {
  top: 1rem;
}

/* Reading progress: a thin accent line, driven by scroll in CSS (no JS). */
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: 3px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .progress {
    animation: progress linear both;
    animation-timeline: scroll(root);
  }
}
@supports not (animation-timeline: scroll()) {
  .progress {
    display: none;
  }
}
@keyframes progress {
  to {
    transform: scaleX(1);
  }
}

/* Page frame */
.page {
  max-width: 72rem;
  margin-inline: auto;
  padding-block: 1.25rem 3rem;
  padding-left: var(--gutter);
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}
.brand {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 0.5rem 1.25rem;
}
.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  padding: 0;
  list-style: none;
}
.top-links a {
  color: var(--muted);
  text-decoration: none;
}
.top-links a:hover {
  color: var(--text);
}
@media (max-width: 34rem) {
  .top-links .wide {
    display: none;
  }
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.6rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--text);
}
.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .sun {
  display: none;
}
.is-dark .theme-toggle .sun {
  display: block;
}
.is-dark .theme-toggle .moon {
  display: none;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 4rem;
  align-items: end;
  padding-block: clamp(2.5rem, 10vw, 7rem) clamp(3rem, 8vw, 5rem);
  border-bottom: 1.5px solid var(--rule);
}
.hero-text {
  min-width: 0;
}
/* Cut-out portrait on a soft accent panel; small above the text on phones, a column on wide screens. */
.hero-photo {
  width: 6rem;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-soft);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  transform: scale(1.5);
  transform-origin: 50% 20%;
}
@media (min-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
  }
  .hero-photo {
    order: 2;
    width: 100%;
    align-self: center;
  }
}
.eyebrow {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}
/* The h1 is the small name line (for search); the big display line is a paragraph. */
.headline {
  max-width: 17ch;
  margin-top: 1rem;
  font-family: var(--display);
  font-size: clamp(2.6rem, 8.2vw, 5.75rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.headline em {
  font-style: normal;
  color: var(--accent);
}
.deck {
  max-width: 38rem;
  margin-top: clamp(1.5rem, 4vw, 2.25rem);
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--muted);
}
.avail {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.avail::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}
.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0;
  list-style: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.55rem 1.2rem;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn:hover {
  background: var(--text);
  color: var(--bg);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--text);
  border-color: var(--text);
}
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

/* Numbered sections: number in the margin on wide screens, above the heading on phones. */
.sec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem 2rem;
  padding-block: clamp(3rem, 8vw, 5.5rem) 0;
}
.sec-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.sec-body {
  min-width: 0;
}
.sec h2 {
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  font-family: var(--display);
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.sec h2 + .intro-text {
  max-width: 40rem;
  margin-top: -1rem;
  margin-bottom: 2rem;
  color: var(--muted);
}
.prose {
  max-width: 40rem;
}
.prose > * + * {
  margin-top: 1rem;
}
@media (min-width: 52rem) {
  .sec {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }
  .sec-num {
    padding-top: 0.9rem;
  }
}

/* 01 Results */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 2rem 1.75rem;
  padding: 0;
  list-style: none;
}
.result {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding-top: 0.9rem;
  border-top: 1.5px solid var(--rule);
}
.result-num {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 2.9rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.result-label {
  font-weight: 600;
}
.result-context {
  font-size: 0.95rem;
  color: var(--muted);
}

/* 02 Case studies */
.case + .case {
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
}
.case-shot {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.case-shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: left top;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.case:hover .case-shot img {
  transform: scale(1.015);
}
.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-top: 1.5rem;
}
.case h3 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.case-company {
  color: var(--muted);
}
.case-grid {
  display: grid;
  gap: 1.5rem 3rem;
  margin-top: 1.25rem;
}
.case-parts {
  display: grid;
  gap: 1.25rem;
  max-width: 40rem;
}
.case-parts h4,
.case-meta dt {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-parts h4 {
  margin-bottom: 0.3rem;
}
.case-parts ul {
  display: grid;
  gap: 0.4rem;
  padding-left: 1.1rem;
  list-style: disc;
}
.case-parts li::marker {
  color: var(--accent);
}
.case-result p {
  font-weight: 500;
}
.case-result strong {
  color: var(--accent);
}
.case-meta {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  font-size: 0.95rem;
}
.case-meta dd {
  margin-top: 0.15rem;
}
@media (min-width: 60rem) {
  .case-grid {
    grid-template-columns: minmax(0, 40rem) minmax(0, 15rem);
  }
}

/* 03 Things I've built */
.built {
  display: grid;
  gap: clamp(2.5rem, 6vw, 3.5rem);
}
.product {
  display: grid;
  gap: 1.25rem 2.5rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}
.product-shot {
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--line);
  align-self: start;
}
.product-shot img {
  width: 100%;
}
.product-body {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  min-width: 0;
}
.product-kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.product h3 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.product-lede {
  font-size: 1.1rem;
  font-weight: 500;
}
.product ul {
  display: grid;
  gap: 0.35rem;
  padding-left: 1.1rem;
  list-style: disc;
}
.product li::marker {
  color: var(--accent);
}
.product h4 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.product .stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 !important;
  list-style: none;
  font-size: 0.85rem;
}
.stack li {
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.visit {
  font-weight: 600;
}
@media (min-width: 60rem) {
  .product {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
}

.earlier {
  margin-top: clamp(3rem, 7vw, 4rem);
}
.earlier h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.earlier-list {
  padding: 0;
  list-style: none;
}
.earlier-list li {
  display: grid;
  gap: 0.1rem 1.5rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--line);
}
.earlier-list li:last-child {
  border-bottom: 1px solid var(--line);
}
.earlier-list a {
  font-weight: 600;
}
.earlier-meta {
  font-size: 0.95rem;
  color: var(--muted);
}
@media (min-width: 46rem) {
  .earlier-list li {
    grid-template-columns: 12rem minmax(0, 1fr);
  }
  .earlier-list .earlier-meta {
    grid-column: 1;
    grid-row: 2;
  }
}

/* 04 Speaking */
.talks {
  display: grid;
  gap: 2rem;
  padding: 0;
  list-style: none;
}
.talk {
  display: grid;
  gap: 0.5rem 2rem;
  padding-top: 1rem;
  border-top: 1.5px solid var(--rule);
}
.talk-date {
  font-size: 0.95rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.talk h3 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.2vw, 1.8rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.talk-event {
  font-weight: 600;
}
.talk p {
  max-width: 40rem;
}
@media (min-width: 46rem) {
  .talk {
    grid-template-columns: 12rem minmax(0, 1fr);
  }
  .talk-body {
    display: grid;
    gap: 0.5rem;
  }
}

/* 05 Experience */
.jobs {
  padding: 0;
  list-style: none;
}
.job {
  display: grid;
  gap: 0.15rem 1.5rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
}
.job:first-child {
  border-top: 1.5px solid var(--rule);
}
.job:last-child {
  border-bottom: 1px solid var(--line);
}
.job h3 {
  font-size: 1.05rem;
  font-weight: 600;
}
.job h3 .muted {
  font-weight: 400;
}
.job-dates,
.job-loc {
  font-size: 0.95rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.job-loc {
  font-size: 0.875rem;
}
.job-points {
  margin-top: 0.5rem;
  padding-left: 1.1rem;
  list-style: disc;
  display: grid;
  gap: 0.35rem;
}
.job-points li::marker {
  color: var(--muted);
}
@media (min-width: 46rem) {
  .job {
    grid-template-columns: 12rem minmax(0, 1fr);
  }
  .job-meta {
    padding-top: 0.1rem;
  }
}
.edu {
  margin-top: 1.25rem;
  color: var(--muted);
}

/* 06 Skills */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem 2rem;
}
.skills div {
  padding-top: 0.75rem;
  border-top: 1.5px solid var(--rule);
}
.skills dt {
  font-weight: 600;
}
.skills dd {
  margin-top: 0.25rem;
  color: var(--muted);
}

/* 07 AI */
.ai {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-left: 1.2rem;
}
.ai li::marker {
  color: var(--accent);
}
code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
}

/* 08 Quotes */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 2rem 3rem;
}
.quote blockquote p {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.quote figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* 09 Contact */
.contact-mail {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(1.6rem, 6vw, 3.5rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.contact .avail {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: clamp(4rem, 9vw, 6rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--muted);
}
