/* worlds.css — project worlds and the home-page doorways into them.
   Structure only: every colour and typeface comes from the project's world
   (--w-* custom properties set inline from apps/projects/worlds.py), so each
   project page looks like itself, not like Mich's brand. */

.world {
  --w-gutter: clamp(16px, 4vw, 64px);
  background: var(--w-bg);
  color: var(--w-fg);
  font-family: var(--w-body), ui-sans-serif, system-ui, sans-serif;
  overflow: clip;
}
.world ::selection { background: var(--w-fg); color: var(--w-bg); }
.world :focus-visible { outline-color: var(--w-accent); }

.world-label {
  font-family: var(--w-body), ui-sans-serif, sans-serif;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .72;
}
.world-link { text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
.world-link:hover { color: var(--w-accent); }
.world-prose { font-size: clamp(1.05rem, 1.2vw, 1.2rem); line-height: 1.7; max-width: 60ch; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.world-hero { padding: clamp(40px, 7vw, 110px) var(--w-gutter) clamp(40px, 6vw, 90px); display: grid; gap: clamp(28px, 4vw, 56px); }
.world-hero__text { display: grid; gap: 18px; align-content: start; }
.world-hero__meta { margin-top: 18px; }
.world-hero__title {
  font-family: var(--w-display), serif;
  font-size: clamp(2.6rem, min(10vw, calc(96vw / var(--len, 8))), 11rem);
  line-height: .9;
  letter-spacing: -.02em;
  max-width: 14ch;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.world-hero__hook { font-size: clamp(1.2rem, 2.2vw, 2rem); line-height: 1.3; max-width: 32ch; }
.world-hero__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.world-hero__cover--artwork { display: grid; place-items: center; background: color-mix(in srgb, var(--w-fg) 6%, var(--w-bg)); padding: clamp(24px, 5vw, 72px); }
.world-hero__cover--artwork img { width: auto; height: auto; max-width: min(560px, 80%); max-height: 40svh; object-fit: contain; }
.world-hero--poster { position: relative; min-height: 88svh; align-content: end; }
.world-hero--poster .world-hero__cover { position: absolute; inset: 0; z-index: 0; }
.world-hero--poster .world-hero__cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, var(--w-bg) 96%); }
.world-hero--poster .world-hero__text { position: relative; z-index: 1; }

.world-hero--split .world-hero__cover { aspect-ratio: 4 / 3; overflow: hidden; }
@media (min-width: 900px) {
  .world-hero--split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; min-height: 80svh; }
  .world-hero--split .world-hero__title { font-size: clamp(2.6rem, min(6.4vw, calc(50vw / var(--len, 8))), 8.5rem); }
}
.world-hero--stacked .world-hero__cover { aspect-ratio: 16 / 8; overflow: hidden; }

/* The red dot crosses over: Mich's signature full stop, in someone else's world. */
.world-slot { display: inline-block; width: .2em; height: .15em; margin-left: .05em; }

.world-aside {
  font-size: .98rem;
  max-width: 40ch;
  padding: .7em 1em;
  border: 1px solid color-mix(in srgb, var(--w-fg) 25%, transparent);
  border-radius: 999px;
  justify-self: start;
}
.world-aside__by { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; opacity: .6; margin-right: .5em; }

/* ── Intro ────────────────────────────────────────────────────────── */
.world-intro { padding: clamp(40px, 6vw, 96px) var(--w-gutter); display: grid; gap: 40px; }
@media (min-width: 900px) { .world-intro { grid-template-columns: 7fr 5fr; } }
.world-intro__lead { font-family: var(--w-display), serif; font-size: clamp(1.6rem, 3vw, 3rem); line-height: 1.12; max-width: 24ch; }
.world-intro__side { display: grid; gap: 12px; align-content: start; }
.world-intro__side .world-label:not(:first-child) { margin-top: 20px; }
.world-links { display: flex; gap: 24px; margin-top: 16px; }

/* ── Chapters ─────────────────────────────────────────────────────── */
.chapter { padding: clamp(56px, 8vw, 130px) var(--w-gutter); }
.chapter--even { background: var(--w-muted); }
.chapter__head { display: grid; gap: 10px; margin-bottom: clamp(28px, 4vw, 56px); }
.chapter__num { display: inline-flex; align-items: center; gap: .7em; }
.chapter__title { font-family: var(--w-display), serif; font-size: clamp(2.4rem, 6vw, 6rem); line-height: .95; letter-spacing: -.015em; }
.chapter__kicker { font-size: clamp(1.05rem, 1.5vw, 1.35rem); opacity: .8; max-width: 44ch; }

