/* The homepage: the private stack told in morning light. Each product is a
   landscape with the glass mark standing in it, paired with a real artifact from
   that product. Built on the tokens in site.css and light.css. */
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; padding: 10px 16px; border-radius: var(--r-in); background: var(--mint); color: var(--mint-ink); }
.skip:focus { top: 12px; }

/* ---------- film shots ---------- */
.film-shot { position: relative; overflow: hidden; isolation: isolate; background: var(--bg); }
.film-media { position: absolute; inset: 0; z-index: -2; animation: drift 16s var(--ease) both; }
.film-media img, .film-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-media video { opacity: 0; transition: opacity 0.6s; }
.film-media video.on { opacity: 1; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.08); } }
/* Grain over every shot, so the upscaled clips and the sharper stills read as one film. */
.film-shot::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05; mix-blend-mode: multiply; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E"); }

/* ---------- opening ---------- */
.open { min-height: calc(100dvh - 69px); display: grid; }
/* The mark stands in the right third of the shot; a cream veil keeps the left clear for the words. */
.open-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(var(--veil), 0) 0%, rgba(var(--veil), 0) 62%, var(--bg) 100%), linear-gradient(90deg, rgba(var(--veil), 0.78) 0%, rgba(var(--veil), 0.42) 38%, rgba(var(--veil), 0) 62%); }
.open-inner { align-self: end; display: grid; gap: clamp(36px, 5vw, 64px); padding-top: 96px; padding-bottom: 28px; }
.open-copy { display: grid; gap: 22px; max-width: 760px; }
.open h1 { font-size: clamp(2.5rem, 5.6vw, 4.9rem); line-height: 1.04; letter-spacing: -0.04em; }
.open-lede { max-width: 50ch; font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.5; color: var(--body); text-wrap: pretty; }
.open-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 8px; }
.open-cta .link { margin-left: 10px; }

.reel-index { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.reel-index a { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; padding: 18px 20px 6px 0; transition: color 0.2s; }
.reel-index a + a { padding-left: 20px; border-left: 1px solid var(--line); }
.reel-index span { grid-row: span 2; font: 400 0.8rem/1.9 var(--mono); color: var(--faint); }
.reel-index b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; letter-spacing: -0.02em; transition: color 0.2s; }
.reel-index small { color: var(--muted); font-size: 0.875rem; }
.reel-index a:hover b { color: var(--mint); }

/* ---------- who can see what ---------- */
.watch-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 88px); align-items: start; }
.watch-copy { display: grid; gap: 22px; }
.ledger { border-top: 1px solid var(--line-2); }
.ledger-row { display: grid; grid-template-columns: 1.1fr 1fr 1.35fr; gap: 20px; padding: 19px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.ledger-row b { font-weight: 500; }
.ledger-row span:nth-child(2) { color: var(--faint); }
.ledger-row span:nth-child(3) { color: var(--mint); }
.ledger-head { padding: 12px 0; font: 400 0.8rem/1.3 var(--mono); }
.ledger-head span:first-child { color: var(--muted); }
.ledger-head span:nth-child(2) { color: var(--faint); }
.ledger sup { line-height: 0; }
.ledger-note { margin-top: 18px; max-width: 62ch; font-size: 0.875rem; color: var(--muted); text-wrap: pretty; }

/* ---------- the four chapters: each one holds, and the next cut slides over it ---------- */
.chapter { min-height: calc(100dvh - 69px); display: grid; align-items: center; border-top: 1px solid var(--line); }
.chapter-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(var(--veil), 0.86) 0%, rgba(var(--veil), 0.6) 34%, rgba(var(--veil), 0) 62%); }
.chapter-right .chapter-shade { transform: scaleX(-1); }
.chapter-inner { padding-block: 56px; }
.chapter-copy { display: grid; gap: 18px; justify-items: start; width: min(100%, 560px); }
.chapter-right .chapter-copy { margin-left: auto; }
.chapter-copy > p:not([class]) { color: var(--body); font-size: 1.0625rem; text-wrap: pretty; }
.chapter-copy .link { margin-top: 4px; }
.chapter-tag { display: flex; align-items: center; gap: 12px; font: 400 0.85rem/1 var(--mono); color: var(--mint); }
.chapter-tag span { color: var(--muted); }
.chapter-tag em { padding: 3px 6px; border: 1px solid var(--line-2); border-radius: 4px; font-style: normal; font-size: 0.72rem; color: var(--muted); }
.chapter-note { font-size: 0.875rem; color: var(--muted); }

