/* Homepage only. The shared stylesheet continues to serve the article pages. */
/* Vue replaces this readable fallback only after its bundle has loaded. */
.home-page .work-fallback .project-slide { display: grid; margin-bottom: 32px; padding: 24px; border: 1px solid var(--line); }
.home-page .work-fallback { height: auto; }
html:has(.home-page) { scroll-behavior: auto; scroll-padding-top: 0; }
.home-page {
  --bg: #f5e8c9;
  --bg-alt: #efe0bb;
  --panel: #fcf5e2;
  --panel-2: #f8efd6;
  --fg: #2b2318;
  --dim: #4f3e2b;
  --mute: #6b5740;
  --accent: #a1402c;
  --accent-dim: #853422;
  --accent-soft: #a1402c0c;
  --accent-line: #a1402c50;
  --line: #242b2926;
  --line-2: #242b2942;
  --ink: var(--fg);
  --action: var(--accent);
  --font-display: var(--serif);
  --display-weight: 700;
  --display-tracking: -.015em;
  --t-h2: clamp(36px, 3.6vw, 52px);
  --wrap: 1200px;
  --home-header-height: 80px;
  --paper-light: #fffdf0a6;
  --paper-rule: #8765362e;
  --paper-mark: #87653624;
  --serif: Georgia, "Songti SC", "STSong", "SimSun", serif;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", Consolas, monospace;
  background: var(--bg);
  color: var(--fg);
  font-size: 18px;
  font-weight: 500;
  isolation: isolate;
}
[data-theme="dark"] .home-page {
  --bg: #1b1711;
  --bg-alt: #221d16;
  --panel: #262019;
  --panel-2: #2b241c;
  --fg: #edece4;
  --dim: #cdcfc5;
  --mute: #a3afa4;
  --accent: #efa58f;
  --accent-dim: #f6b7a4;
  --accent-soft: #efa58f12;
  --accent-line: #efa58f70;
  --line: #edece42a;
  --line-2: #edece44a;
  --paper-light: #e4bf7720;
  --paper-rule: #d2b27e26;
  --paper-mark: #d2b27e20;
}
.home-page::before, .home-page::after { display: block; }
.home-page .paper-chapter, .home-page .work-continuation { display: none; }
.home-page .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.home-page .wrap {
  width: min(1200px, calc(100% - 112px));
  max-width: none;
  padding: 0;
  margin-inline: auto;
}
.home-page .site-header {
  position: sticky;
  background: var(--bg);
  backdrop-filter: none;
  border-bottom: 1px solid var(--line);
}
.home-page .header-inner { min-height: var(--home-header-height); gap: 24px; }
.home-page .brand { gap: 12px; min-height: 44px; }
.home-page .brand-mark {
  width: 36px;
  height: 36px;
  border: 1px solid var(--fg);
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
}
.home-page .brand-text { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.home-page .brand-sub { font-family: var(--sans); font-size: 15px; letter-spacing: .04em; margin-top: 4px; }
.home-page .nav { display: flex; flex-direction: row; align-items: center; position: static; padding: 0; width: auto; height: auto; border: 0; background: transparent; backdrop-filter: none; box-shadow: none; margin-left: auto; gap: 24px; }
.home-page :focus-visible { scroll-margin-block: calc(var(--home-header-height) + 16px); }
.home-page .menu-btn { display: none; }
.home-page .nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  border-radius: 0;
  background: none;
  font-size: 17px;
  font-weight: 600;
}
.home-page .nav a::after { left: 0; right: 0; bottom: 6px; }
.home-page .header-actions { display: flex; gap: 16px; }
.home-page .theme-toggle {
  position: relative;
  right: auto;
  bottom: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  box-shadow: none;
  z-index: auto;
}
.home-page .pages { width: 100%; border: 0; box-shadow: none; background: transparent; overflow-x: clip; }
.home-page .pages .page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - var(--home-header-height));
  padding: 96px 0;
  border: 0;
  background: transparent;
  overflow: visible;
  scroll-snap-align: none;
  scroll-snap-stop: normal;
  scroll-margin-top: var(--home-header-height);
}
.home-page .pages .page > .wrap { transform: none; }
.home-page .pages [data-reveal], .home-page .pages [data-reveal].is-in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  transition: opacity .5s var(--ease), translate .65s var(--ease), scale .65s var(--ease), transform .2s var(--ease);
}
.home-page .pages [data-reveal].reveal-pending {
  opacity: 0;
  translate: var(--fx, 0px) 34px;
  scale: .94;
}
.home-page .pages [data-reveal]:focus-within {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  transition: none;
}
.home-page .hero-glow, .home-page .hero::after, .home-page .scroll-hint { display: none; }
.home-page .pages .hero {
  min-height: calc(100svh - var(--home-header-height));
  padding: 72px 0 40px;
  gap: 64px;
}
.home-page .hero-grid { display: grid; grid-template-columns: 1.12fr 1fr; gap: 72px; align-items: center; }
.home-page .hero-copy { min-width: 0; }
.home-page .eyebrow {
  display: flex;
  gap: 10px;
  width: fit-content;
  padding: 0;
  margin-bottom: 24px;
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: .02em;
}
.home-page .dot { width: 6px; height: 6px; background: var(--accent); box-shadow: none; animation: none; }
.home-page .pages .hero h1 {
  margin: 0;
  font-size: clamp(46px, 5.2vw, 76px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.025em;
}
.home-page .pages .hero h1 .hl { color: var(--accent); background: none; text-decoration: none; }
.home-page .pages .hero h1 .hl::after { display: none; }
.home-page .hero-lead { max-width: 32em; margin-top: 32px; color: var(--dim); font-size: 19px; line-height: 1.9; }
.home-page .hero-note { margin-top: 20px; padding: 0; border: 0; font-size: 16px; color: var(--mute); line-height: 1.8; }
.home-page .hero-actions { margin-top: 32px; gap: 16px; }
.home-page .btn {
  min-height: 48px;
  padding-inline: 24px;
  border-radius: 4px;
  font-size: 17px;
  font-weight: 600;
  box-shadow: none;
}
.home-page .btn-primary { background: var(--accent); color: #fffdf9; }
[data-theme="dark"] .home-page .btn-primary { color: #242b29; }
.home-page :is(.btn-ghost, .btn-outline) { border-color: var(--line-2); color: var(--fg); background: transparent; }
.home-page .terminal, .home-page .terminal:hover, .home-page .terminal[data-reveal].is-in:hover {
  background: #25332c;
  color: #eeeede;
  border: 1px solid #25332c;
  border-radius: 8px;
  box-shadow: 12px 12px 0 var(--bg-alt);
  transform: none;
  overflow: hidden;
}
.home-page .terminal::before, .home-page .terminal::after { display: none; }
.home-page .terminal-bar {
  min-height: 52px;
  padding: 0 24px;
  border-bottom: 1px solid #eeeede24;
  background: transparent;
}
.home-page .t-dots { gap: 6px; }
.home-page .t-dots i { width: 6px; height: 6px; background: #9caa9e; }
.home-page .t-path { font-family: var(--mono); font-size: 15px; color: #b6c1b4; }
.home-page .terminal-body { padding: 24px 28px 32px; font-size: 16px; line-height: 1.9; }
.home-page .t-prompt { color: #dc9a7c; }
.home-page .t-cmd { color: #eeeede; }
.home-page .t-out { color: #b6c1b4; }
.home-page .t-gap { margin-top: 20px; }
.home-page .t-json { margin: 12px 0 0; color: #d2dace; font-size: 15px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.home-page .t-key { color: #dca888; }
.home-page .t-str { color: #c0d1af; }
.home-page .metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding-top: 24px;
  background: none;
}
.home-page .metric { padding: 0; border: 0; background: none; box-shadow: none; }
.home-page .metric + .metric { padding-left: 0; }
.home-page .metric-num { font-size: 34px; font-weight: 600; line-height: 1.4; letter-spacing: -.025em; }
.home-page .metric-num small { font-family: var(--sans); font-size: 15px; color: var(--mute); margin-left: 8px; }
.home-page .metric-num .arrow { margin-inline: 8px; color: var(--accent); }
.home-page .metric-label { margin-top: 8px; font-size: 15px; color: var(--mute); }
.home-page .section-head { margin-bottom: 48px; }
.home-page .section-kicker { color: var(--mute); font-family: var(--mono); font-size: 15px; letter-spacing: 0; text-transform: none; margin-bottom: 16px; }
.home-page h2 { font-size: var(--t-h2); font-weight: 700; line-height: 1.4; letter-spacing: -.015em; }
.home-page .section-note { margin-top: 16px; max-width: 35em; font-size: 18px; color: var(--dim); }
.home-page .pages #work { padding-block: 80px; background: color-mix(in srgb, var(--bg-alt) 65%, transparent); }
.home-page .pages #work .section-head { margin-bottom: 40px; }
.home-page .pages #work .section-kicker { margin-bottom: 16px; }
.home-page .pages #work .project-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: none;
  transform: none;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.home-page .pages #work .project-card[data-reveal].is-in { transform: none; }
.home-page .pages #work .project-card::before, .home-page .pages #work .project-card::after { display: none; }
.home-page .pages #work .project-featured {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 0;
  gap: 48px;
  padding: 40px;
}
.home-page .pages #work .project-main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.home-page .pages #work .project-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.home-page .pages #work .project-index { font-size: 15px; color: var(--mute); }
.home-page .tag { font-size: 15px; padding: 0; border: 0; border-radius: 0; color: var(--mute); background: none; letter-spacing: 0; }
.home-page .tag-accent, .home-page .tag-live { color: var(--accent); }
.home-page .tag-live i { background: var(--accent); box-shadow: none; animation: none; }
.home-page .pages #work .project-card h3 { font-size: 32px; font-weight: 700; letter-spacing: -.015em; }
.home-page .pages #work .project-sub { margin-top: 8px; font-family: var(--sans); font-size: 17px; color: var(--mute); letter-spacing: 0; }
.home-page .pages #work .project-intro { display: block; margin-top: 20px; color: var(--dim); font-size: 18px; line-height: 1.85; max-width: 36em; }
.home-page .pages #work .project-main > .chips { margin: 24px 0; }
.home-page .pages #work .chips { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.home-page .pages #work .chips li { border: 0; background: none; padding: 0; font-size: 15px; color: var(--mute); line-height: 1.6; }
.home-page .pages #work .btn { border-radius: 10px; }
.home-page .pages #work .project-aside { display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 24px; border: 0; background: var(--bg-alt); border-radius: 14px; }
.home-page .flow-caption { margin: 0; color: var(--mute); font-size: 15px; text-align: center; line-height: 1.6; }
.home-page .flow-context { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--mute); font-size: 15px; line-height: 1.7; text-align: center; }
.home-page .agent-flow { width: 100%; margin: 0; display: grid; gap: 0; text-align: center; font-family: var(--mono); font-size: 15px; color: var(--dim); }
.home-page .agent-flow > li { display: grid; justify-items: center; }
.home-page .agent-flow > li + li::before { content: ""; display: block; width: 1px; height: 16px; background: var(--line-2); }
.home-page .flow-node { display: block; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); }
.home-page .flow-core { color: var(--panel); background: var(--fg); border-color: var(--fg); }
.home-page .flow-lanes { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 8px; }
.home-page .flow-lanes span { padding: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; }
.home-page .flow-result { color: var(--accent); border-color: var(--accent-line); }
.home-page .pages #work .project-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.home-page .pages #work .project-grid .project-foot { margin-top: auto; padding-top: 24px; border: 0; gap: 24px; align-items: flex-start; }
.home-page .pages #work .project-grid .project-intro { margin-bottom: 24px; }
.home-page .pages #work .project-foot .foot-actions { width: 100%; margin-top: 0; display: flex; align-items: center; gap: 16px; justify-content: flex-end; }
.home-page .pages #work .link-out { display: inline-flex; align-items: center; min-height: 48px; font-size: 17px; color: var(--accent); }
.home-page .pages #work .link-out:hover { text-decoration: underline; text-underline-offset: 5px; }
.home-page #notes .section-head { margin-bottom: 32px; }
.home-page .notes-list { border: 0; border-top: 1px solid var(--line-2); counter-reset: note; }
.home-page .note-item {
  display: grid;
  grid-template-columns: 48px 140px minmax(0, 1fr) 24px;
  gap: 24px;
  padding: 24px 0;
  min-height: 90px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.home-page .note-item::before, .home-page .note-item:hover::before { position: static; width: auto; height: auto; transform: none; opacity: 1; background: none; counter-increment: note; content: counter(note, decimal-leading-zero); font: 600 15px var(--mono); color: var(--mute); }
.home-page .note-item::after { display: none; }
.home-page .note-item:hover { background: none; transform: none; padding-left: 0; }
.home-page .note-kicker { font-family: var(--sans); font-size: 15px; color: var(--mute); letter-spacing: 0; line-height: 1.6; }
.home-page .note-body { min-width: 0; }
.home-page .note-title { font-size: 21px; font-weight: 600; line-height: 1.75; color: var(--fg); }
.home-page .note-item:is(:hover, :focus-visible) .note-title { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.home-page .note-item:is(:hover, :focus-visible) { background: var(--accent-soft); }
.home-page .note-item:focus-visible { outline-offset: 4px; }
.home-page .note-arrow { font-size: 18px; color: var(--mute); transition: transform 150ms; }
.home-page .note-item:is(:hover, :focus-visible) .note-arrow { transform: translateX(3px); color: var(--accent); }
.home-page .note-item.is-off { display: none; }
.home-page .notes-pager { display: flex; justify-content: flex-start; margin-top: 32px; gap: 8px; }
.home-page .page-dot { width: 44px; height: 44px; border-radius: 4px; border: 1px solid var(--line-2); background: none; color: var(--mute); font: 600 16px var(--mono); transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }
.home-page .page-dot:not(.is-active):is(:hover, :focus-visible) { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.home-page .page-dot.is-active { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.home-page .stack-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 64px; }
.home-page .stack-card, .home-page .stack-card:hover { padding: 24px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.home-page .stack-card h3 { font-family: var(--sans); font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.home-page .stack-icon { width: auto; height: auto; margin-right: 8px; color: var(--mute); font: 600 15px var(--mono); border: 0; background: none; }
.home-page .stack-card dl { display: grid; grid-template-columns: 64px 1fr; gap: 16px 24px; }
.home-page .stack-card dt { font-size: 15px; color: var(--mute); line-height: 1.9; }
.home-page .stack-card dd { margin: 0; font-size: 18px; color: var(--dim); line-height: 1.8; }
.home-page .stack-foot { margin-top: 40px; font-size: 16px; color: var(--mute); line-height: 1.8; }
.home-page .pages #principles { background: color-mix(in srgb, var(--bg-alt) 65%, transparent); }
.home-page #principles > .wrap { display: block; }
.home-page .principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.home-page .principles li, .home-page .principles li:hover { display: grid; grid-template-columns: 32px 1fr; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: none; }
.home-page .p-num { color: var(--accent); font: 600 15px/2 var(--mono); }
.home-page .principles h3 { font-family: var(--sans); font-size: 22px; line-height: 1.6; font-weight: 700; }
.home-page .principles p { margin-top: 12px; font-size: 18px; line-height: 1.8; color: var(--dim); }
.home-page .contact-inner, .home-page .contact-inner:hover { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.home-page .contact-inner > p { max-width: 920px; margin-top: 32px; font-size: clamp(26px, 3vw, 40px); font-weight: 600; line-height: 1.75; color: var(--fg); letter-spacing: -.01em; }
.home-page .contact-inner .mo-w { color: var(--dim); }
.home-page .contact-inner .mo-w.is-on { color: var(--fg); }
.home-page .about-contact { margin-top: 32px; }
.home-page .about-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.home-page .about-facts li { display: flex; flex-direction: column; align-items: flex-start; padding: 0; gap: 8px; border: 0; }
.home-page .about-facts span { font-size: 15px; color: var(--mute); }
.home-page .about-facts :is(a, em) { font-size: 17px; color: var(--fg); font-family: var(--sans); font-style: normal; }
.home-page .about-facts a { min-height: 44px; display: inline-flex; align-items: center; margin-top: -8px; }
.home-page .site-footer { padding: 24px 0; border-top: 1px solid var(--line); background: none; }
.home-page .footer-inner { min-height: 44px; border: 0; box-shadow: none; font-size: 15px; color: var(--mute); }
.home-page .footer-note { font-size: 15px; }
.home-page .footer-note a { display: inline-flex; align-items: center; min-height: 44px; }
.home-page .project-dialog { border-radius: 20px; background: var(--bg); }
.home-page .dlg-head { padding: 24px 32px; background: var(--bg-alt); }
.home-page .dlg-head h2 { font-size: 34px; }
.home-page .dlg-close { width: 44px; height: 44px; top: 16px; right: 16px; border-radius: 4px; }
.home-page .dlg-body { padding: 32px; }
.home-page .dlg-section h3 { color: var(--fg); font-size: 18px; }
.home-page .dlg-item h4 { font-size: 19px; }
.home-page :is(.dlg-item p, .dlg-section > p, .qa-body p) { color: var(--dim); font-size: 18px; }
.home-page :is(.dlg-kicker, .dlg-sub, .dlg-footnote, .dlg-metrics span) { font-size: 15px; }
.home-page .dlg-metrics > div { background: var(--panel); }
.home-page .qa summary { font-size: 18px; }
.home-page code { color: var(--fg); background: var(--line); }
/* Each desktop work screen has its own meaningful page stop. */
@media (min-width: 901px) {
  .home-page .pages .page { padding-block: 32px; }
  .home-page .pages .hero { padding-block: 32px; gap: 32px; }
  .home-page .pages #work { padding-block: 0; }
  .home-page .work-screen {
    min-height: calc(100svh - var(--home-header-height));
    padding-block: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-margin-top: var(--home-header-height);
  }
  .home-page .work-continuation { display: block; }
  .home-page .section-head, .home-page .pages #work .section-head { margin-bottom: 24px; }
  .home-page .pages #work .project-grid { margin-top: 0; }
  .home-page .pages #work .project-featured { padding: 24px; gap: 32px; }
  .home-page .pages #work .project-aside { padding: 16px; gap: 12px; }
  .home-page .agent-flow > li + li::before { height: 10px; }
  .home-page .flow-node { padding-block: 6px; }
  .home-page .flow-context { padding-top: 12px; }
}
/* Keep the paper even inside the margin rules, then fade outward symmetrically. */
@media (min-width: 1024px) {
  .home-page::before,
  [data-theme="dark"] .home-page::before {
    --paper-margin: max(24px, calc((100vw - 1280px) / 2));
    background:
      linear-gradient(to right, var(--paper-light), transparent) left / var(--paper-margin) 100% no-repeat,
      linear-gradient(to left, var(--paper-light), transparent) right / var(--paper-margin) 100% no-repeat;
  }
  .home-page::after { opacity: .12; }
  [data-theme="dark"] .home-page::after { opacity: .08; }
  .home-page .pages #work, .home-page .pages #principles { background: transparent; }
  .home-page .pages > .page { isolation: isolate; }
  .home-page .pages > .page > .wrap { position: relative; z-index: 1; }
  .home-page .pages > .page::before {
    content: "";
    position: absolute;
    inset: 32px max(24px, calc((100% - 1280px) / 2));
    border-inline: 1px solid var(--paper-rule);
    mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
    pointer-events: none;
    z-index: 0;
  }
  .home-page .paper-chapter {
    display: block;
    position: absolute;
    top: 32px;
    right: max(56px, calc((100% - 1200px) / 2));
    color: var(--paper-mark);
    font: 400 clamp(104px, 9vw, 152px)/1 var(--serif);
    letter-spacing: -.06em;
    pointer-events: none;
    user-select: none;
    z-index: 0;
  }
  .home-page .paper-chapter::after {
    content: "";
    display: block;
    width: 48px;
    height: 1px;
    margin: 12px 0 0 auto;
    background: var(--paper-rule);
  }

}
@media (min-width: 1024px) and (max-height: 800px) {
  .home-page .pages .hero { padding-top: 24px; gap: 24px; }
  .home-page .pages .hero h1 { font-size: clamp(46px, 4.4vw, 64px); }
}
@media (min-width: 901px) and (max-height: 800px) {
  .home-page .pages .page, .home-page .work-screen { padding-block: 24px; }
  .home-page .pages #work { padding-block: 0; }
  .home-page .section-kicker, .home-page .pages #work .section-kicker { margin-bottom: 12px; }
  .home-page .note-item { padding-block: 16px; min-height: 80px; }
  .home-page #notes .section-head { margin-bottom: 24px; }
  .home-page .notes-pager { margin-top: 16px; }
  .home-page .stack-grid { gap: 20px 40px; }
  .home-page .stack-card { padding-top: 16px; }
  .home-page .stack-card h3 { margin-bottom: 16px; }
  .home-page .stack-card dl { gap: 8px 16px; }
  .home-page .stack-foot { margin-top: 24px; }
  .home-page .principles li { padding: 16px 24px; }
  .home-page .principles p { margin-top: 8px; }
}
@media (max-width: 1099px) {
  .home-page .wrap { width: calc(100% - 80px); }
  .home-page .hero-grid { gap: 40px; }
  .home-page .pages #work .project-featured { padding: 24px; gap: 24px; }
  .home-page #principles > .wrap { gap: 40px; }
  .home-page .note-item { grid-template-columns: 32px 104px minmax(0, 1fr) 20px; gap: 16px; }
}
@media (max-width: 900px) {
  .home-page { --home-header-height: 72px; }
  .home-page .wrap { width: calc(100% - 64px); }
  .home-page .pages .page { min-height: auto; padding-block: 80px; }
  .home-page .pages .hero { min-height: calc(100svh - 72px); padding-block: 56px 32px; gap: 40px; }
  .home-page .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .home-page .pages .hero h1 { font-size: clamp(46px, 6.4vw, 64px); }
  .home-page .hero-lead { max-width: 40em; margin-top: 24px; }
  .home-page .hero-note { display: none; }
  .home-page .terminal-body { padding: 20px 24px; }
  .home-page .t-json { font-size: 15px; }
  .home-page .nav { gap: 16px; }
  .home-page .nav a { font-size: 16px; }
  .home-page .brand-sub { display: none; }
  .home-page .pages #work .project-featured { grid-template-columns: 1.1fr 1fr; gap: 24px; }
  .home-page .pages #work .project-aside { padding: 20px; }
  .home-page .pages #work .project-card { padding: 24px; }
  .home-page .stack-grid { gap: 32px; }
  .home-page #principles > .wrap { grid-template-columns: 1fr; gap: 0; }
  .home-page .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .home-page .principles li, .home-page .principles li:first-child { padding: 24px; }
  .home-page .contact-inner > p { font-size: 30px; }
}
@media (max-width: 700px) {
  .home-page { --home-header-height: 68px; }
  .home-page { font-size: 16px; }
  .home-page .wrap { width: calc(100% - 48px); }
  .home-page .header-inner { gap: 16px; }
  .home-page .brand-mark { width: 32px; height: 32px; font-size: 21px; }
  .home-page .header-actions { gap: 8px; }
  .home-page .menu-btn { display: block; border-radius: 4px; }
  .home-page .nav {
    display: none;
    position: fixed;
    inset: var(--home-header-height) 0 0;
    width: 100%;
    height: calc(100dvh - var(--home-header-height));
    padding: 32px 24px;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    background: var(--bg);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    z-index: 50;
    overflow: auto;
  }
  .home-page.nav-open { overflow: hidden; }
  .home-page.nav-open .nav { display: flex; }
  .home-page .nav a { min-height: 60px; padding: 6px 0; font-family: var(--serif); font-size: 25px; border-bottom: 1px solid var(--line); }
  .home-page .nav a::after { display: none; }
  .home-page .pages .page, .home-page .pages #work { padding-block: 48px; }
  .home-page .pages .hero { min-height: calc(100svh - 68px); padding: 32px 0 28px; gap: 24px; }
  .home-page .hero-grid { gap: 24px; }
  .home-page .eyebrow { font-size: 15px; margin-bottom: 20px; }
  .home-page .pages .hero h1 { font-size: clamp(29px, 8vw, 34px); line-height: 1.35; letter-spacing: -.025em; }
  .home-page .hero-lead { font-size: 15px; line-height: 1.7; margin-top: 16px; }
  .home-page .hero-actions { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .home-page .hero-actions .btn { width: 100%; padding-inline: 8px; font-size: 16px; }
  .home-page .terminal { box-shadow: 6px 6px 0 var(--bg-alt); }
  .home-page .terminal-bar { min-height: 40px; padding-inline: 20px; }
  .home-page .terminal-body { padding: 16px 20px 20px; font-size: 15px; }
  .home-page .terminal-body > .t-gap, .home-page .t-json { display: none; }
  .home-page .terminal-body .t-out { margin: 4px 0 0; }
  .home-page .metrics-grid { gap: 16px; padding-top: 20px; }
  .home-page .metric-num { font-size: 24px; }
  .home-page .metric-num small { margin-left: 3px; font-size: 15px; }
  .home-page .metric-num .arrow { margin-inline: 3px; }
  .home-page .metric-range { font-size: 18px; padding-top: 6px; white-space: nowrap; }
  .home-page .metric-range .arrow { margin-inline: 1px; }
  .home-page .metric-range small { font-size: 12px; margin-left: 1px; }
  .home-page .metric-label { font-size: 15px; line-height: 1.6; }
  .home-page .section-head { margin-bottom: 24px; }
  .home-page .section-kicker { margin-bottom: 12px; }
  .home-page h2 { font-size: 26px; }
  .home-page .pages #work .project-featured { grid-template-columns: 1fr; padding: 24px; gap: 32px; }
  .home-page .pages #work .project-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
  .home-page .pages #work .project-card h3 { font-size: 25px; }
  .home-page .pages #work .project-intro { font-size: 16px; line-height: 1.8; }
  .home-page .pages #work .project-meta { margin-bottom: 20px; gap: 8px 12px; }
  .home-page .pages #work .project-aside { padding: 24px 16px; }
  .home-page .note-item { grid-template-columns: 24px minmax(0, 1fr) 20px; gap: 8px 12px; padding-block: 20px; }
  .home-page .note-item::before { grid-row: 1 / 3; }
  .home-page .note-kicker { grid-column: 2; }
  .home-page .note-body { grid-column: 2; }
  .home-page .note-arrow { grid-column: 3; grid-row: 1 / 3; }
  .home-page .note-title { font-size: 17px; line-height: 1.65; }
  .home-page .section-note { font-size: 16px; line-height: 1.75; }
  .home-page .principles h3 { font-size: 18px; }
  .home-page .principles p { margin-top: 8px; font-size: 15px; line-height: 1.7; }
  .home-page .stack-grid, .home-page .principles { grid-template-columns: 1fr; gap: 20px; }
  .home-page .stack-card h3 { margin-bottom: 16px; font-size: 19px; }
  .home-page .stack-card dl { grid-template-columns: 52px 1fr; gap: 10px 12px; }
  .home-page .stack-card dt { font-size: 14px; line-height: 1.7; }
  .home-page .stack-card dd { font-size: 15px; line-height: 1.7; }
  .home-page .principles li, .home-page .principles li:first-child { padding: 20px; gap: 12px; }
  .home-page .contact-inner > p { margin-top: 24px; font-size: 18px; line-height: 1.7; }
  .home-page .about-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 48px; }
  .home-page .site-footer { padding: 20px 0; }
  .home-page .footer-inner { align-items: flex-start; gap: 4px; }
  .home-page .footer-note a { margin-top: -8px; }
  .home-page .dlg-head, .home-page .dlg-body { padding: 24px; }
  .home-page .dlg-head h2 { font-size: 26px; }
}
@media (max-width: 359px) {
  .home-page .wrap { width: calc(100% - 40px); }
  .home-page .metrics-grid { gap: 8px; }
  .home-page .metric-num { font-size: 21px; }
  .home-page .metric-range { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home-page .pages [data-reveal].reveal-pending { opacity: 1; translate: 0 0; scale: 1; }
  .home-page *, .home-page *::before, .home-page *::after { animation: none !important; transition: none !important; }
}

/* Project showcase: a calm, paper-toned interpretation of the reference site's phase card. */
.project-showcase { padding-top: 72px; padding-bottom: 88px; }
.project-showcase .showcase-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.project-showcase .showcase-head h2 { margin-top: 10px; }
.showcase-status { display: grid; gap: 5px; min-width: 140px; color: var(--accent); font: 600 13px/1.5 var(--mono); text-align: right; }
.showcase-layout { display: grid; grid-template-columns: 400px minmax(0, 760px); gap: 64px; align-items: stretch; justify-content: center; }
.project-orbit-panel { display: grid; align-content: center; min-width: 0; }
.project-compass { --compass-radius: 145px; position: relative; width: 400px; aspect-ratio: 1; margin: 0 auto; color: var(--accent); isolation: isolate; }
.compass-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.compass-scale { transform-origin: 140px 140px; animation: compass-scale-turn 60s linear infinite; }
@keyframes compass-scale-turn { to { transform: rotate(360deg); } }
.project-compass::before { content: ""; position: absolute; inset: 23%; border: 1px solid var(--accent-line); border-radius: 50%; opacity: .45; animation: compass-glow 4.8s ease-in-out infinite; pointer-events: none; }
@keyframes compass-glow { 0%,100% { transform: scale(.94); opacity: .18; } 50% { transform: scale(1.04); opacity: .5; } }
.compass-notch-ring { position: absolute; inset: 0; transform: rotate(var(--compass-angle, 0deg)); transition: transform .8s cubic-bezier(.2,0,0,1); }
.compass-notch { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 108px; min-height: 58px; padding: 0; border: 0; background: transparent; color: var(--dim); cursor: pointer; transform: translate(-50%, -50%) rotate(var(--notch-angle)) translateX(var(--compass-radius)); transform-origin: center; transition: color .25s ease; }
.compass-notch-content { display: grid; place-content: center; justify-items: center; gap: 5px; width: 108px; min-height: 58px; border: 1px solid transparent; border-radius: 3px; background: var(--bg); transform: rotate(calc(var(--compass-return, 0deg) - var(--notch-angle))); transition: transform .8s cubic-bezier(.2,0,0,1), border-color .25s ease, background-color .25s ease; }
.compass-notch b { color: var(--accent); font: 500 13px/1.3 var(--mono); }
.compass-notch strong { color: inherit; font: 600 14px/1.4 var(--sans); white-space: nowrap; }
.compass-notch:hover { color: var(--accent); }
.compass-notch:focus-visible { outline: none; }
.compass-notch:hover .compass-notch-content, .compass-notch:focus-visible .compass-notch-content { border-color: var(--accent); }
.compass-notch:focus-visible .compass-notch-content { outline: 2px solid var(--accent); outline-offset: 3px; }
.compass-notch.is-active { color: var(--accent); }
.compass-notch.is-active .compass-notch-content { border-color: var(--accent-line); background: color-mix(in srgb, var(--bg) 85%, var(--accent)); }
.compass-core { position: absolute; inset: 33%; display: grid; place-content: center; justify-items: center; border: 1px solid var(--line-2); border-radius: 50%; background: color-mix(in srgb, var(--panel) 68%, transparent); text-align: center; box-shadow: 0 0 0 10px color-mix(in srgb, var(--panel) 28%, transparent); pointer-events: none; }
.compass-core span { color: var(--mute); font: 600 10px/1.4 var(--mono); letter-spacing: .14em; }
.compass-core strong { margin-top: 3px; color: var(--fg); font: 600 42px/.95 var(--mono); letter-spacing: -.08em; text-shadow: 0 0 18px var(--accent-soft); }
.compass-core b { max-width: 90px; margin-top: 8px; overflow: hidden; color: var(--accent); font: 600 11px/1.3 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.compass-signal { position: absolute; top: 50%; right: -64px; width: 64px; height: 1px; background: var(--accent); box-shadow: 0 0 12px 3px var(--accent-soft); pointer-events: none; }
.compass-signal::before { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border: 1px solid var(--accent); border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 4px var(--accent-soft); }
.compass-signal::after { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border: 1px solid var(--accent); border-radius: 50%; animation: compass-signal 2.4s ease-out infinite; }
@keyframes compass-signal { from { transform: scale(.8); opacity: .8; } to { transform: scale(3); opacity: 0; } }
.project-rail { display: grid; align-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.project-tab { display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 12px; width: 100%; min-height: 76px; padding: 14px 16px; border: 1px solid transparent; border-left: 2px solid var(--line-2); background: transparent; color: var(--mute); text-align: left; cursor: pointer; transition: border-color .22s ease, background-color .22s ease, color .22s ease, transform .22s ease; }
.project-tab span { grid-row: 1 / 3; align-self: start; color: var(--accent); font: 600 14px/1.4 var(--mono); }
.project-tab strong { color: inherit; font: 600 16px/1.35 var(--sans); }
.project-tab small { color: inherit; font: 13px/1.45 var(--sans); opacity: .75; }
.project-tab:hover, .project-tab:focus-visible { border-color: var(--accent-line); background: var(--accent-soft); color: var(--fg); transform: translateX(3px); }
.project-tab.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 68%, transparent); color: var(--fg); box-shadow: inset 3px 0 0 var(--accent); }
.project-stage { position: relative; min-width: 0; min-height: 500px; padding: 34px 36px 24px; border: 1px solid var(--line); border-radius: 4px; background: color-mix(in srgb, var(--panel) 78%, transparent); box-shadow: 14px 14px 0 color-mix(in srgb, var(--bg-alt) 72%, transparent); outline: 0; overflow: hidden; }
.project-stage::before, .project-stage::after { content: ""; position: absolute; width: 22px; height: 22px; border-color: var(--accent); pointer-events: none; }
.project-stage::before { inset: -1px auto auto -1px; border-top: 2px solid; border-left: 2px solid; }
.project-stage::after { inset: auto -1px -1px auto; border-right: 2px solid; border-bottom: 2px solid; }
.project-stage:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft), 14px 14px 0 color-mix(in srgb, var(--bg-alt) 72%, transparent); }
.project-slide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(205px, .72fr); gap: 28px; min-height: 400px; animation: project-slide-in .38s ease both; }
.project-slide[hidden] { display: none; }
@keyframes project-slide-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.project-slide-copy { display: flex; flex-direction: column; min-width: 0; }
.project-slide .project-meta { margin-bottom: 26px; }
.project-slide h3 { font-size: clamp(36px, 5vw, 64px); letter-spacing: -.04em; }
.project-slide .project-sub { margin-top: 7px; color: var(--accent); font: 600 15px/1.5 var(--mono); }
.project-slide .project-intro { max-width: 24em; margin-top: 30px; color: var(--dim); font-size: 20px; line-height: 1.75; }
.project-slide .project-points { display: grid; gap: 10px; max-width: 700px; margin: 28px 0 0; padding: 0; list-style: none; }
.project-slide .project-points li { position: relative; padding-left: 22px; color: var(--dim); font-size: 15px; line-height: 1.7; }
.project-slide .project-points li::before { content: ""; position: absolute; top: .7em; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.project-slide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: auto; padding-top: 32px; }
.project-slide-actions .btn, .project-slide-actions .link-out { min-height: 44px; }
.project-slide-aside { align-self: center; padding: 22px; border-top: 2px solid var(--accent); background: color-mix(in srgb, var(--panel-2) 74%, transparent); }
.slide-aside-kicker { display: block; margin-bottom: 18px; color: var(--accent); font: 600 12px/1.5 var(--mono); letter-spacing: .12em; }
.project-slide-aside strong { display: block; color: var(--fg); font: 600 20px/1.45 var(--serif); }
.project-slide-aside p { margin: 18px 0 0; color: var(--mute); font-size: 14px; line-height: 1.8; }
.slide-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 24px; color: var(--fg); font: 600 13px/1.5 var(--mono); }
.slide-flow i { color: var(--accent); font-style: normal; }
.slide-stat { display: grid; gap: 5px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.slide-stat b { color: var(--accent); font: 600 clamp(24px, 3vw, 38px)/1.2 var(--mono); letter-spacing: -.04em; }
.slide-stat span { color: var(--mute); font-size: 13px; line-height: 1.6; }
.project-dots { display: flex; gap: 10px; margin: 24px 0 0; justify-content: center; pointer-events: none; }
.project-dot { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; pointer-events: auto; cursor: pointer; }
.project-dot::before { content: ""; display: block; width: 10px; height: 10px; border: 1px solid var(--line-2); border-radius: 50%; background: transparent; transition: width .2s ease, border-color .2s ease, background-color .2s ease; }
.project-dot:is(:hover, :focus-visible)::before { border-color: var(--accent); }
.project-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.project-dot.is-active::before { width: 28px; border-radius: 99px; border-color: var(--accent); background: var(--accent); }
[data-theme="dark"] .project-stage { background: color-mix(in srgb, var(--panel) 86%, transparent); }
[data-theme="dark"] .project-stage { box-shadow: 14px 14px 0 rgba(0,0,0,.18); }
@media (prefers-reduced-motion: reduce) {
  .project-slide { animation: none; }
  .project-tab, .project-dot { transition: none; }
}
@media (max-width: 900px) {
  .project-showcase .showcase-head { align-items: start; }
  .showcase-layout { grid-template-columns: 1fr; }
  .project-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: stretch; }
  .project-tab { min-height: 68px; padding: 12px; }
  .project-stage { min-height: 0; }
  .project-slide { grid-template-columns: 1fr; gap: 28px; min-height: 0; }
  .project-slide-aside { align-self: stretch; }
  .compass-signal { right: -15px; width: 15px; }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .showcase-layout { grid-template-columns: 340px minmax(0, 1fr); gap: 44px; }
  .project-compass { --compass-radius: 124px; width: 340px; }
  .compass-signal { right: -44px; width: 44px; }
  .project-slide { grid-template-columns: 1fr; gap: 24px; }
  .project-slide-aside { align-self: stretch; }
}
@media (max-width: 900px) {
  .project-compass { --compass-radius: 100px; width: 300px; }
  .compass-notch, .compass-notch-content { width: 100px; }
  .compass-notch strong { font-size: 13px; }
}
@media (max-width: 359px) {
  .project-compass { --compass-radius: 90px; width: 270px; }
  .compass-notch, .compass-notch-content { width: 90px; min-height: 48px; }
  .compass-notch strong { font-size: 12px; }
  .compass-core b { font-size: 10px; }
  .compass-core strong { font-size: 34px; }
  .compass-signal { right: -5px; width: 10px; }
}
@media (max-width: 700px) {
  .project-showcase { padding-top: 48px; padding-bottom: 64px; }
  .project-showcase .showcase-head { display: block; margin-bottom: 24px; }
  .showcase-status { display: flex; justify-content: space-between; margin-top: 18px; text-align: left; }
  .project-rail { gap: 8px; }
  .project-tab { grid-template-columns: 30px minmax(0, 1fr); gap: 2px 8px; min-height: 68px; padding: 10px 8px; }
  .project-tab strong { font-size: 14px; }
  .project-tab small { font-size: 11px; }
  .project-stage { padding: 24px 20px 20px; box-shadow: 7px 7px 0 color-mix(in srgb, var(--bg-alt) 72%, transparent); }
  .project-slide h3 { font-size: 30px; }
  .project-slide .project-meta { gap: 7px; margin-bottom: 20px; }
  .project-slide .project-intro { margin-top: 16px; font-size: 15px; line-height: 1.7; }
  .project-slide .project-points { margin-top: 20px; }
  .project-slide-aside { padding: 18px; }
  .project-dots { margin-top: 24px; }
}
