/* Wave 3 experience layer (identical file on Website Development, Performance Marketing, Content and Social Media).
   Chapter rail, pixel seams, the dark chapter plate, the light gallery still, and the three process builds. */

/* ---------- chapter rail: navigation, square markers, Space Mono ---------- */
.x3-rail { display: none; }
@media (min-width: 1100px) {
  .x3-rail { --m: oklch(0.62 0.012 358); --t: oklch(0.965 0.005 358); --t2: oklch(0.78 0.01 358); --bg: oklch(0.135 0.006 358);
    position: fixed; z-index: 30; right: max(8px, calc(var(--pad) / 2 - 12px)); top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 14px; }
  .x3-rail.is-light { --m: oklch(0.5 0.012 358); --t: oklch(0.17 0.006 358); --t2: oklch(0.38 0.01 358); --bg: oklch(0.975 0.003 358); }
  .x3-rail ol { display: flex; flex-direction: column; gap: 2px; }
  .x3-rail a { position: relative; display: grid; place-items: center; width: 24px; height: 24px; text-decoration: none; }
  .x3-rail i { width: 10px; height: 10px; border: 1.5px solid var(--m); transition: background-color .4s var(--ease), border-color .4s var(--ease), transform .5s var(--ease); }
  .x3-rail a.is-done i { background: var(--m); }
  .x3-rail a[aria-current] i { background: var(--accent); border-color: var(--accent); transform: scale(1.2); }
  .x3-rail a:hover i { border-color: var(--accent); }
  .x3-rail span { position: absolute; right: 30px; top: 50%; white-space: nowrap; padding: 6px 9px; background: var(--bg); color: var(--t);
    font: 400 .6875rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
    opacity: 0; transform: translate(6px, -50%); pointer-events: none; transition: opacity .35s var(--ease), transform .5s var(--ease); }
  .x3-rail:hover span, .x3-rail a:focus-visible span { opacity: 1; transform: translate(0, -50%); }
  .x3-rail-now { writing-mode: vertical-rl; transform: rotate(180deg); font: 400 .6875rem/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--t2); white-space: nowrap; }
}

/* ---------- pixel seams: the next ground steps up into the last one ---------- */
.x3-seam { position: relative; z-index: 4; height: 0; pointer-events: none; clip-path: inset(-120px 0 0 0); }
.x3-seam span { position: absolute; transform-origin: 50% 100%; background: var(--seam); }
.x3-seam[data-seam="paper"] { --seam: oklch(0.975 0.003 358); }
.x3-seam[data-seam="dark"] { --seam: oklch(0.135 0.006 358); }

/* the chapter that opens on a plate starts flush with it */
.x3-chap.pg-sec, .x3-chap.pc { padding-top: 0; border-top: 0; }
.x3-chap .steps, .x3-chap .pc-steps { margin-top: clamp(64px, 10vh, 112px); }

/* ---------- the dark chapter plate: concrete, one magenta object, type in its empty side ---------- */
.x3-chap { position: relative; background: var(--ink-0); }
.x3-plate { position: relative; height: clamp(600px, 100svh, 1040px); overflow: hidden; background: var(--ink-0); }
.x3-plate img, .x3-plate canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--fx, 50%) var(--fy, 50%); }
.x3-plate canvas { display: block; }
.x3-plate::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16%; z-index: 0; pointer-events: none; background: linear-gradient(180deg, oklch(0.135 0.006 358 / 0), var(--ink-0)); }
.x3-plate-copy { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; pointer-events: none; }
.x3-plate-copy > div { width: min(100%, var(--cw, 520px)); pointer-events: auto; }
.x3-plate-copy[data-side="right"] > div { margin-left: auto; }
.x3-plate-copy[data-side="right"] { justify-content: flex-end; }
.x3-plate-line { margin-top: 26px; font: 500 var(--t-m)/1.35 var(--f-display); letter-spacing: -0.01em; color: var(--fg); max-width: 28ch; text-wrap: pretty; }
.x3-plate-src { margin-top: 18px; font: 400 var(--t-xs)/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); }
@media (max-width: 767px) {
  .x3-plate { height: auto; overflow: visible; }
  .x3-plate::after { bottom: auto; top: 0; height: calc(100vw * .75); background: linear-gradient(180deg, oklch(0.135 0.006 358 / 0) 82%, var(--ink-0)); }
  .x3-plate img { position: relative; inset: auto; height: auto; aspect-ratio: 4 / 3; object-position: var(--sx, var(--fx, 50%)) var(--fy, 50%); }
  .x3-plate-copy { position: relative; inset: auto; display: block; padding-top: 36px; }
  .x3-plate-line { font-size: 1.2rem; }
}

