/* ===========================================================================
   ARC — A Random Web · Scroll experience  (websites.html ONLY)
   ---------------------------------------------------------------------------
   Isolated module. Pairs with assets/js/websites-scroll.js. Loaded right after
   websites.css in websites.html. Provides the SPARKK-grade scroll system:
     • dark kinetic hero (arc-hero)
     • masked line reveals (.arc-line-mask)
     • a pinned "Who we are" intro (arc-intro)
     • scroll-reactive gallery marquee + per-card image reveal
     • a big closing CTA

   FOUC / NO-JS / NO-LIBS / REDUCED-MOTION SAFE:
   The default state in this file is the FINAL, fully visible, readable state.
   The JS adds `is-scroll-ready` to <html> and only then hides things (via GSAP
   sets). If the JS or the libraries never run, everything is simply visible and
   the page scrolls natively.
   ========================================================================= */

/* ---- Lenis smooth-scroll baseline (recommended by darkroom.engineering) ---- */
html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---- Masked line primitive (shared by hero + statement headings) ---------- */
.arc-line-mask { display: block; overflow: hidden; }
.arc-line-mask > * { display: block; }
/* Give the descender room so masking never clips letters like g / y / j. */
.arc-line-mask > * { padding-bottom: 0.08em; }

/* =========================================================================
   HERO — A Random Web Design (kinetic, dark, editorial)
   ========================================================================= */
.arc-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #050506;
  color: var(--arc-frost);
  isolation: isolate;
}

/* Responsive background art (desktop vs mobile <picture>). Sits at the very
   bottom of the hero stack over the flat #050506 base (the load/failure
   fallback). Stacking inside .arc-hero (isolation: isolate):
   image 0 · overlay 1 · streak decoration 2 · content 3. */
.websites-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

/* Full-bleed art anchored to the bottom (Qubstudio-style): the wave / bokeh
   lives in the lower-right, the upper-left stays clean dark for the copy. No
   object-fit:cover crop — width drives the size, height follows the aspect ratio,
   so we never get the "orange blob stuck in one corner" look. */
.websites-hero-bg img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: auto;
  max-width: none;
  display: block;
  object-fit: initial;
  object-position: center bottom;
  transform: translateX(-50%);
}

/* Left-weighted darkening (protects the copy) + a soft top/bottom pass so the
   clean dark area reads premium. Lighter than before so the image stays alive. */
.arc-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.82) 0%,
      rgba(0, 0, 0, 0.62) 34%,
      rgba(0, 0, 0, 0.24) 68%,
      rgba(0, 0, 0, 0.08) 100%
    ),
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.35) 0%,
      rgba(0, 0, 0, 0.08) 45%,
      rgba(0, 0, 0, 0.18) 100%
    );
}

.arc-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.arc-hero__symbol {
  position: absolute;
  top: 50%;
  right: -8vw;
  width: min(70vw, 760px);
  height: auto;
  transform: translateY(-50%);
  opacity: 0.9;
}

.arc-hero__inner {
  position: relative;
  z-index: 3;
  width: min(100% - 64px, var(--arc-container-max, 1280px));
  margin-inline: auto;
  padding-block: clamp(96px, 14vh, 180px);
}

.arc-hero__eyebrow {
  font-family: var(--arc-font-mono);
  font-size: var(--arc-fs-label, 0.6875rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--arc-vermillion);
  margin: 0 0 clamp(20px, 3vw, 32px);
}

.arc-hero__title {
  font-family: var(--arc-font-display, 'Newsreader', Georgia, serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 6.4vw, 6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: none;
  color: #fff;
}

.arc-hero__line { display: block; }
/* Keep "Algo extraordinary" on a single line from tablet up; on phones it may
   wrap on ultra-narrow widths (handled in the mobile block below). */
@media (min-width: 768px) {
  .arc-hero__line { white-space: nowrap; }
}

.arc-hero__serif {
  font-style: italic;
  color: var(--arc-vermillion);
}

/* New hero headline accent: "extraordinary" / "extraordinario" in Vermillion. */
.arc-hero__accent {
  font-style: normal;
  color: var(--arc-vermillion);
}

.arc-hero__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: clamp(28px, 4vw, 44px) 0 0;
  padding: 0;
  font-family: var(--arc-font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--arc-ink-30);
}
.arc-hero__tags li { position: relative; }
.arc-hero__tags li + li::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--arc-vermillion);
  transform: translateY(-50%);
}

