/* ===== Section 2 — Problem ===== */

.problem-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 72px;
  align-items: start;
  margin-bottom: 96px;
}
.problem-prose p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-muted);
  margin: 0 0 22px;
}
.problem-prose .lede { color: var(--fg); font-size: 18px; }
.problem-prose strong { color: var(--fg); font-weight: 500; }

.problem-side { position: sticky; top: 100px; }

.quote-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}
.quote-card::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
}
.quote-card p {
  font-size: 22px;
  line-height: 1.35;
  margin: 0;
  color: var(--fg);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.stat {
  padding: 18px 16px;
  background: var(--bg-card);
}
.stat-k { font-size: 9px; letter-spacing: 0.15em; color: var(--fg-dim); text-transform: uppercase; margin-bottom: 8px; }
.stat-v { font-size: 30px; line-height: 1; color: var(--fg); margin-bottom: 6px; letter-spacing: -0.02em; }
.stat-l { font-size: 9px; letter-spacing: 0.12em; color: var(--fg-muted); text-transform: uppercase; }

.diagram-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
  align-items: center;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 32px 32px;
}
.diagram-caption p { font-size: 17px; line-height: 1.5; max-width: 320px; }
.disconnect-diagram { width: 100%; height: auto; }

/* ===== Section 3 — Ladder ===== */

.ladder-grid {
  display: flex;
  align-items: center;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  padding: 60px 40px;
  min-height: 600px;
  margin-top: 40px;
}

.ladder-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ladder-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px;
  cursor: pointer;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}
.ladder-card:hover, .ladder-card.open {
  border-color: color-mix(in oklab, var(--accent) 40%, var(--line));
  background: var(--bg-card-2);
}
.ladder-card.highlight {
  border-color: color-mix(in oklab, var(--accent) 50%, var(--line));
  background: color-mix(in oklab, var(--accent) 6%, var(--bg-card));
}

.ladder-row {
  display: grid;
  grid-template-columns: 40px 1fr 48px;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.ladder-n { font-size: 12px; color: var(--fg-muted); letter-spacing: 0.1em; }
.ladder-bar { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.ladder-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .5s ease; }

.ladder-timer {
  height: 2px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ladder-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .1s linear;
}
.ladder-hint {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.ladder-pct { font-size: 11px; color: var(--fg-muted); text-align: right; letter-spacing: 0.1em; }

.ladder-name {
  font-size: 28px;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}
.ladder-short { font-size: 15px; color: var(--fg-muted); line-height: 1.5; }
.ladder-long {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, margin-top .3s ease;
}
.ladder-card.open .ladder-long {
  max-height: 180px;
  margin-top: 18px;
}
.ladder-rule { height: 1px; background: var(--line); margin-bottom: 14px; }
.ladder-long p { font-size: 14px; color: var(--fg-muted); font-style: italic; margin: 0; line-height: 1.6; }

.ladder-pill {
  position: absolute;
  top: 20px; right: 20px;
  padding: 4px 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 9px;
  letter-spacing: 0.15em;
  border-radius: 99px;
}

.ladder-side {
  width: 45%;
  position: relative;
  z-index: 2;
  padding-right: 40px;
}
.ladder-callout {
  font-size: 92px; line-height: 1;
  color: var(--fg);
  margin: 16px 0 20px;
  letter-spacing: -0.04em;
}
.ladder-callout strong { color: var(--accent); }

.ladder-meter { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.ladder-meter-label { font-size: 9px; letter-spacing: 0.2em; color: var(--fg-dim); margin-bottom: 14px; }
.meter-row { display: grid; grid-template-columns: 24px 1fr 36px; gap: 12px; align-items: center; margin-bottom: 8px; font-size: 10px; color: var(--fg-muted); letter-spacing: 0.08em; }
.meter-track { height: 2px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--accent-2), color-mix(in oklab, var(--accent-2) 60%, var(--accent))); }

/* ===== Section 4 — How It Works ===== */

.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.how-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px 32px;
  position: relative;
  min-height: 280px;
  transition: transform .2s ease, border-color .2s ease;
}
.how-card:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.how-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 60px; }
.how-n { font-size: 10px; letter-spacing: 0.18em; color: var(--fg-muted); }
.how-dot { color: var(--accent); font-size: 10px; }
.how-name { font-size: 24px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.015em; }
.how-body { font-size: 14px; color: var(--fg-muted); line-height: 1.55; margin: 0; }
.how-rule {
  position: absolute;
  bottom: 0; left: 24px; right: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
  opacity: 0; transform: translateX(-20%);
  transition: all .3s ease;
}
.how-card:hover .how-rule { opacity: 1; transform: translateX(0); }

/* ===== Section 5 — Before/After Horizontal Rails ===== */