.media { margin: 0; }
.media img { display: block; width: 100%; height: auto; }
.media figcaption { margin-top: 10px; font-size: .9rem; opacity: .7; }
.media--artwork { background: color-mix(in srgb, var(--w-fg) 5%, var(--w-bg)); padding: clamp(20px, 4vw, 56px); display: grid; place-items: center; }
.media--artwork img { max-height: 320px; width: auto; max-width: 100%; }

/* Wall */
.wall { display: grid; gap: 32px; }
.wall__note { max-width: 52ch; }
.wall__board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 44vw), 1fr)); gap: clamp(14px, 2.5vw, 32px); padding: 12px; }
.wall__pin { position: relative; transform: rotate(var(--tilt, -2deg)); transition: transform .5s cubic-bezier(.22,1,.36,1); box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.wall__pin:nth-child(3n+2) { --tilt: 2.5deg; margin-top: 18px; }
.wall__pin:nth-child(3n) { --tilt: -1deg; margin-top: -8px; }
.wall__pin:nth-child(4n) { --tilt: 3.5deg; }
.wall__pin:hover { transform: rotate(0) scale(1.03); z-index: 2; }
.wall__pin::before { /* a strip of tape */
  content: ''; position: absolute; top: -10px; left: 50%; width: 64px; height: 20px; translate: -50% 0; rotate: -4deg;
  background: color-mix(in srgb, var(--w-accent) 45%, transparent); z-index: 1;
}
.wall__pin .media img { aspect-ratio: 3 / 4; object-fit: cover; }

/* Split */
.split { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .split { grid-template-columns: 5fr 7fr; align-items: start; }
  .chapter:not(.chapter--even) .split__text { order: 2; }
}
.split__media { display: grid; gap: 18px; }

/* Full bleed */
.fullbleed__hero { position: relative; margin: 0 calc(-1 * var(--w-gutter)); }
.fullbleed__hero .media img { max-height: 92svh; object-fit: cover; }
.fullbleed__words {
  position: absolute; left: var(--w-gutter); bottom: var(--w-gutter); max-width: 40ch;
  background: var(--w-bg); color: var(--w-fg); padding: 1.1em 1.3em; font-size: 1.05rem; line-height: 1.6;
}
.fullbleed__rest { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }

/* Specimen */
.specimen { display: grid; gap: clamp(28px, 4vw, 56px); }
.specimen__palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; }
.swatch { display: grid; gap: 4px; padding-bottom: 14px; }
.swatch__chip { display: block; aspect-ratio: 1 / 1.15; background: var(--swatch); outline: 1px solid color-mix(in srgb, var(--w-fg) 12%, transparent); outline-offset: -1px; }
.swatch__name { font-weight: 600; margin-top: 10px; padding-left: 2px; }
.swatch__hex { font-size: .85rem; opacity: .7; padding-left: 2px; font-variant-numeric: tabular-nums; }
.specimen__type { display: grid; gap: 18px; }
@media (min-width: 700px) { .specimen__type { grid-template-columns: 1fr 1fr; } }
.specimen__face { border-top: 1px solid color-mix(in srgb, var(--w-fg) 30%, transparent); padding-top: 14px; display: grid; gap: 6px; }
.specimen__aa { font-size: clamp(5rem, 14vw, 13rem); line-height: .9; }
.specimen__face--display .specimen__aa { font-family: var(--w-display), serif; }
.specimen__marks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }

/* Gallery */
.gallery { display: grid; gap: 28px; }
.gallery__strip {
  display: flex; gap: clamp(12px, 2vw, 24px); overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--w-gutter)); padding: 0 var(--w-gutter) 14px; scrollbar-width: thin;
}
.gallery__strip .media { flex: none; scroll-snap-align: start; }
.gallery__strip .media img { height: clamp(280px, 62svh, 640px); width: auto; max-width: none; }
.gallery__strip .media--artwork { height: clamp(280px, 62svh, 640px); aspect-ratio: 4 / 5; }

/* Statement */
.statement__words { font-family: var(--w-display), serif; font-size: clamp(2rem, 5vw, 5.2rem); line-height: 1.05; max-width: 22ch; letter-spacing: -.01em; }
.statement .media { margin-top: 40px; }

