/* About — two site-matched themes for the collage table.
   theme-light: Home's white ground and violet accent.
   theme-dark:  Play's near-black ground, violet glow and dot field.
   Both share the same light story panels. */

/* ---------- Shared: site palette for objects and story panels ---------- */

.theme-light,
.theme-dark {
  --about-paper: #f4f2ff;
  --about-paper-deep: #e9e6ff;
  --about-paper-white: #ffffff;
  --about-navy: #1b1a2e;
  --about-cobalt: #5145cd;
  --about-periwinkle: #9d91ff;
  --about-mustard: #d9d4ff;
  --about-muted: #6b6e68;
}

.theme-light .grain,
.theme-dark .grain {
  display: none;
}

.theme-light .table::before,
.theme-light .table::after,
.theme-dark .table::before,
.theme-dark .table::after {
  display: none;
}

.theme-light .table .dot-field,
.theme-dark .table .dot-field {
  z-index: -3;
}

/* The nav goes back to the site's plain style */
.theme-light .site-nav__links,
.theme-dark .site-nav__links {
  padding: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

.theme-light .site-nav__links a.is-active,
.theme-dark .site-nav__links a.is-active {
  text-decoration: none;
}

/* Torn shapes: keep the collage edge, soften the colour */
.theme-light .table__torn::after,
.theme-dark .table__torn::after {
  opacity: .5;
}

/* Story panels */
.theme-light .viewer__close,
.theme-dark .viewer__close {
  color: #fff;
  background: var(--about-cobalt);
}

.theme-light .mag__controls .mag__next,
.theme-dark .mag__controls .mag__next {
  color: #fff;
  background: var(--about-cobalt);
  border-color: var(--about-cobalt);
}

.theme-light .mag__page--conclusion,
.theme-dark .mag__page--conclusion {
  background: #e9e6ff;
}

.theme-light .story--music .viewer__kicker,
.theme-light .story--music figcaption,
.theme-dark .story--music .viewer__kicker,
.theme-dark .story--music figcaption {
  color: var(--about-periwinkle);
}

.theme-light .sketchbook,
.theme-light .sketchbook__page,
.theme-dark .sketchbook,
.theme-dark .sketchbook__page {
  background-color: #fff;
}

/* ---------- Light: Home's white and violet ---------- */

.page-table.theme-light,
.page-table.theme-light > .page,
.page-table.theme-light .site-content,
.theme-light .table {
  background: #fff;
}

.theme-light .table {
  background:
    radial-gradient(circle at 84% 14%, rgba(157, 145, 255, .2), transparent 32%),
    radial-gradient(circle at 6% 92%, rgba(157, 145, 255, .14), transparent 30%),
    #fff;
}

.theme-light .table__torn--cobalt {
  background: #e3dfff;
}

.theme-light .table__torn--navy {
  background: #ccc5ff;
  opacity: .75;
}

.theme-light .table__torn--mustard {
  background: #9d91ff;
  opacity: .45;
}

.theme-light .table__heading h1 {
  color: #0b0b0c;
}

.theme-light .table__lede {
  color: rgba(11, 11, 12, .68);
}

.theme-light .site-nav {
  --nav-scrim-rgb: 255, 255, 255;
}

.theme-light .site-nav__brand,
.theme-light .site-nav__links a {
  color: rgba(11, 11, 12, .65);
}

.theme-light .site-nav__brand {
  color: #0b0b0c;
}

.theme-light .site-nav__links a.is-active,
.theme-light .site-nav__links a:hover {
  color: #5145cd;
}

.page-about.theme-light .site-footer {
  background: #fff;
}

.page-about.theme-light .site-footer a {
  color: #0b0b0c;
}

/* ---------- Dark: Play's starfield ---------- */

.page-table.theme-dark,
.page-table.theme-dark > .page,
.page-table.theme-dark .site-content {
  background: #0b0b0c;
}

.theme-dark .table {
  background:
    radial-gradient(circle at 82% 16%, rgba(124, 113, 255, .3), transparent 34%),
    radial-gradient(circle at 8% 90%, rgba(124, 113, 255, .16), transparent 30%),
    #0b0b0c;
}

.theme-dark .table .dot-field {
  opacity: .7;
}

.theme-dark .table__torn--cobalt {
  background: #2a2468;
}

.theme-dark .table__torn--navy {
  background: #1d1a44;
}

.theme-dark .table__torn--mustard {
  background: #9d91ff;
  opacity: .35;
}

.theme-dark .table__kicker {
  color: #9d91ff;
}

.theme-dark .table__heading h1 {
  color: #fff;
}

.theme-dark .table__heading h1 em {
  color: #9d91ff;
}

.theme-dark .table__lede {
  color: rgba(255, 255, 255, .72);
}

.theme-dark .obj {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55));
}

