@font-face {
  font-family: "Sinteca";
  src: url("fonts/Sinteca-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sinteca";
  src: url("fonts/Sinteca-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sinteca";
  src: url("fonts/Sinteca-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #18191a;
  --muted: #737373;
  --rule: #d2d2d2;
  --focus: #0a66c2;
  --measure: 31rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080808;
    --ink: #f2f2f2;
    --muted: #9a9a9a;
    --rule: #3a3a3a;
    --focus: #4d9bff;
  }
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

html {
  min-height: 100%;
  color-scheme: light dark;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Sinteca",
    sans-serif;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

.layout--detail {
  grid-template-columns: 1fr;
}

.layout--detail .site-shell {
  justify-self: center;
  margin-right: auto;
  margin-left: auto;
  padding-top: 0;
}

.layout--detail .dither-stage {
  display: none;
}

.site-shell {
  width: min(calc(100% - 2rem), var(--measure));
  justify-self: center;
  margin: 0;
  padding: clamp(2.75rem, 5vw, 4.3rem) 0 clamp(4.5rem, 10vw, 7.5rem);
  opacity: 1;
  transition: opacity 310ms ease-out;
}

.site-shell.faded {
  opacity: 0;
  pointer-events: none;
}

.breadcrumb {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: min(calc(100vw - 3rem), 64rem);
  height: clamp(2.75rem, 5vw, 4.3rem);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  border-bottom-color: color-mix(in srgb, var(--rule) 40%, transparent);
  margin-left: 50%;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  transform: translateX(-50%);
  transition: transform 220ms ease, opacity 180ms ease;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

.breadcrumb--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -100%);
}

.breadcrumb__parent {
  color: var(--muted);
  background: none;
  transition: color 180ms ease;
}

.breadcrumb__parent:hover {
  color: var(--ink);
  background: none;
}

.breadcrumb__sep {
  color: var(--muted);
  user-select: none;
}

.breadcrumb__current {
  color: var(--ink);
  font-weight: 600;
}

.dither-stage {
  position: sticky;
  top: 0;
  align-self: start;
  width: 100%;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.dither-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.section {
  margin: 0 0 clamp(1.7rem, 3.5vw, 2.5rem);
}

.section:last-child {
  margin-bottom: 0;
}

.intro {
  padding-top: 0.25rem;
}

a:focus-visible {
  outline: 0.16rem solid var(--focus);
  outline-offset: 0.18rem;
}
h1,
h2,
p,
ul {
  margin: 0;
}

h1,
h2 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0.5rem;
  font-size: 15px;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0.7rem;
  font-size: 15px;
  line-height: 1.1;
}

p,
.link-list a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
}

p + p {
  margin-top: 0.65rem;
}

.link-list {
  display: grid;
  gap: 0.3rem;
  padding: 0;
  list-style: none;
}

.link-list--rows li a {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.link-list--rows li a:has(> span) > span:first-child {
  flex: 0 0 10rem;
}

.link-list--rows .meta {
  color: #a8a8a8;
  background: none;
}

.link-list--contact a {
  display: inline-block;
}

.ext-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.35em;
  vertical-align: -0.15em;
  opacity: 0;
  transition: opacity 180ms ease;
}

.link-list a:hover .ext-icon {
  opacity: 1;
}

.link-list--stack {
  gap: 0.85rem;
}

.link-list--stack li a {
  display: inline;
  background: none;
}

.link-list--stack li a:hover {
  background: none;
}

.link-list--stack li a > span {
  background-image: radial-gradient(circle, var(--rule) 35%, transparent 40%);
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 0.27em 0.14em;
  padding-bottom: 4px;
  transition:
    color 180ms ease,
    background-image 180ms ease;
}

.link-list--stack li a:hover > span {
  color: var(--ink);
  background-image: radial-gradient(circle, var(--ink) 35%, transparent 40%);
}

.link-list--stack .meta {
  display: block;
  color: #a8a8a8;
  background: none;
  margin-top: 0.1rem;
}

.link-list--stack li a:hover .meta {
  color: #a8a8a8;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.link-list a,
.text-link {
  background-image: radial-gradient(circle, var(--rule) 35%, transparent 40%);
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 0.27em 0.14em;
  padding-bottom: 4px;
}

.link-list a,
.text-link {
  transition:
    color 180ms ease,
    background-image 180ms ease;
}

.link-list a:hover,
.text-link:hover {
  color: var(--ink);
  background-image: radial-gradient(circle, var(--ink) 35%, transparent 40%);
}

.book-hero {
  margin: 0;
}

.book-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.portrait {
  position: relative;
  left: 50%;
  width: min(48rem, calc(100vw - 2rem));
  margin: 0;
  transform: translateX(-50%);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
}

.case-media {
  position: relative;
  left: 50%;
  width: min(60rem, calc(100vw - 2rem));
  margin: clamp(1.7rem, 3.5vw, 2.5rem) 0;
  transform: translateX(-50%);
}

.case-media img,
.case-media video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

.case-media--body {
  left: auto;
  width: 100%;
  transform: none;
}

.case-media--portrait {
  width: min(28rem, calc(100vw - 2rem));
}

.case-solutions,
.case-step {
  display: grid;
  gap: clamp(1.7rem, 3.5vw, 2.5rem);
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: solution;
}

.case-step {
  gap: 0.4rem;
}

.case-step .case-media {
  margin-top: clamp(1rem, 2.4vw, 1.5rem);
  margin-bottom: 0;
}

.case-step .case-media + .case-media {
  margin-top: clamp(0.8rem, 2vw, 1.2rem);
}

.case-solutions h3,
.case-step h3 {
  margin: 0 0 0.4rem;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
}

.case-solutions p,
.case-step p {
  margin: 0;
}

em {
  font-style: italic;
  color: var(--ink);
}

.chapter-list {
  display: grid;
  gap: 1.1rem;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: chapter;
}

.chapter-list li {
  counter-increment: chapter;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.4rem;
}

.chapter-list li::before {
  content: counter(chapter, decimal-leading-zero);
  color: #a8a8a8;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.chapter-list__title {
  color: var(--ink);
  font-weight: 600;
  margin: 0;
}

.chapter-list__blurb {
  margin: 0.1rem 0 0;
}

.chapter-accordion {
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: chapter;
  background-image: radial-gradient(circle, var(--rule) 35%, transparent 40%);
  background-repeat: repeat-x;
  background-position: 0 0;
  background-size: 0.27em 0.14em;
}

.chapter-accordion li {
  counter-increment: chapter;
  background-image: radial-gradient(circle, var(--rule) 35%, transparent 40%);
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 0.27em 0.14em;
}

.chapter-accordion__summary {
  display: grid;
  grid-template-columns: 1.8rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  transition: color 180ms ease;
}

.chapter-accordion__summary::before {
  content: counter(chapter, decimal-leading-zero);
  color: #a8a8a8;
  font-weight: 500;
}

.chapter-accordion__icon {
  position: relative;
  width: 0.7rem;
  height: 0.7rem;
}

.chapter-accordion__icon::before,
.chapter-accordion__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.7rem;
  height: 1px;
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: transform 240ms ease;
}

.chapter-accordion__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.chapter-accordion__summary[aria-expanded="true"] .chapter-accordion__icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.chapter-accordion__content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms ease;
}

.chapter-accordion__content > div {
  overflow: hidden;
}

.chapter-accordion__summary[aria-expanded="true"] + .chapter-accordion__content {
  grid-template-rows: 1fr;
}

.chapter-accordion__blurb {
  margin: 0;
  padding: 0 0 0.95rem 2.3rem;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.6rem 1.4rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.music-card {
  display: flex;
  flex-direction: column;
}

.music-card__art {
  display: block;
  background: none;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.7rem;
}

.music-card__art:hover {
  background: none;
}

.music-card__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-card__title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.15rem;
}

.music-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.55rem;
}

