/* =============================================
   Marble component library, EarlyBird port
   Source: hawkacademy-static production css/marble-elements.css
   + css/animations.css + hawk-marble-test prototype utilities.
   Retokenized against assets/css/tokens.css. Load tokens.css first.
   Components:
   1. Reveal system (.reveal / .reveal-stagger / .visible)
   2. Hero faces row
   3. Badge with dotPing pulse dot
   4. Glass nav utilities (backdrop blur)
   5. Paper grain overlay (body.eb-grain)
   6. Logo marquee (.lmarquee)
   7. Journey trail (.journey-trail)
   8. Testimonial marquee (.tmarquee + .tcard)
   9. Comparison cards (.mcompare / .mcard)
   10. Reduced-motion block (targeted, explicit visible states)
   ============================================= */

/* ---- 1. Reveal system ----
   Production IntersectionObserver pattern: JS adds .visible once,
   then unobserves. Per-element delay via the --d custom property.
   No-JS fallback: page builder ships the noscript block documented
   in data/port-notes.md so nothing stays hidden without JS. */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.19, 0.71, 0.22, 1);
  transition-delay: var(--d, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.4s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.5s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.6s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---- 2. Hero faces row ----
   Overlapping 34px circles. Border matches the section background:
   var(--ink) on dark sections per the build contract. */
.hero__faces {
  display: flex;
  flex-shrink: 0;
}

.hero__faces img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  margin-left: -10px;
}

.hero__faces img:first-child {
  margin-left: 0;
}

/* ---- 3. Badge with dotPing pulse ---- */
.eb-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--white) 5%, transparent);
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: var(--r-pill);
}

.eb-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPing 2.4s ease-out infinite;
}

