:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  --bg: #F3EFE6;
  --surface: #FFFDF8;
  --surface-soft: #E3ECEB;
  --surface-accent: #DDEDEE;
  --text: #1F2A2D;
  --muted: #566367;
  --border: #BFCBCD;
  --link: #23666C;
  --primary: #C27742;
  --primary-text: #151B1D;
  --focus: #0B6E7C;
  --code-bg: #E9E5DC;
  --pre-bg: #172326;
  --pre-text: #F3EFE6;
  --browser-theme-color: #E3ECEB;
}
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1719;
    --surface: #182427;
    --surface-soft: #142B2F;
    --surface-accent: #173338;
    --text: #F3EFE6;
    --muted: #C4CED0;
    --border: #466064;
    --link: #8CD7DD;
    --primary: #D8905D;
    --primary-text: #101719;
    --focus: #78D7DF;
    --code-bg: #263639;
    --pre-bg: #091012;
    --pre-text: #F3EFE6;
    --browser-theme-color: #142B2F;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1719;
  --surface: #182427;
  --surface-soft: #142B2F;
  --surface-accent: #173338;
  --text: #F3EFE6;
  --muted: #C4CED0;
  --border: #466064;
  --link: #8CD7DD;
  --primary: #D8905D;
  --primary-text: #101719;
  --focus: #78D7DF;
  --code-bg: #263639;
  --pre-bg: #091012;
  --pre-text: #F3EFE6;
  --browser-theme-color: #142B2F;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); }
img { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: .09em; text-underline-offset: .16em; }
a:hover { text-decoration-thickness: .13em; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
.shell { width: min(1120px, 100%); margin-inline: auto; padding-inline: 24px; }
.skip-link {
  position: fixed; z-index: 1000; left: 12px; top: 12px; transform: translateY(-180%);
  background: var(--surface); color: var(--text); border: 2px solid var(--focus);
  border-radius: 8px; padding: 10px 14px; font-weight: 750;
}
.skip-link:focus { transform: translateY(0); }

.site-header { background: var(--surface-soft); border-bottom: 1px solid var(--border); }
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 16px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; }
.brand-word { font-size: 1.15rem; font-weight: 820; letter-spacing: -.025em; }
.nav-cluster { display: flex; align-items: center; justify-content: flex-end; gap: 14px 20px; flex-wrap: wrap; }
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 680; padding: 10px 8px; min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a[aria-current="page"], .brand[aria-current="page"] {
  text-decoration: underline; text-decoration-thickness: .14em; text-underline-offset: .28em;
}

