/* Reading pages — the card catalog of the rooms.
   An index card laid over a cinematic room image. */
:root {
  --night: #0a1120;
  --paper: #f7f8f5;
  --ink: #1d2531;
  --teal: #137a6c;
  --rule-blue: rgba(72, 118, 173, 0.28);   /* the ruled lines of a catalog card */
  --stamp: #a2453a;                        /* due-date stamp */
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --serif: "Fraunces", Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body {
  min-height: 100vh;
  background: var(--night);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.04rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

/* ---------- the room behind the card ---------- */
.scene-bg {
  position: fixed; inset: 0; z-index: -1;
  background: var(--night) url("/assets/scenes-v4/cambridge.png") center / cover no-repeat;
}
.scene-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 100% at 50% 40%, rgba(10,17,32,0.25) 40%, rgba(10,17,32,0.85) 100%),
    linear-gradient(to bottom, rgba(10,17,32,0.55), rgba(10,17,32,0.2) 30%, rgba(10,17,32,0.6));
}

/* ---------- masthead & colophon sit on the image ---------- */
.masthead, .colophon {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.6rem 1.4rem;
  display: flex; justify-content: space-between; align-items: baseline;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}
.masthead-name {
  font-family: var(--serif); font-weight: 500; font-size: 0.98rem;
  color: var(--paper); text-decoration: none;
}
.masthead nav { display: flex; gap: 1.4rem; }
.masthead nav a, .colophon a {
  font-family: var(--mono); font-size: 0.64rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--paper); opacity: 0.72; text-decoration: none;
}
.masthead nav a:hover, .colophon a:hover { opacity: 1; }
.colophon { justify-content: flex-start; gap: 1.6rem; padding-bottom: 3rem; }

/* ---------- the index card ---------- */
main {
  max-width: 46rem;
  margin: 0.6rem auto 2.4rem;
  padding: 0 1.4rem;
}
.index-card {
  position: relative;
  background:
    linear-gradient(rgba(255,255,255,0), rgba(255,255,255,0)),
    var(--paper);
  border-radius: 3px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.12) inset,
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 4px 18px rgba(0, 0, 0, 0.45);
  padding: 2.6rem 3rem 4.2rem;
  animation: card-in 0.5s ease both;
}
/* the punched rod hole at the foot of every catalog card */
.index-card::after {
  content: "";
  position: absolute; left: 50%; bottom: 1.15rem;
  width: 0.85rem; height: 0.85rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--night);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.85);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* typed catalog header: ruled lines + kicker */
.card-head {
  background: repeating-linear-gradient(
    to bottom,
    transparent, transparent calc(1.9rem - 1px),
    var(--rule-blue) calc(1.9rem - 1px), var(--rule-blue) 1.9rem
  );
  background-position: 0 0.4rem;
  padding-bottom: 0.6rem;
  margin-bottom: 1.8rem;
  border-bottom: 1.5px solid var(--rule-blue);
}
.kicker {
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--teal);
  line-height: 1.9rem;
}
h1 {
  font-weight: 500; font-size: 2rem; line-height: 1.18;
  margin: 0.4rem 0 0.5rem;
}
.byline {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.12em;
  text-transform: uppercase; opacity: 0.6; line-height: 1.9rem;
}
.stamp {
  display: inline-block;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stamp); border: 1.5px solid currentColor; border-radius: 2px;
  padding: 0.15rem 0.45rem; margin-right: 0.7rem;
  transform: rotate(-1.6deg);
  opacity: 0.85;
}
.draft-note {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em;
  color: var(--stamp); border: 1px dashed currentColor;
  padding: 0.55rem 0.8rem; margin-bottom: 2rem;
}

/* ---------- prose ---------- */
.prose h2 { font-weight: 500; font-size: 1.35rem; margin: 2.3rem 0 0.8rem; }
.prose h3 { font-weight: 600; font-size: 1.06rem; margin: 1.8rem 0 0.6rem; }
.prose h5 { font-weight: 600; font-size: 0.92rem; margin: 1.2rem 0 0.4rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.05rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose a {
  color: var(--teal); text-decoration: underline;
  text-decoration-color: rgba(19, 122, 108, 0.4); text-underline-offset: 3px;
}
.prose a:hover { text-decoration-color: var(--teal); }
.prose code { font-family: var(--mono); font-size: 0.85em; background: rgba(29,37,49,0.07); padding: 0.1em 0.35em; border-radius: 3px; }
.prose pre { background: rgba(29,37,49,0.07); padding: 1rem 1.2rem; overflow-x: auto; margin-bottom: 1.05rem; border-radius: 3px; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 2px solid var(--rule-blue); padding-left: 1.1rem; font-style: italic; margin-bottom: 1.05rem; }
.prose hr { border: 0; border-top: 1px solid var(--rule-blue); margin: 2.2rem 0; }

/* ---------- media: photos & clippings pinned to the card ---------- */
.prose img {
  max-width: 100%; height: auto; display: block; margin: 0 auto;
}
.prose figure {
  margin: 1.8rem 0;
}
.prose figure div { display: contents; } /* unwrap Webflow's inner div */
.prose figure img {
  border: 1px solid rgba(29, 37, 49, 0.12);
  border-radius: 2px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16);
}
.prose figcaption {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; opacity: 0.55; text-align: center;
  margin-top: 0.7rem;
}
/* responsive video embeds (Webflow figures + bare iframes) */
.prose figure[data-rt-type="video"], .prose figure.w-richtext-figure-type-video {
  position: relative; height: 0; overflow: hidden;
  padding-bottom: 56.25% !important;
  border-radius: 2px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16);
  background: #000;
}
.prose figure[data-rt-type="video"] iframe, .prose figure.w-richtext-figure-type-video iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.prose > iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; margin: 1.8rem 0; }
.prose iframe { max-width: 100%; }

/* ---------- the catalog (article index) ---------- */
.article-list { list-style: none; padding: 0; }
.article-list li {
  padding: 1.35rem 0;
  border-top: 1px solid var(--rule-blue);
}
.article-list li:first-child { border-top: 0; }
.article-list .date {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.2em;
  color: var(--stamp); display: block; margin-bottom: 0.35rem;
}
.article-list a.title {
  font-size: 1.22rem; font-weight: 500; color: var(--ink); text-decoration: none;
}
.article-list a.title:hover { color: var(--teal); }
.article-list p { margin-top: 0.35rem; font-size: 0.92rem; opacity: 0.8; }

.empty { opacity: 0.6; font-style: italic; }

/* ---------- responsive & a11y ---------- */
@media (max-width: 700px) {
  main { padding: 0 0.7rem; }
  .index-card { padding: 1.8rem 1.4rem 3.6rem; }
  h1 { font-size: 1.6rem; }
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .index-card { animation: none; }
}