/* ---------- the light gallery still on paper ---------- */
.x3-still { position: relative; margin: clamp(48px, 8vh, 88px) 0 0; overflow: hidden; aspect-ratio: 2400 / 1340; background: var(--ink-1); }
.x3-still img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
@media (max-width: 767px) { .x3-still { aspect-ratio: 4 / 3; } .x3-still img { object-position: var(--sx, 50%) center; } }

/* ---------- closing: Next ---------- */
.x3-next { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: clamp(28px, 5vh, 48px); padding-top: 22px; border-top: 1px solid var(--rule-soft); max-width: 720px; }
.x3-next span { font: 400 var(--t-xs)/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); }
.x3-next a { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; font: 700 var(--t-m)/1.15 var(--f-display); color: var(--fg); text-decoration: none; }
.x3-next a::after { content: ""; width: 9px; height: 9px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg); transition: transform .5s var(--ease); }
.x3-next a:hover::after { transform: translateX(5px) rotate(45deg); }

/* ---------- process builds ---------- */
/* Website Development: a switchback down to a magenta landing */
.x3-path { position: absolute; left: 0; top: -20px; pointer-events: none; }
@media (min-width: 1100px) {
  .x3-web .steps { position: relative; padding-bottom: 8px; }
  .x3-web .steps li:nth-of-type(2) { margin-top: 56px; }
  .x3-web .steps li:nth-of-type(3) { margin-top: 112px; }
  .x3-web .steps li:nth-of-type(4) { margin-top: 168px; }
  .x3-web .steps.x3-pathed li { border-top-color: transparent; }
  .x3-web .steps li::before { transition: background-color .4s var(--ease), outline-color .4s var(--ease), transform .5s var(--ease); }
  .x3-web .steps li.x3-on::before { background: var(--accent); outline-color: var(--accent); transform: scale(1.25); }
}

/* Performance Marketing: dominoes stand up in order */
.x3-dom { display: none; }
@media (min-width: 900px) {
  .x3-perf .pc-steps { margin-top: clamp(84px, 11vh, 120px); }
  .x3-perf .x3-dom { --r: 0deg; display: block; position: absolute; left: 32px; top: -52px; width: 15px; height: 62px; background: var(--fg-3);
    transform-origin: 100% 100%; transform: rotate(var(--r)); transition: transform .55s var(--ease); }
  .x3-perf .pc-step:last-child .x3-dom { background: var(--accent); }
  .x3-perf .pc-step:hover .x3-dom { transform: rotate(calc(var(--r) + 9deg)); }
}

/* Content and Social Media: a metronome keeps time across the steps */
.x3-tempo { display: none; }
@media (min-width: 900px) {
  .x3-content .x3-tempo { display: block; position: absolute; left: 0; right: 0; top: 0; height: 20px; z-index: 1; pointer-events: none; }
  .x3-content .pc-step.is-lit::after { background: var(--fg-2); }
  .x3-weight { position: absolute; left: 0; top: 0; width: 20px; height: 20px; transition: transform .8s var(--ease); }
  .x3-weight::before { content: ""; position: absolute; inset: 0; background: var(--fg); }
  .x3-rod { position: absolute; left: 9px; bottom: 10px; width: 2px; height: 74px; background: var(--fg); transform-origin: 50% 100%; }
  .x3-rod b { position: absolute; left: -8px; top: 14px; width: 18px; height: 18px; background: var(--accent); }
  .x3-rod.is-swing-r { animation: x3swingR 1.6s var(--ease); }
  .x3-rod.is-swing-l { animation: x3swingL 1.6s var(--ease); }
  .x3-tempo.is-still .x3-weight { transition: none; }
  @keyframes x3swingR { 0% { transform: rotate(-22deg); } 30% { transform: rotate(12deg); } 60% { transform: rotate(-5deg); } 100% { transform: rotate(0); } }
  @keyframes x3swingL { 0% { transform: rotate(22deg); } 30% { transform: rotate(-12deg); } 60% { transform: rotate(5deg); } 100% { transform: rotate(0); } }
}

@media (prefers-reduced-motion: reduce) {
  .x3-weight, .x3-rod, .x3-dom, .x3-rail i, .x3-rail span { transition: none !important; animation: none !important; }
}