.theme-control { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-size: .9rem; font-weight: 650; }
.theme-control select { min-height: 44px; padding: 7px 30px 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.theme-control.theme-segmented { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.theme-options { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.theme-option { position: relative; display: inline-flex; width: 44px; height: 44px; cursor: pointer; }
.theme-option input { position: absolute; inset: 0; width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
.theme-option-face { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid transparent; border-radius: 8px; color: var(--text); background: transparent; pointer-events: none; }
.theme-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-option:hover .theme-option-face { background: var(--surface-accent); }
.theme-option input:checked + .theme-option-face { border-width: 2px; border-color: currentColor; box-shadow: inset 0 -3px 0 currentColor; background: var(--surface-accent); }
.theme-option input:focus-visible + .theme-option-face { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-tooltip { position: absolute; z-index: 30; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); padding: 5px 8px; border-radius: 6px; background: var(--pre-bg); color: var(--pre-text); font-size: .76rem; font-weight: 700; line-height: 1.2; white-space: nowrap; opacity: 0; visibility: hidden; pointer-events: none; }
.theme-option:hover .theme-tooltip, .theme-option:focus-within .theme-tooltip { opacity: 1; visibility: visible; }

.main, main.shell { padding-block: 42px 72px; }
main:focus { outline: none; }
h1 { font-size: clamp(2.6rem, 7vw, 5.3rem); line-height: .96; margin: .18em 0 .35em; letter-spacing: -.045em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.65rem); line-height: 1.08; letter-spacing: -.025em; margin: .25em 0 .6em; }
h3 { font-size: 1.2rem; margin: 0 0 .45em; }
p { max-width: 72ch; }
.lede { font-size: clamp(1.05rem, 2vw, 1.22rem); max-width: 66ch; }
.quiet { color: var(--muted); }
.eyebrow { color: #2E6C71; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; font-size: .76rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: #86D4DA; } }
:root[data-theme="dark"] .eyebrow { color: #86D4DA; }

.hero { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); gap: 56px; align-items: center; padding-block: 58px 72px; }
.hero-structure { position: relative; min-height: 330px; border-radius: 28px; overflow: hidden; background: linear-gradient(145deg, var(--surface-soft), var(--surface-accent)); border: 1px solid var(--border); }
.beam { position: absolute; display: block; height: 34px; background: var(--primary); border-radius: 10px; transform-origin: center; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); }
.beam-a { width: 58%; left: 10%; top: 25%; transform: rotate(29deg); }
.beam-b { width: 62%; right: 8%; top: 48%; transform: rotate(-26deg); background: #2E7D83; }
.beam-c { width: 48%; left: 26%; bottom: 18%; transform: rotate(17deg); background: #566367; }
.joint { position: absolute; width: 54px; height: 54px; border: 9px solid var(--surface); background: var(--text); border-radius: 50%; box-shadow: 0 0 0 1px var(--border); }
.joint-a { left: 44%; top: 30%; }
.joint-b { right: 29%; top: 49%; }
.joint-c { left: 38%; bottom: 13%; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--border); border-radius: 9px; padding: 10px 15px; text-decoration: none; font-weight: 740; background: var(--surface); color: var(--text); }
.button.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.external-link-indicator { display: inline-block; margin-left: .22em; font-size: .84em; font-weight: 800; line-height: 1; }

.section { margin-top: 48px; scroll-margin-top: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 18px; }
.section-heading > .quiet { max-width: 48ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.project-card { display: flex; flex-direction: column; min-height: 230px; }
.project-card p { flex: 1 1 auto; }
.project-family { color: var(--muted); font-size: .78rem; font-weight: 780; letter-spacing: .065em; text-transform: uppercase; margin-bottom: 8px; }
.card-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.card-actions a { font-weight: 700; }

.repo-browser { margin-top: 22px; background: var(--surface-accent); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.repo-browser-heading { display: flex; gap: 18px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.repo-list:empty { display: none; }
.repo-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 12px; margin-top: 14px; }
.repo-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.repo-item h4 { margin: 0 0 8px; font-size: 1rem; }
.repo-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }
.fallback { margin-bottom: 0; }

.split { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); gap: 50px; align-items: start; }
.prose { max-width: 850px; }
.prose h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
.prose li + li { margin-top: .55em; }

.site-footer { border-top: 1px solid var(--border); padding-block: 24px 40px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; }
.footer-row a { color: var(--link); }
.footer-actions { display: flex; justify-content: flex-end; align-items: flex-start; gap: 12px 18px; flex-wrap: wrap; }
.accessibility-disclosure { max-width: 36ch; }
.accessibility-disclosure summary { cursor: pointer; color: var(--link); text-decoration: underline; text-decoration-thickness: .09em; text-underline-offset: .16em; }
.accessibility-disclosure p { margin: .55em 0 0; color: var(--muted); }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 760px) {
  .site-nav { align-items: flex-start; flex-direction: column; }
  .nav-cluster { width: 100%; justify-content: flex-start; }
  .nav-links { width: 100%; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 34px; }
  .hero-structure { min-height: 230px; order: -1; }
  .section-heading, .split { display: block; }
  .section-heading > .quiet { margin-top: 4px; }
}
@media (max-width: 420px) {
  .shell { padding-inline: 16px; }
  h1, .prose h1 { font-size: 2.2rem; }
  .nav-links a { padding-inline: 6px; }
  .theme-control { width: 100%; justify-content: space-between; }
  .theme-control select { flex: 1 1 auto; }
  .theme-control.theme-segmented { width: auto; justify-content: flex-start; }
  .hero-structure { min-height: 190px; }
  .footer-actions { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (forced-colors: active) {
  .button, .theme-control select, .theme-options, .theme-option-face, .card, .repo-browser, .repo-item, .hero-structure { border-color: CanvasText; }
  .theme-option input:checked + .theme-option-face { border: 2px solid CanvasText; box-shadow: inset 0 -3px 0 CanvasText; }
  .theme-option input:focus-visible + .theme-option-face { outline-color: Highlight; }
  .external-link-indicator, .theme-icon { forced-color-adjust: auto; }
  .beam, .joint { forced-color-adjust: none; }
}