/* A real artifact laid over the shot. */
.proof { justify-self: stretch; margin: 6px 0 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(var(--veil), 0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.proof figcaption { margin-bottom: 10px; font-size: 0.8rem; color: var(--muted); }
.proof pre { margin: 0; padding: 0; background: none; overflow-x: auto; font: 400 0.8rem/1.75 var(--mono); }
.proof .k { color: var(--muted); }
.proof .v { color: var(--text); }
.proof .m { color: var(--mint); }

@media (min-width: 900px) and (min-height: 700px) {
  .chapter { position: sticky; top: 69px; }
}

/* ---------- two ways in ---------- */
.start, .catalog, .limits, .holders { position: relative; background: var(--bg); }
.start { padding-bottom: clamp(36px, 5vw, 64px); }
.doors { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.door { display: flex; flex-direction: column; gap: 24px; min-width: 0; padding: clamp(24px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.door-copy { display: grid; gap: 12px; justify-items: start; }
.door-copy p:not(.door-for) { color: var(--muted); max-width: 46ch; }
.door-copy .btn { margin-top: 8px; }
.door-for { font: 400 0.8rem/1 var(--mono); color: var(--mint); }
.door h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; letter-spacing: -0.02em; }
.door-chat { padding-bottom: 0; overflow: hidden; }
.door-chat img { width: 100%; height: 190px; margin-top: auto; object-fit: cover; object-position: 50% 0; border: 1px solid var(--line-2); border-bottom: 0; border-radius: var(--r-in) var(--r-in) 0 0; }
.diff { margin: 0; padding: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-in); background: var(--bg-2); font: 400 0.875rem/1.9 var(--mono); }
.diff .del { color: var(--faint); }
.diff .add { color: var(--mint); }
.door-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: auto; }

/* ---------- catalog ---------- */
.catalog { padding-top: clamp(36px, 5vw, 64px); }
.catalog-more { margin-top: 28px; }

/* ---------- limits, holders ---------- */
.limits { padding-block: clamp(56px, 7vw, 96px); border-top: 1px solid var(--line); }
.limits-grid, .holders-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); }
.limits-grid > div, .holders-grid > div { display: grid; gap: 16px; justify-items: start; align-content: start; }
.limit-list, .rail-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-2); }
.limit-list li { padding: 20px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.limit-list b { display: block; margin-bottom: 4px; color: var(--text); font-weight: 500; }
.holders { padding-block: clamp(56px, 7vw, 96px); border-top: 1px solid var(--line); }
.holders-links { margin: 0; }
.rail-list { align-self: start; }
.rail-list li { display: flex; align-items: center; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rail-list b { font-weight: 500; }
.rail-list span:last-child { margin-left: auto; color: var(--muted); font-size: 0.925rem; text-align: right; }

/* ---------- close ---------- */
.closing-shot { min-height: min(82dvh, 760px); display: grid; align-items: center; }
.closing-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--bg) 0%, rgba(var(--veil), 0) 30%), linear-gradient(270deg, rgba(var(--veil), 0.7) 0%, rgba(var(--veil), 0) 55%); }
.closing-inner { padding-block: clamp(96px, 12vw, 160px); }
/* The mark stands left of centre in the valley: the words take the right. */
.closing-copy { display: grid; gap: 24px; justify-items: start; width: min(100%, 520px); margin-left: auto; }
.closing-inner h2 { max-width: 18ch; font-size: clamp(1.9rem, 3.8vw, 3.2rem); }

@media (max-width: 1040px) {
  .watch-grid, .limits-grid, .holders-grid { grid-template-columns: minmax(0, 1fr); }
}

/* On small screens the shot sits above the words, so neither one fights the other. */
@media (max-width: 899px) {
  /* The shot takes the top of the screen and the words sit under it, on the page. */
  .open .film-media { inset: 0 0 auto; height: 58%; }
  .open .film-media img { object-position: 72% 50%; }
  .open-shade { background: linear-gradient(180deg, rgba(var(--veil), 0) 34%, var(--bg) 58%); }
  .open-inner { padding-top: 300px; }
  .proof pre { white-space: pre-wrap; }
  .reel-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reel-index a:nth-child(3) { padding-left: 0; border-left: 0; }
  .reel-index a:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .chapter { display: block; min-height: 0; }
  .chapter .film-media { position: relative; aspect-ratio: 16 / 10; animation: none; }
  .chapter-shade { top: auto; height: 0; }
  .chapter-right .chapter-copy { margin-left: 0; }
  .closing-copy { margin-left: 0; }
  /* Centre the crop on the mark, so it sits above the words. */
  .closing-shot .film-media img, .closing-shot .film-media video { object-position: 34% 50%; }
  .closing-inner { padding-top: 300px; }
  .chapter-inner { padding-block: 28px 56px; }
  .doors { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .ledger-row { grid-template-columns: 1fr 1fr; gap: 6px 16px; }
  .ledger-row b { grid-column: 1 / -1; }
  .ledger-head span:first-child { display: none; }
  .open-cta .link { margin-left: 2px; }
  .rail-list li { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .film-media { animation: none; }
}

/* ---------- light brand: the opening's chain line ---------- */
.open-chain { display: inline-flex; align-items: center; gap: 9px; font: 500 0.9rem/1 var(--sans); color: var(--body); }
.open-chain img { opacity: 0.85; flex: none; }
/* The chain mark is drawn light grey for dark pages: ink it here. */
.open-chain img { filter: brightness(0.2); }
