:root {
  --ink: #222324;
  --muted: #68696b;
  --paper: rgba(249, 248, 246, .62);
  --paper-strong: rgba(252, 251, 249, .86);
  --line: rgba(42, 43, 44, .14);
  --blue: #286ff2;
  --shadow: 0 24px 70px rgba(63, 58, 54, .08), inset 0 1px 0 rgba(255,255,255,.65);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #e8e7e5; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(ellipse at 16% 10%, rgba(246, 222, 225, .58), transparent 44%),
    radial-gradient(ellipse at 86% 88%, rgba(204, 224, 241, .76), transparent 48%),
    radial-gradient(ellipse at 62% 24%, rgba(248, 240, 230, .78), transparent 40%),
    linear-gradient(145deg, #e8e5e3, #f1efec 48%, #dce6ed);
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .38;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

a { color: inherit; }
button { font: inherit; }
.masthead {
  width: min(1640px, calc(100% - 9vw));
  margin: 0 auto;
  padding: 46px 0 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.wordmark { font-size: 15px; font-weight: 650; text-decoration: none; letter-spacing: .01em; }
.archive-state { margin: 0; color: var(--muted); font-size: 13px; }
main {
  width: min(1640px, calc(100% - 9vw));
  margin: 0 auto;
  padding: 44px 0 120px;
  position: relative;
  z-index: 1;
  outline: none;
}

.section { margin: 0 0 88px; }
.section-heading, .page-title {
  margin: 0;
  font-size: clamp(38px, 4.2vw, 70px);
  line-height: .98;
  letter-spacing: -.048em;
  font-weight: 620;
}
.section-heading { font-size: clamp(31px, 3vw, 48px); }
.enter-mark { display: inline-block; margin-left: 10px; color: #565759; font-weight: 430; transform: translateY(-.06em); }
.eyebrow { margin: 0 0 20px; color: var(--muted); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.page-dek { max-width: 760px; margin: 25px 0 0; color: #565759; font-size: clamp(18px, 2vw, 27px); line-height: 1.38; letter-spacing: -.016em; }
.back { display: inline-flex; margin-bottom: 56px; gap: 10px; text-decoration: none; color: #55575a; }
.back:hover, .back:focus-visible { color: var(--blue); }

.wake-grid, .volume-grid, .space-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
}
.card {
  min-height: 330px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(.9);
  -webkit-backdrop-filter: blur(26px) saturate(.9);
  text-decoration: none;
  padding: 42px;
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(250px, 1.1fr);
  gap: 24px;
  overflow: hidden;
  transition: transform .22s ease, background .22s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); background: rgba(253,252,250,.76); outline: none; }
.card-copy { display: flex; flex-direction: column; min-width: 0; }
.card h3 { margin: 0; font-size: clamp(24px, 2.1vw, 35px); font-weight: 470; letter-spacing: -.028em; line-height: 1.07; }
.card-meta { margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.card-summary { margin: auto 0 0; padding-top: 25px; border-top: 1px solid var(--line); color: #5b5c5e; font-size: 16px; line-height: 1.48; }
.preview-stack { position: relative; min-height: 244px; align-self: center; }
.preview-sheet {
  position: absolute;
  width: 73%;
  aspect-ratio: .8;
  right: 4%;
  top: 5%;
  border-radius: 11px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 45px rgba(33,36,40,.16);
  padding: 22px;
  transform: rotate(2.8deg);
  overflow: hidden;
}
.preview-sheet.behind { right: 24%; top: 18%; transform: rotate(-3.6deg); opacity: .86; }
.sheet-mark { position: absolute; right: 18px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-right: 14px;
  color: #77797b;
  font-size: 8px;
  line-height: 1.2;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
.preview-sheet h4 {
  margin: 22px 0 15px;
  color: #292b2d;
  font-size: clamp(13px, 1.12vw, 19px);
  line-height: 1.07;
  letter-spacing: -.027em;
  font-weight: 630;
}
.preview-sheet p {
  margin: 0;
  color: #55585a;
  font-size: clamp(8px, .7vw, 11px);
  line-height: 1.46;
  display: -webkit-box;
  -webkit-line-clamp: 9;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sheet-foot {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 17px;
  padding-top: 8px;
  border-top: 1px solid #e2e2e0;
  color: #939495;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.volume-card { grid-template-columns: 1fr; min-height: 280px; }
.book {
  width: min(230px, 80%);
  height: 145px;
  margin: 8px auto 0;
  border-radius: 7px 18px 18px 7px;
  background: linear-gradient(100deg, rgba(44,51,58,.18), rgba(255,255,255,.75) 7%, rgba(233,229,223,.9) 92%, rgba(112,105,99,.22));
  box-shadow: -8px 15px 25px rgba(44,45,48,.14), inset 4px 0 0 rgba(255,255,255,.76);
  display: grid;
  place-items: center;
  color: #47484a;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 12px;
}

.wake-head { margin-bottom: 90px; }
.wake-head .page-title { max-width: 1050px; }
.wake-meta { margin-top: 24px; color: var(--muted); }
.space-card { min-height: 300px; }
.space-card .preview-sheet { width: 68%; }
.space-card h3.active { color: var(--blue); }

.item-shelf {
  display: flex;
  gap: 44px;
  margin: 22px calc((100vw - min(1640px, calc(100vw - 9vw))) / -2) -42px 0;
  padding: 30px clamp(64px, 7vw, 120px) 72px 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline-end: clamp(64px, 7vw, 120px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.item-shelf::-webkit-scrollbar { display: none; }
.item { flex: 0 0 clamp(245px, 21vw, 330px); scroll-snap-align: start; text-decoration: none; }
.item-paper {
  height: 360px;
  border-radius: 12px;
  background: var(--paper-strong);
  box-shadow: 0 22px 48px rgba(43,44,47,.14), inset 0 0 0 1px rgba(255,255,255,.7);
  padding: 29px 26px;
  transition: transform .2s ease;
}
.item:hover .item-paper, .item:focus-visible .item-paper { transform: translateY(-5px) rotate(-.35deg); }
.item-kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.item-paper h3 { margin: 22px 0 28px; font-size: 24px; line-height: 1.08; font-weight: 590; letter-spacing: -.026em; }
.item-paper p { margin: 0; color: #555759; line-height: 1.52; font-size: 15px; }
.item-paper p {
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-label { margin: 19px 0 0; font-size: 17px; font-weight: 570; }
.item-date { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); font-size: 20px; }
.empty-section { min-height: 120px; margin-top: 32px; border-top: 1px solid var(--line); }

.item-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 5vh 24px;
  background: rgba(231, 230, 228, .72);
  backdrop-filter: blur(22px) saturate(.75);
  -webkit-backdrop-filter: blur(22px) saturate(.75);
}
.overlay-dismiss { position: absolute; inset: 0; }
.expanded-paper, .space-document {
  position: relative;
  z-index: 1;
  width: min(660px, calc(100vw - 48px));
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(34px, 5vw, 70px);
  border-radius: 15px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 32px 90px rgba(42,43,46,.2), inset 0 0 0 1px rgba(255,255,255,.75);
}
.expanded-top {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.expanded-top a { position: relative; z-index: 2; text-decoration: none; color: var(--ink); text-transform: none; letter-spacing: 0; }
.expanded-paper h2, .space-document h2 {
  margin: 46px 0 32px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: .98;
  letter-spacing: -.045em;
  font-weight: 620;
}
.expanded-body { color: #3f4143; font-family: ui-serif, Georgia, serif; font-size: clamp(18px, 1.7vw, 23px); line-height: 1.62; }
.expanded-body p { margin: 0 0 1.25em; }

.space-focus {
  min-height: calc(100vh - 180px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 290px) minmax(420px, 1fr);
  gap: clamp(50px, 8vw, 150px);
  align-items: start;
  padding-top: 90px;
}
.space-focus > h1 {
  position: absolute;
  z-index: -1;
  left: 0;
  top: -45px;
  margin: 0;
  color: rgba(44,45,47,.055);
  font-size: clamp(70px, 12vw, 190px);
  line-height: .9;
  letter-spacing: -.065em;
  font-weight: 560;
  white-space: nowrap;
}
.space-close { position: absolute; top: 0; left: 0; color: #55575a; text-decoration: none; font-size: 14px; }
.space-rail { padding-top: 55px; }
.space-rail > p { margin: 0 0 28px; color: #5f6163; font-size: 13px; }
.space-rail-item {
  display: block;
  margin: 0 0 8px;
  padding: 14px 16px;
  border-radius: 9px;
  color: #5d5f61;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.2;
}
.space-rail-item span { display: block; margin-bottom: 5px; color: #9a9b9c; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.space-rail-item.selected { color: var(--ink); background: rgba(255,255,255,.48); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.space-stage { min-height: 620px; display: grid; place-items: start center; }
.space-document { width: min(660px, 100%); max-height: none; }
.space-overview .expanded-body { max-width: 54ch; }
.space-overview-label {
  margin: 2.2em 0 .55em !important;
  color: #898a8b;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.space-overview-label:first-child { margin-top: 0 !important; }

@media (max-width: 900px) {
  .wake-grid, .volume-grid, .space-grid { grid-template-columns: 1fr; }
  .card { min-height: 290px; }
  .space-focus { grid-template-columns: 1fr; gap: 25px; }
  .space-rail { padding-top: 20px; display: flex; gap: 8px; overflow-x: auto; }
  .space-rail > p { display: none; }
  .space-rail-item { flex: 0 0 190px; }
}
@media (max-width: 620px) {
  .masthead, main { width: calc(100% - 36px); }
  .masthead { padding-top: 28px; }
  .archive-state { display: none; }
  main { padding-top: 28px; }
  .section { margin-bottom: 65px; }
  .card { grid-template-columns: 1fr; padding: 28px; min-height: 430px; }
  .preview-stack { min-height: 200px; }
  .item-shelf { gap: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
