/* ============================================================
   spin360 demo · Neo-Brutalist marquee stage
   ============================================================ */

:root {
  --bg: #efe8d8;
  --surface: #ffffff;
  --surface-deep: #e2dbc8;

  --ink: #0a0a0a;
  --ink-soft: #2a2a2a;
  --ink-faint: #6a6a6a;

  --accent: #c8ff3a;
  --accent-2: #ff5a3c;    /* secondary shouting colour, used on graphic chrome */
  --accent-soft: rgba(200, 255, 58, 0.30);

  --line: var(--ink);

  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-md: 6px 6px 0 var(--ink);
  --shadow-lg: 14px 14px 0 var(--ink);
  --shadow-glow-lime: 0 0 0 6px var(--accent);

  --font-body:    'Space Grotesk', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.32, 0, 0.67, 0);
  --t-fast: 160ms;
  --t-med: 280ms;
  --t-slow: 600ms;

  /* Marquee tuning — read by JS */
  --marquee-speed: 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  /* Two crossed line patterns + base. Strong texture without raster images. */
  background:
    repeating-linear-gradient(0deg,
      transparent 0px, transparent 23px,
      rgba(0,0,0,0.05) 23px, rgba(0,0,0,0.05) 24px),
    repeating-linear-gradient(90deg,
      transparent 0px, transparent 119px,
      rgba(0,0,0,0.025) 119px, rgba(0,0,0,0.025) 120px),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;            /* marquee tracks can spill */
}

/* Registration mark in the bottom-right corner — print-proof. The
 * top-left one was removed because the search bar already anchors that
 * corner and the crosshair looked like a stray "+" up there. */
body::after {
  content: '';
  position: fixed;
  bottom: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  pointer-events: none;
  z-index: 1200;
  background:
    linear-gradient(var(--ink) 0 0) center / 100% 1.5px no-repeat,
    linear-gradient(var(--ink) 0 0) center / 1.5px 100% no-repeat;
}

/* =====================================================================
   SEARCH BAR — "find my look" strip pinned at the very top
   ===================================================================== */

.search-bar {
  position: relative;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: stretch;
  gap: 0;
  background: var(--ink);
  color: var(--accent);
  border-bottom: 2px solid var(--ink);
}

.search-bar-label {
  display: flex;
  align-items: center;
  padding: 0 clamp(16px, 2.4vw, 28px);
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(13px, 1.3vw, 17px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-right: 2px solid var(--ink);
  user-select: none;
  white-space: nowrap;
}

.search-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: clamp(14px, 1.6vw, 20px) clamp(18px, 2vw, 28px);
  background: var(--ink);
  color: var(--accent);
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.3vw, 18px);
  letter-spacing: 0.02em;
  caret-color: var(--accent-2);
}
.search-input::placeholder {
  color: rgba(200, 255, 58, 0.45);
  font-style: italic;
  letter-spacing: 0.02em;
}
.search-input:focus {
  background: #161616;
}
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-count {
  display: flex;
  align-items: center;
  padding: 0 clamp(14px, 2vw, 22px);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 0;
}
.search-count:empty { padding: 0; }

.search-clear {
  width: 56px;
  border: none;
  border-left: 2px solid var(--ink);
  background: var(--accent-2);
  color: var(--surface);
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.search-clear:hover { background: #ff3a1a; }

/* =====================================================================
   HERO — massive type, lime issue badges, decorative chrome
   ===================================================================== */

.hero {
  position: relative;
  z-index: 50;
  padding: 24px clamp(28px, 5vw, 80px) 0;
  border-bottom: 2px solid var(--ink);
}

.hero-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  padding-bottom: 14px;
}

/* Asterisk anchor on the left, rotating slowly. Smaller so it doesn't
 * eat the headline's column. */
.hero-asterisk {
  font-size: clamp(48px, 6vw, 88px);
  font-weight: 700;
  line-height: 0.8;
  color: var(--accent);
  -webkit-text-stroke: 2.5px var(--ink);
  animation: spin-slow 30s linear infinite;
  transform-origin: 50% 55%;
}

.hero-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  /* Reduced from clamp(56,12vw,220) so the carousel is the centrepiece
   * rather than the headline. Still bold-enough on every viewport. */
  font-size: clamp(34px, 6.5vw, 104px);
  line-height: 0.86;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.3em;
  align-items: baseline;
}
.hero-title h1 .line { display: inline-block; }
.hero-title h1 .line-2 {
  color: var(--surface);
  -webkit-text-stroke: 1.5px var(--ink);
}

