:root {
  color-scheme: light dark;
  --fg: #37291f;
  --muted: #796553;
  --bg: #f7f1e8;
  --surface: #fffbf5;
  --accent: #865335;
  --rule: #ded0be;
  --soft: #eee2d2;
  --green: #756744;
  --button-fg: #fffbf5;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #f0e4d5;
    --muted: #bda793;
    --bg: #241b16;
    --surface: #30241d;
    --accent: #d3a078;
    --rule: #503e30;
    --soft: #3b2d23;
    --green: #c6b18b;
    --button-fg: #241b16;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--button-fg); }
a { color: var(--accent); text-decoration: none; text-underline-offset: 5px; }
a:hover { text-decoration: underline; }
main p a:not([class]), .publications-section li a, .article li a { text-decoration: underline; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
main:focus { outline: none; }
img { max-width: 100%; }
p { margin: .75rem 0; }
ul { padding-left: 1.25rem; margin: .5rem 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-family: var(--serif); font-size: clamp(2.6rem, 5.4vw, 4.2rem); font-weight: 400; line-height: 1.08; letter-spacing: -.045em; margin: 0 0 1.25rem; }
h2 { font-size: 1.4rem; line-height: 1.3; letter-spacing: -.025em; margin: 2.25rem 0 .75rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 40px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: .65rem 1rem; background: var(--fg); color: var(--bg); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-header { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--rule); }
.site-title { display: inline-flex; gap: 14px; align-items: center; font-size: .87rem; font-weight: 600; color: var(--fg); letter-spacing: -.015em; }
.site-title:hover { text-decoration: none; }
.site-monogram { font-family: var(--serif); font-size: 2.2rem; font-weight: 700; letter-spacing: -.09em; }
.site-monogram span, .accent-dot { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: .85rem; }
.site-nav a { color: var(--muted); padding: 12px 0; position: relative; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); text-decoration: none; }
.site-nav a[aria-current="page"]::after { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); left: calc(50% - 2px); }
main { padding: 68px 0 0; }
.tagline { color: var(--muted); font-size: 1.05rem; max-width: 620px; margin: 0 0 3rem; }
.eyebrow { display: block; font-family: var(--mono); font-size: .68rem; line-height: 1.6; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 20px; }
.home { padding-top: 0; }
.home-hero { display: grid; grid-template-columns: 1fr 270px; align-items: center; gap: 70px; padding: 70px 0 76px; }
.hero-copy .eyebrow { display: flex; align-items: center; gap: 9px; }
.status-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; flex: none; }
.home-hero h1 { font-size: clamp(3.5rem, 6.6vw, 5.2rem); margin-bottom: 25px; }
.home-hero h1 em { color: var(--accent); font-weight: 400; }
.hero-intro { max-width: 475px; font-size: 1rem; color: var(--muted); line-height: 1.85; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 25px; margin-top: 29px; }
.button-primary { display: inline-flex; justify-content: space-between; align-items: center; gap: 28px; padding: 12px 19px; border-radius: 4px; color: var(--bg); background: var(--fg); font-size: .83rem; font-weight: 500; transition: background .2s, transform .2s; }
.button-primary:hover { background: var(--accent); color: var(--button-fg); text-decoration: none; transform: translateY(-2px); }
.text-link { display: inline-flex; align-items: center; gap: 16px; font-size: .82rem; font-weight: 500; color: var(--fg); }
.text-link span { color: var(--accent); }
.hero-portrait { padding-top: 32px; }
.portrait-frame { padding: 9px; border: 1px solid var(--rule); background: var(--surface); transform: rotate(3deg); box-shadow: 0 10px 35px #20251008; }
.profile-photo { display: block; width: 100%; height: 310px; object-fit: cover; object-position: center; filter: saturate(.7); }
.portrait-caption { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; color: var(--muted); font-size: .65rem; }
.tagline-flags { display: inline-flex; align-items: center; gap: 5px; }
.tagline-flags svg, .tagline-flags img { height: 11px; width: auto; border-radius: 1px; }
.home-section { padding: 50px 0 56px; border-top: 1px solid var(--rule); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-heading .eyebrow { margin-bottom: 12px; }
.section-heading h2 { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.35rem); font-weight: 400; line-height: 1.2; margin: 0; letter-spacing: -.04em; }
.section-heading > .text-link { margin-bottom: 4px; flex-shrink: 0; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.project-card { display: block; min-width: 0; color: var(--fg); border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; background: var(--surface); transition: border-color .2s, transform .2s, box-shadow .2s; }
.project-card:hover { text-decoration: none; border-color: var(--muted); transform: translateY(-4px); box-shadow: 0 12px 24px #20251008; }
.project-preview { height: 240px; overflow: hidden; position: relative; display: flex; align-items: center; flex-direction: column; border-bottom: 1px solid var(--rule); }
.preview-label { font-family: var(--mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; margin: 22px 15px; }
.relai-preview { background: #eadbcd; color: #68503f; }
.relai-preview img { width: calc(100% - 56px); height: auto; border-radius: 6px 6px 0 0; box-shadow: 0 5px 22px #23203225; transition: transform .35s; }
.project-card:hover .relai-preview img { transform: translateY(-4px); }
.gramp-preview { background: #e6dfcf; color: #61543f; }
.brosophagus-preview { background: #ead8ce; color: #694b3d; }
.coterue-preview { background: #e2ded2; color: #5c5141; }
.app-preview-brand { display: flex; align-items: center; gap: 18px; margin-top: 5px; }
.app-preview-brand img { width: 80px; height: 80px; flex: none; border-radius: 18px; }
.app-preview-brand > span { font-family: var(--serif); font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.05em; }
.gramp-preview-brand { display: flex; align-items: center; gap: 18px; margin-top: 5px; }
.gramp-preview-brand > span { font-family: var(--serif); font-size: 3.5rem; letter-spacing: -.07em; }
.gramp-preview-brand .harold { width: 80px; height: 80px; border-radius: 16px; box-shadow: none; }
.gramp-preview-brand .harold pre { font-size: 1.6px; }
.privacy-note { font-family: var(--mono); font-size: .6rem; margin-top: 28px; }
.privacy-note span { font-size: .5rem; margin-right: 5px; }
.project-info { padding: 20px 24px 23px; }
.project-heading { display: flex; align-items: center; justify-content: space-between; }
.project-heading h3 { font-size: 1.55rem; font-weight: 600; letter-spacing: -.06em; margin: 0; }
.project-heading h3 span { color: var(--accent); }
.project-arrow { color: var(--muted); font-size: 1.3rem; }
.project-info p { color: var(--muted); font-size: .88rem; line-height: 1.7; margin: 9px 0 17px; }
.project-category { font-family: var(--mono); text-transform: uppercase; font-size: .6rem; letter-spacing: .04em; color: var(--muted); }
.project-category span { margin: 0 9px; opacity: .5; }
.expertise-section, .biography-section { display: grid; grid-template-columns: 1fr 1.5fr; gap: 55px; }
.expertise-section .section-heading, .biography-section .section-heading { align-self: start; }
.expertise-content > p:first-child, .biography-copy > p:first-child { margin-top: 0; }
.expertise-content, .biography-copy { color: var(--muted); font-size: .92rem; }
.expertise-content ul { list-style: none; padding: 0; margin-top: 25px; }
.expertise-content li { padding: 16px 0; border-top: 1px solid var(--rule); }
.expertise-content li:last-child { padding-bottom: 0; }
.expertise-content strong { color: var(--fg); font-weight: 600; }
.biography-copy .text-link { margin-top: 12px; }
.publications-section > ul { list-style: none; padding: 0; counter-reset: publications; }
.publications-section li { position: relative; padding: 20px 0 20px 44px; border-bottom: 1px solid var(--rule); font-size: .85rem; color: var(--muted); counter-increment: publications; }
.publications-section li::before { content: "0" counter(publications); position: absolute; left: 0; top: 23px; font-family: var(--mono); font-size: .65rem; color: var(--accent); }
.publications-section li:last-child { border-bottom: none; }
.contact-section { padding: 50px 0 25px; }
.contact-section h2 { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 400; line-height: 1.12; margin: 0 0 20px; }
.contact-section > p:not(.eyebrow) { color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 12px 25px; list-style: none; padding: 0; margin-top: 25px; }
.links li { font-size: .8rem; }
.links li:first-child { width: 100%; font-size: clamp(.9rem, 3vw, 1.2rem); margin-bottom: 8px; overflow-wrap: anywhere; }
.archive-heading { margin: 55px 0 25px; font-family: var(--serif); font-size: 1.8rem; font-weight: 400; }
.squirrel-track {
  width: 100%;
  overflow: hidden;
  margin-top: 3rem;
  padding-bottom: 1rem;
}

.squirrel-runner {
  display: inline-block;
  white-space: nowrap;
  animation: walk 14s linear infinite;
  will-change: transform;
}

@keyframes walk {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100vw); }
}

.squirrel-window {
  display: inline-block;
  overflow: hidden;
  height: 9.2em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.15;
  color: var(--muted);
}

.squirrel-window pre {
  margin: 0;
  font: inherit;
  color: inherit;
  white-space: pre;
  animation: tennis 0.35s step-end infinite;
}

@keyframes tennis {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .squirrel-runner,
  .squirrel-window pre { animation: none; }
}

/* ── Entry list (observations + projects) ─────────────────── */

.entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 3rem;
}

.entry {
  display: grid;
  gap: 0.5rem;
}

.entry-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.entry-title {
  font-size: 1.9rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}

.entry-title a { color: var(--fg); }
.entry-title a:hover { color: var(--accent); text-decoration: none; }

.entry-summary {
  color: var(--fg);
  margin: 0.25rem 0 0;
}

.entry-tags {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 2rem 0;
}

/* ── Career track (work timeline) ─────────────────────────── */

.track {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  position: relative;
}

.track::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--rule);
}

.track-item {
  position: relative;
  padding: 0 0 3rem 2.25rem;
}

.track-item:last-child { padding-bottom: 0.5rem; }

/* commit node */
.track-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--muted);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.track-item:hover::before {
  border-color: var(--accent);
  background: var(--accent);
}

/* HEAD — the present, gently pulsing */
.track-now::before {
  border-color: var(--accent);
  background: var(--accent);
}

.track-now::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: track-ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes track-ping {
  0%   { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}

/* era divider — a branch tag on the rail */
.track-era {
  position: relative;
  padding: 0 0 1.5rem 2.25rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.track-era::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.25rem;
  width: 8px;
  height: 8px;
  background: var(--bg);
  border: 2px solid var(--rule);
  transform: rotate(45deg);
}

.track-date {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.track-company {
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.track-logo {
  margin-left: auto;
  height: 26px;
  width: auto;
  max-width: 150px;
  border-radius: 5px;
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.track-edu .track-logo { height: 34px; }

@media (max-width: 480px) {
  .track-logo { max-width: 110px; }
}

.track-company a { color: var(--fg); }
.track-company a:hover { color: var(--accent); text-decoration: none; }

.track-edu .track-company { font-size: 1.1rem; }

.track-role {
  font-weight: 600;
  font-size: 1rem;
}

.track-bullets {
  margin: 0.6rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.35rem;
}

.track-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.5rem 0 0;
}

.track-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.track-stack span {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.1em 0.6em;
}

/* staggered entrance */
@media (prefers-reduced-motion: no-preference) {
  .track-item, .track-era {
    animation: track-rise 0.5s ease both;
  }
  .track > :nth-child(1)  { animation-delay: 0.05s; }
  .track > :nth-child(2)  { animation-delay: 0.1s; }
  .track > :nth-child(3)  { animation-delay: 0.15s; }
  .track > :nth-child(4)  { animation-delay: 0.2s; }
  .track > :nth-child(5)  { animation-delay: 0.25s; }
  .track > :nth-child(6)  { animation-delay: 0.3s; }
  .track > :nth-child(7)  { animation-delay: 0.35s; }
  .track > :nth-child(8)  { animation-delay: 0.4s; }
  .track > :nth-child(9)  { animation-delay: 0.45s; }
  .track > :nth-child(10) { animation-delay: 0.5s; }
  .track > :nth-child(11) { animation-delay: 0.55s; }
  .track > :nth-child(12) { animation-delay: 0.6s; }
}

@keyframes track-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .track-now::after { animation: none; opacity: 0; }
}

/* ── Article (project / blog page) ────────────────────────── */

.article .back-link {
  margin: 0 0 1.5rem;
}

.article .back-link a {
  color: var(--muted);
  font-size: 0.95rem;
}

.article h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.article .tagline {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

.article h2 {
  margin-top: 2.5rem;
  padding-top: 0;
  border-top: 0;
  text-transform: none;
  letter-spacing: -0.005em;
  font-size: 1.3rem;
  color: var(--fg);
}

.article p,
.article ul,
.article ol { margin: 1rem 0; }

.article code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(127, 127, 127, 0.12);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.download-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1.5rem 0 2.5rem;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
}

.download-btn:hover {
  text-decoration: none;
  opacity: 0.9;
  color: #fff;
}

.download-btn svg {
  display: block;
}

.download-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.download-hint a {
  color: var(--muted);
  text-decoration: underline;
}

.article figure {
  margin: 2rem 0;
}

.article figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--rule);
  margin: 0 auto;
}

.article figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 0.5rem;
  text-align: center;
}

/* ── gramp hero (Harold brand mark) ───────────────────────── */

.gramp-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.gramp-hero > div:not(.harold) { flex: 1; min-width: 0; }
.gramp-hero .tagline { margin-bottom: 0; }

.harold {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 14px;
  background: linear-gradient(150deg, #1f8f4e, #0c5c30);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(15, 110, 60, 0.28);
}

.harold pre {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 2.4px;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.92);
  white-space: pre;
  letter-spacing: 0;
}

@media (max-width: 480px) {
  .gramp-hero { gap: 1rem; }
  .harold { width: 92px; height: 92px; }
  .harold pre { font-size: 1.85px; }
}

/* ── Blog article extras (code, math, embeds) ─────────────── */

.article pre.astro-code {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 1.25rem 0;
}

.article pre.astro-code code {
  background: none;
  padding: 0;
  font-size: inherit;
}

@media (prefers-color-scheme: dark) {
  .astro-code,
  .astro-code span {
    color: var(--shiki-dark) !important;
    background-color: var(--shiki-dark-bg) !important;
  }
}

.article .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
}

.miro-embed {
  margin: 2rem 0;
}

.miro-embed iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--rule);
  border-radius: 6px;
}


