@font-face {
  font-family: 'Mona Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/mona-sans-condensed-latin.be7ce15f.woff2') format('woff2');
}
@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/geologica-latin.0df4fc8d.woff2') format('woff2');
}
@font-face {
  font-family: 'Azeret Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/azeret-mono-latin.20cbb538.woff2') format('woff2');
}

:root {
  --field: #F3E0B6;
  --field-deep: #EBD4A2;
  --card: #FFFFFF;
  --ink: #1C2133;
  --ink-soft: #4B4A52;
  --pen-gas: #A8261E;
  --pen-electric: #1F4FA8;
  --rule: #C9AE74;
  --tick: rgba(28, 33, 51, .09);
  --display: 'Mona Sans', 'Arial Narrow', sans-serif;
  --text: 'Geologica', system-ui, sans-serif;
  --mono: 'Azeret Mono', ui-monospace, monospace;
  --gutter: clamp(1rem, 4vw, 3rem);
  --offset: clamp(0rem, 14vw - 4rem, 11rem);
  --measure: 40rem;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

[data-channel="gas"] { --pen: var(--pen-gas); }
[data-channel="electric"] { --pen: var(--pen-electric); }
[data-channel="duo"] { --pen: var(--pen-gas); --pen-2: var(--pen-electric); }
[data-channel="ink"] { --pen: var(--ink); }

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; scrollbar-color: var(--ink-soft) var(--field-deep); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  overflow-x: clip;
  caret-color: var(--pen-gas);
}
::selection { background: var(--ink); color: var(--field); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--pen-electric); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); text-wrap: balance; }
p { text-wrap: pretty; }
strong { font-weight: 650; }
em, i { font-style: normal; }

.skip { position: absolute; left: -999px; top: .75rem; z-index: 10; padding: .6rem 1rem; background: var(--ink); color: var(--field); }
.skip:focus { left: 1rem; }

.icon { width: 1.1em; height: 1.1em; flex: none; }

.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font: 700 1.05rem/1 var(--display); min-height: 2.75rem; }
.brand .mark { width: 1.75rem; height: 1.75rem; color: var(--pen-gas); }
.brand-name { overflow-wrap: anywhere; }
.tld { color: var(--ink-soft); font-weight: 500; }
.langs ul { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.langs a {
  display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem;
  font: 500 .78rem/1 var(--mono); letter-spacing: .04em; text-decoration: none;
  border: 1px solid transparent;
}
.langs a:hover { border-color: var(--rule); }
.langs a[aria-current] { border-color: var(--ink); }

main { padding-inline: var(--gutter); }

.cover {
  display: grid; gap: clamp(1.5rem, 4vw, 3.5rem);
  max-width: 82rem; margin: 0 auto;
  padding-block: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 3vw, 2.5rem);
}
.cover h1 {
  margin: 0;
  font-weight: 820;
  font-size: clamp(2.45rem, 1.15rem + 4.9vw, 5.6rem);
  line-height: .97;
  letter-spacing: -.015em;
  max-width: 17ch;
}
.lead { max-width: 38rem; margin-top: clamp(1.25rem, 3vw, 2rem); }
.lead p { margin: 0; font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.55; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 1.5rem 0 0; padding: 0; list-style: none; font: 500 .78rem/1.4 var(--mono); color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: .6rem; }
.legend li::before { content: ""; width: 1.75rem; height: 2px; background: var(--pen); }

.cover-slip { align-self: end; max-width: 22rem; }

.slip {
  margin: 0; height: 100%;
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--rule);
  padding: .7rem .7rem .85rem;
}
.slip picture { display: block; overflow: hidden; }
.slip img { width: 100%; aspect-ratio: 1; object-fit: contain; transition: transform .6s var(--ease); }
.slip:hover img { transform: scale(1.035); }
.slip figcaption { margin-top: .65rem; font: 400 .76rem/1.45 var(--mono); color: var(--ink); }
.slip-name { display: block; }
.chip { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .35rem; font-weight: 600; color: var(--pen); }
.chip--gas { --pen: var(--pen-gas); }
.chip--electric { --pen: var(--pen-electric); }
.chip::before { content: ""; width: 1rem; height: 2px; background: currentColor; }