.hero-tag {
  margin: 14px 0 0;
  max-width: 56ch;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

/* Right side: stacked issue / season badges. */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.hero-vol,
.hero-season,
.hero-loc {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
}
.hero-vol {
  background: var(--accent);
  font-size: 16px;
  padding: 6px 14px;
  box-shadow: 3px 3px 0 var(--ink);
}
.hero-season {
  background: var(--ink);
  color: var(--accent);
}

/* ADD LOOK trigger — sits at the bottom of the hero-side stack, shouting. */
.add-look-btn {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(15px, 1.4vw, 19px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 18px;
  border: 2.5px solid var(--ink);
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.add-look-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--accent-2);
  color: var(--surface);
}
.add-look-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.add-look-btn .add-look-plus {
  font-size: 1.4em;
  line-height: 0.8;
  font-weight: 700;
}

/* Hero strip — "SCROLLING NOW ★ SCROLLING NOW ★" running below the title. */
.hero-strip {
  background: var(--ink);
  color: var(--accent);
  overflow: hidden;
  border-top: 2px solid var(--ink);
}
.hero-strip .strip-track {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  padding: 10px 0;
  white-space: nowrap;
  width: max-content;
  animation: marquee-text 18s linear infinite;
}
.hero-strip span:nth-child(even) { color: var(--accent); }

/* =====================================================================
   STAGE — multiple parallax layers running right→left
   ===================================================================== */

.stage {
  position: relative;
  height: 70vh;
  min-height: 540px;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  /* Lock horizontal panning to our drag handler on touch devices so the
   * browser doesn't compete with us. Vertical page-scroll is still free. */
  touch-action: pan-y;
}
/* The stage itself isn't grabbable — only individual cards are. */
.card { cursor: grab; }
.card.is-dragging {
  cursor: grabbing;
  z-index: 50;
  box-shadow: var(--shadow-md), 0 0 0 6px var(--accent);
}
.stage.is-dragging { user-select: none; }

.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

.layer-track {
  display: flex;
  gap: clamp(20px, 3vw, 64px);
  align-items: center;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
}

/* Layer 1 — gigantic outlined display type, slowest */
.layer-back {
  align-items: center;
}
.layer-back .layer-track {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(140px, 22vw, 320px);
  letter-spacing: -0.04em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2.5px var(--ink);
  opacity: 0.18;
  animation: marquee-slow 90s linear infinite;
  animation-play-state: var(--marquee-play, running);
  animation-direction: var(--marquee-dir, normal);
}
.layer-back .diamond {
  color: var(--ink);
  -webkit-text-stroke: 0;
  opacity: 0.18;
}

/* Layer 2 — repeating halftone dot pattern, even slower */
.layer-dots {
  background-image: radial-gradient(circle, rgba(10,10,10,0.18) 1.5px, transparent 2px);
  background-size: 22px 22px;
  background-repeat: repeat;
  animation: pan-dots 60s linear infinite;
  animation-play-state: var(--marquee-play, running);
  opacity: 0.7;
}

/* Layer 3 — lime mid-stripe with season tags, medium speed */
.layer-mid {
  top: auto;
  bottom: 26px;
  height: 38px;
}
.layer-mid .mid-track {
  height: 38px;
  background: var(--accent);
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.18em;
  padding: 0 22px;
  gap: 32px;
  animation: marquee-mid 28s linear infinite;
  animation-play-state: var(--marquee-play, running);
  animation-direction: var(--marquee-dir, normal);
}

/* Layer 5 — small arrows at top, fastest, signals motion direction */
.layer-front {
  align-items: flex-start;
  height: 36px;
  top: 8px;
}
.layer-front .front-track {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-2);
  gap: 36px;
  animation: marquee-fast 14s linear infinite;
  animation-play-state: var(--marquee-play, running);
  animation-direction: var(--marquee-dir, normal);
  text-shadow: 2px 2px 0 var(--ink);
}

/* =====================================================================
   CARD TRACK — JS-driven scroll (per-card translateX), inside .stage
   ===================================================================== */

.card-track {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 5;
}
.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 32px;
}
.empty code {
  background: var(--ink);
  color: var(--accent);
  padding: 2px 6px;
  font-family: var(--font-mono);
}