.music-card__links li + li::before {
  content: "·";
  margin-right: 0.55rem;
  color: var(--muted);
}

.layout--detail:has(.music-grid) .site-shell {
  width: min(100% - 3rem, 64rem);
}

@media (max-width: 50rem) {
  .breadcrumb {
    width: min(calc(100vw - 2rem), var(--measure));
  }

  .music-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1rem;
  }

  .layout--detail:has(.music-grid) .site-shell {
    width: min(100% - 2rem, var(--measure));
  }
}

@media (max-width: 30rem) {
  .music-grid {
    grid-template-columns: 1fr;
  }
}

.progress-toc {
  position: fixed;
  top: 50%;
  left: clamp(1.5rem, 4vw, 3rem);
  transform: translateY(-50%);
  display: flex;
  align-items: stretch;
  gap: 0.9rem;
  max-width: 16rem;
  z-index: 5;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 240ms ease;
}

.progress-toc.is-ready {
  opacity: 1;
}

.progress-toc.is-occluded {
  opacity: 0;
  pointer-events: none;
}

.progress-toc__track {
  position: relative;
  width: 1px;
  background: color-mix(in srgb, var(--rule) 40%, transparent);
  flex-shrink: 0;
}

.progress-toc__fill {
  position: absolute;
  inset: 0 0 auto 0;
  width: 1px;
  height: 100%;
  background: var(--ink);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 120ms linear;
}

.progress-toc__list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  margin: 0;
  list-style: none;
  gap: 0.55rem;
}

.progress-toc__item {
  line-height: 1.25;
}

.progress-toc__link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  color: #b3b3b3;
  letter-spacing: 0;
  transition: color 180ms ease;
}

.progress-toc__link:hover {
  color: var(--ink);
}

.progress-toc__item.is-passed .progress-toc__link {
  color: var(--muted);
}

.progress-toc__item.is-active .progress-toc__link {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 70rem) {
  .progress-toc {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 60rem) {
  .layout {
    display: block;
    min-height: 0;
  }

  .site-shell {
    width: min(100% - 2rem, var(--measure));
    justify-self: auto;
    margin: 0 auto;
  }

  .dither-stage {
    display: none;
  }
}

@media (max-width: 42rem) {
  .site-shell {
    padding-top: 2rem;
  }
}

.book-hero img,
.portrait img {
  cursor: zoom-in;
}

body.lightbox-locked {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 6vw, 4.5rem);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: lightbox-fade 180ms ease-out;
}

.lightbox[hidden] {
  display: none;
}

@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox__figure {
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__media {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 20px 60px color-mix(in srgb, var(--ink) 18%, transparent);
}

.lightbox__media[hidden] {
  display: none;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 0.55rem;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  opacity: 0.6;
  transition:
    background-color 180ms ease,
    opacity 180ms ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  outline: 0.16rem solid var(--focus);
  outline-offset: 0.18rem;
  opacity: 1;
}

.lightbox__close svg,
.lightbox__nav svg {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

.lightbox__close {
  top: clamp(0.75rem, 2.5vw, 1.5rem);
  right: clamp(0.75rem, 2.5vw, 1.5rem);
}

.lightbox__nav--prev {
  left: clamp(0.5rem, 2vw, 1.5rem);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--next {
  right: clamp(0.5rem, 2vw, 1.5rem);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav[hidden] {
  display: none;
}
