:root {
  /* Layout: section titles sit in a left rail, content reads like a column of search results on the right; the hero query demo is the one animated moment. */
  --paper: #EEF1F6;
  --surface: #FFFFFF;
  --ink: #101B33;
  --muted: #535E78;
  --link: #1A44D6;
  --mark: #FFE45C;
  --mark-ink: #101B33;
  --path: #0B6B4A;
  --rule: #D3D9E5;
  --display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --gutter: clamp(20px, 5vw, 56px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C1322;
    --surface: #151E33;
    --ink: #E9EDF6;
    --muted: #9CA7BF;
    --link: #93B2FF;
    --mark: #F0D23C;
    --mark-ink: #101B33;
    --path: #6FCFA5;
    --rule: #27324B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0C1322;
  --surface: #151E33;
  --ink: #E9EDF6;
  --muted: #9CA7BF;
  --link: #93B2FF;
  --mark: #F0D23C;
  --mark-ink: #101B33;
  --path: #6FCFA5;
  --rule: #27324B;
  color-scheme: dark;
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }
mark {
  color: var(--mark-ink);
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 55% / 100% 1.05em;
  padding: 0 0.14em;
  margin: 0 -0.04em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.wrap { max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--surface); color: var(--ink); padding: 0.5rem 0.9rem; z-index: 10;
  font-family: var(--display); font-size: 0.95rem;
}
.skip:focus { top: 0.75rem; }

/* Header */
.site-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding-block: 22px;
  font-family: var(--display);
}
.brand { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand span { font-weight: 400; color: var(--muted); margin-left: 0.5em; }
.site-nav { display: flex; align-items: baseline; gap: clamp(14px, 2.2vw, 30px); font-size: 0.98rem; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-nav .lang {
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.15em 0.75em; font-weight: 600;
}
@media (max-width: 760px) {
  .site-nav a.sec { display: none; }
  .brand span { display: none; }
}

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
  padding-block: clamp(28px, 6vw, 76px) clamp(40px, 6vw, 72px);
}
.hero h1 {
  font-size: clamp(2.35rem, 5.4vw, 4.4rem);
  line-height: 0.98; letter-spacing: -0.025em; font-weight: 750;
  font-stretch: 82%; font-variation-settings: "wdth" 82;
}
.lede { margin-top: 1.5rem; font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.5; max-width: 34em; }
.actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; font-family: var(--display); }
.btn {
  display: inline-block; background: var(--link); color: var(--surface); text-decoration: none;
  padding: 0.78em 1.5em; border-radius: 999px; font-weight: 650; font-size: 1.02rem;
  transition: transform 0.15s ease;
}
button.btn { border: 0; font-family: inherit; cursor: pointer; }
button.btn:disabled { opacity: 0.6; cursor: progress; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.actions .quiet { color: var(--ink); font-size: 1.02rem; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

/* Query demo */
.demo {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 18px;
  padding: clamp(16px, 2.4vw, 26px);
  font-family: var(--display);
  box-shadow: 0 24px 60px -36px color-mix(in srgb, var(--link) 55%, transparent);
}
.demo-query {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.62em 1.1em;
  font-size: 0.98rem; line-height: 1.3; min-height: 3.1em;
}
.demo-query svg { flex: none; color: var(--muted); }
.demo-query .q { min-width: 0; }
.demo-query .q.typing::after {
  content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px;
  background: var(--link); vertical-align: -0.15em; animation: caret 0.9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.demo-tabs { display: flex; gap: 22px; margin-top: 14px; border-bottom: 1px solid var(--rule); }
.demo-tabs button {
  appearance: none; background: none; border: 0; padding: 0.5em 0; margin-bottom: -1px;
  font: inherit; font-size: 0.95rem; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent;
}
.demo-tabs button[aria-selected="true"] { color: var(--link); border-bottom-color: var(--link); font-weight: 650; }
.demo-panels { display: grid; margin-top: 18px; transition: opacity 0.25s ease; }
.demo.is-typing .demo-panels { opacity: 0.28; }
.panel { grid-area: 1 / 1; visibility: hidden; opacity: 0; transition: opacity 0.3s ease, visibility 0s 0.3s; }
.panel.is-active { visibility: visible; opacity: 1; transition: opacity 0.3s ease; }
.path { font-family: var(--display); font-size: 0.88rem; color: var(--path); letter-spacing: 0.005em; }
.panel .path { display: flex; align-items: center; gap: 9px; }
.panel .path img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.r-title { font-size: 1.3rem; line-height: 1.2; font-weight: 600; margin-top: 4px; }
.r-title a { text-decoration: none; }
.r-title a:hover { text-decoration: underline; }
.r-title a:visited { color: color-mix(in srgb, var(--link) 55%, #8A2BB8); }
.r-snippet { margin-top: 8px; font-size: 0.98rem; line-height: 1.5; color: var(--muted); }
.r-snippet b { color: var(--ink); font-weight: 650; }
.sitelinks { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; font-size: 0.98rem; }
.answer { font-family: var(--body); font-size: 1.08rem; line-height: 1.55; }
.answer .w { display: inline; }
.demo.is-streaming .answer .w { opacity: 0; animation: word-in 0.28s ease forwards; animation-delay: calc(var(--i) * 42ms); }
.demo.is-streaming .sources { opacity: 0; animation: word-in 0.4s ease forwards; animation-delay: calc(var(--n) * 42ms + 200ms); }
@keyframes word-in { to { opacity: 1; } }
.cite {
  display: inline-block; font-family: var(--display); font-size: 0.72rem; font-weight: 700; line-height: 1;
  padding: 0.3em 0.55em; border-radius: 999px; border: 1px solid var(--rule); text-decoration: none; vertical-align: 0.2em;
}
.sources { margin-top: 14px; font-size: 0.9rem; color: var(--muted); }
.demo figcaption { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); font-family: var(--body); font-size: 0.98rem; line-height: 1.45; color: var(--muted); }

/* Facts */
.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(18px, 3vw, 40px);
  border-top: 1px solid var(--rule); padding-block: clamp(24px, 4vw, 40px);
}
.facts div { display: flex; flex-direction: column-reverse; gap: 4px; }
.facts dd {
  font-family: var(--display); font-weight: 750; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; letter-spacing: -0.02em;
  font-stretch: 82%; font-variation-settings: "wdth" 82; font-variant-numeric: tabular-nums;
}
.facts dt { font-size: 1rem; line-height: 1.35; color: var(--muted); max-width: 15em; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr 1fr; row-gap: 26px; } }

/* Bands: left rail + content */
.band {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
  gap: 20px clamp(28px, 6vw, 88px);
  border-top: 1px solid var(--rule);
  padding-block: clamp(52px, 8vw, 104px);
}
.rail h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.02; letter-spacing: -0.02em; font-weight: 750;
  font-stretch: 82%; font-variation-settings: "wdth" 82;
}
.rail p { margin-top: 0.9rem; color: var(--muted); font-size: 1.05rem; line-height: 1.5; max-width: 22em; }
@media (min-width: 861px) { .rail > div { position: sticky; top: 28px; } }
@media (max-width: 860px) { .band { grid-template-columns: 1fr; } }

/* Results */
.results { display: grid; gap: clamp(30px, 4vw, 44px); max-width: 44rem; }
.result h3 { font-size: clamp(1.35rem, 2.3vw, 1.7rem); line-height: 1.16; letter-spacing: -0.012em; font-weight: 650; margin-top: 5px; }
.result .snippet { margin-top: 9px; max-width: 36em; }
.js .result mark { background-size: 0 1.05em; transition: background-size 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s; }
.js .result mark.in { background-size: 100% 1.05em; }

/* Expertise */
.skills { display: grid; gap: 0; max-width: 46rem; }
.skills div { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); gap: 6px 28px; padding-block: 20px; border-top: 1px solid var(--rule); }
.skills div:first-child { border-top: 0; padding-top: 0; }
.skills dt { font-family: var(--display); font-weight: 650; font-size: 1.15rem; line-height: 1.25; }
.skills dd { font-size: 1.05rem; line-height: 1.5; }
@media (max-width: 600px) { .skills div { grid-template-columns: 1fr; } }