@keyframes dotPing {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  70% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

/* ---- 4. Glass nav utilities ----
   Dark glass + backdrop blur for the fixed nav and the sticky CTA bar.
   JS toggles .scrolled on .eb-glass--hairline at scrollY > 10. */
.eb-glass {
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.eb-glass--hairline {
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.eb-glass--hairline.scrolled {
  border-bottom-color: var(--line);
}

/* ---- 5. Paper grain overlay ----
   feTurbulence noise as a fixed full-page film. Opt in by adding
   class "eb-grain" to body. Zero asset requests. */
body.eb-grain::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- 6. Logo marquee ----
   Production math: JS triples the track, keyframe travels exactly
   one set (-33.3333%). Clones are aria-hidden. */
.lmarquee {
  overflow: hidden;
  position: relative;
}

.lmarquee::before,
.lmarquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.lmarquee::before {
  left: 0;
  background: linear-gradient(90deg, var(--ink), transparent);
}

.lmarquee::after {
  right: 0;
  background: linear-gradient(-90deg, var(--ink), transparent);
}

.lmarquee__track {
  display: flex;
  align-items: center;
  gap: 70px;
  width: max-content;
  animation: lmScroll 38s linear infinite;
}

.lmarquee:hover .lmarquee__track {
  animation-play-state: paused;
}

@keyframes lmScroll {
  to { transform: translateX(-33.3333%); }
}

.lmarquee__track img {
  /* logos are pre-normalized to light monochrome, so no grayscale filter is
     needed; fit each within a uniform box so wide wordmarks and square marks
     stay optically balanced without distortion */
  height: auto;
  width: auto;
  max-height: 30px;
  max-width: 132px;
  opacity: 0.72;
  transition: opacity 0.3s ease;
}

.lmarquee__track img:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  /* native swipe scroller instead of the auto-marquee */
  .lmarquee__track {
    animation: none;
    width: auto;
    overflow-x: auto;
    padding: 0 20px 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .lmarquee__track::-webkit-scrollbar {
    display: none;
  }

  .lmarquee__track [aria-hidden="true"] {
    display: none;
  }

  .lmarquee__track img {
    scroll-snap-align: center;
  }

  .lmarquee::before,
  .lmarquee::after {
    width: 36px;
  }
}

/* ---- 7. Journey trail ---- */
.journey-trail {
  background: var(--ink);
  padding: 60px 0 100px;
}

.journey-trail h2 {
  color: var(--paper);
  text-align: center;
  margin-bottom: 16px;
}

.journey-trail__subtitle {
  color: var(--muted);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 28px;
  font-size: 16px;
  line-height: 1.6;
}

.journey-trail__legend {
  display: flex;
  gap: 26px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.journey-trail__legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.jt-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
}

.jt-dot--done {
  background: var(--accent);
}

.jt-dot--next {
  background: transparent;
  border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.jt-dot--later {
  background: transparent;
  border: 1.5px solid color-mix(in srgb, var(--paper) 35%, transparent);
}

.journey-trail__box {
  overflow-x: auto;
  scrollbar-width: none;
}

.journey-trail__box::-webkit-scrollbar {
  display: none;
}

.journey-trail__svg {
  display: block;
  min-width: 900px;
  width: 100%;
  height: auto;
}

.journey-trail__svg .jt-link {
  fill: none;
  stroke: color-mix(in srgb, var(--paper) 28%, transparent);
  stroke-width: 2;
  stroke-dasharray: 2 8;
  stroke-linecap: round;
}

.jt-node {
  cursor: pointer;
}

.jt-node circle.c {
  stroke-width: 2;
  transition: fill 0.25s ease, stroke 0.25s ease, r 0.2s ease;
}

.jt-node text.n {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: fill 0.25s ease;
}

.jt-node text.t {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  text-anchor: middle;
  fill: color-mix(in srgb, var(--paper) 60%, transparent);
  transition: fill 0.25s ease;
}

.jt-node:hover text.t {
  fill: var(--paper);
}

.jt-node:hover circle.c {
  r: 19;
}

.jt-node--done circle.c {
  fill: var(--strand);
  stroke: var(--strand);
}

.jt-node--done text.n {
  fill: var(--accent-ink);
}

.jt-node--next circle.c {
  fill: var(--ink);
  stroke: var(--accent);
  animation: jtPulse 2.2s ease-out infinite;
}

.jt-node--next text.n {
  fill: var(--accent);
}

.jt-node--later circle.c {
  fill: transparent;
  stroke: color-mix(in srgb, var(--paper) 35%, transparent);
}

.jt-node--later text.n {
  fill: color-mix(in srgb, var(--paper) 50%, transparent);
}

.jt-node--sel circle.c {
  fill: var(--accent);
  stroke: var(--accent);
}

.jt-node--sel text.n {
  fill: var(--accent-ink);
}

.jt-node--sel text.t {
  fill: var(--paper);
}

@keyframes jtPulse {
  0% { filter: drop-shadow(0 0 0 color-mix(in srgb, var(--accent) 60%, transparent)); }
  70% { filter: drop-shadow(0 0 9px color-mix(in srgb, var(--accent) 0%, transparent)); }
  100% { filter: drop-shadow(0 0 0 color-mix(in srgb, var(--accent) 0%, transparent)); }
}

.journey-trail__card {
  max-width: 640px;
  margin: 18px auto 0;
  background: color-mix(in srgb, var(--white) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--white) 8%, transparent);
  border-radius: var(--r-sm);
  padding: 30px 36px;
  text-align: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.journey-trail__card.swap {
  opacity: 0;
  transform: translateY(8px);
}

.journey-trail__strand {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--sc, var(--accent));
  padding: 5px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 14px;
}

.journey-trail__card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 28px;
  color: var(--paper);
  margin-bottom: 8px;
}

.journey-trail__card p {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto 14px;
}

.journey-trail__meta {
  font-size: 13px;
  color: color-mix(in srgb, var(--paper) 45%, transparent);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ---- 7b. Mobile trail affordances ---- */
.journey-trail__scrollwrap {
  position: relative;
}

.journey-trail__scrollwrap::before,
.journey-trail__scrollwrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 46px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.journey-trail__scrollwrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--ink), transparent);
}

.journey-trail__scrollwrap::after {
  right: 0;
  background: linear-gradient(-90deg, var(--ink), transparent);
}

.journey-trail__scrollwrap.jt-fade-l::before {
  opacity: 1;
}

.journey-trail__scrollwrap.jt-fade-r::after {
  opacity: 1;
}

.journey-trail__hint {
  display: none;
}

@media (max-width: 768px) {
  .journey-trail__hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    color: color-mix(in srgb, var(--paper) 55%, transparent);
    margin: 10px 0 2px;
    transition: opacity 0.6s ease;
  }

  .journey-trail__hint.dismissed {
    opacity: 0;
  }

  .jt-chev {
    color: var(--accent);
    font-size: 15px;
  }

  .jt-chev--r {
    animation: jtNudgeR 1.6s ease-in-out infinite;
  }

  .jt-chev--l {
    animation: jtNudgeL 1.6s ease-in-out infinite;
  }

  .journey-trail__card {
    padding: 24px 22px;
  }
}

@keyframes jtNudgeR {
  50% { transform: translateX(5px); }
}

@keyframes jtNudgeL {
  50% { transform: translateX(-5px); }
}

/* ---- 8. Testimonial marquee ---- */
.tmarquee {
  overflow: hidden;
  position: relative;
  padding-bottom: 80px;
}

.tmarquee::before,
.tmarquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.tmarquee::before {
  left: 0;
  background: linear-gradient(90deg, var(--ink), transparent);
}

.tmarquee::after {
  right: 0;
  background: linear-gradient(-90deg, var(--ink), transparent);
}

