/* ════════════════════════════════════════════════════════════
   AL MILLENNIUM — v2.css · "Future Edition" shared foundation
   Loaded ONLY by the /v2 preview pages, after style/app/components.
   Everything derives from the :root tokens in style.css — no new
   colors, no new fonts. Motion is composed and slow (no springs).
   Complements enhancements.js (cursor / curtain / progress /
   particles already exist there — nothing here duplicates them).
   ════════════════════════════════════════════════════════════ */

:root {
  --v2-ease: cubic-bezier(0.16, 1, 0.3, 1);   /* long decelerate */
  --v2-dur:  1.1s;
}

/* ─────────────────────────────────────────────────────
   KINETIC DISPLAY TYPE — per-letter rise, masked
   v2.js splits [data-kinetic] into .kw (word) / .kc (char)
───────────────────────────────────────────────────── */
.v2-kinetic .kw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}
.v2-kinetic .kc {
  display: inline-block;
  transform: translateY(118%);
  transition: transform 1.15s var(--v2-ease);
  transition-delay: var(--kd, 0ms);
  will-change: transform;
}
.v2-kinetic.in .kc { transform: none; }

/* Line-mask reveal — v2.js wraps [data-lines] lines in .klw > .kl */
.v2-lines .klw { display: block; overflow: hidden; }
.v2-lines .kl {
  display: block;
  transform: translateY(105%);
  opacity: 0;
  transition: transform 1.2s var(--v2-ease), opacity 0.9s ease;
  transition-delay: var(--kd, 0ms);
}
.v2-lines.in .kl { transform: none; opacity: 1; }

/* Simple fade-rise for hero chrome (CTAs, eyebrows, cues) */
.v2-io {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s ease var(--kd, 0ms), transform 1.2s var(--v2-ease) var(--kd, 0ms);
}
.v2-io.in { opacity: 1; transform: none; }

/* ─────────────────────────────────────────────────────
   SIGIL — stroke-draws itself, then fills
───────────────────────────────────────────────────── */
.v2-sigil polygon {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  fill-opacity: 0;
  transition:
    stroke-dashoffset 2.6s var(--v2-ease) var(--kd, 0ms),
    fill-opacity 1.4s ease calc(var(--kd, 0ms) + 1.5s);
}
.v2-sigil.in polygon { stroke-dashoffset: 0; fill-opacity: 1; }

/* ─────────────────────────────────────────────────────
   GOLD SHEEN — living gradient text (use sparingly: one
   element per page). Uses the existing --grad-gold token.
───────────────────────────────────────────────────── */
.v2-sheen {
  background: var(--grad-gold);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: v2Sheen 9s ease-in-out infinite;
}
@keyframes v2Sheen {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ─────────────────────────────────────────────────────
   WATERMARK — giant outlined word behind mastheads
───────────────────────────────────────────────────── */
.v2-watermark {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(120px, 19vw, 300px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1px rgba(147,115,65,0.14);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  animation: v2Breathe 16s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes v2Breathe {
  from { letter-spacing: 0.08em; opacity: 0.8; }
  to   { letter-spacing: 0.13em; opacity: 1; }
}

/* ─────────────────────────────────────────────────────
   SCROLL-DRIVEN PARALLAX — progressive (modern engines);
   older browsers simply see the static framed image.
───────────────────────────────────────────────────── */
@supports (animation-timeline: view()) {
  .v2-par {
    animation: v2Par linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }
  @keyframes v2Par {
    from { transform: translateY(-6.5%) scale(1.14); }
    to   { transform: translateY(6.5%) scale(1.14); }
  }
}

/* ─────────────────────────────────────────────────────
   GLASS PANEL
───────────────────────────────────────────────────── */
.v2-glass {
  background: rgba(17,17,21,0.55);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid var(--border);
}

/* ─────────────────────────────────────────────────────
   SHIMMER FRAME — slow gold light travelling a 1px border
───────────────────────────────────────────────────── */
.v2-shimmer-frame {
  position: relative;
  padding: 1px;
  background: linear-gradient(120deg,
    rgba(147,115,65,0.16) 0%,
    rgba(196,185,152,0.55) 18%,
    rgba(147,115,65,0.16) 36%,
    rgba(147,115,65,0.16) 100%);
  background-size: 300% 100%;
  animation: v2Shimmer 8s linear infinite;
}
.v2-shimmer-frame > * { background: var(--bg); }
@keyframes v2Shimmer {
  from { background-position: 100% 0; }
  to   { background-position: -200% 0; }
}

/* ─────────────────────────────────────────────────────
   EYEBROW + DISPLAY (system §3, shared here for v2 pages)
───────────────────────────────────────────────────── */
.v2-eyebrow {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
}
.v2-eyebrow.ruled::before,
.v2-eyebrow.ruled::after {
  content: '';
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--gold-dim);
  vertical-align: middle;
  margin: 0 18px;
}
.v2-display {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 120px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-bright);
  line-height: 0.95;
  text-shadow: var(--glow-gold);
}
.v2-display em { font-style: italic; font-weight: 400; color: var(--gold); }

/* ─────────────────────────────────────────────────────
   LENS RAIL — accordion portrait gallery (The Souls)
───────────────────────────────────────────────────── */
.v2-lens {
  display: flex;
  gap: 10px;
  height: 560px;
}
.v2-lens .lens-card {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  background: var(--bg2);
  text-decoration: none;
  transition: flex-grow 1s var(--v2-ease), min-width 1s var(--v2-ease);
  will-change: flex-grow;
}
/* The expanded card is guaranteed wide enough for the full name block,
   however many souls share the rail. */
.v2-lens .lens-card:hover,
.v2-lens .lens-card:focus-visible { flex-grow: 3.4; min-width: min(330px, 38vw); outline: none; }
.v2-lens .lens-card.hidden { display: none; }

.lens-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: top center;
  filter: brightness(0.6) contrast(1.05) saturate(0.78) grayscale(0.3);
  transition: filter 1s ease;
}
.lens-card:hover .lens-img,
.lens-card:focus-visible .lens-img {
  filter: brightness(0.95) contrast(1.08) saturate(1) grayscale(0);
}
.lens-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(4,4,6,0.92) 0%, rgba(4,4,6,0.25) 38%, transparent 62%);
  pointer-events: none;
}