.theme-dark .obj:hover,
.theme-dark .obj:focus-visible {
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .6)) drop-shadow(0 0 22px rgba(157, 145, 255, .25));
}

.theme-dark .site-nav {
  --nav-scrim-rgb: 11, 11, 12;
}

.theme-dark .site-nav__brand {
  color: #fff;
}

.theme-dark .site-nav__links a {
  color: rgba(255, 255, 255, .65);
}

.theme-dark .site-nav__links a.is-active,
.theme-dark .site-nav__links a:hover {
  color: #fff;
}

.page-about.theme-dark .site-footer {
  background: #0b0b0c;
  border-top-color: rgba(255, 255, 255, .12);
}

.page-about.theme-dark .site-footer a {
  color: #fff;
}

.page-about.theme-dark .site-footer__meta {
  color: rgba(255, 255, 255, .5);
}

.theme-light .mag__curl,
.theme-dark .mag__curl {
  background:
    linear-gradient(to top left, var(--about-paper-white) 0 49%, transparent 50%),
    linear-gradient(to top left, #c9c2ff 50%, #f1efff 72%, #ddd8ff 100%);
}

.theme-light .story--cats,
.theme-dark .story--cats {
  background:
    radial-gradient(circle at 88% 16%, rgba(157, 145, 255, .4) 0 70px, transparent 71px),
    linear-gradient(90deg, rgba(157, 145, 255, .16) 0 38%, transparent 38%),
    #fff;
}

/* ---------- Open stories: indigo backdrop (both previews) ---------- */

.stories-light .viewer__backdrop,
.stories-dark .viewer__backdrop {
  background: rgba(14, 12, 38, .78);
}

/* ---------- Open stories: dark panels (preview) ---------- */

.stories-dark .viewer {
  --about-paper-white: #15142b;
  --about-paper: #1c1a38;
  --about-paper-deep: #24214a;
  --about-navy: #f1efff;
  --about-muted: #a9a4d6;
}

.stories-dark .viewer__dialog {
  background-image: none;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6), 0 0 0 1px rgba(157, 145, 255, .18);
}

.stories-dark .mag__standfirst,
.stories-dark .mag__page > p:not([class]),
.stories-dark .story__copy > p:not([class]) {
  color: rgba(241, 239, 255, .8);
}

.stories-dark .viewer__kicker,
.stories-dark .mag__section {
  color: #9d91ff;
}

.stories-dark .mag__spread {
  border-color: rgba(157, 145, 255, .2);
}

.stories-dark .mag__page {
  border-color: rgba(157, 145, 255, .16);
}

.stories-dark .mag__page--conclusion {
  background: #2a2468;
}

.stories-dark .mag__folio {
  color: rgba(241, 239, 255, .4);
}

.stories-dark .mag__controls {
  background: var(--about-paper-white);
}