.drum {
  position: relative; height: 3.5rem;
  border-block: 1px solid var(--rule);
  background: repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 4rem);
}
.trace { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trace path { fill: none; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pen-ink { stroke: var(--ink); }
.pen-gas { stroke: var(--pen-gas); }
.pen-electric { stroke: var(--pen-electric); }

.drum--live { max-width: 82rem; margin: 0 auto; height: clamp(4rem, 7vw, 5.5rem); }
.trace--live path { stroke-width: 2.2; stroke-dasharray: 1; }
@media (prefers-reduced-motion: no-preference) {
  .trace--live .pen-ink { animation: draw 1.1s var(--ease) .15s backwards; }
  .trace--live .pen-gas { animation: draw .9s var(--ease) 1s backwards; }
}
@keyframes draw { from { stroke-dashoffset: 1; } }

.band {
  position: relative;
  width: 100vw; margin: clamp(1rem, 3vw, 2rem) calc(50% - 50vw);
  aspect-ratio: var(--ratio);
  max-height: 46rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}
.band picture, .band img { width: 100%; height: 100%; }
.band img { object-fit: cover; }
.band--cover { margin-top: 0; -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent); mask-image: linear-gradient(to bottom, #000 80%, transparent); }

.intro, .chapter, .toc, .log { max-width: 82rem; margin-inline: auto; }
.intro { padding-left: var(--offset); }
.intro > p, .chapter-body > p, .chapter-body > h3, .more-body > p, .more-body > h3 { max-width: var(--measure); }
.intro > p:first-child { margin-top: 0; }

.note { position: relative; margin-block: 1.6rem; font-size: clamp(1.12rem, 1.02rem + .4vw, 1.3rem); line-height: 1.45; }
.note strong { font-weight: 600; }
.note::before {
  content: ""; position: absolute; top: .72em; left: calc(-1 * min(var(--offset), 2.75rem) + .25rem);
  width: min(var(--offset) - .75rem, 2rem); height: 2px; background: var(--pen-gas);
}

.rich { text-decoration: underline; text-decoration-color: var(--pen-gas); text-decoration-thickness: 1.5px; text-underline-offset: .22em; transition: color .2s; }
.rich:hover { color: var(--pen-gas); }

.toc { margin-block: clamp(3rem, 6vw, 5rem); padding-left: var(--offset); }
.toc h2 { margin: 0 0 1rem; font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 780; }
.toc ol { margin: 0; padding: .2rem 0 0; list-style: none; columns: 2 22rem; column-gap: 3rem; border-top: 1px solid var(--rule); }
.toc li { break-inside: avoid; padding-block: .2rem; border-bottom: 1px solid var(--rule); }
.toc a { display: flex; align-items: center; gap: .9rem; min-height: 2.9rem; padding-block: .45rem; text-decoration: none; line-height: 1.35; }
.toc a::before { content: ""; flex: none; width: 1.5rem; height: 2px; background: var(--pen); }
.toc li[data-channel="duo"] a::before { background: linear-gradient(90deg, var(--pen-gas) 50%, var(--pen-electric) 50%); }
.toc li[data-channel="ink"] a::before { background: var(--ink-soft); }
.toc a:hover { color: var(--pen, var(--ink)); text-decoration: underline; text-underline-offset: .2em; }

.chapter { margin-top: clamp(3.5rem, 7vw, 6rem); scroll-margin-top: 1rem; }
.chapter h2 {
  margin: clamp(1rem, 2.5vw, 1.6rem) 0 1.1rem var(--offset);
  font-size: clamp(1.8rem, 1.15rem + 2.4vw, 3rem);
  font-weight: 790; line-height: 1.03; letter-spacing: -.01em;
  max-width: 24ch;
  scroll-margin-top: 5rem;
}
.chapter-body { padding-left: var(--offset); }
.chapter-body > p:first-child { margin-top: 0; }
.chapter-body h3 { margin: 2rem 0 .4rem; font-size: 1.32rem; font-weight: 720; line-height: 1.2; }

.more { margin-top: .5rem; }
.more summary, .more-close {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 2.75rem; padding: .5rem 1.05rem .5rem .85rem;
  font: 600 .92rem/1 var(--text); color: var(--ink);
  background: transparent; border: 1px solid var(--ink); border-radius: 999px;
  cursor: pointer; list-style: none;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.more summary::-webkit-details-marker { display: none; }
.more summary:hover, .more-close:hover { background: var(--ink); color: var(--field); }
.fold-icon { transition: transform .35s var(--ease); }
.more[open] > summary .fold-icon, .more-close .fold-icon { transform: rotate(180deg); }
.more-opened { display: none; }
.more[open] > summary .more-opened { display: inline; }
.more[open] > summary .more-closed { display: none; }
.more-body { padding-top: .25rem; }
.more-close { margin-top: .75rem; }
@media (prefers-reduced-motion: no-preference) {
  .more[open] .more-body { animation: unroll .5s var(--ease); }
}
@keyframes unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

.chapter--links .chapter-body { display: grid; gap: .75rem; max-width: calc(var(--measure) + var(--offset)); }
.tile {
  position: relative;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--card); border: 1px solid var(--rule);
  transition: border-color .25s var(--ease);
}
.tile p { margin: 0; line-height: 1.4; }
.tile .rich { display: block; font: 500 .86rem/1.4 var(--mono); white-space: nowrap; text-decoration: none; }
.tile .rich::after { content: ""; position: absolute; inset: 0; }
.tile-icon { width: 1.5rem; height: 1.5rem; color: var(--pen-gas); }
.tile-arrow { color: var(--ink-soft); transition: transform .3s var(--ease), color .3s; }
.tile:hover { border-color: var(--ink); }
.tile:hover .tile-arrow { transform: translate(3px, -3px); color: var(--pen-gas); }
.tile:has(.rich:focus-visible) { outline: 2px solid var(--pen-electric); outline-offset: 3px; }
.tile .rich:focus-visible { outline: none; }

.log { margin-top: clamp(3.5rem, 7vw, 6rem); padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.log h2 { margin: 0 0 1.5rem var(--offset); font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); font-weight: 790; line-height: 1.05; max-width: 24ch; }
.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .9rem; margin: 0; padding: 0; list-style: none; }

.foot { margin-top: clamp(4rem, 8vw, 7rem); border-top: 1px solid var(--rule); background: var(--field-deep); }
.colophon {
  max-width: 82rem; margin: 0 auto; padding: 2rem var(--gutter) 2.5rem;
  display: grid; gap: 1.25rem 3rem; grid-template-columns: 1fr;
}
.privacy-note { display: flex; gap: .6rem; max-width: 46rem; margin: 0; font-size: .78rem; line-height: 1.55; color: var(--ink-soft); }
.privacy-icon { margin-top: .1rem; color: var(--ink-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.foot-links a { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; font-size: .9rem; text-decoration-color: var(--pen-gas); text-underline-offset: .22em; }
.foot-brand { display: flex; align-items: center; gap: .5rem; margin: 0; font: 700 .95rem/1 var(--display); }
.foot-brand .mark { width: 1.5rem; height: 1.5rem; color: var(--pen-gas); }
.foot-top { margin: 0; }
.to-top { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; font: 500 .8rem/1 var(--mono); text-decoration: none; }
.to-top:hover { color: var(--pen-gas); }

@media (min-width: 56rem) {
  .log-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cover { grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); align-items: end; }
  .colophon { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .foot-top { justify-self: end; }
}

@media (max-width: 47.9rem) {
  .band { aspect-ratio: var(--ratio-m); max-height: 34rem; }
  .cover-slip { max-width: 15rem; }
  .note::before { left: 0; width: .9rem; }
  .note { padding-left: 1.5rem; }
}

@media (max-width: 30rem) {
  .tile { grid-template-columns: 1fr; padding-right: 2.75rem; }
  .tile-icon { display: none; }
  .tile-arrow { position: absolute; top: 1rem; right: 1rem; }
  .tile .rich { font-size: .8rem; }
  .log-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .slip figcaption { font-size: .76rem; }
}
