:root {
  --ink: #0A0A0A;
  --ink-soft: #3D3D3D;
  --ink-muted: #595959;
  --paper: #FFFFFF;
  --line: #EDEDED;
  --blue: #1F4FFF;
  --blue-tint: #F2F4FF;
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --header-bg: rgba(255, 255, 255, .9);
  --rule: #D4D4D4;
  --button-dark-hover: #262626;
  --blue-hover: #1A40D6;
  --on-blue: #FFFFFF;
  --inverse-muted: #BDBDBD;
  --agents-bg: #FFF6E8;
  --word-start: #C9C9C9;
  --footer-bg: #0A0A0A;
  --footer-ink: #FFFFFF;
  --footer-muted: #BDBDBD;
  --shadow: rgba(10, 10, 10, .18);
  --panel-border: transparent;
  color-scheme: light;
}

[data-theme="dark"] {
  --ink: #F2F2EF;
  --ink-soft: #C9C9C5;
  --ink-muted: #A0A09B;
  --paper: #0C0C0D;
  --line: #1F1F22;
  --blue: #7B93FF;
  --blue-tint: #121833;

  --header-bg: rgba(12, 12, 13, .85);
  --rule: #2E2E33;
  --button-dark-hover: #D9D9D5;
  --blue-hover: #9AADFF;
  --on-blue: #0C0C0D;
  --inverse-muted: #55554F;
  --agents-bg: #1C1810;
  --word-start: #3C3C40;
  --footer-bg: #000000;
  --footer-ink: #F2F2EF;
  --footer-muted: #9A9A96;
  --shadow: rgba(0, 0, 0, .55);
  --panel-border: #22283A;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--ink); }
a:hover { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

em { font-style: italic; font-weight: 700; }

.mono { font-family: var(--mono); }

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 20;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 28px;
}

.header-email {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
  text-decoration: none;
}

.logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  font-size: 15px;
}
.nav a:not(.button) { text-decoration: none; }

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform .2s var(--ease);
}
.theme-toggle:hover { transform: rotate(-12deg); color: var(--blue); border-color: var(--blue); }
.theme-toggle svg { width: 20px; height: 20px; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.theme-switching,
.theme-switching * {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease !important;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s var(--ease), background-color .2s;
}
.button:hover { transform: translateY(-2px); }
.button-dark { background: var(--ink); color: var(--paper); }
.button-dark:hover { color: var(--paper); background: var(--button-dark-hover); }
.button-blue { background: var(--blue); color: var(--on-blue); }
.button-blue:hover { color: var(--on-blue); background: var(--blue-hover); }
.button-outline { border: 2px solid var(--ink); }
.button-large { min-height: 56px; padding: 0 28px; font-size: 17px; font-weight: 700; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */

.hero {
  min-height: calc(100vh - 73px);
  min-height: calc(100svh - 73px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  padding: 80px 0;
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-muted);
}

.hero-title {
  margin: 0;
  font-size: clamp(48px, 8.6vw, 124px);
  line-height: .95;
  font-weight: 800;
  letter-spacing: -.045em;
}
.hero-title em { color: var(--blue); }

.hero-lead {
  margin: 0;
  max-width: 600px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.scroll-cue { font-size: 14px; color: var(--ink-muted); }

/* ---------- Statement ---------- */

.statement {
  padding: 120px 0 160px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.statement-text {
  margin: 0;
  max-width: 900px;
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.32;
  font-weight: 500;
  letter-spacing: -.01em;
  word-spacing: .04em;
  text-wrap: pretty;
}

.statement-strong { font-weight: 700; }

/* ---------- Work ---------- */

.work {
  display: flex;
  flex-direction: column;
  gap: 120px;
  padding-bottom: 160px;
}

.section-label {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.project {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
}
.project-flip { flex-direction: row-reverse; }

.project-text,
.project-visual {
  flex: 1 1 420px;
  min-width: 0;
}

.project-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.project-text p {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.project-meta {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
}

.project-title {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.035em;
}

.project-link { font-weight: 600; }
.project-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

.project-visual {
  border-radius: 24px;
  padding: 32px;
  min-height: 280px;
}

.visual-caption {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}

/* 01 — volatility smile */
.visual-ivest {
  background: #0B0F1A;
  color: #C9D1E3;
  border: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
}
.visual-ivest svg { width: 100%; height: auto; display: block; }
.ivest-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #E6EAF5; }
.ivest-head sub { font-size: 9px; }
.ivest-solve { color: #FFB000; }
.ivest-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; color: #8A93A8; }
.ivest-legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend-line { width: 18px; height: 3px; background: #FFB000; border-radius: 2px; }
.legend-dot { width: 8px; height: 8px; border: 2px solid #FFB000; border-radius: 50%; }

/* Photos and screenshots */
.visual-photo {
  position: relative;
  overflow: hidden;
  padding: 0;
  min-height: 360px;
  background: #111111;
}
.visual-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-overlay {
  position: relative;
  z-index: 1;
  min-height: 360px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  color: #F5F5F5;
  background: rgba(10, 10, 10, .55);
}

.visual-shot {
  padding: 0;
  min-height: 0;
  overflow: hidden;
  background: #1E1E1E;
  box-shadow: 0 24px 60px var(--shadow);
}
.visual-shot img { display: block; width: 100%; height: auto; }
.visual-shot-purple { background: #2B2A3A; }

/* 03 — ubermenschs overlay */
.uber-domain { font-family: var(--mono); font-size: 13px; color: #D6D6D6; }
.uber-tagline {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.03em;
}
.uber-tagline em { color: #A9BBFF; }
.uber-menu { display: flex; flex-wrap: wrap; gap: 8px; }
.uber-menu span {
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(10, 10, 10, .35);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  transform-origin: left;
}

/* 04 — Errand Crew agents */
.visual-agents {
  background: var(--agents-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
}
.agent {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform-origin: center;
}
.agent span { font-size: 11px; font-weight: 400; color: var(--ink-muted); }
.agent-main { background: var(--ink); color: var(--paper); padding: 12px 28px; font-size: 15px; }
.agent-main span { color: var(--inverse-muted); }
.agent-judge { background: var(--blue); border-color: var(--blue); }
.agent-judge { color: var(--on-blue); }
.agent-judge span { color: inherit; opacity: .8; }
.agent-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.agent-arrow { font-size: 18px; color: var(--ink-muted); }

/* 06 — Clients queue */
.visual-queues {
  background: #2B2A3A;
  color: #ECEAF5;
  border: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 13px;
}
.queues-policy { color: #C4B5FD; font-weight: 600; }
.queue-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.queue-name { width: 72px; color: #B9B6CC; }
.client {
  background: #4A4766;
  border: 1px solid #6E6A92;
  border-radius: 8px;
  padding: 8px 10px;
  transform-origin: left;
}
.visual-caption-dim { color: #B9B6CC; }

/* ---------- Awards and skills ---------- */

.project-stat {
  font-family: var(--mono);
  font-size: 14px !important;
  color: var(--ink) !important;
}
.project-stat span { color: var(--ink-muted); }

.module-title {
  margin: 0;
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.035em;
}

.awards {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 80px 0 120px;
  border-top: 2px solid var(--ink);
}
.award-list { list-style: none; margin: 0; padding: 0; }
.award {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 200px;
  gap: 8px 32px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.award-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.award-detail { font-size: 16px; line-height: 1.5; color: var(--ink-soft); }
.certifications { border-top: 0; padding-top: 0; }
.award-detail a { font-weight: 600; }
.award-date { font-family: var(--mono); font-size: 14px; color: var(--ink-muted); white-space: nowrap; text-align: right; }

.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-bottom: 140px;
}
.skill-module {
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.skill-module-ai { background: var(--ink); color: var(--paper); }
.skill-module-ai .chip-list li { border-color: var(--inverse-muted); }
.skill-module-ai .chip-list li:nth-child(-n+2) { color: var(--on-blue); }
.skill-module-ai .chip-list li:nth-child(-n+2) { background: var(--blue); border-color: var(--blue); }

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-list li {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.contact {
  padding: 80px 0 140px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}
.contact-title {
  margin: 0;
  font-size: clamp(52px, 9vw, 128px);
  line-height: .95;
  font-weight: 800;
  letter-spacing: -.045em;
}
.contact-title em { color: var(--blue); }

.site-footer { background: var(--footer-bg); color: var(--footer-ink); }
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 32px;
  padding-bottom: 32px;
  font-size: 14px;
}

/* ---------- Motion ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(56px); } to { opacity: 1; transform: none; } }
@keyframes ink { from { color: var(--word-start); } to { color: var(--ink); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes settle { from { transform: scale(1.14); } to { transform: scale(1); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.load { animation: rise 1s var(--ease) both; }

.draw { stroke-dasharray: 1; }

/* Statement: words darken as you scroll (Chrome, Edge, Safari 26+) */
@supports (animation-timeline: view()) {
  .word {
    animation: ink linear both;
    animation-timeline: view();
    animation-range: cover 30% cover 48%;
  }
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 30;
  pointer-events: none;
}

.site-header { transition: box-shadow .3s; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(10, 10, 10, .06); }

/* Reveal on scroll: the inline script in <head> adds .io to <html>, script.js adds .in to elements as they enter the screen */
.io .reveal {
  opacity: 0;
  transform: translateY(64px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--delay, 0) * 110ms);
}
.io .reveal.in { opacity: 1; transform: none; }

/* Projects: text slides in from its side, the picture opens up */
.io .project.reveal { opacity: 1; transform: none; transition: none; }
.io .project .project-text {
  opacity: 0;
  transform: translateX(-56px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
}
.io .project-flip .project-text { transform: translateX(56px); }
.io .project .project-visual {
  opacity: 0;
  clip-path: inset(14% 10% 14% 10% round 24px);
  transition: opacity .8s var(--ease) .1s, clip-path 1.3s var(--ease) .1s;
}
.io .project.in .project-text { opacity: 1; transform: none; }
.io .project.in .project-visual { opacity: 1; clip-path: inset(0 0 0 0 round 24px); }

/* Details inside a revealed block */
.io .grow {
  transform: scaleX(0);
  transition: transform .8s var(--ease);
  transition-delay: calc(var(--delay, 0) * 140ms + 500ms);
}
.io .zoom { transform: scale(1.18); transition: transform 1.8s var(--ease) .1s; }
.io .draw { stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease) .5s; }
.io .in .grow, .io .in .zoom { transform: none; }
.io .in .draw { stroke-dashoffset: 0; }

/* Chips and list items pop in one after another */
.io .stagger > * {
  opacity: 0;
  transform: translateY(14px) scale(.96);
  transition: opacity .5s var(--ease), transform .6s var(--ease);
  transition-delay: calc(var(--i, 0) * 45ms + 250ms);
}
.io .in .stagger > *, .io .stagger.in > * { opacity: 1; transform: none; }

/* Statement fallback when scroll-driven color is not supported */
.io .statement-text { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--delay, 0) * 110ms); }
.io .statement-text.in { opacity: 1; transform: none; }

/* Reduced motion: no sliding or zooming, only soft fades */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .load { animation-name: fade; }
  .io .reveal,
  .io .project .project-text,
  .io .project-flip .project-text,
  .io .statement-text,
  .io .stagger > * { transform: none !important; }
  .io .project .project-visual { clip-path: none !important; }
  .io .grow, .io .zoom { transform: none !important; transition: none !important; }
  .draw { stroke-dashoffset: 0 !important; transition: none !important; }
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .nav { gap: 4px 18px; }
  .hero { padding: 48px 0; }
  .statement { padding: 72px 0 96px; }
  .work { gap: 88px; padding-bottom: 96px; }
  .project-visual { padding: 24px; min-height: 240px; }
  .visual-photo, .visual-shot { padding: 0; }
  .visual-shot { min-height: 0; }
  .photo-overlay { padding: 24px; }
  .queue-name { width: 100%; }
  .award { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .award-date { text-align: left; }
  .skills { grid-template-columns: minmax(0, 1fr); }
  .skill-module { padding: 24px; }
  .agent-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
}

@media (max-width: 430px) {
  .logo { font-size: 16px; }
  .nav { gap: 4px 16px; font-size: 14px; }
  .nav-optional { display: none; }
}