/* Approach */
.views { display: grid; gap: clamp(28px, 4vw, 40px); max-width: 40rem; }
.views h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.18; letter-spacing: -0.012em; font-weight: 650; }
.views p { margin-top: 8px; }

/* Timeline */
.timeline { position: relative; display: grid; gap: 30px; max-width: 46rem; padding-left: 26px; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; left: 0; top: 0.5em; bottom: 0.5em; width: 2px; background: var(--rule);
}
.timeline::after { background: var(--link); transform-origin: top; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .timeline::after { animation: grow linear both; animation-timeline: view(); animation-range: entry 25% cover 70%; }
  }
}
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.timeline li { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); gap: 4px 20px; }
.timeline time { font-family: var(--display); font-size: 0.98rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 0.2em; }
.timeline h3 { font-size: 1.2rem; line-height: 1.25; font-weight: 650; }
.timeline h3 span { font-weight: 400; color: var(--muted); }
.timeline p { margin-top: 4px; font-size: 1.05rem; line-height: 1.5; }
@media (max-width: 600px) { .timeline li { grid-template-columns: 1fr; } }

/* Contact */
.contact { border-top: 1px solid var(--rule); padding-block: clamp(56px, 9vw, 120px); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.contact:has(.portrait) { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.portrait { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; border: 1px solid var(--rule); }
@media (max-width: 760px) { .contact:has(.portrait) { grid-template-columns: 1fr; } .portrait { order: -1; max-width: 15rem; } }
.captcha:not(:empty) { margin-top: 1.2rem; }
.status { font-family: var(--display); font-size: 0.98rem; color: var(--muted); }
.status:not(:empty) { margin-top: 0.9rem; }
.contact h2 {
  font-size: clamp(2.2rem, 5.6vw, 4.2rem); line-height: 0.98; letter-spacing: -0.025em; font-weight: 750; max-width: 13em;
  font-stretch: 82%; font-variation-settings: "wdth" 82;
}
.contact-lede { margin-top: 1.4rem; font-size: clamp(1.15rem, 1.6vw, 1.3rem); line-height: 1.5; max-width: 34em; }
.contact-links { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; font-family: var(--display); font-size: 1.08rem; }
.contact-meta { margin-top: 2.6rem; display: grid; grid-template-columns: repeat(3, minmax(0, 15rem)); gap: 18px 40px; font-size: 1rem; line-height: 1.4; }
.contact-meta dt { font-family: var(--display); color: var(--muted); font-size: 0.92rem; }
@media (max-width: 600px) { .contact-meta { grid-template-columns: 1fr; } }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding-block: 26px 40px; font-family: var(--display); font-size: 0.9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .result mark { background-size: 100% 1.05em; }
  .demo.is-streaming .answer .w, .demo.is-streaming .sources { opacity: 1; }
}