.stories-dark .mag__curl {
  background:
    linear-gradient(to top left, var(--about-paper-white) 0 49%, transparent 50%),
    linear-gradient(to top left, #3b3486 50%, #5a50b8 72%, #463f9c 100%);
}

.stories-dark .story--conference {
  background: linear-gradient(90deg, transparent 0 67%, rgba(157, 145, 255, .08) 67%), #15142b;
}

.stories-dark .story--making {
  background: linear-gradient(128deg, transparent 0 68%, rgba(157, 145, 255, .16) 68% 100%), #15142b;
}

.stories-dark .story--music {
  background: #0b0b0c;
}

.stories-dark .story--cats {
  background:
    radial-gradient(circle at 88% 16%, rgba(157, 145, 255, .3) 0 70px, transparent 71px),
    linear-gradient(90deg, rgba(157, 145, 255, .1) 0 38%, transparent 38%),
    #15142b;
}

.stories-dark .sketchbook {
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}

.stories-dark .sketchbook__title {
  color: #1b1a2e;
}

.stories-dark .story--music h2 {
  color: #fff;
}

/* ---------- Open stories: starry (preview) ----------
   The full-screen layer behind an open story becomes Play's sky:
   near-black, violet glow, drifting dots. The panel floats on it. */

.stories-dark .viewer__backdrop {
  background:
    radial-gradient(circle at 80% 18%, rgba(124, 113, 255, .26), transparent 38%),
    radial-gradient(circle at 12% 88%, rgba(124, 113, 255, .16), transparent 34%),
    rgba(11, 11, 12, .94);
  backdrop-filter: blur(6px);
}

.stories-dark .viewer > .dot-field {
  z-index: 0;
  opacity: .8;
}

.stories-dark .viewer__dialog {
  z-index: 1;
  background-color: rgba(21, 20, 43, .82);
  backdrop-filter: blur(4px);
}

/* ---------- Open stories: case-study sky (preview) ----------
   Same recipe as the case-study dark sections: deep purple surface, one
   large violet glow high right, and the dot network drawn inside. */

.stories-dark .viewer {
  --about-paper-white: #211b3d;
}

.stories-dark .viewer__dialog {
  background:
    radial-gradient(65vw 55vw at 88% 10%, rgba(159, 149, 245, .2), transparent 62%),
    #211b3d;
  backdrop-filter: none;
}

.stories-dark .viewer > .dot-field {
  opacity: .45;
}

.stories-dark .viewer__network {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .42;
  pointer-events: none;
}

.stories-dark .viewer__panel {
  position: relative;
  z-index: 1;
}

.stories-dark .story--conference,
.stories-dark .story--making,
.stories-dark .story--music,
.stories-dark .story--cats,
.stories-dark .story--portraits {
  background: transparent;
}

.stories-dark .story--cats {
  background: radial-gradient(circle at 88% 16%, rgba(159, 149, 245, .22) 0 70px, transparent 71px);
}

.stories-dark .mag__spread {
  background: rgba(255, 255, 255, .035);
  box-shadow: none;
}

.stories-dark .mag__page--conclusion {
  background: rgba(159, 149, 245, .16);
}

.stories-dark .mag__controls {
  background: transparent;
}

/* Torn edge on the open panel: the purple ground is drawn on its own
   layer, inset a little so the ripped edge isn't clipped, and run through
   the same displacement filter as the torn shapes on the table. Text and
   photos sit above it and stay sharp. */
.stories-dark .viewer__dialog {
  background: transparent;
  box-shadow: none;
}

.stories-dark .viewer__dialog::before {
  position: absolute;
  z-index: 0;
  inset: 16px;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(65vw 55vw at 88% 10%, rgba(159, 149, 245, .2), transparent 62%),
    #211b3d;
  filter: url(#torn-3) drop-shadow(0 24px 40px rgba(0, 0, 0, .55));
}

.stories-dark .viewer__network {
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
}

/* Keep everything that touches the panel's edge inside the tear */
.stories-dark .viewer__close {
  margin: 22px 22px -70px auto;
}

.stories-dark .story--music::after {
  right: 22px;
  bottom: 22px;
}

.stories-dark .story--conference::before {
  top: 16px;
}