/* Pillars */
.pillars { display: grid; gap: 40px; }
.pillars__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 0; }
.pillar { border-top: 1px solid color-mix(in srgb, var(--w-fg) 30%, transparent); padding: 22px 20px 30px 0; display: grid; gap: 10px; align-content: start; }
.pillar__n { font-size: .8rem; letter-spacing: .14em; opacity: .6; }
.pillar__title { font-family: var(--w-display), serif; font-size: clamp(1.5rem, 2.4vw, 2.3rem); line-height: 1.05; }
.pillar__text { line-height: 1.6; opacity: .88; max-width: 42ch; }
.pillars__media { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }

/* Outcome */
.world-outcome { padding: clamp(56px, 8vw, 120px) var(--w-gutter); display: grid; gap: 18px; }
.world-outcome__text { font-family: var(--w-display), serif; font-size: clamp(1.6rem, 3.4vw, 3.4rem); line-height: 1.12; max-width: 26ch; }

/* Next world: a strip of the next project's colours, a door out of this one. */
.next-world { background: var(--w-bg); color: var(--w-fg); }
.next-world__link { display: grid; gap: 10px; padding: clamp(40px, 6vw, 90px) var(--w-gutter, clamp(16px, 4vw, 60px)); }
.next-world__title { font-family: var(--w-display), serif; font-size: clamp(2.4rem, 7vw, 7rem); line-height: .95; transition: transform .6s cubic-bezier(.22,1,.36,1); }
.next-world__link:hover .next-world__title { transform: translateX(.08em); }

/* ── Home: doorways ───────────────────────────────────────────────── */
.doors { position: relative; }
.door {
  position: sticky;
  top: 0;
  min-height: 100svh;
  background: var(--w-bg);
  color: var(--w-fg);
  box-shadow: 0 -24px 48px rgba(20, 12, 8, .18);
}
.door__link { display: grid; grid-template-rows: auto 1fr auto; min-height: 100svh; padding: clamp(84px, 9vw, 120px) clamp(16px, 4vw, 60px) clamp(24px, 4vw, 48px); gap: clamp(20px, 3vw, 40px); }
.door__top { display: flex; justify-content: space-between; gap: 16px; font-family: 'DM Sans', sans-serif; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.door__swatches { display: inline-flex; gap: 6px; align-items: center; }
.door__swatches i { width: 14px; height: 14px; border-radius: 50%; outline: 1px solid color-mix(in srgb, var(--w-fg) 30%, transparent); }
.door__main { display: grid; gap: clamp(20px, 4vw, 56px); align-items: center; }
@media (min-width: 900px) {
  .door__main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .door:nth-child(even) .door__title { order: 2; }
}
.door__title {
  font-family: var(--w-display), serif;
  /* long names shrink so the cover keeps its half */
  font-size: clamp(2.6rem, min(8.6vw, calc(78vw / var(--len, 8))), 9.5rem);
  line-height: .9;
  letter-spacing: -.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  transition: transform 1s cubic-bezier(.22,1,.36,1);
}
.door__cover { aspect-ratio: 4 / 3; overflow: hidden; max-height: 56svh; width: 100%; }
.door__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s cubic-bezier(.22,1,.36,1); }
.door__cover--artwork { display: grid; place-items: center; background: color-mix(in srgb, var(--w-fg) 6%, var(--w-bg)); }
.door__cover--artwork img { width: 62%; height: auto; object-fit: contain; }
.door__link:hover .door__cover img { transform: scale(1.04); }
.door__link:hover .door__title { transform: translateX(.06em); }
.door__bottom { display: grid; gap: 14px; font-family: 'DM Sans', sans-serif; }
@media (min-width: 900px) { .door__bottom { grid-template-columns: 1fr auto; align-items: end; } }
.door__hook { font-size: clamp(1.02rem, 1.3vw, 1.25rem); line-height: 1.5; max-width: 46ch; }
.door__aside { font-size: .92rem; opacity: .72; margin-top: 6px; }
.door__enter {
  justify-self: start; display: inline-flex; gap: .6em; align-items: center;
  padding: .9em 1.4em; border-radius: 999px; background: var(--w-accent); color: var(--w-bg);
  font-family: 'Clash Display', sans-serif; font-weight: 500; white-space: nowrap;
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.door__link:hover .door__enter { transform: translateX(4px); }
@media (max-width: 899px) {
  .door__link { padding-top: 72px; }
  .door__cover { max-height: 38svh; }
}

@media (prefers-reduced-motion: reduce) {
  .door { position: relative; }
}