/* Cards are absolutely-positioned within the track. JS owns translateX
 * (and a constant translateY(-50%) for vertical centring). Card height is
 * driven by the .frame's inline aspect-ratio + the meta strip — never
 * pin it explicitly here, or the avatar will be stretched/squished. */
.card {
  position: absolute;
  top: 50%;
  width: 260px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  contain: layout paint;
  /* No transition on transform — we own that via RAF. */
  transition: box-shadow var(--t-fast) var(--ease);
  will-change: transform;
  /* Default offscreen-left + vertically-centred. Without this a freshly-
   * mounted card sits at (left:0, top:50%) WITHOUT a translateY(-50%) and
   * appears in the lower-left of the stage for the few hundred ms it takes
   * the async decoder to come up. JS overwrites this transform on its
   * first marquee tick. */
  transform: translate3d(-9999px, -50%, 0);
}
/* Hard-hide cards until the marquee tick has written their first real
 * transform (`.is-positioned` is toggled on inside marqueeTick /
 * searchTickBody). Belt-and-braces — even if the -9999px translate doesn't
 * fully occlude in some engine, opacity 0 will. The transition gives an
 * imperceptible fade once positioning kicks in but doesn't compete with
 * the drift-in itself, which is a transform, not opacity. */
.card:not(.is-positioned):not(.expanded) {
  opacity: 0;
  pointer-events: none;
}
.card.is-paused {
  z-index: 10;
  box-shadow: var(--shadow-md), var(--shadow-glow-lime);
}
.card:hover .frame {
  animation: rgb-split 240ms ease-in-out;
}

.card .frame {
  position: relative;
  width: 100%;
  /* aspect-ratio is set inline per card from card.width / card.height in the
   * manifest. Don't pin a fixed height — that's exactly what was squishing
   * the avatar before. */
  background-color: var(--surface-deep);
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
}
.card canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.frame .play { display: none; }

.card .meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
.card .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.card .runid {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: var(--ink);
  color: var(--accent);
  padding: 2px 6px;
  letter-spacing: 0.04em;
}

.card .badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: var(--accent);
  border: 1.5px solid var(--ink);
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
  z-index: 2;
}
.card.is-paused .badge { opacity: 1; }

/* Vibe-word stamps — three corner pieces in alternating colours. */
.vibe-stamps {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.vibe-stamp {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 2px 6px;
  border: 1.5px solid var(--ink);
  background: var(--accent);
}
.vibe-stamp.s1 { top: 10px; left: 10px; }
.vibe-stamp.s2 {
  top: 10px;
  right: 10px;
  background: var(--ink);
  color: var(--accent);
}
.vibe-stamp.s3 {
  bottom: 10px;
  right: 10px;
  background: var(--surface);
  transform: rotate(-3deg);
}

/* =====================================================================
   CONTROLS strip (replaces the old motion-mode toolbar)
   ===================================================================== */

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 18px clamp(28px, 5vw, 80px);
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
  position: relative;
  z-index: 40;
}
.controls-label {
  background: var(--ink);
  color: var(--accent);
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.controls-divider {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0 4px;
}
.ctl-btn {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 12px 6px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.ctl-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--accent);
}
.ctl-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.ctl-btn.is-active {
  background: var(--ink);
  color: var(--accent);
  box-shadow: 3px 3px 0 var(--accent);
}

/* =====================================================================
   TICKER FOOTER — slowly scrolling text
   ===================================================================== */

.ticker {
  background: var(--ink);
  color: var(--surface);
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
}
.ticker-track {
  display: flex;
  gap: 26px;
  padding: 9px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
  width: max-content;
  animation: marquee-text 36s linear infinite;
}
.ticker span:nth-child(2n+1) { color: var(--accent); }

.ticker-credit {
  margin: 0;
  padding: 10px clamp(16px, 4vw, 32px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.82;
}
.ticker-credit strong {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* =====================================================================
   Backdrop + expanded card
   ===================================================================== */

.backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 380ms var(--ease);
  z-index: 900;
}
.backdrop.visible {
  opacity: 0.97;
  pointer-events: auto;
}

.card.expanded {
  position: fixed;
  z-index: 1000;
  margin: 0;
  cursor: zoom-out;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-lg);
  will-change: transform;
  /* Override `.card`'s offscreen-default transform — once the expand
   * animation finishes the inline transform is cleared, and without this
   * reset the spotlight card would inherit -9999px and disappear. */
  transform: none;
}
.card.expanded .meta {
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease);
}
.card.expanded .badge { display: none; }
/* Vibe stamps sit in the corners of the small card; the top-right one
 * collides with the close X once expanded. They're decorative on the
 * thumbnail — drop them in the spotlight view so nothing fights for that
 * corner. */