.ba-rails {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ba-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--fg-muted);
}
.ba-tag.tag-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Rail row — gutter (label on left) + horizontal scrolling track */
.rail-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: stretch;
}

.rail-gutter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 20px 0;
}

.rail-tag {
  align-self: flex-start;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--fg-muted);
}
.rail-tag.tag-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.rail-headline {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0;
}
.rail-headline em { font-style: italic; color: color-mix(in oklab, var(--fg) 50%, var(--accent) 50%); }

.rail-stats { display: flex; gap: 20px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.rail-stats > div { display: flex; flex-direction: column; gap: 4px; }
.rail-stats .serif { font-size: 26px; line-height: 1; color: var(--fg); letter-spacing: -0.02em; }
.rail-stats .mono { font-size: 9px; letter-spacing: 0.1em; color: var(--fg-muted); text-transform: uppercase; }

.rail-track-wrap {
  min-width: 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 48px, black calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 48px, black calc(100% - 48px), transparent 100%);
}

/* The horizontal track: grid of 8 equal columns, drag/wheel to scroll */
.rail-track {
  display: grid;
  grid-template-columns: repeat(8, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}
.rail-track::-webkit-scrollbar { display: none; }

/* Phase header row */
.rail-phases .rail-track {
  padding: 0 2px 8px;
  border-bottom: 1px dashed var(--line);
}
.phase-cell {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px 8px;
}
.phase-num { font-size: 10px; color: var(--fg-dim); letter-spacing: 0.15em; }
.phase-name { font-size: 10px; color: var(--fg-muted); letter-spacing: 0.12em; text-transform: uppercase; }

/* Rail card */
.rail-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all .2s ease;
  position: relative;
}
.rail-card:hover { transform: translateY(-2px); }

.rail-human {
  border-color: color-mix(in oklab, var(--warn) 30%, var(--line));
  background: color-mix(in oklab, var(--warn) 4%, var(--bg-card));
}
.rail-judgment {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--line));
  background: color-mix(in oklab, var(--accent) 5%, var(--bg-card));
}
.rail-judgment::before {
  content: "★"; position: absolute; top: -8px; right: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 9px; padding: 2px 8px; border-radius: 99px;
  letter-spacing: 0.1em;
  font-family: 'IBM Plex Mono', monospace;
}
.rail-agent {
  border-color: color-mix(in oklab, var(--accent) 30%, var(--line));
  background: color-mix(in oklab, var(--accent) 3%, var(--bg-card));
}

.rail-card-head { display: flex; justify-content: space-between; align-items: center; }
.rail-who {
  font-size: 9px;
  letter-spacing: 0.15em;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--bg);
}
.rail-who-human { color: var(--warn); border: 1px solid color-mix(in oklab, var(--warn) 40%, transparent); }
.rail-who-agent { color: var(--accent); border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.rail-who-judgment { color: var(--accent); background: var(--accent); color: var(--accent-ink); }

.rail-what {
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg);
  flex: 1;
}
.rail-tool {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

/* Connector between rails */
.rail-connect {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  padding: 28px 0;
  align-items: center;
}
.rail-connect > :first-child { grid-column: 2; }
.rail-connect {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 32px 0;
}
.rail-connect-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.rail-connect-label { font-size: 10px; letter-spacing: 0.2em; color: var(--fg-muted); }

/* Legend */
.rail-legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--fg-muted); letter-spacing: 0.1em; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-human { background: color-mix(in oklab, var(--warn) 60%, var(--bg-card)); border: 1px solid var(--warn); }
.legend-judgment { background: var(--accent); }
.legend-agent { background: color-mix(in oklab, var(--accent) 30%, var(--bg-card)); border: 1px solid var(--accent); }

/* Glassmorphism wrapper for the rails */
.ba-glass {
  background: color-mix(in oklab, var(--bg-card) 52%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid color-mix(in oklab, var(--fg) 8%, transparent);
  border-radius: 24px;
  padding: 36px 36px 28px;
  overflow: hidden;
  box-shadow:
    0 4px 40px rgba(0,0,0,0.25),
    0 0 0 1px color-mix(in oklab, var(--accent) 5%, transparent) inset,
    inset 0 1px 0 color-mix(in oklab, var(--fg) 6%, transparent);
}

.ba-quote {
  margin-top: 88px;
  padding: 72px 40px;
  text-align: center;
  border-top: 1px solid var(--line-soft);
}
.ba-quote-text {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.25;
  color: var(--fg);
  letter-spacing: -0.02em;
  max-width: 900px;
  margin: 20px auto 0;
  text-wrap: balance;
}
.ba-quote-text em { color: var(--accent); font-style: italic; }

/* ===== Section 6 — Final CTA ===== */

.section-cta { padding: 80px 0 120px; }
.cta-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  position: relative;
}
.cta-card::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 80% at 100% 50%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.cta-left { padding: 56px; position: relative; z-index: 1; }
.cta-title {
  font-size: clamp(36px, 3.8vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--fg);
  text-wrap: balance;
}
.cta-title em { color: color-mix(in oklab, var(--fg) 50%, var(--accent) 50%); }
.cta-sub { font-size: 15px; color: var(--fg-muted); line-height: 1.6; margin: 16px 0 0; max-width: 520px; }