/* Shared reading layouts */
.entry-list { gap: 0; }
.entry { border-top: 1px solid var(--rule); padding: 30px 0; }
.entry-title { font-family: var(--serif); font-weight: 400; font-size: 2rem; }
.entry-meta, .entry-tags { font-family: var(--mono); font-size: .72rem; }
.entry-summary { color: var(--muted); max-width: 740px; }
.empty-state { max-width: 670px; padding: 40px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); font-style: normal; }
.empty-state h2 { font-family: var(--serif); font-weight: 400; font-size: 2rem; color: var(--fg); margin: 0; }
.empty-state .text-link { margin-top: 15px; }
.track { max-width: 780px; margin: 50px auto 0; }
.track-company { font-weight: 600; font-size: 1.6rem; margin-top: 5px; }
.track-bullets { color: var(--muted); font-size: .92rem; }
.track-logo { background: #fff; }
.track-era { color: var(--accent); }
.track-stack span { border-radius: 4px; background: var(--soft); font-size: .65rem; }
.article { max-width: 740px; margin: 0 auto; overflow-wrap: anywhere; }
.article h1 { font-family: var(--serif); font-size: clamp(2.3rem, 4.5vw, 3.6rem); font-weight: 400; line-height: 1.12; margin-bottom: 20px; letter-spacing: -.035em; }
.article h2 { font-family: var(--serif); font-size: 1.85rem; font-weight: 400; }
.article .tagline { line-height: 1.7; }
.article p, .article li { line-height: 1.85; }
.article .back-link { margin-bottom: 35px; }
.article .back-link a { font-family: var(--mono); font-size: .72rem; }
.download-btn { color: var(--button-fg); }
.download-btn:hover { color: var(--button-fg); }
.article table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .85rem; }
.article td, .article th { border: 1px solid var(--rule); padding: 10px 14px; text-align: left; }
.article blockquote { border-left: 2px solid var(--accent); margin: 25px 0; padding: 0 20px; color: var(--muted); }
footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 65px; padding: 28px 0 36px; border-top: 1px solid var(--rule); color: var(--muted); font-size: .72rem; }
footer p { margin: 3px 0 0; }
.footer-name { color: var(--fg); font-size: .85rem; font-weight: 500; }
.footer-name span { color: var(--accent); }
.socials { display: flex; gap: 10px; }
.socials a { display: inline-flex; justify-content: center; align-items: center; width: 34px; height: 36px; color: var(--muted); border-radius: 4px; }
.socials a:hover { color: var(--accent); background: var(--soft); }
.socials svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.squirrel-track { margin-top: 0; }
@media (prefers-color-scheme: dark) {
  .relai-preview { background: #433125; color: #dfc5ac; }
  .gramp-preview { background: #3c3528; color: #d9ccb1; }
  .brosophagus-preview { background: #493329; color: #e6c9b8; }
  .coterue-preview { background: #39342b; color: #d8cbb5; }
}
@media (max-width: 800px) {
  .wrap { padding: 0 28px; }
  .home-hero { grid-template-columns: 1fr 210px; gap: 35px; padding: 55px 0; }
  .profile-photo { height: 260px; }
  .portrait-caption { flex-direction: column; align-items: flex-start; gap: 8px; }
  .home-hero h1 { font-size: 3.8rem; }
  .expertise-section, .biography-section { gap: 30px; }
  .project-preview { height: 210px; }
  .project-info { padding: 17px 20px 20px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 22px; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 21px 0 16px; min-height: auto; }
  .site-title { font-size: .82rem; }
  .site-monogram { font-size: 1.9rem; }
  .site-nav { width: 100%; justify-content: space-between; gap: 18px; }
  .site-nav a { padding: 7px 0; }
  .site-nav a[aria-current="page"]::after { bottom: 0; }
  main { padding-top: 40px; }
  .home-hero { display: flex; flex-direction: column; align-items: stretch; gap: 30px; padding: 40px 0; }
  .home-hero h1 { font-size: clamp(3.4rem, 12vw, 4.8rem); }
  .hero-intro { font-size: .94rem; }
  .hero-portrait { padding-top: 0; display: flex; align-items: center; gap: 25px; }
  .portrait-frame { width: 98px; padding: 4px; flex: none; }
  .profile-photo { height: 110px; }
  .portrait-caption { margin: 0; gap: 12px; font-size: .72rem; }
  .hero-actions { gap: 20px; }
  .home-section { padding: 35px 0 40px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 15px; }
  .section-heading h2 { font-size: 2rem; }
  .project-grid { grid-template-columns: 1fr; gap: 22px; }
  .project-preview { height: 230px; }
  .expertise-section, .biography-section { grid-template-columns: 1fr; gap: 0; }
  .expertise-content li { font-size: .85rem; }
  .publications-section li { padding-left: 30px; }
  .empty-state { padding: 25px; }
  .track-item, .track-era { padding-left: 25px; }
  .track-company { font-size: 1.35rem; flex-wrap: wrap; }
  .track-logo { margin-left: 0; max-width: 100px; }
  .gramp-hero { align-items: flex-start; flex-direction: column; }
  footer { align-items: flex-start; flex-direction: column; margin-top: 35px; gap: 18px; }
  .socials { margin-left: -8px; }
  .links { gap: 10px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.development-note { margin: 1.5rem 0 2rem; padding: 18px 22px; border-left: 3px solid var(--accent); background: var(--soft); font-size: .88rem; color: var(--fg); }
.development-note strong { color: var(--fg); }

/* Motion follows the same ink-and-paper palette as the rest of the site. */
.header-controls { display: flex; align-items: center; gap: 25px; }
.motion-toggle { display: grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border: 1px solid var(--rule); border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; transition: color .2s, border-color .2s, transform .3s; }
.motion-toggle[hidden] { display: none; }
.motion-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(8deg); }
.motion-toggle:disabled { cursor: default; opacity: .65; }
.motion-play, [data-motion="off"] .motion-pause { display: none; }
[data-motion="off"] .motion-play { display: block; }
.reading-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; pointer-events: none; z-index: 20; }
.hero-line { display: block; overflow: clip; padding: .08em .08em .14em 0; margin: -.08em -.08em -.14em 0; }
.hero-line > span { display: block; }
.home-hero h1 em { position: relative; display: inline-block; }
.home-hero h1 em::after { content: ''; position: absolute; left: 0; bottom: -.035em; width: 100%; height: .055em; border-radius: 50%; background: currentColor; opacity: .45; transform-origin: left; }
.portrait-stage { position: relative; isolation: isolate; }
.portrait-orbits { position: absolute; width: 125%; max-width: none; height: auto; left: -12.5%; top: -6%; stroke: var(--accent); stroke-width: .8; pointer-events: none; z-index: -1; }
.orbit-guide { opacity: .4; }
.orbit-spin { transform-origin: 210px 210px; opacity: .65; }
.orbit-particle { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.orbit-cross { opacity: .7; }
.portrait-frame { transition: transform .7s cubic-bezier(.16,1,.3,1), box-shadow .7s; }
.portrait-caption { position: relative; }
.project-card { position: relative; isolation: isolate; }
.project-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(400px circle at var(--light-x, 50%) var(--light-y, 0%), #e8bb8530, transparent 65%); opacity: 0; transition: opacity .35s; z-index: 2; }
.project-preview::after { content: ''; position: absolute; inset: -75% -50%; pointer-events: none; background: linear-gradient(110deg, transparent 40%, #fffbf52b 50%, transparent 60%); transform: translateX(-75%); opacity: 0; z-index: 1; }
.project-arrow, .text-link span, .button-primary span, .download-btn span { display: inline-block; transition: transform .4s cubic-bezier(.16,1,.3,1); }
.site-nav a::before { content: ''; position: absolute; bottom: 5px; left: 0; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .35s; }
.site-nav a:hover::before, .site-nav a:focus-visible::before { transform: scaleX(1); transform-origin: left; }

@media (prefers-reduced-motion: no-preference) {
  [data-motion="on"] .hero-line > span { animation: headline-in 1.05s cubic-bezier(.16,1,.3,1) both; }
  [data-motion="on"] .hero-line:nth-child(2) > span { animation-delay: .1s; }
  [data-motion="on"] .hero-line:nth-child(3) > span { animation-delay: .2s; }
  [data-motion="on"] .home-hero h1 em::after { animation: ink-in 1s .7s cubic-bezier(.16,1,.3,1) both; }
  [data-motion="on"] .hero-copy > .eyebrow,
  [data-motion="on"] .hero-intro,
  [data-motion="on"] .hero-actions { animation: detail-in .9s .25s cubic-bezier(.16,1,.3,1) both; }
  [data-motion="on"] .hero-actions { animation-delay: .4s; }
  [data-motion="on"] .hero-portrait[data-in-view] .orbit-spin { animation: orbit 26s linear infinite; }
  [data-motion="on"] .hero-portrait[data-in-view] .orbit-reverse { animation-direction: reverse; animation-duration: 36s; }
  [data-motion="on"] .project-card:is(:hover, :focus-visible) .project-preview::after { animation: preview-sweep .9s ease-out; }
  [data-motion="on"] .project-card:is(:hover, :focus-visible) .project-arrow,
  [data-motion="on"] .text-link:is(:hover, :focus-visible) span,
  [data-motion="on"] .button-primary:is(:hover, :focus-visible) span,
  [data-motion="on"] .download-btn:is(:hover, :focus-visible) span { transform: translate(3px, -3px); }
  [data-motion="on"] .project-card:is(:hover, :focus-visible) .brosophagus-preview .app-preview-brand img { animation: icon-wave .7s ease-in-out; }
  [data-motion="on"] .project-card:is(:hover, :focus-visible) .coterue-preview .app-preview-brand img { animation: pin-drop .7s cubic-bezier(.2,.8,.3,1); }
  [data-motion="on"] .project-card:is(:hover, :focus-visible) .gramp-preview-brand { animation: detail-in .65s cubic-bezier(.16,1,.3,1); }
  @media (hover: hover) and (pointer: fine) {
    [data-motion="on"] .project-card[data-tilting] { transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-6px); transition: transform .16s ease-out, border-color .2s, box-shadow .2s; box-shadow: 0 20px 40px #23150918; }
    [data-motion="on"] .project-card[data-tilting]::after { opacity: 1; }
    [data-motion="on"] .portrait-stage:hover .portrait-frame { transform: rotate(-3deg) translateY(-7px); box-shadow: 0 20px 45px #23150920; }
  }
}

@keyframes headline-in { from { transform: translateY(110%) rotate(3deg); } to { transform: translateY(0) rotate(0); } }
@keyframes ink-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes detail-in { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes preview-sweep { 0% { transform: translateX(-75%); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateX(75%); opacity: 0; } }
@keyframes icon-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 65% { transform: rotate(7deg) translateY(-4px); } }
@keyframes pin-drop { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-14px) rotate(4deg); } 70% { transform: translateY(2px); } }

[data-page-hidden] *, [data-page-hidden] *::before, [data-page-hidden] *::after { animation-play-state: paused !important; }
[data-motion="off"] { scroll-behavior: auto; }
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after { animation: none !important; transition: none !important; }
[data-motion="off"] .reading-progress { display: none; }
[data-motion="off"] .project-card:hover, [data-motion="off"] .project-card:hover .relai-preview img,
[data-motion="off"] .button-primary:hover, [data-motion="off"] .motion-toggle:hover { transform: none; }

@media (max-width: 600px) {
  .header-controls { width: 100%; gap: 18px; }
  .motion-toggle { width: 30px; height: 30px; }
  .portrait-stage { width: 98px; flex: none; }
  .portrait-stage .portrait-frame { width: 100%; }
  .portrait-orbits { top: -3%; }
}
@media (prefers-reduced-motion: reduce) {
  .reading-progress { display: none; }
  .project-card:hover, .project-card:hover .relai-preview img, .button-primary:hover, .motion-toggle:hover { transform: none; }
}