/* collapsed state — vertical name strip */
.lens-name-v {
  position: absolute;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-light);
  z-index: 2;
  white-space: nowrap;
  opacity: 0.85;
  transition: opacity 0.5s ease;
}
.lens-card:hover .lens-name-v,
.lens-card:focus-visible .lens-name-v { opacity: 0; }

/* expanded state — full meta block */
.lens-meta {
  position: absolute;
  left: 24px; right: 24px; bottom: 22px;
  z-index: 2;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease 0.25s, transform 0.8s var(--v2-ease) 0.25s;
}
.lens-card:hover .lens-meta,
.lens-card:focus-visible .lens-meta { opacity: 1; transform: none; }
.lens-meta .lm-nation {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--na, var(--gold-light));
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  white-space: nowrap;
}
.lens-meta .lm-nation::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(to right, var(--na, var(--gold-dim)), transparent);
  opacity: 0.5;
}
.lens-meta .lm-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-bright);
  line-height: 1.05;
  white-space: normal;     /* very long names wrap instead of clipping */
  text-wrap: balance;
}
.lens-meta .lm-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-style: italic;
  color: var(--text-sub);
  margin-top: 7px;
  white-space: normal;
}
.lens-meta .lm-open {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.lens-chip {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.22em;
  padding: 5px 9px;
  border: 1px solid rgba(196,185,152,0.4);
  color: var(--gold-bright);
  background: rgba(10,10,12,0.55);
  backdrop-filter: blur(4px);
}

@media (max-width: 860px) {
  .v2-lens { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; height: auto; }
  .v2-lens .lens-card { aspect-ratio: 3 / 4; }
  .lens-name-v { display: none; }
  .lens-meta { opacity: 1; transform: none; left: 16px; right: 16px; bottom: 16px; }
  .lens-meta .lm-name { font-size: 16px; white-space: normal; }
  .lens-meta .lm-open { display: none; }
}

/* ─────────────────────────────────────────────────────
   CHAPTER RAIL — fixed side dots tracking story frames
───────────────────────────────────────────────────── */
.v2-rail {
  position: fixed;
  right: 26px; top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.v2-rail a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  text-decoration: none;
}
.v2-rail .lbl {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.4s ease, transform 0.6s var(--v2-ease), color 0.3s;
  white-space: nowrap;
}
.v2-rail .dot {
  width: 7px; height: 7px;
  border: 1px solid var(--gold-dim);
  transform: rotate(45deg);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
  flex-shrink: 0;
}
.v2-rail a:hover .lbl, .v2-rail a.active .lbl { opacity: 1; transform: none; }
.v2-rail a.active .lbl { color: var(--gold-light); }
.v2-rail a:hover .dot { border-color: var(--gold-light); }
.v2-rail a.active .dot {
  background: var(--gold-light);
  border-color: var(--gold-light);
  box-shadow: 0 0 10px rgba(196,185,152,0.5);
}
@media (max-width: 1100px) { .v2-rail { display: none; } }

/* ─────────────────────────────────────────────────────
   ACCESSIBILITY / MOTION SAFETY
───────────────────────────────────────────────────── */
.v2-lens .lens-card:focus-visible { box-shadow: inset 0 0 0 1px var(--gold-light); }

@media (prefers-reduced-motion: reduce) {
  .v2-kinetic .kc, .v2-lines .kl, .v2-io {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .v2-sigil polygon { transition: none; stroke-dashoffset: 0; fill-opacity: 1; }
  .v2-sheen, .v2-watermark, .v2-shimmer-frame { animation: none; }
  .v2-par { animation: none !important; }
  .v2-lens .lens-card { transition: none; }
}