.cta-form {
  margin-top: 40px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cta-form input {
  flex: 1;
  min-width: 240px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 99px;
  font-family: inherit;
  font-size: 14px;
}
.cta-form input:focus { outline: none; border-color: var(--accent); }

.cta-fine {
  margin-top: 20px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
}
.cta-confirm { padding: 20px 0; }

.cta-right { padding: 40px; display: grid; place-items: center; position: relative; z-index: 1; }
.radar { width: 100%; height: 100%; max-width: 380px; }
.radar-sweep { transform-origin: 0 0; animation: sweep 4s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .how-grid { grid-template-columns: repeat(2, 1fr); }
  .ladder-grid { grid-template-columns: 1fr; }
  .rail-row { grid-template-columns: 1fr; gap: 16px; }
  .rail-gutter { padding: 0; }
  .rail-track { grid-auto-flow: column; grid-auto-columns: 220px; grid-template-columns: none; }
  .problem-grid { grid-template-columns: 1fr; }
  .problem-side { position: static; }
  .cta-card { grid-template-columns: 1fr; }
  .cta-right { display: none; }
  .diagram-wrap { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .section { padding: 80px 0; }
  .section-head { flex-direction: column; gap: 16px; align-items: flex-start; margin-bottom: 48px; }
  .how-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-left { padding: 32px; }
}

/* ===== Mobile fixes (max 767px) ===== */
@media (max-width: 767px) {
  /* Ladder timer + hint — desktop-only auto-advance UX */
  .ladder-timer,
  .ladder-hint { display: none; }

  /* Section — reduce vertical padding */
  .section {
    padding: 64px 0;
  }

  /* Section-head — collapse early for these viewport widths */
  .section-head {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 40px;
  }

  /* Ladder callout — the 92px number is the biggest overflow culprit */
  .ladder-callout {
    font-size: clamp(48px, 14vw, 92px);
  }

  /* Ladder grid — ROOT FIX: the base rule uses display:flex (not grid), so
     the 1100px breakpoint's grid-template-columns:1fr had zero effect.
     Force a column stack here so the side and stack don't share a row. */
  .ladder-grid {
    flex-direction: column;
    align-items: stretch;
    padding: 32px 20px;
    min-height: unset;
  }

  /* Ladder stack — override inline position:absolute from JSX so the
     CardSwap deck flows BELOW the side panel while keeping GSAP animations. */
  .ladder-stack {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-height: 420px !important;
    order: 2;
    margin-top: 8px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* CardSwap container — shrink the 600px desktop deck height for mobile.
     Keep perspective + relative positioning so GSAP transforms still animate.
     (CardSwap.css applies its own scale() on mobile — we leave that alone.) */
  .card-swap-container {
    height: 380px !important;
    min-height: 380px !important;
  }

  /* Cards — the JSX hard-codes width:460/height:360 via inline style, which
     overflows a 375px viewport. Shrink to fit while preserving GSAP's
     transform-based animation (we only touch width/height, not transform). */
  .card-swap-container > .card {
    width: min(300px, calc(100vw - 80px)) !important;
    height: 280px !important;
    padding: 18px !important;
    font-size: 13px;
  }
  .card-swap-container > .card .ladder-name {
    font-size: 20px !important;
  }
  .card-swap-container > .card .ladder-short {
    font-size: 13px !important;
  }

  /* Ladder side — "0 — 1" callout + meter move above the cards */
  .ladder-side {
    width: 100%;
    padding-right: 0;
    order: 1;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
  }

  /* Ladder card — reduce padding */
  .ladder-card {
    padding: 18px 16px;
  }

  /* How-grid — single column already covered at 640px, reinforce */
  .how-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .how-card {
    min-height: unset;
  }

  /* Before/After glass container — tighten padding */
  .ba-glass {
    padding: 20px 16px 16px;
    border-radius: 16px;
  }

  /* BA quote — reduce vertical space */
  .ba-quote {
    margin-top: 48px;
    padding: 40px 0;
  }

  /* CTA card — single column already at 1100px; tighten padding */
  .cta-left {
    padding: 28px 20px;
  }

  /* CTA form — let input fill full width, reduce min-width */
  .cta-form {
    flex-direction: column;
    gap: 12px;
  }
  .cta-form input {
    min-width: 0;
    width: 100%;
  }
  .cta-form .btn {
    width: 100%;
    justify-content: center;
  }

  /* Diagram wrap — reduce padding */
  .diagram-wrap {
    padding: 24px 16px;
    gap: 24px;
  }

  /* Stat row — allow wrapping on very narrow screens */
  .stat-row {
    grid-template-columns: 1fr 1fr;
  }
  .stat:last-child {
    grid-column: 1 / -1;
  }

  /* Problem grid — single col already at 1100px */
  .problem-grid {
    margin-bottom: 48px;
  }
  .quote-card p {
    font-size: 18px;
  }

  /* Rail connect label — allow wrapping on mobile */
  .rail-connect {
    flex-wrap: wrap;
    padding: 20px 0;
  }
  .rail-connect-label {
    font-size: 9px;
    letter-spacing: 0.12em;
    text-align: center;
    flex: 0 0 100%;
    order: -1;
    margin-bottom: 8px;
  }
  .rail-connect-line {
    flex: 1;
  }

  /* Rail track — slightly smaller card min-width for mobile touch scrolling */
  .rail-track {
    grid-auto-columns: 140px;
  }
}

/* ==========================================================================
   Before/After Modern Scroll Indicator Styles
   ========================================================================== */

.ba-scrollbar-container {
  margin: 32px auto 24px;
  width: 100%;
  max-width: 480px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.ba-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent, #FFBD2E);
  border-radius: 2px;
  min-width: 40px;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* ==========================================================================
   LogoLoop Component Styles
   ========================================================================== */

.logoloop {
  position: relative;
  --logoloop-gap: 32px;
  --logoloop-logoHeight: 28px;
  --logoloop-fadeColorAuto: #ffffff;
}

.logoloop--vertical {
  height: 100%;
  display: inline-block;
}

.logoloop--scale-hover {
  padding-top: calc(var(--logoloop-logoHeight) * 0.1);
  padding-bottom: calc(var(--logoloop-logoHeight) * 0.1);
}

@media (prefers-color-scheme: dark) {
  .logoloop {
    --logoloop-fadeColorAuto: var(--bg-base);
  }
}

.logoloop__track {
  display: flex;
  width: max-content;
  will-change: transform;
  user-select: none;
  position: relative;
  z-index: 0;
}

.logoloop--vertical .logoloop__track {
  flex-direction: column;
  height: max-content;
  width: 100%;
}

.logoloop__list {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logoloop--vertical .logoloop__list {
  flex-direction: column;
}

.logoloop__item {
  flex: 0 0 auto;
  margin-right: var(--logoloop-gap);
  font-size: var(--logoloop-logoHeight);
  line-height: 1;
}

.logoloop--vertical .logoloop__item {
  margin-right: 0;
  margin-bottom: var(--logoloop-gap);
}

.logoloop__item:last-child {
  margin-right: var(--logoloop-gap);
}

.logoloop--vertical .logoloop__item:last-child {
  margin-right: 0;
  margin-bottom: var(--logoloop-gap);
}

.logoloop__node {
  display: inline-flex;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
  font-size: 14px;
}

.logoloop__item img {
  height: var(--logoloop-logoHeight);
  width: auto;
  display: block;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  -webkit-user-drag: none;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logoloop--scale-hover .logoloop__item {
  overflow: visible;
}

.logoloop--scale-hover .logoloop__item:hover img,
.logoloop--scale-hover .logoloop__item:hover .logoloop__node {
  transform: scale(1.1);
  transform-origin: center center;
  color: var(--fg-base);
}

.logoloop--scale-hover .logoloop__node {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logoloop__link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 4px;
  transition: opacity 0.2s ease;
}

.logoloop__link:hover {
  opacity: 0.8;
}

.logoloop__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.logoloop--fade::before,
.logoloop--fade::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(24px, 8%, 120px);
  pointer-events: none;
  z-index: 10;
}

.logoloop--fade::before {
  left: 0;
  background: linear-gradient(
    to right,
    var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

.logoloop--fade::after {
  right: 0;
  background: linear-gradient(
    to left,
    var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

.logoloop--vertical.logoloop--fade::before,
.logoloop--vertical.logoloop--fade::after {
  left: 0;
  right: 0;
  width: 100%;
  height: clamp(24px, 8%, 120px);
}

.logoloop--vertical.logoloop--fade::before {
  top: 0;
  bottom: auto;
  background: linear-gradient(
    to bottom,
    var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

.logoloop--vertical.logoloop--fade::after {
  bottom: 0;
  top: auto;
  background: linear-gradient(
    to top,
    var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

@media (prefers-reduced-motion: reduce) {
  .logoloop__track {
    transform: translate3d(0, 0, 0) !important;
  }

  .logoloop__item img,
  .logoloop__node {
    transition: none !important;
  }
}
