/* Inside the centre (27 Oct; 28 Oct framing). One full-viewport cinematic image (Higgsfield Cinema Studio, illustrative),
   Starlight copy over a soft Void scrim, and the "Enter the centre" control: the Spline Metallic Blackhole YODA symbol
   (canvas) or its silver still, centred, with a small text label. Type: section heading token (52/42/32), 16/24 lead. Gold is
   not used here; the header stays dark over this section. Opening pushes in through the symbol into the gallery (.cg). */
.centre { position: relative; z-index: 7; display: flex; flex-direction: column; min-height: 100svh; overflow: hidden;
  /* Copy and portal sit in normal flow, clear of the fixed header (76/64 px) and the safe areas; short or landscape screens and
     larger text make the section grow instead of clipping. The nav link lands on the section top (the header is glass). */
  padding: calc(76px + 24px) var(--m) calc(clamp(40px, 7vh, 80px) + env(safe-area-inset-bottom));
  background: var(--void); color: var(--star); isolation: isolate; }
.ct-bg, .ct-bg img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.ct-bg img { object-fit: cover; object-position: 50% 58%; }
.ct-scrim { position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background: linear-gradient(to top, rgba(14, 14, 15, 0.8) 0%, rgba(14, 14, 15, 0.44) 30%, rgba(14, 14, 15, 0) 60%),
              linear-gradient(to right, rgba(14, 14, 15, 0.35) 0%, rgba(14, 14, 15, 0) 45%),
              linear-gradient(to bottom, rgba(14, 14, 15, 0.35) 0, rgba(14, 14, 15, 0) 140px); }
/* 28 Oct: the symbol sits in the middle of the free space (between the header and the foot), the copy at the bottom left.
   Rows 1fr / auto / 1fr keep the symbol centred; on short or landscape screens the copy row takes what it needs and the
   section grows instead of overlapping. */
.ct-inner { flex: 1; display: grid; grid-template-rows: 1fr auto 1fr; grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
.ct-copy { grid-row: 3; align-self: end; justify-self: start; }
.ct-h { margin: 0; font: 400 var(--y-type-section)/1 var(--f-display); letter-spacing: -0.01em; color: var(--star); text-wrap: balance; }
.ct-h:focus { outline: none; }
.ct-lead { margin: 15px 0 0; max-width: 30em; font: 400 var(--y-type-body)/1.5 var(--f-text); color: rgba(233, 228, 218, 0.82); text-wrap: pretty; }

/* Portal (28 Oct, Shali): the Spline symbol on its own, centred and larger, with a small text label under it; no disc, ring
   or pill. --lw = the symbol's width. The Spline canvas is a square of --lw / 0.62 (centre.js zooms the symbol to 62 % of
   it) centred on the symbol, so it overhangs the button box on purpose; the still is sized to the same symbol width. */
.ct-portal { --lw: min(clamp(200px, 18vw, 300px), 34vh); grid-row: 2; justify-self: center; display: flex; flex-direction: column;
  align-items: center; gap: 4px; padding: 0; border: 0; border-radius: 16px; background: none; color: var(--star); cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
.ct-visual { position: relative; display: block; width: var(--lw); height: calc(var(--lw) * 0.72);
  transition: transform .6s cubic-bezier(.22, 1, .36, 1); }
.ct-still, .ct-stage, .ct-canvas { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.ct-still { width: calc(var(--lw) / 0.87); max-width: none; height: auto; transform: translate(-51.6%, -50%); opacity: 0.95; transition: opacity .5s ease;
  filter: drop-shadow(0 18px 36px rgba(14, 14, 15, 0.4)); } /* alpha bounds: symbol spans 87% of the asset, centred at 51.6%; override the global img max-width */
/* The Spline runtime sizes its canvas to its parent, so the canvas gets its own square stage (the visual box is not square). */
.ct-stage { width: calc(var(--lw) / 0.62); height: calc(var(--lw) / 0.62); transform: translate(-50%, -50%); }
.ct-canvas { width: 100%; height: 100%; transform: translate(-50%, -50%); opacity: 0; transition: opacity .6s ease; }
.centre.spline-live .ct-canvas { opacity: 1; }
.centre.spline-live .ct-still { opacity: 0; }
.ct-label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px;
  font: 400 15px/1.4 var(--f-text); letter-spacing: 0.01em; color: var(--star); text-shadow: 0 1px 14px rgba(14, 14, 15, 0.55);
  transition: opacity .35s ease; }
.ct-label .pki { font-size: 17px; transition: transform .25s cubic-bezier(.22, 1, .36, 1); }
@media (hover: hover) and (pointer: fine) {
  .ct-portal:hover .ct-visual { transform: scale(1.04); }
  .ct-portal:hover .ct-label .pki { transform: translateX(3px); }
}
.ct-portal:active .ct-visual { transform: scale(.97); }
.ct-portal:focus-visible { outline: 2px solid var(--star); outline-offset: 6px; }

/* Entering (centre.js): the symbol pushes towards the camera until the visitor is through its opening while the gallery
   grows inside that opening; the photo eases forward a little and the copy and label fade. One script loop sets all of it
   from one progress value (inline styles), so nothing here may transition while it runs. Closing plays the same frames back. */
.centre.is-moving .ct-visual, .centre.is-moving .ct-bg img, .centre.is-moving .ct-copy, .centre.is-moving .ct-label { transition: none; will-change: transform, opacity; }

/* Tablets upright: more room for the symbol. */
@media (max-width: 1099px) and (orientation: portrait) { .ct-portal { --lw: min(40vw, 300px, 28svh); } }
/* Phones: the symbol floats in the open middle of the portrait image, the copy sits at the foot; all in flow. */
@media (max-width: 759px) {
  .centre { padding-top: calc(64px + 16px + env(safe-area-inset-top)); padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .ct-bg img { object-position: 50% 50%; }
  .ct-scrim { background: linear-gradient(to top, rgba(14, 14, 15, 0.84) 0%, rgba(14, 14, 15, 0.46) 32%, rgba(14, 14, 15, 0) 62%),
              linear-gradient(to bottom, rgba(14, 14, 15, 0.3) 0, rgba(14, 14, 15, 0) 120px); }
  .ct-portal { --lw: min(58vw, 240px, 28svh); }
}
/* Landscape phones: one row, the copy at the foot on the left, the symbol in the middle of the screen. */
@media (orientation: landscape) and (max-height: 520px) {
  .centre { padding-top: calc(64px + 12px); padding-bottom: 24px; }
  .ct-inner { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); column-gap: 24px; }
  .ct-copy { grid-row: 1; grid-column: 1; }
  .ct-portal { --lw: min(36svh, 170px); grid-row: 1; grid-column: 2; align-self: center; }
}

/* Gallery dialog */
.cg { --cx: 50vw; --cy: 50vh; position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--void); color: var(--star); overflow: hidden; display: none;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; clip-path: circle(0 at var(--cx) var(--cy)); }
.cg[open] { display: grid; }
.cg::backdrop { background: transparent; }
.cg.is-open { clip-path: circle(150vmax at var(--cx) var(--cy)); transition: clip-path .85s cubic-bezier(.7, 0, .2, 1); }
.cg.is-closing { clip-path: circle(0 at var(--cx) var(--cy)); transition: clip-path .6s cubic-bezier(.7, 0, .2, 1); }
/* 28 Oct, through the portal: centre.js sets the gallery's circle and opacity every frame (inline) while it opens and closes. */
.cg.is-portal, .cg.is-portal.is-open { transition: none; }
.cg-top { display: flex; align-items: center; gap: 16px; padding: 16px var(--m); }
.cg-h { margin: 0; font: 400 20px/1.3 var(--f-display); letter-spacing: -0.01em; }
.cg-count { margin: 0 0 0 auto; font: 400 14px/1.5 var(--f-text); color: rgba(233, 228, 218, 0.7); font-variant-numeric: tabular-nums; }
.cg-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(233, 228, 218, 0.1); color: var(--star); transition: background-color .3s ease; }
.cg-close:hover { background: rgba(233, 228, 218, 0.2); }
.cg-close:focus-visible, .cg-arrow:focus-visible, .cg-thumb:focus-visible { outline: 2px solid var(--star); outline-offset: 2px; }