.arc-hero__subtitle {
  margin: clamp(24px, 3.5vw, 38px) 0 0;
  max-width: 640px;
  font-family: var(--arc-font-sans);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-weight: 400;
  line-height: 1.5;
  color: #ffffff;
}

.arc-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: clamp(32px, 4vw, 48px) 0 0;
}

/* Premium text-link CTA (replaces the solid accent button). Pure white, no box,
   with a baseline underline that retracts right-to-left on hover. */
.arc-hero__cta-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: #ffffff;
  font-family: var(--arc-font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0 2px 8px 0;
  cursor: pointer;
}

/* The underline. transform-origin:left + scaleX(0) on hover makes it collapse
   toward the left, i.e. it visually disappears from the right edge inward. */
.arc-hero__cta-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: #ffffff;
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.65s cubic-bezier(0.77, 0, 0.175, 1);
}
.arc-hero__cta-link:hover::after,
.arc-hero__cta-link:focus-visible::after {
  transform: scaleX(0);
}

.arc-hero__cta-arrow {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.45s var(--ease, cubic-bezier(0.4, 0, 0.2, 1));
}
.arc-hero__cta-link:hover .arc-hero__cta-arrow,
.arc-hero__cta-link:focus-visible .arc-hero__cta-arrow {
  transform: translateY(4px);
}

/* Desktop / laptop: enlarge slightly so the wave spans the lower half and the
   bokeh reaches the right edge — more presence than a 100% band. The hero's
   overflow:hidden clips the overhang, so there is no horizontal scroll. */
@media (min-width: 768px) {
  .websites-hero-bg img { width: 112%; }
}

/* Mobile (Website_cell.png): drop the art below the fold so the orange wave sits
   under the centred copy instead of behind the title. A dark, empty top is fine
   — the base #050506 carries it. Height stays auto so the art never distorts. */
@media (max-width: 767.98px) {
  .websites-hero-bg img { bottom: -90px; }
  .arc-hero::after {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.88) 0%,
      rgba(0, 0, 0, 0.76) 32%,
      rgba(0, 0, 0, 0.38) 68%,
      rgba(0, 0, 0, 0.20) 100%
    );
  }

  /* Slightly smaller title so "Algo extraordinary" stays on one line on phones. */
  .arc-hero__title {
    font-size: clamp(1.9rem, 14.6vw, 3.9rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
  }
  /* Push the description well below the title (more breathing room / clean zone),
     and the CTA further down again so it is not in the first glance. */
  .arc-hero__subtitle {
    margin-top: clamp(64px, 16vh, 120px);
    color: #ffffff;
  }
  .arc-hero__actions { margin-top: 40px; }
}

/* =========================================================================
   GALLERY — scroll-reactive marquee + per-card image reveal
   The base marquee styles live in main.css (".arc-web-*"). When JS takes over,
   it adds .is-js-driven so the CSS keyframe animation steps aside.
   ========================================================================= */
.arc-web-gallery.is-js-driven .arc-web-marquee__track {
  animation: none;
}
.arc-web-gallery.is-js-driven .arc-web-marquee--right .arc-web-marquee__track {
  margin-left: 0;
}
/* While JS drives the loop, don't pause on hover (the velocity reaction is the
   intended interaction); keep the CSS pause for the non-JS fallback only. */
.arc-web-gallery.is-js-driven .arc-web-marquee:hover .arc-web-marquee__track,
.arc-web-gallery.is-js-driven .arc-web-marquee:focus-within .arc-web-marquee__track {
  animation-play-state: running;
}

.arc-web-card img {
  transform-origin: center;
  will-change: transform;
}

/* =========================================================================
   CLOSING CTA — let the streak parallax without clipping
   ========================================================================= */
.cta-dark { overflow: hidden; }

/* =========================================================================
   REVEAL fail-safety
   These declarations only take effect once JS confirms it can animate. Until
   then (and forever, if JS/libs fail) the content keeps the visible default.
   ========================================================================= */
html.is-scroll-ready .arc-hero__scroll { /* placeholder hook, kept for clarity */ }

@media (prefers-reduced-motion: reduce) {
  /* Stop the gallery marquee entirely — no looping motion under reduced-motion. */
  .arc-web-marquee__track { animation: none !important; }
}