.tmarquee__row {
  display: flex;
  gap: 20px;
  width: max-content;
  margin-bottom: 20px;
  animation: tmScroll 48s linear infinite;
}

.tmarquee__row--reverse {
  animation: tmScrollReverse 56s linear infinite;
}

.tmarquee__row:hover {
  animation-play-state: paused;
}

@keyframes tmScroll {
  to { transform: translateX(-33.3333%); }
}

@keyframes tmScrollReverse {
  from { transform: translateX(-33.3333%); }
  to { transform: translateX(0); }
}

/* Review card. Ported from production styles.css .tcard and
   retokenized: accent bar becomes accent to accent-deep. */
.tcard {
  background: color-mix(in srgb, var(--white) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--white) 8%, transparent);
  border-radius: var(--r-sm);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.tcard__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
}

.tcard__quote {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--accent);
  opacity: 0.2;
  line-height: 0.8;
  margin-bottom: 8px;
}

.tcard p {
  font-size: 15px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
  font-style: italic;
  margin-bottom: 20px;
}

.tcard__author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tcard__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.tcard__mono {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--white) 8%, transparent);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.tcard__photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--white) 8%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--white) 14%, transparent);
}

.tcard__name {
  font-weight: 700;
  font-size: 14px;
  color: var(--paper);
}

.tcard__role {
  font-size: 12px;
  color: color-mix(in srgb, var(--paper) 50%, transparent);
}

.tcard__stars {
  color: var(--star);
  font-size: 14px;
  margin-top: 12px;
  letter-spacing: 2px;
}

.tmarquee .tcard {
  width: 400px;
  flex-shrink: 0;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .tmarquee .tcard {
    width: 310px;
  }

  .tmarquee .tcard p {
    font-size: 14px;
  }

  /* swipeable review rows instead of the auto-marquee */
  .tmarquee__row {
    animation: none;
    width: auto;
    overflow-x: auto;
    padding: 0 20px 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tmarquee__row::-webkit-scrollbar {
    display: none;
  }

  .tmarquee__row [aria-hidden="true"] {
    display: none;
  }

  .tmarquee .tcard {
    scroll-snap-align: center;
  }

  .tmarquee::before,
  .tmarquee::after {
    width: 36px;
  }
}

/* ---- 9. Comparison cards ---- */
.mcompare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  align-items: stretch;
  margin-top: 56px;
}

.mcard {
  background: var(--ink-2);
  color: var(--paper);
  border: 1px solid color-mix(in srgb, var(--white) 5%, transparent);
  border-radius: 20px;
  padding: 42px 40px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.mcard--them {
  transform: rotate(-1.2deg);
}

.mcard--us {
  transform: rotate(1.2deg);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, transparent) 0%, color-mix(in srgb, var(--accent-deep) 4%, transparent) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 6%, transparent), 0 0 120px color-mix(in srgb, var(--accent) 3%, transparent);
  position: relative;
}

.mcard--them:hover,
.mcard--us:hover {
  transform: rotate(0) translateY(-6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.mcard--us:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.mcard__tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.mcard--us .mcard__tag {
  color: var(--accent);
}

.mcard__price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 4.4vw, 54px);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 8px;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
}

.mcard--us .mcard__price {
  color: var(--accent);
}

.mcard__sub {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 28px;
}

.mcard ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mcard li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 0;
  border-top: 1px solid color-mix(in srgb, var(--white) 8%, transparent);
  font-size: 15px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--paper) 75%, transparent);
}

.mcard .mk {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

.mcard .mk--x {
  background: color-mix(in srgb, var(--white) 6%, transparent);
  color: var(--faint);
}

.mcard .mk--c {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}

.mcard__sticker {
  position: absolute;
  top: -17px;
  right: 26px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  transform: rotate(3deg) scale(0);
}

.reveal.visible .mcard__sticker {
  animation: mSticker 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.45s forwards;
}

@keyframes mSticker {
  from { transform: rotate(3deg) scale(0); }
  to { transform: rotate(3deg) scale(1); }
}

@media (max-width: 860px) {
  .mcompare {
    grid-template-columns: 1fr;
  }

  .mcard--them,
  .mcard--us {
    transform: none;
  }
}

/* ---- 10. Reduced motion: targeted disables with explicit
   visible end states. Never a nuclear animation kill. ---- */
@media (prefers-reduced-motion: reduce) {
  .tmarquee__row,
  .lmarquee__track,
  .jt-node--next circle.c,
  .jt-chev--l,
  .jt-chev--r,
  .eb-badge .dot {
    animation: none;
  }

  .mcard__sticker,
  .reveal.visible .mcard__sticker {
    animation: none;
    transform: rotate(3deg) scale(1);
  }

  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