.card.expanded .vibe-stamps { display: none; }
.card.expanded .frame {
  background-color: transparent;
  height: 100%;
  aspect-ratio: auto !important;
  border-bottom: 0;
}
.card.expanded .frame canvas { opacity: 1; }

.card-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--ink);
  background: var(--accent);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  z-index: 2;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 240ms var(--ease) 120ms,
    transform 240ms var(--ease) 120ms;
}
.card-close:hover {
  background: var(--ink);
  color: var(--accent);
  box-shadow: 3px 3px 0 var(--accent);
}
.card.expanded .card-close { opacity: 1; transform: scale(1); }

/* =====================================================================
   ADD LOOK MODAL — upload → live progress → done/error
   ===================================================================== */

.al-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 64px);
}
.al-modal.is-open {
  display: flex;
}

.al-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.96;
  background-image:
    repeating-linear-gradient(45deg,
      transparent 0, transparent 12px,
      rgba(0,0,0,0.05) 12px, rgba(0,0,0,0.05) 13px);
}

.al-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--surface);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 3vw, 36px);
  animation: al-pop 280ms var(--ease);
}
@keyframes al-pop {
  from { transform: translate(8px, 8px) scale(0.97); opacity: 0; }
  to   { transform: translate(0, 0) scale(1); opacity: 1; }
}

.al-close {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink);
  background: var(--accent-2);
  color: var(--surface);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform var(--t-fast) var(--ease);
}
.al-close:hover { transform: translate(-1px, -1px); }

.al-stage[hidden] { display: none; }

.al-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
.al-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 0.95;
}
.al-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border: 1.5px solid var(--ink);
  background: var(--accent);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.al-tag-live { background: var(--accent-2); color: var(--surface); animation: al-pulse 1.4s ease-in-out infinite; }
.al-tag-ok   { background: var(--accent); color: var(--ink); }
.al-tag-bad  { background: var(--ink); color: var(--accent-2); }
@keyframes al-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

.al-lede {
  margin: 0 0 18px;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* Dropzone — big clickable target. */
.al-dropzone {
  display: block;
  width: 100%;
  padding: clamp(28px, 4vw, 56px) 20px;
  border: 2.5px dashed var(--ink);
  background: var(--surface-deep);
  cursor: pointer;
  text-align: center;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.al-dropzone:hover,
.al-dropzone.is-drag {
  background: var(--accent-soft);
  border-color: var(--accent-2);
  transform: translate(-1px, -1px);
}
.al-dz-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.al-dz-plus {
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.8;
  font-weight: 700;
  color: var(--accent-2);
}
.al-dz-main {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 2.2vw, 24px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.al-dz-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.al-fineprint {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.al-fineprint code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--ink);
  color: var(--accent);
  padding: 1px 4px;
}

/* Progress stage. */
.al-preview-wrap {
  width: 100%;
  height: 140px;
  margin-bottom: 16px;
  border: 2px solid var(--ink);
  overflow: hidden;
  background: var(--ink);
}
.al-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05) saturate(0.9);
}

.al-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  counter-reset: al-step;
  border-top: 1.5px solid var(--ink);
}
.al-steps li {
  counter-increment: al-step;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: background var(--t-fast) var(--ease);
}
.al-steps li::before {
  content: counter(al-step, decimal-leading-zero);
  font-weight: 700;
  color: var(--ink-faint);
}
.al-steps .al-step-label {
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  font-size: 12.5px;
  letter-spacing: 0.04em;
}
.al-steps .al-step-state {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.al-steps li.is-active {
  background: var(--accent-soft);
}
.al-steps li.is-active::before {
  color: var(--accent-2);
}
.al-steps li.is-active .al-step-state { color: var(--accent-2); }
.al-steps li.is-done .al-step-state { color: var(--ink); }
.al-steps li.is-done::before { color: var(--ink); }
.al-steps li.is-done .al-step-label { text-decoration: line-through; text-decoration-thickness: 1.5px; }

.al-log-wrap {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--ink);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  min-height: 38px;
  align-items: flex-start;
}
.al-log-label {
  color: var(--accent-2);
  font-weight: 700;
  flex-shrink: 0;
}
.al-log {
  margin: 0;
  flex: 1;
  word-break: break-word;
}

