/* ---------- Themes (palettes from my theme-switch) ---------- */
:root,
[data-theme="golden-gate"] {
  --bg: #101820;
  --surface: #15212b;
  --surface-2: #1b2833;
  --line: #2a3a47;
  --text: #e3e7ea;
  --muted: #a2adb5;
  --faint: #7d8f9d;
  --accent: #e58b65;
  --accent-2: #7cb4d8;
  --on-accent: #101820;
  color-scheme: dark;
}
[data-theme="obsidian"],
[data-theme="obsidian-vivid"] {
  --bg: #08090a;
  --surface: #101213;
  --surface-2: #151719;
  --line: #25292c;
  --text: #e4e9e8;
  --muted: #a3adb0;
  --faint: #7a8488;
  --accent: #bacacd;
  --accent-2: #8aafd0;
  --on-accent: #08090a;
  color-scheme: dark;
}
[data-theme="obsidian-vivid"] {
  --accent: #61afef;
  --accent-2: #c678dd;
}
[data-theme="mandalorian"] {
  --bg: #0a0a0f;
  --surface: #101017;
  --surface-2: #15151d;
  --line: #262633;
  --text: #e4e4ec;
  --muted: #a9a9ba;
  --faint: #6e7c98;
  --accent: #5ec4e8;
  --accent-2: #c09848;
  --on-accent: #0a0a0f;
  color-scheme: dark;
}
[data-theme="monokai"] {
  --bg: #2d2a2e;
  --surface: #353236;
  --surface-2: #403e41;
  --line: #4d4a4e;
  --text: #fcfcfa;
  --muted: #c1c0c0;
  --faint: #939293;
  --accent: #a9dc76;
  --accent-2: #78dce8;
  --on-accent: #2d2a2e;
  color-scheme: dark;
}
[data-theme="gruvbox"] {
  --bg: #1d2021;
  --surface: #282828;
  --surface-2: #32302f;
  --line: #3c3836;
  --text: #ebdbb2;
  --muted: #bdae93;
  --faint: #928374;
  --accent: #fe8019;
  --accent-2: #83a598;
  --on-accent: #1d2021;
  color-scheme: dark;
}
[data-theme="witcher"] {
  --bg: #0b0f12;
  --surface: #12181c;
  --surface-2: #1b2428;
  --line: #2a363b;
  --text: #d8d3c5;
  --muted: #a9a394;
  --faint: #827d72;
  --accent: #d89a2b;
  --accent-2: #6f93a2;
  --on-accent: #0b0f12;
  color-scheme: dark;
}
[data-theme="rdr2"] {
  --bg: #1a1410;
  --surface: #1f1813;
  --surface-2: #261e17;
  --line: #3d3229;
  --text: #e4d8c2;
  --muted: #a89880;
  --faint: #7a7062;
  --accent: #da863d;
  --accent-2: #8a9ca8;
  --on-accent: #1a1410;
  color-scheme: dark;
}
[data-theme="vader"] {
  --bg: #08080a;
  --surface: #0e0e12;
  --surface-2: #16161c;
  --line: #26262e;
  --text: #d8d8dc;
  --muted: #90909a;
  --faint: #6a6a74;
  --accent: #ef4f4f;
  --accent-2: #56c8c8;
  --on-accent: #08080a;
  color-scheme: dark;
}
[data-theme="hollow"] {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a24;
  --line: #2a2a3a;
  --text: #e8e8f0;
  --muted: #a8a8c0;
  --faint: #7a7a92;
  --accent: #6bb6ff;
  --accent-2: #7dd3c0;
  --on-accent: #0a0a0f;
  color-scheme: dark;
}
[data-theme="paper"] {
  --bg: #f3ede2;
  --surface: #faf6ee;
  --surface-2: #ebe3d5;
  --line: #d6cbb8;
  --text: #1f1a14;
  --muted: #5f5648;
  --faint: #857a69;
  --accent: #a24c14;
  --accent-2: #2f6474;
  --on-accent: #faf6ee;
  color-scheme: light;
}

:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --topbar: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.1; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd {
  font-family: var(--font-mono);
  font-size: .78em;
  padding: .1em .4em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
}
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--font-mono); }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.backdrop-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: .28;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
}
.backdrop-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(520px circle at var(--mx, 70%) var(--my, 18%), color-mix(in srgb, var(--accent) 13%, transparent), transparent 65%),
    radial-gradient(900px circle at 0% 0%, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 60%);
}
.backdrop-grain {
  position: absolute; inset: -50%;
  opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[data-theme="paper"] .backdrop-grain { opacity: .12; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
}
.topbar.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.topbar-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mark {
  font-family: var(--font-serif); font-style: italic;
  font-size: 30px; line-height: 1; text-decoration: none;
  letter-spacing: -.02em;
}
.mark span { color: var(--accent); }
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 12px; border-radius: 999px;
  font-size: 14px; color: var(--muted); text-decoration: none;
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--text); background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
.nav a.active { color: var(--text); }
.nav a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--accent);
}
.controls { display: flex; align-items: center; gap: 8px; }
.lang, .theme-btn, .cmd-btn {
  height: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  transition: border-color .2s, background-color .2s;
}
.lang:hover, .theme-btn:hover, .cmd-btn:hover { border-color: var(--faint); }
.lang { padding: 0 4px; font-family: var(--font-mono); font-size: 12px; }
.lang span { padding: 3px 7px; border-radius: 999px; color: var(--faint); transition: all .2s; }
html[lang="en"] .lang [data-lang="en"],
html[lang="pt-BR"] .lang [data-lang="pt"] { background: var(--text); color: var(--bg); }
.theme-btn { width: 36px; padding: 0; }
.theme-wrap { position: relative; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30;
  width: min(320px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55);
  animation: pop .2s var(--ease);
}
.theme-menu[hidden] { display: none; }
.theme-menu-title { padding: 8px 10px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.theme-menu .swatches { margin-top: 0; gap: 2px; }
.theme-menu .swatches button { grid-template-columns: 1fr repeat(5, 14px); gap: 5px; }
.theme-menu .swatches i { width: 14px; height: 14px; border-radius: 4px; }
.theme-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: conic-gradient(var(--accent) 0 50%, var(--accent-2) 0 100%);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line);
}
.cmd-btn { padding: 0 10px; font-size: 13px; color: var(--muted); }
.cmd-btn kbd { border: 0; background: none; padding: 0; font-size: 13px; }
kbd.ctrl { margin-right: .3em; }
.cmd-menu { display: none; }
@media (hover: none) {
  .cmd-keys { display: none; }
  .cmd-menu { display: inline; }
  .hide-touch { display: none; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .cmd-keys { display: none; }
  .cmd-menu { display: inline; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--topbar));
  display: flex; align-items: center;
  padding-block: clamp(40px, 8vh, 96px) clamp(72px, 10vh, 120px);
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: clamp(20px, 4vh, 40px);
}
.hero-meta > span { display: inline-flex; align-items: center; gap: 10px; }
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(64px, 14.5vw, 196px);
  line-height: .86;
  letter-spacing: -.035em;
  margin-left: -.04em;
}
.hero-title .line { display: block; overflow: hidden; padding: 0 .08em .24em; margin: 0 -.08em -.24em; }
.hero-title .line > * { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
.hero-title .line:nth-child(2) > * { animation-delay: .12s; }
.hero-title em {
  font-style: italic;
  padding-right: .06em;
  background: linear-gradient(100deg, var(--accent) 10%, color-mix(in srgb, var(--accent) 45%, var(--accent-2)) 60%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title .dot { color: var(--accent); }
@keyframes rise { to { transform: translateY(0); } }

.hero-row {
  display: grid; grid-template-columns: 1fr minmax(0, 470px);
  gap: clamp(32px, 6vw, 80px); align-items: start;
  margin-top: clamp(28px, 5vh, 56px);
}
@media (min-width: 1001px) {
  .hero-row .terminal { margin-top: clamp(-170px, -11vw, -110px); }
}
.hero-lede { font-size: clamp(19px, 2vw, 23px); line-height: 1.5; max-width: 32ch; color: var(--muted); }
.hero-lede strong { color: var(--text); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500; text-decoration: none;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--faint); }

.terminal {
  margin: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .55), inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tl { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.terminal-bar .tl:nth-child(1) { background: #ff5f57; }
.terminal-bar .tl:nth-child(2) { background: #febc2e; }
.terminal-bar .tl:nth-child(3) { background: #28c840; }
.terminal-title { margin-left: auto; margin-right: auto; padding-right: 44px; font-size: 12px; color: var(--faint); }
.terminal-body {
  margin: 0; padding: 18px 20px 22px;
  min-height: 258px;
  font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  color: var(--muted);
}
.terminal-body .p { color: var(--accent); }
.terminal-body .c { color: var(--text); }
.terminal-body .o { color: var(--muted); }
.terminal-body .k { color: var(--accent-2); }
.cursor {
  display: inline-block; width: .6em; height: 1.15em; vertical-align: -.2em;
  background: var(--accent); animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 24px; translate: -50% 0;
  width: 24px; height: 38px; border: 1px solid var(--line); border-radius: 999px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 2px; background: var(--accent);
  animation: scroll 2s var(--ease) infinite;
}
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex; width: max-content; align-items: center; gap: 28px;
  padding: 18px 0;
  font-size: 14px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  animation: marquee 48s linear infinite;
}
.marquee-track i { font-style: normal; color: var(--accent); }
@keyframes marquee { to { transform: translateX(calc(-50% - 14px)); } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(72px, 10vw, 128px); scroll-margin-top: var(--topbar); }
.section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-num { font-size: 13px; color: var(--accent); letter-spacing: .1em; }
.section-num::after { content: " ——"; color: var(--faint); }
.section-head h2, .contact-title {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(44px, 7vw, 88px); letter-spacing: -.025em; line-height: .95;
}
.section-intro { max-width: 58ch; font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); margin: -16px 0 clamp(36px, 5vw, 56px); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.portrait { margin: 0; position: sticky; top: calc(var(--topbar) + 32px); }
.portrait-frame {
  position: relative; overflow: hidden;
  border-radius: 22px; border: 1px solid var(--line);
  aspect-ratio: 1; background: var(--accent);
}
.portrait-frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.08) brightness(1.02);
  mix-blend-mode: multiply;
  transition: transform .8s var(--ease), filter .6s;
}
.portrait-frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--bg) 55%, transparent));
}
[data-theme="paper"] .portrait-frame { background: color-mix(in srgb, var(--accent) 55%, #fff); }
.portrait:hover img { transform: scale(1.04); }
.portrait figcaption { margin-top: 14px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

.about-copy > p { color: var(--muted); max-width: 60ch; }
.about-copy > p + p { margin-top: 1.1em; }
.about-big {
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.6vw, 46px) !important;
  line-height: 1.12 !important;
  color: var(--text) !important;
  letter-spacing: -.01em;
  margin-bottom: 1.2em;
}
.about-big em { color: var(--accent); }
.facts {
  margin: 40px 0 0; padding: 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.facts div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; padding-top: 2px; }
.facts dd { margin: 0; color: var(--text); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(56px, 8vw, 96px);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.stats li { padding: 28px 26px; border-left: 1px solid var(--line); }
.stats li:first-child { border-left: 0; }
.stats strong {
  display: block;
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(48px, 6vw, 72px); line-height: 1; letter-spacing: -.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stats span { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }

/* ---------- Spotlight surfaces ---------- */
.spot { position: relative; isolation: isolate; }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(380px circle at var(--x, 50%) var(--y, 50%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  opacity: 0; transition: opacity .35s;
}
.spot:hover::before { opacity: 1; }

/* ---------- Roles ---------- */
.role {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 72px);
  padding-block: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--line);
}
.role-past { margin-top: clamp(56px, 8vw, 96px); border-bottom: 1px solid var(--line); }
.role-when { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.role-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(34px, 4vw, 48px); letter-spacing: -.02em; margin: 10px 0 8px; }
.role-org { font-size: 13px; color: var(--faint); }
.role-body > p { font-size: clamp(17px, 1.5vw, 19px); color: var(--text); max-width: 62ch; }
.role-points { display: grid; gap: 14px; margin-top: 24px; }
.role-points li { position: relative; padding-left: 22px; color: var(--muted); font-size: 16px; max-width: 64ch; }
.role-points li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 1px; background: var(--accent); }
.role-points strong { color: var(--text); font-weight: 500; }
.role-body .tags { margin-top: 26px; }
.cards-label { margin: clamp(40px, 6vw, 64px) 0 18px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

/* ---------- Work cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card {
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  transition: border-color .3s, transform .4s var(--ease);
}
.cards .card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-3px); }
.card-icon {
  width: 40px; height: 40px; padding: 8px; margin-bottom: 28px;
  border-radius: 12px; border: 1px solid var(--line);
  fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  background: var(--surface-2);
}
.card h3 { font-size: 24px; letter-spacing: -.01em; margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags li {
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface-2);
}

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 900px; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; left: 180px; top: 8px; bottom: 8px; width: 1px;
}
.timeline::before { background: var(--line); }
.timeline::after {
  background: linear-gradient(var(--accent), var(--accent-2));
  transform-origin: top; transform: scaleY(var(--progress, 0));
}
.timeline li { position: relative; display: grid; grid-template-columns: 180px 1fr; padding-bottom: 44px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 180px; top: 9px; z-index: 1;
  width: 11px; height: 11px; margin-left: -5px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--faint);
  transition: border-color .4s, background-color .4s;
}
.timeline li.in::before { border-color: var(--accent); }
.timeline li.is-now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent); }
.tl-when { padding-right: 32px; display: flex; flex-direction: column; }
.tl-when span { font-size: 15px; color: var(--text); }
.tl-when small { font-size: 12px; color: var(--faint); letter-spacing: .04em; margin-top: 2px; }
.tl-body { padding-left: 40px; }
.tl-body h3 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(26px, 2.6vw, 32px); letter-spacing: -.01em; }
.tl-body p { margin-top: 6px; color: var(--muted); max-width: 56ch; }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.tile {
  display: flex; flex-direction: column;
  padding: clamp(22px, 2.6vw, 32px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  overflow: hidden;
  transition: border-color .3s;
}
.tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tile h3 { font-size: 26px; letter-spacing: -.015em; margin-bottom: 10px; }
.tile p { color: var(--muted); font-size: 15.5px; }
.tile-kicker { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px !important; }
.tile-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: auto; padding-top: 22px; font-size: 13px; }
.tile-links a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color .2s, color .2s; }
.tile-links a:hover { color: var(--accent); border-color: var(--accent); }

.tile-momentum { grid-column: span 4; display: grid; grid-template-columns: 1fr 1.05fr; gap: 32px; align-items: center; }
.tile-momentum .tile-text { display: flex; flex-direction: column; justify-content: center; }
.tile-momentum .tile-links { margin-top: 0; padding-top: 28px; }
.tile-momentum h3 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(40px, 4.4vw, 56px); letter-spacing: -.02em; }
.tile-finance, .tile-dotfiles { grid-column: span 2; }
.tile-themes { grid-column: span 4; }
.tile-themes .swatches { grid-template-columns: 1fr 1fr; column-gap: 10px; }

.mock {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
  padding-bottom: 10px;
  transform: rotate(-1.2deg);
  transition: transform .6s var(--ease);
}
.tile-momentum:hover .mock { transform: rotate(0) translateY(-4px); }
.mock-bar { display: flex; gap: 6px; padding: 10px 12px; }
.mock-head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 16px 8px; font-weight: 500; }
.mock-head .mono { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.mock-meter { height: 5px; margin: 0 16px 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.mock-meter span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.mock-list li {
  display: grid; grid-template-columns: 16px 1fr auto; gap: 12px; align-items: center;
  margin: 0 8px; padding: 9px 8px; border-radius: 8px; font-size: 14px;
}
.mock-list li:nth-child(3) { background: var(--surface-2); }
.mock-list i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--faint); }
.mock-list b { font-weight: 400; font-size: 11.5px; color: var(--faint); }
.mock-list .done span { text-decoration: line-through; color: var(--faint); }
.mock-list .done i { background: var(--accent); border-color: var(--accent); }
.mock-list .meet i { border-radius: 3px; border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 30%, transparent); }
.mock-list .meet span { color: var(--accent-2); }

.bars {
  position: relative; display: flex; align-items: flex-end; gap: 8px;
  height: 64px; margin-top: auto;
}
.tile-finance > p { margin-bottom: 28px; }
.bars span {
  flex: 1; height: var(--h); border-radius: 6px 6px 2px 2px;
  background: color-mix(in srgb, var(--accent-2) 55%, var(--surface-2));
  transform-origin: bottom; transform: scaleY(.15);
  transition: transform .9s var(--ease);
}
.bars span.over { background: var(--accent); }
.tile-finance.in .bars span { transform: scaleY(1); }
.tile-finance.in .bars span:nth-child(2) { transition-delay: .05s; }
.tile-finance.in .bars span:nth-child(3) { transition-delay: .1s; }
.tile-finance.in .bars span:nth-child(4) { transition-delay: .15s; }
.tile-finance.in .bars span:nth-child(5) { transition-delay: .2s; }
.tile-finance.in .bars span:nth-child(6) { transition-delay: .25s; }
.tile-finance.in .bars span:nth-child(7) { transition-delay: .3s; }
.budget-line { position: absolute; left: 0; right: 0; bottom: 80%; border-top: 1px dashed var(--faint); }

.tree { margin: 18px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--faint); }

.swatches { display: grid; gap: 6px; margin-top: 20px; }
.swatches button {
  display: grid; grid-template-columns: 1fr repeat(5, 18px); gap: 6px; align-items: center;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid transparent; background: none; text-align: left; font-size: 14px;
  transition: background-color .2s, border-color .2s;
}
.swatches button:hover { background: var(--surface-2); }
.swatches button:focus-visible { outline-offset: -2px; }
.swatches button[aria-pressed="true"] { border-color: var(--line); background: var(--surface-2); }
.swatches button[aria-pressed="true"] span::after { content: "  ●"; color: var(--accent); font-size: 10px; vertical-align: 2px; }
.swatches i { width: 18px; height: 18px; border-radius: 5px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }


/* ---------- Setup ---------- */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.kbd-panel, .toolbox {
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}
.kbd-panel h3 { font-size: 24px; margin-bottom: 10px; }
.kbd-panel > p { color: var(--muted); font-size: 15.5px; max-width: 52ch; }

.kbd-panel { container-type: inline-size; }
.kbd {
  --k: min(44px, calc(100cqi / 12.6));
  --g: calc(var(--k) * .14);
  display: flex; justify-content: center; gap: calc(var(--k) * .9);
  margin: 36px 0 24px;
}
.kbd-half { display: grid; grid-template-columns: repeat(5, var(--k)); column-gap: var(--g); }
.kbd-col { display: grid; gap: var(--g); align-content: start; }
.kbd-thumbs { grid-column: 1 / -1; display: flex; gap: var(--g); margin-top: calc(var(--g) * 2.5); }
.kbd-half.left .kbd-thumbs { justify-content: flex-end; padding-right: calc(var(--k) * .3); }
.kbd-half.right .kbd-thumbs { justify-content: flex-start; padding-left: calc(var(--k) * .3); }
.key {
  position: relative;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  width: var(--k); height: var(--k);
  display: grid; place-items: center;
  border-radius: calc(var(--k) * .22);
  border: 1px solid var(--line); border-bottom-width: 3px;
  background: var(--surface-2);
  font-family: var(--font-mono); font-size: calc(var(--k) * .34); color: var(--text);
  text-transform: uppercase;
  transition: background-color .25s, color .25s, transform .12s, box-shadow .25s, border-color .25s;
}
.key.home::after {
  content: ""; position: absolute; bottom: calc(var(--k) * .14); left: 50%;
  width: calc(var(--k) * .26); height: 2px; margin-left: calc(var(--k) * -.13);
  border-radius: 2px; background: var(--faint);
}
.key.thumb { width: calc(var(--k) * 1.2); font-size: calc(var(--k) * .24); color: var(--muted); }
.key.on {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
  transform: translateY(2px); border-bottom-width: 1px;
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 55%, transparent);
  transition-duration: 0s;
}
.kbd-out {
  display: flex; align-items: center; gap: 6px;
  min-height: 46px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  font-size: 15px; overflow: hidden; white-space: nowrap;
}
.kbd-out .prompt { color: var(--accent); }
#kbd-out { overflow: hidden; white-space: pre; }
#kbd-out:empty::before { content: attr(data-placeholder); color: var(--faint); }
.kbd-out .caret { width: 8px; height: 18px; background: var(--accent); animation: blink 1.1s steps(1) infinite; flex: none; }

.toolbox { display: grid; gap: 24px; align-content: start; }
.tool-group h4 { font-size: 11.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.tool-group ul { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-group li {
  padding: 6px 12px; border-radius: 999px; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface-2);
  transition: border-color .2s, color .2s;
}
.tool-group li:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact .section-num { margin-bottom: 24px; }
.contact .section-num::after { content: ""; }
.contact-title { font-size: clamp(52px, 9.5vw, 132px); max-width: 12ch; margin-inline: auto; }
.contact-title em { font-style: italic; color: var(--accent); }
.contact-text { max-width: 54ch; margin: 28px auto 0; color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); }
.contact-actions { display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: 44px; }
.email {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 24px; border-radius: 999px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent);
  max-width: 100%;
}
.email-link { font-size: clamp(16px, 2.4vw, 24px); text-decoration: none; overflow-wrap: anywhere; }
.email-link:hover { color: var(--accent); }
.copy-btn {
  height: 40px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--on-accent); font-size: 13px; flex: none;
}
.socials { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.social {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); text-decoration: none; font-size: 15px;
  transition: border-color .2s, transform .2s var(--ease);
}
.social:hover { border-color: var(--faint); transform: translateY(-2px); }
.social svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-block: 28px; font-size: 12.5px; color: var(--faint); }

