/* Responsive layout and motion; all colors use the Paper tokens. */
html { color-scheme: light; scroll-padding-top: 24px; }
body { background-image: none; font-family: var(--sans); font-size: 14px; }
::selection { background: var(--text-hi); color: var(--bg); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 5px; }
a { transition: color .2s, background .2s, border-color .2s; }
.nav { min-height: 80px; height: auto; background: var(--bg1); }
.nav .brand { font: 700 20px/1 var(--sans); letter-spacing: -.04em; }
.brand img { background: none; padding: 0; border-radius: 0; }
.nav-links { align-self: stretch; gap: 0; }
.nav-links a { display: grid; place-items: center; padding: 0 24px; border-left: 1px solid var(--rule); }
.nav-links a:last-child { border-right: 1px solid var(--rule); }
.nav a, .foot, .subnav { font-family: var(--mono); }
.nav-links a:hover { background: var(--bg1); }
.btn, .lang { border-radius: 0; font: 11px/1.6 var(--mono); }
.btn { padding: 12px 18px; border: 1px solid var(--border2); }
.btn-p { background: var(--accent); color: var(--on-accent) !important; box-shadow: none; }
.btn-s { background: var(--bg1); border-color: var(--border2); }
.btn:hover { opacity: 1; background: var(--bg1); border-color: var(--border2); }
.btn-p:hover { background: var(--text2); color: var(--on-accent) !important; }
.btn:hover, .lang:hover { box-shadow: 2px 2px 0 var(--text-hi); }
.subnav { padding-block: 12px; gap: 7px; background: var(--bg1); }
.subnav a, .subnav a:first-child { padding: 6px 11px; border: 1px solid var(--border2); background: var(--bg1); }
.subnav a:hover, .subnav a:focus-visible { background: var(--bg1); border-color: var(--border2); box-shadow: none; }
.subnav b { color: var(--text); }
.hero { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 660px; padding: 80px 22px; overflow: clip; }
.hero-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.hero-rail { position: absolute; top: 0; bottom: 0; width: 26px; z-index: -1; background: var(--bg1); border-inline: 1px solid var(--border2); }
.rail-left { left: 9%; } .rail-right { right: 9%; }
.hero-frame { position: relative; width: 100%; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 26px; padding: 44px; border: 1px solid var(--border2); background: var(--bg); box-shadow: 6px 6px 0 var(--bg3); }
.hero-frame::before, .hero-frame::after, .mod::before, .mod::after { content: ''; position: absolute; width: 7px; height: 7px; pointer-events: none; }
.hero-frame::before, .mod::before { top: 5px; left: 5px; border-top: 1px solid var(--border2); border-left: 1px solid var(--border2); }
.hero-frame::after, .mod::after { right: 5px; bottom: 5px; border-right: 1px solid var(--border2); border-bottom: 1px solid var(--border2); }
.hero h1 { font: 400 clamp(46px, 5.5vw, 80px)/1.15 var(--mono); letter-spacing: -.07em; }
.hero h1 em { color: var(--ink); }
.kick { font: 10px/1.6 var(--mono); color: var(--dim); margin-bottom: 24px; }
.hero .sub { font: 14px/1.85 var(--mono); }
.hero .fine { line-height: 1.8; max-width: 70ch; }
.hero .fine a { color: var(--text); text-underline-offset: 3px; }
.hero-emblem { min-width: 0; padding: 16px; border: 1px solid var(--border2); background: var(--bg); }
.cronopus-object { display: block; width: 100%; height: 270px; }
.emblem-label { display: block; text-align: center; font: 9px/1.6 var(--mono); letter-spacing: .08em; color: var(--dim); padding-top: 16px; border-top: 1px solid var(--rule); }
.figure { border: 1px solid var(--border2); background: var(--bg1); }
.wrap-main > .figure { margin: 36px 0; box-shadow: none; }
.figcap { padding: 12px 16px; font-family: var(--mono); background: var(--bg1); color: var(--text); }
.sect { border-top: 1px solid var(--rule); }
.item { padding-block: 26px; }
.item h3 { font-size: 17px; font-weight: 400; }
.item p, .card p { font-size: 13px; }
.num, .stitle, .chk, .card b s { font-family: var(--mono); }
.spane { padding: 28px; background: var(--bg1); }
.card { padding: 16px 0; }
.card b { font-size: 13px; font-weight: 400; }
.modules, .dl { padding-block: 64px; }
.modules h2, .dl h2 { font: 400 clamp(28px, 3vw, 40px)/1.2 var(--mono); letter-spacing: -.05em; margin-bottom: 16px; }
.modules > .sub, .dl > .sub { font-size: 14px; max-width: 80ch; line-height: 1.8; }
.mgrid { display: grid; gap: 24px; border-top: 0; }
.mod { position: relative; padding: 28px; gap: 0 32px; border: 1px solid var(--border2); background: var(--bg); box-shadow: none; transition: border-color .2s; }
.mod:hover { border-color: var(--border2); }
.mod-h h3 { font: 400 26px/1.2 var(--mono); letter-spacing: -.06em; }
.mod .mk { font-family: var(--mono); }
.mod-lead { font-size: 14px; color: var(--text); }
.mod-row { grid-template-columns: 116px minmax(0, 1fr); }
.mod-row dt { font: 10px/1.8 var(--mono); color: var(--text); }
.mod-row dd { font-size: 12px; color: var(--dim); }
.mod-more, .mod-nodoc { font-family: var(--mono); }
.mod .figure { align-self: center; }
.preview-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-top: 1px solid var(--rule); }
.preview-tabs button { cursor: pointer; font: 11px/1.5 var(--mono); padding: 6px 9px; background: var(--bg); color: var(--text2); border: 1px solid var(--border2); }
.preview-tabs button:hover { border-color: var(--text); color: var(--text); }
.preview-tabs button[aria-pressed="true"] { background: var(--text-hi); border-color: var(--text-hi); color: var(--bg); }
.preview-note { padding: 0 10px 10px; font: 10px/1.6 var(--mono); color: var(--text2); }
.mod:target { background: var(--bg1); animation: none; border-color: var(--mint); }
.dlgrid { gap: 18px; border: 0; }
.dlc, .dlc:last-child { position: relative; padding: 24px; border: 1px solid var(--border2); background: var(--bg); }
.dlc .t { font: 14px/1.6 var(--mono); }
.dlc .m { font-size: 12px; min-height: 42px; color: var(--dim); }
.dlmore h3, .dlnote h3 { font-family: var(--mono); font-size: 14px; }
.dlmore li, .dlnote p { font-size: 13px; }
.foot { padding-top: 30px; padding-bottom: 0; border-top: 1px solid var(--rule); background: var(--bg1); }
.footer-mark { position: relative; flex-basis: 100%; max-width: 440px; height: 160px; margin: 22px auto 32px; }
.footer-mark { height: auto; }
.footer-mark > img { display: block; width: 100%; height: auto; }
.footer-mark canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.footer-fallback { display: grid; place-items: center; position: absolute; inset: 0; font: 700 120px/1 var(--sans); letter-spacing: -.08em; color: var(--text3); }
.ascii-ready .footer-fallback { visibility: hidden; }
.docs { background: var(--bg); }
.docs-nav, .docs-toc { font-family: var(--mono); background: var(--bg1); }
.docs-search input { background: var(--bg1); border-color: var(--border2); border-radius: 0; }
.docs-search input::placeholder { color: var(--text3); opacity: 1; }
.docs-nav li a { padding-block: 6px; }
.docs-nav li a.on { background: var(--bg1); padding-left: 8px; border-left: 2px solid var(--mint); }
.md-body { max-width: 84ch; overflow-wrap: anywhere; }
.md-body a { text-decoration: underline; text-underline-offset: 3px; }
.md-body h1 { font-family: var(--mono); font-size: clamp(25px, 3vw, 40px); letter-spacing: -.05em; }
.md-body h2 { font-size: 22px; margin-top: 40px; }
.md-body h3 { font-size: 17px; }
.md-body code { background: var(--bg1); color: var(--text); }
.md-body pre, .dlnote pre, .dlmore pre { background: var(--bg1); border-color: var(--border2); }
.md-body pre code { background: none; }
.md-body th { border-color: var(--border2); color: var(--text); }
.kinetic { position: relative; display: inline-block; vertical-align: bottom; max-width: 100%; }
.kinetic-source { opacity: 0; }
.kinetic-output { position: absolute; inset: 0; font: inherit; letter-spacing: inherit; overflow-wrap: inherit; }
.ascii-motion { animation: ascii-drift 18s ease-in-out infinite alternate; will-change: transform; }
@keyframes ascii-drift {
  from { transform: scale(1.12) translate3d(calc(-1.5% + var(--ascii-x, 0px)), calc(-1% + var(--ascii-y, 0px)), 0); }
  to { transform: scale(1.12) translate3d(calc(1.5% + var(--ascii-x, 0px)), calc(1% + var(--ascii-y, 0px)), 0); }
}
@media (max-width: 1100px) {
  .nav { gap: 14px; }
  .nav-links a { padding-inline: 14px; }
  .nav-gh { display: none; }
  .hero-frame { padding: 32px; gap: 20px; }
  .cronopus-object { height: 230px; }
}
@media (max-width: 900px) {
  .mod { padding: 22px; }
  .mod-row { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 860px) {
  .nav { min-height: 72px; }
  .nav-links { order: 3; width: 100%; border-top: 1px solid var(--rule); }
  .nav-links a { flex: 1; padding: 12px 8px; font-size: 10px; }
  .subnav { padding-block: 12px; gap: 6px; }
  .subnav a { font-size: 10px; padding: 5px 8px; }
  .hero { padding: 44px 12px; min-height: 0; }
  .hero-frame { grid-template-columns: 1fr; padding: 28px 22px; gap: 28px; }
  .hero h1 { font-size: clamp(38px, 8vw, 60px); }
  .hero .sub { font-size: 12px; }
  .hero-emblem { max-width: 360px; width: 100%; justify-self: center; padding: 12px; }
  .cronopus-object { height: 170px; }
  .hero-rail { width: 16px; }
  .rail-left { left: 20px; } .rail-right { right: 20px; }
  .sect .spane { padding: 24px 16px; }
  .modules, .dl { padding-block: 44px; }
  .dlgrid { grid-template-columns: 1fr; }
  .dlc .m { min-height: 0; }
  .docs-main { padding-inline: 22px; }
}
@media (max-width: 420px) {
  .nav { gap: 10px; }
  .nav .brand { font-size: 18px; }
  .nav > .btn { padding: 8px 10px; font-size: 10px; }
  .hero { padding-inline: 8px; }
  .hero-frame { padding-inline: 18px; }
  .hero .cta { flex-direction: column; align-items: stretch; }
  .hero .btn { text-align: center; }
  .mod { padding: 20px 16px; }
  .mod-h { flex-wrap: wrap; }
  .figbody { padding: 0; }
  .foot { gap: 14px; }
  .footer-mark { flex: 0 0 100%; height: auto; max-width: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  html { color-scheme: light; }
  body, .docs { background: var(--text); color: var(--text); }
  .md-body p, .md-body li { color: var(--text); }
  .hero-field, .hero-rail, .hero-emblem { display: none; }
}
