:root {
  color-scheme: light;
  --ink: #17212d;
  --obsidian: #0b1320;
  --ivory: #f1ede3;
  --paper: #faf8f3;
  --copper: #92532e;
  --line: #dcd5c7;
  --secondary: #535961;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
a, summary { text-underline-offset: 0.25em; }
a:hover, summary:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

.shell { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.skip-link {
  position: absolute;
  z-index: 2;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--paper);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.masthead {
  position: relative;
  isolation: isolate;
  overflow: clip;
  color: var(--ivory);
  background: var(--obsidian);
}
.masthead--constellation::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/header-starfield.webp") center / cover;
  opacity: .8;
  mask-image: linear-gradient(90deg, #0009, #000 65%);
  pointer-events: none;
}
.header {
  position: relative;
  z-index: 1;
  min-height: 5.7rem;
  border-bottom: 1px solid #38414c;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem 1rem;
}
.wordmark { display: block; margin-inline-start: -12px; }
.wordmark img { width: 205px; height: auto; }
.header nav { display: flex; gap: clamp(0.95rem, 4vw, 2.4rem); }
.header nav a {
  padding-block: 0.75rem;
  font-size: 0.93rem;
  text-decoration: none;
}
.header nav a:hover { text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(25rem, 1fr);
  align-items: start;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding-block: 1.5rem 2rem;
}
.hero-copy { padding-top: clamp(3rem, 6vw, 5.5rem); }
.studio-signature { position: relative; container-type: inline-size; min-width: 0; }
.constellation-frame { position: relative; }
.constellation { width: 100%; height: auto; }
h1, h2, .book h4 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
}
.hero h1 {
  font-size: clamp(2.9rem, 4.7vw, 4.5rem);
  line-height: 0.99;
  letter-spacing: -0.051em;
  text-wrap: balance;
  max-width: 47rem;
  overflow-wrap: anywhere;
}
.hero p {
  margin-top: 1.55rem;
  max-width: 35rem;
  color: #d3cbbd;
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.catalog { padding-block: 3.25rem 3.6rem; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
h2 { font-size: clamp(2.25rem, 4vw, 3.1rem); letter-spacing: -0.035em; line-height: 1.05; }
.section-heading p { color: var(--secondary); font-size: 0.86rem; }
.group-heading { font-size: 1.02rem; font-weight: 650; margin: 1.3rem 0 0.9rem; }
.book {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  display: grid;
  grid-template-columns: clamp(5.75rem, 10vw, 8.25rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 2.2vw, 1.65rem);
  padding: clamp(1rem, 2.2vw, 1.65rem);
  overflow-wrap: anywhere;
}
.book-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  container-type: inline-size;
}
.book-moby { background: #edf1f1; }
.book-lupin { background: #f5ede1; }
.cover {
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
  box-shadow: 0 5px 12px #17212d28;
}
.meta { color: var(--secondary); font-size: 0.83rem; margin-bottom: 0.45rem; }
.book h4 {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: pretty;
}
.book h4 + p { margin-top: 0.65rem; font-size: 0.94rem; }
.status { margin-top: 0.75rem; color: var(--secondary); font-size: 0.8rem; }
.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--copper);
}
.app-links a { display: inline-block; padding-block: 0.5rem; }
details { margin-top: 0.15rem; }
summary { cursor: pointer; }
.book summary {
  color: var(--copper);
  font-size: 0.86rem;
  font-weight: 600;
  padding-block: 0.5rem;
}
.book details p { margin-top: 0.25rem; font-size: 0.9rem; }

.studio {
  border-top: 1px solid var(--line);
  padding-block: 2.6rem 3.5rem;
}
.studio h2 + p { margin-top: 0.85rem; max-width: 36rem; }

.document-page {
  max-width: 42rem;
  padding-block: clamp(1.35rem, 5vw, 3rem) 3.5rem;
  overflow-wrap: anywhere;
}
.document-page a { color: var(--copper); }
.document-back { display: inline-block; padding-block: 0.45rem; }
.document-header { margin-top: 1.4rem; }
.document-header h1 {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.document-header .eyebrow, .document-header .updated {
  color: var(--secondary);
  font-size: 0.9rem;
}
.document-header .eyebrow { margin-bottom: 0.35rem; }
.document-header .document-intro { margin-top: 0.75rem; }
.document-header .updated { margin-top: 0.65rem; }
.document section, .draft-notice, .document-next { margin-top: 1.75rem; }
.document h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.document section p { margin-top: 0.5rem; }
.draft-notice {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--ivory);
}
.document-next {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.document-next a { display: block; width: fit-content; padding-block: 0.4rem; }
.star-chart { position: absolute; inset: 0; }
.star-chart[hidden], .chart-leader[hidden], .companion-callout[hidden] { display: none; }
.companion-star {
  position: absolute;
  width: clamp(28px, 7cqw, 44px);
  height: clamp(28px, 7cqw, 44px);
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ivory);
  cursor: pointer;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-touch-callout: none;
}
.companion-star:focus-visible { outline: 2px solid var(--ivory); outline-offset: 2px; }
.chart-leader { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.chart-leader path { fill: none; stroke: #c7895b; stroke-width: 1; }
.companion-callout {
  position: absolute;
  width: max-content;
  max-width: calc(100% - 16px);
  padding: .125rem .65rem;
  border: 1px solid #c7895b;
  border-radius: 2px;
  background: #0b1320f5;
  color: var(--ivory);
  font-size: 1rem;
  line-height: 1;
  overflow-wrap: anywhere;
  pointer-events: none;
}
@media (max-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .hero-copy { padding-top: 1.5rem; }
  .hero h1 { max-width: 48rem; font-size: clamp(2.9rem, 6.8vw, 4.5rem); }
  .studio-signature { width: min(100%, 30rem); margin-inline: auto; padding-block: .5rem; }
}

@media (max-width: 48rem) {
  .book-grid { grid-template-columns: 1fr; }
  .book { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .desktop-break { display: none; }
}
@media (max-width: 34rem) {
  .shell { width: calc(100% - 2rem); }
  .header { min-height: 4.75rem; }
  .wordmark img { width: 182px; }
  .header { column-gap: .5rem; }
  .header nav { gap: .75rem; }
  .hero { padding-top: 1rem; }
  .hero-copy { padding-top: 1rem; }
  .studio-signature { width: calc(100% + 2rem); margin-inline: -1rem; padding-block: 1rem .5rem; }
  .hero h1 { text-wrap: wrap; }
  .catalog { padding-block: 2.3rem 2.5rem; }
  .book { grid-template-columns: 5.4rem minmax(0, 1fr); }
}

/* Stack the cover when larger text leaves too little room for reading. */
@container (max-width: 16rem) {
  .book { grid-template-columns: minmax(0, 1fr); }
  .cover { max-width: 5.4rem; }
}