.al-elapsed {
  margin-top: 8px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* Done + error stages share a CTA button. */
.al-cta {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 24px;
  border: 2.5px solid var(--ink);
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.al-cta:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.al-cta-secondary {
  background: var(--surface);
}
.al-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* =====================================================================
   Animations
   ===================================================================== */

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Marquee tracks use translateX(0 → -50%) because each track contains its
   content TWICE, so when the first set has fully passed off-screen the
   second set is in exactly the original starting position — seamless loop. */
@keyframes marquee-slow {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes marquee-mid {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes marquee-fast {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes marquee-text {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes pan-dots {
  from { background-position: 0 0; }
  to   { background-position: -440px 0; }
}

@keyframes rgb-split {
  0%, 100% { filter: none; }
  20%  { filter: drop-shadow(-2px 0 0 rgba(255, 0, 80, 0.7))
                  drop-shadow( 2px 0 0 rgba(0, 200, 255, 0.7)); }
  40%  { filter: drop-shadow( 2px 0 0 rgba(255, 0, 80, 0.7))
                  drop-shadow(-2px 0 0 rgba(0, 200, 255, 0.7)); }
  60%  { filter: drop-shadow(-1px 1px 0 rgba(255, 0, 80, 0.7))
                  drop-shadow( 1px -1px 0 rgba(0, 200, 255, 0.7)); }
}

@media (prefers-reduced-motion: reduce) {
  .layer-track, .strip-track, .ticker-track,
  .hero-asterisk, .layer-dots {
    animation: none !important;
  }
  .card, .card .meta, .card-close, .backdrop, .ctl-btn {
    transition: none !important;
  }
}

@media (max-width: 700px) {
  .hero { padding: 18px 16px 0; }
  .hero-asterisk { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 10px; }
  .hero-side { flex-direction: row; flex-wrap: wrap; }
  .stage { height: 62vh; min-height: 440px; }
  .card { width: 200px; }
}

/* Mobile / touch performance pass.
 *
 * On iPhone Safari the parallax stack (huge outlined `LOOKS COLLECTION`
 * text, mid stripe, dot pattern, foreground arrows) competes with N
 * concurrently-decoding animated WebPs for the compositor budget and
 * produces a visibly low framerate carousel. We drop the heaviest layers
 * on small viewports and on coarse pointers (touch devices regardless of
 * width). Keep the dot pattern — it's the cheapest of the lot and still
 * gives the scene texture. */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  /* Hide every continuously-transforming parallax layer. On iOS Safari
   * each one is its own compositor surface, and combined with N animated
   * WebPs decoding in the carousel they exhaust the compositing budget. */
  .layer-back,
  .layer-front,
  .layer-mid {
    display: none;
  }
  .hero-strip { display: none; }

  /* `.layer-dots` panning is a `background-position` keyframe — that's a
   * per-frame REPAINT of the entire stage area (not a compositor
   * translate). Disable on mobile; the dots are still visible, just
   * static. */
  .layer-dots { animation: none; }

  /* Footer ticker is outside the stage but also runs at 60Hz and shares
   * the compositor pipeline. Pause it. */
  .ticker-track { animation: none; }

  /* Hero asterisk is already display:none in the <700px block but on
   * tablets in coarse-pointer mode it might still spin — kill it. */
  .hero-asterisk { animation: none; }

  /* Simplify the body background. The two layered repeating gradients
   * are static, but on a tiled mobile compositor every scroll triggers
   * a re-tile. Solid bg colour is dramatically cheaper. */
  body {
    background: var(--bg);
  }

  /* The `rgb-split` filter animation gets stuck after a tap on touch
   * because :hover sticks until the next tap elsewhere; cheaper for the
   * GPU not to run drop-shadow animations on phones at all. */
  .card:hover .frame { animation: none; }

  /* Drop hard offset shadows on cards — soft compositor-friendly border
   * is enough at phone scale. */
  .card {
    box-shadow: 2px 2px 0 var(--ink);
    /* `will-change: transform` from the base rule promotes every card to
     * its own GPU layer. iPhone has tight VRAM and would rather batch
     * adjacent siblings; Safari will still auto-promote each one because
     * it's transforming every frame, but only when it actually needs to. */
    will-change: auto;
  }
}