/* ---------- Command palette ---------- */
.palette {
  width: min(560px, calc(100vw - 32px)); max-height: min(520px, 70vh);
  margin: 12vh auto auto; padding: 0;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.palette::backdrop { background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.palette[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.palette-inner { display: flex; flex-direction: column; max-height: inherit; }
.palette-search { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-search svg { width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; flex: none; }
.palette-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.palette-search input::placeholder { color: var(--faint); }
.palette-list { overflow-y: auto; padding: 8px; }
.palette-group { padding: 10px 10px 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.palette-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 15px;
}
.palette-item small { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.palette-item[aria-selected="true"] { background: var(--surface-2); }
.palette-item[aria-selected="true"]::before { content: ""; width: 3px; height: 16px; margin-right: -4px; border-radius: 2px; background: var(--accent); }
.palette-item span { flex: 1; }
.palette-empty { padding: 24px; text-align: center; color: var(--faint); font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 13px;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-row { grid-template-columns: 1fr; align-items: start; }
  .terminal { max-width: 560px; }
  .tile-momentum { grid-column: span 6; }
  .tile-finance, .tile-dotfiles { grid-column: span 3; }
  .tile-themes { grid-column: span 6; }
  .setup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hide-sm { display: none !important; }
  .theme-menu { position: fixed; top: calc(var(--topbar) + 4px); left: var(--gutter); right: var(--gutter); width: auto; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { position: static; max-width: 320px; }
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stats li { padding: 22px 18px; }
  .bento { grid-template-columns: 1fr; }
  .tile-momentum, .tile-finance, .tile-dotfiles, .tile-themes { grid-column: auto; }
  .tile-momentum { grid-template-columns: 1fr; }
  .tile-themes .swatches { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; gap: 16px; }
  .mock { transform: none; }
  .timeline::before, .timeline::after { left: 5px; }
  .timeline li { grid-template-columns: 1fr; padding-left: 32px; }
  .timeline li::before { left: 5px; }
  .tl-when { flex-direction: row; align-items: baseline; gap: 10px; padding: 0 0 4px; }
  .tl-body { padding-left: 0; }
  .facts div { grid-template-columns: 110px 1fr; }
  .section-head { gap: 14px; }
  .scroll-cue { display: none; }
  .terminal-body { min-height: 0; font-size: 12.5px; }
  .email { padding-left: 18px; }
}
@media (max-width: 420px) {
  .controls { gap: 6px; }
  .lang span { padding: 3px 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-title .line > * { transform: none; }
  .marquee-track { animation: none; }
}
