/* =========================================================================
   Cover Flow — the archetype deck as a 3-D fan (REQ-273, REQ-800).

   The stylesheet of `cover-flow.js`, shared by the homepage (its nine) and
   `/archetypes` (one per vector). Moved out of `home.css` on 2026-10-26 so a
   v1.0 page can use the component without pulling the whole landing page
   onto itself (the cascade-reach rule). Every colour is a `var()` from
   `brand-tokens.css`; this file declares none. Load it BEFORE a page's own
   stylesheet, which may restyle `.cf-nav` for its other carousels.
   ========================================================================= */
.carousel-section {
  padding: var(--sec-y, 64px) 0;
  overflow: hidden;
  position: relative;
}
.carousel-section .section-label,
.carousel-section .heading,
.carousel-section .sub,
.carousel-section .carousel-cta,
.carousel-section .cf-info {
  padding-left: 24px; padding-right: 24px;
}
.carousel-track-wrap {
  position: relative;
  margin-top: 16px;
}
.carousel-stage {
  position: relative;
  width: 100%;
  height: 480px;
  perspective: 1500px;
  perspective-origin: 50% 50%;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
/* REQ-821 (b) — the stage is focusable (arrow keys); the focus is visible. */
.carousel-stage:focus:not(:focus-visible) { outline: none; }
.carousel-stage:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px; }
.carousel-stage.is-dragging { cursor: grabbing; }
.carousel-stage.is-dragging .arc-card { transition: none; }
.carousel-track {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  display: block;
}
.arc-card {
  position: absolute;
  top: 50%; left: 50%;
  width: 240px;
  height: 448px;
  margin-top: -224px;
  margin-left: -120px;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  display: block;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1),
              width 620ms cubic-bezier(0.22, 1, 0.36, 1),
              height 620ms cubic-bezier(0.22, 1, 0.36, 1),
              margin 620ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity 420ms ease;
  -webkit-box-reflect: below 6px linear-gradient(transparent 55%, rgba(0,0,0,0.42));
  will-change: transform, opacity;
}
/* REQ-820 — the chosen card is enlarged by LAYOUT, not by a compositor scale.
   `scale(1.06)` stretched a raster painted at 240×448 (itself from the 440 px
   delivery copy, REQ-758) and the card went soft the moment it was chosen:
   measured on production 2026-10-29, sharpness 234.8 as drawn against 659.0
   with the scale removed (`ux-audits/_scripts/archetypes-blur-probe.py`).
   The box grows instead — the same 6 % — so the raster is painted at its
   final size; the neighbours keep their down-scales, which do not soften. */
.arc-card.is-active {
  cursor: default;
  width: 254px; height: 475px;
  margin-top: -238px; margin-left: -127px;
}
.ac-card-img {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 30%, rgba(201,168,109,0.10), transparent 60%),
    linear-gradient(180deg, #1a1828, #0f0d1a);
  box-shadow: 0 18px 50px -12px rgba(0,0,0,0.55),
              0 2px 8px rgba(0,0,0,0.4);
}
.arc-card.oracle-card .ac-card-img { border-top: 2px solid var(--oracle); }
.arc-card.mocker-card .ac-card-img { border-top: 2px solid var(--mocker); }
.arc-card.is-active .ac-card-img {
  border-color: var(--gold-2);
  box-shadow: 0 26px 70px -10px rgba(0,0,0,0.7),
              0 0 0 1px rgba(201,168,109,0.25),
              0 4px 14px rgba(0,0,0,0.5);
}
.ac-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ac-card-img::after {
  content: '';
  position: absolute; inset: 0;
  box-shadow: inset 0 0 28px rgba(11,10,18,0.4),
              inset 0 -60px 60px -30px rgba(11,10,18,0.55);
  pointer-events: none;
}
/* Animated card clip: fades in over the static image only while the card is
   centered (`.is-active`) and its video is actually playing. The still image
   stays underneath as poster + graceful fallback when the clip is missing. */
.ac-card-img .ac-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.arc-card.is-active .ac-card-img .ac-video.is-playing { opacity: 1; }
/* While the clip is playing, clear the overlays that sit on top of it (the
   ☽ Oracle/Mocker badge and the edge vignette) so only the animated card
   shows — they return the moment it pauses. */
