:root {
  --paper: #f4f1ea;
  --paper-bright: #fbfaf7;
  --ink: #121317;
  --muted: #696b70;
  --line: #d3d0c8;
  --blue: #3157ff;
  --green: #14854b;
  --body-copy: #414349;
  --card-copy: #51535a;
  --surface-visual: #e8e5dc;
  --border-hover: #9e9b92;
  --runtime-shadow: #dcd8ce;
  --header-shadow: rgb(18 19 23 / 8%);
  --contact-surface: #17181c;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
  --serif: "Newsreader", serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0a0c10;
  --paper-bright: #12161d;
  --ink: #f0f3f8;
  --muted: #98a2b1;
  --line: #2a313c;
  --blue: #7188ff;
  --green: #36c77a;
  --body-copy: #c5ced8;
  --card-copy: #b7c0cc;
  --surface-visual: #161b22;
  --border-hover: #536071;
  --runtime-shadow: #202733;
  --header-shadow: rgb(0 0 0 / 28%);
  --contact-surface: #11151b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.shell { width: min(1320px, calc(100% - 48px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(max-content, 1fr) auto auto; gap: .85rem; align-items: center; min-height: 68px; padding: 0 max(24px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(14px); }
.identity, .header-link, nav a { text-decoration: none; }
.identity { display: inline-flex; gap: .75rem; align-items: center; font-weight: 700; letter-spacing: -.02em; }
.monogram { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--ink); font: 500 .72rem/1 var(--mono); }
nav { justify-self: center; display: flex; gap: 1.7rem; font-size: .82rem; }
.menu-toggle { display: none; }
.header-link { justify-self: end; padding: .55rem .8rem; border: 1px solid var(--ink); font: 500 .76rem/1 var(--mono); text-transform: uppercase; }
.display-controls { display: flex; align-items: center; gap: .45rem; }
.language-dropdown { position: relative; display: inline-flex; }
.language-dropdown::after { content: "⌄"; position: absolute; right: .65rem; top: 50%; transform: translateY(-56%); color: var(--muted); pointer-events: none; font-size: .72rem; }
.language-dropdown select { min-height: 36px; padding: .55rem 1.8rem .55rem .75rem; appearance: none; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-bright); color: var(--ink); cursor: pointer; font: 500 .68rem/1 var(--mono); }
.theme-toggle { position: relative; display: inline-flex; align-items: center; gap: .55rem; min-height: 36px; padding: .45rem .7rem; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font: 500 .65rem/1 var(--mono); text-transform: uppercase; }
.theme-icon-stack { display: grid; place-items: center; width: 1rem; height: 1rem; }
.theme-icon { grid-area: 1 / 1; transition: opacity .2s ease, transform .2s ease; }
.theme-icon-moon { opacity: 0; transform: rotate(-25deg) scale(.7); }
:root[data-theme="dark"] .theme-icon-sun { opacity: 0; transform: rotate(25deg) scale(.7); }
:root[data-theme="dark"] .theme-icon-moon { opacity: 1; transform: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr); gap: clamp(3rem, 7vw, 8rem); min-height: calc(100svh - 68px); padding-block: clamp(4rem, 7vw, 7rem) 5rem; align-items: center; }
.hero > * { min-width: 0; }
.portrait-frame { position: relative; width: clamp(88px, 8vw, 118px); aspect-ratio: 1; margin: 0 0 2.2rem .35rem; border: 3px solid var(--paper); border-radius: 50%; outline: 1px solid var(--line); box-shadow: 9px 9px 0 color-mix(in srgb, var(--blue) 78%, transparent); transition: transform .55s cubic-bezier(.2,.7,.2,1), box-shadow .55s ease; }
.portrait-frame::after { content: ""; position: absolute; inset: -9px; border: 1px solid var(--blue); border-radius: 50%; opacity: 0; transform: scale(.87) rotate(-20deg); transition: transform .65s cubic-bezier(.2,.7,.2,1), opacity .45s ease; pointer-events: none; }
.portrait-photo { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; transition: transform .65s cubic-bezier(.2,.7,.2,1); }
.portrait-frame:hover { transform: translateY(-5px) rotate(-2deg); box-shadow: 13px 14px 0 color-mix(in srgb, var(--blue) 78%, transparent); }
.portrait-frame:hover::after { opacity: 1; transform: scale(1) rotate(0); }
.portrait-frame:hover img { transform: scale(1.09); }
.eyebrow { margin: 0 0 1.35rem; color: var(--blue); font: 500 .72rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; letter-spacing: -.04em; line-height: .98; }
h1 { max-width: 680px; font-family: var(--serif); font-size: clamp(2.7rem, 3.55vw, 3.9rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.12; text-wrap: balance; }
.lede { max-width: 650px; margin: 1.8rem 0 0; color: var(--body-copy); font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .65rem; min-height: 48px; padding: .72rem 1rem; border: 1px solid var(--ink); text-decoration: none; font: 500 .78rem/1 var(--mono); text-transform: uppercase; letter-spacing: .02em; }
.button-dark { background: var(--ink); color: var(--paper); }
.button-light { background: transparent; }
.button:hover, .header-link:hover { background: var(--blue); border-color: var(--blue); color: white; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 3rem 0 0; border-top: 1px solid var(--line); }
.facts div { padding: 1rem 1rem 0 0; }
.facts dt { color: var(--muted); font: .65rem/1.2 var(--mono); text-transform: uppercase; }
.facts dd { margin: .4rem 0 0; font-size: .82rem; font-weight: 600; }
.runtime { align-self: center; border: 1px solid #303744; background: #11151b; color: #f6f5f2; box-shadow: 24px 24px 0 var(--runtime-shadow); }
.runtime-bar { display: flex; align-items: center; gap: .45rem; min-height: 46px; padding: 0 1rem; border-bottom: 1px solid #303239; }
.runtime-bar > span { width: 8px; height: 8px; border: 1px solid #777; border-radius: 50%; }
.runtime-bar code { margin-left: .4rem; color: #989ba5; font: .66rem/1 var(--mono); }
.runtime-bar b { margin-left: auto; color: #76e6a3; font: 500 .58rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.runtime-body { padding: 1.6rem; overflow: auto; font: .75rem/1.85 var(--mono); }
.runtime-body p { margin: 0; white-space: nowrap; }
.runtime-body span { color: #8aa3ff; }
.runtime-body .indent { padding-left: 1.5rem; color: #d8d5cc; }
.runtime-links { display: grid; grid-template-columns: 1fr auto; gap: .65rem 1rem; padding: 1.2rem 1.6rem; border-top: 1px solid #303239; font: .67rem/1.3 var(--mono); }
.runtime-links span { grid-column: 1 / -1; color: #81848e; text-transform: uppercase; }
.runtime-links a { color: #f6f5f2; text-decoration-color: #555; text-underline-offset: 4px; }
.work, .archive, .experience, .about { padding-block: 8rem; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr 2fr; margin-bottom: 3rem; }
.section-heading h2 { font-family: var(--serif); font-size: clamp(2.8rem, 5vw, 5rem); font-weight: 500; }
.section-heading > div > p { max-width: 650px; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.project { display: grid; grid-template-rows: auto 1fr; min-width: 0; border: 1px solid var(--line); background: var(--paper-bright); transition: border-color .25s ease, transform .25s ease; }
.project:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.project-visual { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-visual); }
.project-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.project:hover img { transform: scale(1.025); }
.visual-type { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(1.3rem, 3vw, 2.6rem); font-family: var(--mono); }
.visual-type > span { font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
.visual-type > strong { font: 500 clamp(2rem, 4.1vw, 4.8rem)/.95 var(--serif); letter-spacing: -.05em; }
.visual-tailspend { background: #102b25; color: #e5ff9c; }
.visual-tailspend > div { display: flex; align-items: end; gap: 4%; height: 22%; }
.visual-tailspend i { flex: 1; height: 30%; border-top: 1px solid currentColor; background: color-mix(in srgb, #e5ff9c 15%, transparent); }
.visual-tailspend i:nth-child(2) { height: 65%; }
.visual-tailspend i:nth-child(3) { height: 43%; }
.visual-tailspend i:nth-child(4) { height: 82%; }
.visual-tailspend i:nth-child(5) { height: 58%; }
.visual-linha { overflow: hidden; background: #ff4a28; color: #151515; }
.visual-linha::after { content: "11"; position: absolute; right: -2%; bottom: -29%; font: 700 18rem/1 var(--sans); letter-spacing: -.14em; opacity: .12; }
.ticker { position: relative; z-index: 1; padding-top: .8rem; border-top: 1px solid currentColor; font-size: .7rem; text-transform: uppercase; }
.visual-graham { background: #d9d2ff; color: #1a1430; }
.visual-graham b { align-self: flex-end; padding: .4rem .55rem; border: 1px solid currentColor; font-size: .62rem; font-weight: 500; text-transform: uppercase; }
.project-copy { display: flex; flex-direction: column; padding: 1.35rem; }
.project-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font: .64rem/1.3 var(--mono); text-transform: uppercase; }
.project-meta span:last-child { color: var(--green); }
.project h3 { margin-top: 2rem; font: 600 clamp(2rem, 3.2vw, 3.6rem)/1 var(--serif); }
.project p { max-width: 620px; color: var(--card-copy); }
.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: auto 0 1.5rem; padding: 0; list-style: none; }
.tags li { padding: .35rem .5rem; border: 1px solid var(--line); font: .62rem/1 var(--mono); }
.project-link { align-self: flex-start; font: 500 .72rem/1 var(--mono); text-underline-offset: 5px; }
.link-row { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.archive-list { border-top: 1px solid var(--ink); }
.archive-item { display: grid; grid-template-columns: 52px minmax(260px, 1.35fr) minmax(220px, .8fr) minmax(180px, .7fr); gap: 1.2rem; align-items: center; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.archive-index { align-self: start; color: var(--blue); font: .7rem/1.4 var(--mono); }
.archive-item h3 { font: 600 1.5rem/1.1 var(--serif); }
.archive-item p { max-width: 640px; margin: .45rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.archive-item .tags { margin: 0; }
.archive-item > a, .archive-links a { justify-self: end; font: .65rem/1.4 var(--mono); text-align: right; text-underline-offset: 5px; }
.archive-links { justify-self: end; display: flex; gap: 1rem; }
.archive-note { max-width: 760px; margin: 1.5rem 0 0 52px; color: var(--muted); font: .7rem/1.65 var(--mono); }
.timeline { margin: 0; padding: 0; border-top: 1px solid var(--ink); list-style: none; }
.timeline > li { display: grid; grid-template-columns: minmax(150px, .55fr) minmax(230px, .85fr) minmax(320px, 1.6fr); gap: 1.4rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.timeline-date { color: var(--muted); font: .68rem/1.5 var(--mono); text-transform: uppercase; }
.timeline-role h3 { margin-bottom: .45rem; font: 600 1.55rem/1 var(--serif); }
.timeline-role a, .timeline-role span { color: var(--muted); font-size: .82rem; text-underline-offset: 4px; }
.timeline-copy p { max-width: 680px; margin: 0; color: var(--card-copy); }
.timeline-copy .tags { margin: 1rem 0 0; }
.earlier-career { margin-top: 1.5rem; border: 1px solid var(--line); background: var(--paper-bright); }
.earlier-career summary { cursor: pointer; padding: 1rem 1.25rem; font: 500 .72rem/1.3 var(--mono); text-transform: uppercase; }
.earlier-career > div { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding: 0 1.25rem 1.25rem; color: var(--muted); font-size: .85rem; }
.capabilities { display: grid; grid-template-columns: repeat(3, 1fr); border: solid var(--line); border-width: 1px 0 0 1px; }
.capabilities article { min-width: 0; padding: 1.7rem; border: solid var(--line); border-width: 0 1px 1px 0; background: var(--paper-bright); }
.capabilities article > span { color: var(--blue); font: .68rem/1 var(--mono); }
.capabilities h3 { margin-top: 3rem; font: 600 2rem/1 var(--serif); }
.capabilities p { color: var(--muted); }
.capabilities ul { margin: 1.5rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); list-style: none; font: .72rem/1.9 var(--mono); }
.foundations { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 1rem; border: solid var(--line); border-width: 1px 0 0 1px; }
.foundations > div { padding: 1.3rem; border: solid var(--line); border-width: 0 1px 1px 0; }
.foundations .eyebrow { margin-bottom: 1.3rem; }
.foundations h3 { font: 600 1.2rem/1.15 var(--serif); letter-spacing: -.02em; }
.foundations p:last-child { margin: .55rem 0 0; color: var(--muted); font-size: .78rem; }
.contact { margin-bottom: 1rem; padding: clamp(2rem, 5vw, 4.5rem); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); background: var(--contact-surface); color: #f5f3ed; }
.contact .eyebrow { color: #8aa3ff; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: clamp(3rem, 8vw, 9rem); }
.contact h2 { max-width: 800px; font: 500 clamp(3.5rem, 7vw, 7.4rem)/.92 var(--serif); letter-spacing: -.055em; }
.contact-grid > div:first-child p { max-width: 680px; color: #b7bac1; font-size: 1rem; }
.contact-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 1.3rem; }
.button-blue { border-color: var(--blue); background: var(--blue); color: white; }
.contact-actions > a:not(.button) { color: #c5c8d1; font: .72rem/1 var(--mono); text-underline-offset: 5px; }
.contact-actions dl { width: 100%; margin: auto 0 0; border-top: 1px solid #35373e; }
.contact-actions dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid #35373e; font: .62rem/1.4 var(--mono); }
.contact-actions dt { color: #7d8089; text-transform: uppercase; }
.contact-actions dd { margin: 0; text-align: right; }
.site-footer { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 1rem; align-items: center; padding-block: 1.2rem 2rem; color: var(--muted); font: .65rem/1.4 var(--mono); }
.site-footer p { margin: 0; }
.site-footer a { justify-self: end; }
.footer-theme { justify-self: end; color: var(--muted); }
.footer-theme:hover { border-color: var(--blue); color: var(--ink); }
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .65s ease, transform .65s cubic-bezier(.2,.65,.2,1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto auto; gap: .6rem; padding-inline: 20px; }
  .display-controls { grid-column: 2; grid-row: 1; }
  .header-link { display: none; }
  .menu-toggle { grid-column: 3; grid-row: 1; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 42px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: .68rem/1 var(--mono); text-transform: uppercase; }
  .site-header nav { position: absolute; left: 0; right: 0; top: 100%; display: none; grid-template-columns: 1fr 1fr; justify-self: stretch; width: 100%; gap: 0; padding: 0 20px 20px; border-bottom: 1px solid var(--line); background: var(--paper); box-shadow: 0 14px 20px var(--header-shadow); }
  .site-header nav.is-open { display: grid; }
  .site-header nav a { display: flex; align-items: center; min-height: 52px; padding: 0 .8rem; border: solid var(--line); border-width: 0 1px 1px 0; font: .72rem/1 var(--mono); text-transform: uppercase; }
  .site-header nav a:nth-child(odd) { border-left-width: 1px; }
  .shell { width: min(100% - 32px, 720px); }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-block: 4.5rem 5rem; }
  h1 { font-size: clamp(2.65rem, 6.2vw, 3.7rem); }
  .facts { grid-template-columns: 1fr 1fr; }
  .runtime { box-shadow: 12px 12px 0 var(--runtime-shadow); }
  .section-heading { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .archive-item { grid-template-columns: 42px 1fr; }
  .archive-item .tags, .archive-item > a, .archive-links { grid-column: 2; justify-self: start; text-align: left; }
  .archive-note { margin-left: 42px; }
  .timeline > li { grid-template-columns: 1fr 1fr; }
  .timeline-copy { grid-column: 1 / -1; }
  .capabilities { grid-template-columns: 1fr; }
  .foundations { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-actions dl { margin-top: 1.2rem; }
}

@media (max-width: 520px) {
  .site-header { min-height: 62px; }
  .identity > span:last-child { display: none; }
  .language-dropdown select { min-height: 38px; padding-inline: .65rem 1.55rem; }
  .hero { padding-top: 3rem; }
  .portrait-frame { width: 84px; margin-bottom: 1.9rem; box-shadow: 7px 7px 0 color-mix(in srgb, var(--blue) 78%, transparent); }
  h1 { font-size: clamp(2.35rem, 10.3vw, 3rem); }
  .lede { font-size: 1rem; }
  .hero-actions { display: grid; }
  .button { width: 100%; min-height: 50px; }
  .runtime-body { padding: 1.15rem; font-size: .65rem; }
  .runtime-links { padding: 1.1rem; }
  .work, .archive, .experience, .about { padding-block: 5.2rem; }
  .project-copy { padding: 1.1rem; }
  .archive-item { grid-template-columns: 34px 1fr; gap: .75rem; padding-block: 1.25rem; }
  .archive-note { margin-left: 34px; }
  .timeline > li { grid-template-columns: 1fr; gap: .7rem; }
  .timeline-copy { grid-column: auto; }
  .timeline-role h3 { font-size: 1.45rem; }
  .earlier-career > div { grid-template-columns: 1fr; gap: .2rem; }
  .foundations { grid-template-columns: 1fr; }
  .contact { width: calc(100% - 24px); padding: 1.5rem; }
  .contact h2 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .site-footer { grid-template-columns: 1fr auto; }
  .site-footer p:nth-child(2) { display: none; }
  .footer-theme { grid-column: 1; grid-row: 2; justify-self: start; }
  .site-footer a { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
