@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #f7f8fc;
  --white: #fff;
  --ink: #202039;
  --muted: #53556d;
  --violet: #29245d;
  --accent: #4b3daf;
  --mint: #d9f477;
  --lilac: #eeebff;
  --line: #d9d9e8;
  --heading: "Bricolage Grotesque", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --page: 1240px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--body); }
a { color: inherit; text-underline-offset: .22em; }
a:focus-visible, summary:focus-visible { outline: 3px solid #7265d2; outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 {
  font-family: var(--heading);
  font-weight: 740;
  line-height: 1.07;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.wrap { width: min(var(--page), calc(100% - 5rem)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 5; padding: .65rem 1rem; background: var(--white); }
.skip:focus { top: 1rem; }

.mast { background: var(--white); border-bottom: 1px solid var(--line); }
.mast-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1.1rem; }
.logo { display: block; flex: 0 0 auto; width: 150px; }
.topics { display: flex; align-items: center; justify-content: center; gap: clamp(.15rem, 1vw, 1rem); }
.topics a, .mast-link { text-decoration: none; white-space: nowrap; font-size: .84rem; font-weight: 680; }
.topics a { padding: .55rem .45rem; }
.topics a:hover, .topics [aria-current] { color: var(--accent); text-decoration: underline; }
.mast-link, .mobile-nav summary { border: 1px solid var(--line); padding: .5rem .8rem; }
.mast-link:hover, .mobile-nav summary:hover { background: var(--lilac); }
.mobile-nav { display: none; }

.home-intro {
  background-color: var(--violet);
  background-image: linear-gradient(#ffffff12 1px, transparent 1px), linear-gradient(90deg, #ffffff12 1px, transparent 1px);
  background-size: 34px 34px;
  color: var(--white);
}
.intro-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .9fr);
  align-items: end;
  gap: clamp(1.25rem, 5vw, 5rem);
  padding-block: clamp(2.8rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem);
}
.intro-inner h1 { font-size: clamp(3.05rem, 7vw, 7.3rem); font-weight: 800; line-height: .96; letter-spacing: -.05em; }
.intro-inner h1 span { color: var(--mint); }
.intro-copy { display: grid; gap: 1rem; padding-bottom: .12rem; }
.intro-copy p { max-width: 34ch; color: #eeecff; font-size: clamp(1rem, 1.7vw, 1.25rem); }
.jump-list { display: flex; gap: .45rem; flex-wrap: wrap; }
.jump-list a { border: 1px solid #ffffff5a; background: var(--violet); padding: .3rem .63rem; text-decoration: none; font-size: .78rem; font-weight: 650; }
.jump-list a:hover { background: var(--mint); color: var(--ink); }
.home-intro a:focus-visible, .guide-header a:focus-visible { outline-color: var(--mint); }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr);
  background: var(--mint);
  margin-block: clamp(1.25rem, 3.5vw, 2.75rem);
}
.feature-photo { display: grid; min-height: 260px; overflow: hidden; }
.feature-photo img { width: 100%; height: 100%; min-height: 0; aspect-ratio: 1.9; object-fit: cover; }
.feature-copy { display: grid; align-content: center; justify-items: start; gap: .82rem; padding: clamp(1.25rem, 3.3vw, 3rem); }
.kicker { font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.feature-copy .kicker { color: var(--violet); }
.feature h2 { font-size: clamp(1.8rem, 3.5vw, 3.4rem); max-width: 15ch; }
.feature h2 a { text-decoration: none; }
.feature h2 a:hover { text-decoration: underline; }
.feature-copy > p:not(.kicker) { max-width: 43ch; }
.button { display: inline-flex; align-items: center; gap: .6rem; padding: .65rem .95rem; background: var(--violet); color: var(--white); font-size: .86rem; font-weight: 720; text-decoration: none; }
.button:hover { background: var(--accent); }

.home-collections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding-bottom: 3.5rem; }
.collection { background: var(--white); border: 1px solid var(--line); scroll-margin-top: 1rem; }
.section-head { display: grid; align-items: baseline; gap: .45rem 1rem; grid-template-columns: minmax(0, 1fr) auto; }
.section-head h2 { font-size: clamp(1.65rem, 3vw, 2.65rem); }
.section-head p { grid-column: 1 / -1; grid-row: 2; color: var(--muted); max-width: 60ch; }
.collection .section-head { padding: 1.2rem 1.25rem 1rem; border-bottom: 1px solid var(--line); background: var(--lilac); }
.text-link { color: var(--accent); font-size: .81rem; font-weight: 750; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { min-width: 0; background: var(--white); border: 1px solid var(--line); }
.card a { height: 100%; display: grid; align-content: start; position: relative; text-decoration: none; }
.card a:hover h3 { color: var(--accent); text-decoration: underline; }
.photo { aspect-ratio: 1.7; overflow: hidden; background: var(--lilac); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.card-copy { padding: 1rem 2rem 1rem 1rem; }
.card h3 { margin: .26rem 0 .4rem; font-size: clamp(1.2rem, 2vw, 1.65rem); line-height: 1.13; }
.card-deck { color: var(--muted); font-size: .89rem; }
.card-arrow { position: absolute; bottom: .7rem; right: .8rem; color: var(--accent); font-weight: 750; }
.collection .cards { display: block; }
.collection .card { border: 0; }
.collection .card + .card { border-top: 1px solid var(--line); }
.collection .card a { grid-template-columns: clamp(76px, 9vw, 122px) minmax(0, 1fr); align-items: center; }
.collection .photo { margin-left: .8rem; aspect-ratio: 1.35; }
.collection .card h3 { margin-bottom: 0; }
.collection .card-deck { display: none; }

.listing-head { padding-block: clamp(2.5rem, 6vw, 5rem) 2rem; }
.listing-head h1 { font-size: clamp(2.5rem, 6vw, 5.8rem); margin-block: .5rem .9rem; }
.listing-head .button { margin-top: 1.35rem; }
.deck { max-width: 52ch; color: var(--muted); font-size: clamp(1.04rem, 1.75vw, 1.25rem); line-height: 1.55; }
.catalog, .library, .legal { padding-bottom: 4rem; }
.library { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.library a { display: grid; gap: .65rem; background: var(--white); padding: 1.25rem; border: 1px solid var(--line); text-decoration: none; }
.library a:hover { background: var(--lilac); }
.library h2 { display: flex; justify-content: space-between; gap: .4rem; font-size: clamp(1.4rem, 3vw, 2.3rem); }
.library h2 span { color: var(--accent); }
.library p { color: var(--muted); }

.guide-header { background: var(--violet); color: var(--white); }
.crumb { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; padding-top: 1.15rem; color: #eeecff; font-size: .84rem; }
.article-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.4rem, 5vw, 4.8rem);
  padding-block: clamp(1.25rem, 3vw, 2rem) clamp(1.65rem, 4.5vw, 3.5rem);
}
.article-intro .kicker { color: var(--mint); }
.article-intro h1 { margin-block: .6rem .9rem; font-size: clamp(2.25rem, 5.1vw, 5rem); font-weight: 800; line-height: .99; }
.article-intro .deck { color: #eeecff; }
.article-image { aspect-ratio: 1.57; margin: 0 .55rem .55rem 0; background: var(--lilac); box-shadow: .55rem .55rem 0 var(--mint); overflow: hidden; }
.article-image img { width: 100%; height: 100%; object-fit: cover; }
.reading-grid {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(210px, 300px);
  grid-template-areas: "text tools";
  justify-content: space-between;
  gap: clamp(2rem, 6vw, 7rem);
  padding-block: clamp(1.6rem, 4vw, 3.1rem) 3.5rem;
}
.reading-tools { grid-area: tools; position: sticky; align-self: start; top: 1rem; min-width: 0; }
.contents { border: 1px solid var(--line); background: var(--lilac); }
.contents summary { display: flex; justify-content: space-between; gap: .5rem; padding: .8rem .95rem; cursor: pointer; font-family: var(--heading); font-size: 1.05rem; font-weight: 760; list-style: none; }
.contents summary::-webkit-details-marker { display: none; }
.contents summary::after { content: "+"; }
.contents[open] summary::after { content: "−"; }
.contents nav { max-height: min(58vh, 480px); overflow: auto; border-top: 1px solid var(--line); }
.contents ul { list-style: none; margin: 0; padding: .35rem .55rem; }
.contents a { display: block; padding: .5rem .43rem; color: var(--violet); font-size: .88rem; line-height: 1.3; text-decoration: none; }
.contents a:hover { color: var(--accent); text-decoration: underline; }
.prose { grid-area: text; min-width: 0; max-width: 720px; color: var(--ink); font-size: clamp(1.05rem, 1.45vw, 1.15rem); line-height: 1.74; overflow-wrap: anywhere; }
.prose h2, .prose h3 { scroll-margin-top: 1rem; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 1.7em 0 .62em; }
.prose h3 { font-size: 1.4rem; margin: 1.4em 0 .6em; }
.prose h2:first-child { margin-top: 0; }
.prose :is(h2, h3):target { border-inline-start: 5px solid var(--accent); padding-inline-start: .65rem; }
.prose p, .prose ul, .prose ol { margin-block: 0 1em; }
.prose a { color: var(--accent); }
.back-top { display: inline-block; margin-top: 1rem; font-size: .9rem; font-weight: 720; }
.related { background: var(--lilac); border-top: 1px solid var(--line); padding-block: 2rem 3rem; }
.related .section-head { margin-bottom: 1.2rem; }

.footer { background: var(--violet); color: var(--white); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; padding-block: 1.6rem; }
.footer-mark { display: inline-flex; align-items: center; gap: .4rem; font: 760 1.45rem var(--heading); text-decoration: none; }
.footer-mark img { border-radius: 3px; background: var(--mint); }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .86rem; }
.footer-inner small { color: #eeecff; }
.footer a:focus-visible { outline-color: var(--mint); }

@media (max-width: 960px) {
  .wrap { width: calc(100% - 3rem); }
}

@media (max-width: 870px) {
  .mast-inner { min-height: 68px; }
  .logo { width: 133px; }
  .topics, .mast-link { display: none; }
  .mobile-nav { display: block; position: relative; }
  .mobile-nav summary { list-style: none; cursor: pointer; font-size: .89rem; font-weight: 700; }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav nav { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 3; width: min(220px, 78vw); background: var(--white); border: 1px solid var(--line); box-shadow: 0 .6rem 1.5rem #29245d2c; }
  .mobile-nav a { display: block; padding: .55rem .8rem; text-decoration: none; }
  .mobile-nav a:hover, .mobile-nav [aria-current] { background: var(--lilac); color: var(--accent); }
}

@media (max-width: 700px) {
  .wrap { width: calc(100% - 2rem); }
  .intro-inner, .article-head, .feature, .home-collections, .reading-grid { grid-template-columns: minmax(0, 1fr); }
  .intro-inner { gap: 1rem; }
  .intro-inner h1 { font-size: clamp(2.8rem, 10.4vw, 5.2rem); }
  .intro-copy { gap: .8rem; }
  .feature-photo { min-height: 0; }
  .feature-photo img { aspect-ratio: 1.85; }
  .home-collections { padding-bottom: 2.5rem; }
  .article-head { align-items: start; gap: 1.15rem; }
  .article-image { max-width: 100%; }
  .reading-grid { grid-template-areas: "tools" "text"; gap: 1.3rem; }
  .reading-tools { position: static; }
  .contents nav { max-height: none; }
  .catalog .cards, .library, .related .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 440px) {
  .catalog .cards, .library, .related .cards { grid-template-columns: minmax(0, 1fr); }
  .collection .section-head { padding-inline: .8rem; }
  .collection .card a { grid-template-columns: 82px minmax(0, 1fr); }
  .related .section-head { grid-template-columns: minmax(0, 1fr); }
}