.ac-mode { transition: opacity 0.4s ease; }
.arc-card.is-clip-playing .ac-mode { opacity: 0; }
.ac-card-img::after { transition: opacity 0.4s ease; }
.arc-card.is-clip-playing .ac-card-img::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .ac-card-img .ac-video { display: none; }
}
.ac-mode {
  position: absolute;
  top: 8px; left: 8px;
  padding: 4px 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(11,10,18,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 2px;
  z-index: 2;
}
.arc-card.oracle-card .ac-mode { color: var(--gold-2); border-color: rgba(74,111,165,0.55); }
.arc-card.mocker-card .ac-mode { color: var(--gold-2); border-color: rgba(200,116,82,0.55); }
/* Card-internal meta strings stay in DOM for i18n + JS read; never rendered. */
.arc-card .ac-meta,
.arc-card .ac-vector,
.arc-card .ac-name,
.arc-card .ac-l2 { display: none; }

/* ── Cover Flow nav buttons ────────────────────────────────────────── */
.cf-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  padding: 0;
  background: linear-gradient(180deg, var(--gold-2) 0%, var(--gold) 100%);
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 6px 20px -6px rgba(0,0,0,0.65), 0 0 0 1px rgba(11,10,18,0.15);
  transition: background 200ms var(--ease), border-color 200ms var(--ease),
              color 200ms var(--ease), box-shadow 200ms var(--ease), opacity 200ms ease;
}
.cf-nav svg { display: block; }
/* Sit just outside the visible card fan (offset-3 at ~±360px from center)
   while clamping to a small viewport-edge gap on narrow screens. */
.cf-prev { left:  max(16px, calc(50% - 400px)); }
.cf-next { right: max(16px, calc(50% - 400px)); }
.cf-nav:hover {
  filter: brightness(1.12);
  border-color: var(--gold);
  box-shadow: 0 8px 26px -6px rgba(0,0,0,0.72), 0 0 0 1px rgba(11,10,18,0.22);
}
.cf-nav:disabled { opacity: 0.25; cursor: not-allowed; }

/* ── Active-card info pane ─────────────────────────────────────────── */
.cf-info {
  text-align: center;
  margin: 18px auto 0;
  max-width: 720px;
  min-height: 110px;
}
.cf-info-vector {
  font-family: var(--f-mono);
  font-size: var(--t-kicker-b, 11px);
  letter-spacing: var(--ls-kicker-b, 0.2em);
  text-transform: uppercase;
  color: var(--text-2);
}
.cf-info-name {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--t-name, 28px);
  line-height: 1.15;
  color: var(--gold-2);
  margin: 8px 0 10px;
}
.cf-info-l2 {
  font-family: var(--f-display);
  font-size: var(--read-size);   /* REQ-866 */
  line-height: var(--read-lh);
  color: var(--text);
  margin: 0 auto;
}
.cf-info-vector,
.cf-info-name,
.cf-info-l2 { transition: opacity 280ms ease; }
.cf-info.is-swapping > * { opacity: 0; }

.carousel-cta { text-align: center; margin-top: 28px; }

@media (max-width: 700px) {
  .carousel-stage { height: 420px; }
  .arc-card { width: 200px; height: 374px; margin-top: -187px; margin-left: -100px; }
  .arc-card.is-active { width: 212px; height: 396px; margin-top: -198px; margin-left: -106px; }  /* REQ-820 */
  .cf-nav { width: 44px; height: 44px; }  /* iOS HIG tap-target floor (was 40) */
  .cf-nav svg { width: 18px; height: 18px; }
  .cf-prev { left:  max(8px, calc(50% - 320px)); }
  .cf-next { right: max(8px, calc(50% - 320px)); }
}
@media (max-width: 480px) {
  .carousel-stage { height: 380px; }
  .arc-card { width: 170px; height: 318px; margin-top: -159px; margin-left: -85px; }
  .cf-prev { left:  max(4px, calc(50% - 250px)); }
  .cf-next { right: max(4px, calc(50% - 250px)); }
}

/* ── Split variant: rotating deck (left) + always-on detail (right) ──── */
.archetype-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  max-width: 1180px;
  margin: 28px auto 0;
  padding: 0 24px;
}
.archetype-stage-col { position: relative; min-width: 0; }
/* Stage now lives in the left half — drive the fan off column width, not
   the viewport (see metrics() in home.js), and pin nav inside the column. */
.archetype-split .carousel-stage { height: 472px; }
.archetype-split .cf-prev { left: 4px; }
.archetype-split .cf-next { right: 4px; }

.archetype-detail-col {
  min-width: 0;
  align-self: center;
  text-align: left;
}
/* Neutralise the centred full-width info pane + the section's 24px gutters. */
.archetype-detail-col .cf-info {
  text-align: left;
  margin: 0;
  max-width: none;
  min-height: 0;
  padding-left: 0;
  padding-right: 0;
}
/* REQ-821 (c): the subject name is one size on the page (`--t-name`); the
   42 px here was the largest of eight. */
.archetype-detail-col .cf-info-name {
  margin: 12px 0 18px;
}
.archetype-detail-col .cf-info-l2 {
  margin: 0;
}
.archetype-split .carousel-cta {
  text-align: left;
  margin-top: 26px;
  padding-left: 0;
  padding-right: 0;
}

@media (max-width: 860px) {
  .archetype-split {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .archetype-detail-col { text-align: center; }
  .archetype-detail-col .cf-info { text-align: center; }
  .archetype-split .carousel-cta { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .arc-card { transition: none !important; }
}