.cg-stage { position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.cg-track { list-style: none; display: flex; height: 100%; margin: 0; padding: 0; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior: contain; scrollbar-width: none; }
.cg-track::-webkit-scrollbar { display: none; }
.cg-track:focus-visible { outline: none; }
.cg-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.cg-slide figure { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; height: 100%; margin: 0; padding: 4px clamp(16px, 7vw, 120px) 0; }
.cg-slide img { display: block; min-height: 0; max-width: 100%; max-height: calc(100% - 52px); width: auto; height: auto; object-fit: contain; border-radius: 16px;
  transform: scale(.985); opacity: .5; transition: transform .7s cubic-bezier(.22, 1, .36, 1), opacity .7s ease; }
.cg-slide.is-current img { transform: none; opacity: 1; }
.cg-slide figcaption { display: flex; gap: 10px; align-items: baseline; font: 400 14px/1.5 var(--f-text); color: rgba(233, 228, 218, 0.7); text-align: center; }
.cg-slide figcaption b { font-weight: 500; color: var(--star); }
.cg-arrow { position: absolute; top: 50%; display: grid; place-items: center; width: 52px; height: 52px; margin-top: -40px; padding: 0; border: 0; border-radius: 50%;
  cursor: pointer; background: rgba(233, 228, 218, 0.12); color: var(--star); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background-color .3s ease, opacity .3s ease; }
.cg-arrow:hover:not(:disabled) { background: rgba(233, 228, 218, 0.22); }
.cg-arrow:disabled { opacity: .25; cursor: default; }
.cg-arrow .pki { font-size: 22px; }
.cg-prev { left: var(--m); }
.cg-prev .pki { transform: scaleX(-1); }
.cg-next { right: var(--m); }
.cg-foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px var(--m) calc(16px + env(safe-area-inset-bottom)); }
.cg-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.cg-thumbs::-webkit-scrollbar { display: none; }
.cg-thumb { flex: none; width: 64px; height: 44px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: rgba(233, 228, 218, 0.08);
  opacity: .5; transition: opacity .3s ease; }
.cg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-thumb:hover, .cg-thumb[aria-current="true"] { opacity: 1; }
.cg-thumb[aria-current="true"] { box-shadow: 0 0 0 2px var(--star); }
.cg-note { margin: 0; flex: none; font: 400 14px/1.5 var(--f-text); color: rgba(233, 228, 218, 0.6); }

@media (max-width: 759px) {
  .cg-top { padding: 10px var(--m); }
  .cg-h { font-size: 18px; }
  .cg-arrow { display: none; } /* swipe */
  .cg-slide figure { padding: 0 var(--m); }
  .cg-slide img { border-radius: 12px; }
  .cg-slide figcaption { flex-direction: column; gap: 0; }
  .cg-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .cg-thumb { width: 52px; height: 40px; }
  .cg-note { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ct-visual, .ct-label, .ct-label .pki, .ct-bg img, .ct-copy { transition: none; }
  .cg, .cg.is-open, .cg.is-closing { clip-path: none; transition: none; }
  .cg-track { scroll-behavior: auto; }
  .cg-slide img { transition: none; transform: none; opacity: 1; }
}
