/* ===========================================================================
   HOME — FOLLOW THE RIDE (markup id #sfsc).

   ── what this is ──
   The scroll choreography of charlesleclerc.com's "Life as a driver" band,
   rebuilt on SUPERFLY's own surface. The study behind it, with the values
   measured off the live page, is docs/research/charlesleclerc-driver-section.md.

   ── it is the theme's, not the reference's ──
   Every colour, face, size and curve below is the one the rest of this build
   already uses; nothing here invents a value. Where a number came from:

     colours     theme.json presets. base #171717, contrast #f2f2f4,
                 accent-1 #ec1e79, accent-2 #131317 (panel),
                 accent-4 (muted), accent-5 (line). The hexes are fallbacks
                 for the standalone preview only — the presets win.
     ink         #f2f2f4, not #fff. Every other section token in
                 assets/css resolves to f2f2f4; follow-wall's --ink:#fff is
                 the outlier, not the house.
     surface     the house carbon weave, value for value from
                 categories-flow.css by way of follow-wall.css
     headline    CONDENSED Archivo (wdth 62.5, wght 700), clamp(44px,9.5vw,
                 172px) on line-height .8 — follow-wall.css's own scale,
                 which is itself the reference's 220/176 ratio
     card title  Archivo Black, clamp(22px,2.3vw,34px) / .9 / -.025em
     card body   15px / 1.4 / 500 / -.01em
     eyebrow     700 12px/1 Chakra Petch, .2em, muted ink
     easing      cubic-bezier(.22,1,.36,1) for movement, .5s ease-out for
                 colour — the house pair

   ── what IS taken from the reference, because it is the point ──
     rule          scaleX 0 → 1 from the left
     headline      per-character yPercent 100 → 0, clipped per WORD
     card row      enters from the right, each card further out than the last
     staircase     each card settles a little lower than the one before it,
                   and keeps dropping while the row is on screen
   The numbers live in social-reveal.js, not here, because the desktop
   version is scrubbed and JS owns it.

   ── the two machines ──
   Exactly as the reference does it, and for the same reason:
     ≥1024px   scrubbed to the scroll, JS writes transforms every frame
     ≤1023px   one class toggle, CSS transitions below do the work
   A phone gets the shape of the motion without paying for a scrub.
   =========================================================================== */

#sfsc{
  --mag:  var(--wp--preset--color--accent-1, #ec1e79);
  --ink:  var(--wp--preset--color--contrast, #f2f2f4);
  --card: var(--wp--preset--color--accent-2, #131317);
  --line: var(--wp--preset--color--accent-5, rgba(242,242,244,.12));

  /* THE BASE PRESET, changed 2026-10-20 — read the whole of this before
     changing it back.

     This was #101014, chosen to match the carbon pages (about, contact,
     faq, privacy, terms), which all sit on that shade; contact.css
     records why they do. That reasoning still holds FOR THOSE PAGES and
     they are untouched.

     It was overridden here because this section is loaded on the front
     page and nowhere else (superfly_social_reveal_assets bails unless
     is_front_page), and on the home page it was the last band on a
     surface where every other band resolves the base preset. Six units
     of lightness against #171717 read as a seam straight across the
     page above "Follow the ride" — visible in a screenshot, not a
     theoretical difference.

     So the trade is deliberate: the home page is now one surface, and
     this band no longer matches the interior pages' shade. Putting
     #101014 back is this one line, and costs the home page its seam
     again. */
  --page: var(--wp--preset--color--base, #171717);

  /* .62, the middle of the house range (.55–.78 across assets/css) and the
     value four other sections already use against f2f2f4. */
  --ink2: rgba(242,242,244,.62);
  --ink3: rgba(242,242,244,.45);

  --black:'Archivo Black','Arial Black',sans-serif;
  --tech: 'Chakra Petch','Archivo',system-ui,sans-serif;
  --body: 'Archivo',system-ui,sans-serif;

  /* A safety measure only. The headline's line break comes from the
     display:block accent span, the way about.css does it — NEVER from a
     <br>, which the splitter rebuilds as <br><span></span></br>. Same trap
     the home hero hit. */
  --sfsc-title-measure: 16ch;

  position: relative;
  /* z-index 2 is REQUIRED, not decoration — the same reason follow-wall, the
     collage and home-sequence carry it. A sticky container earlier in an
     Elementor page keeps its sticky containing block for the rest of the
     document and paints over everything after it. */
  z-index: 2;
  box-sizing: border-box;            /* stated, not inherited — an Elementor
                                        conversion silently flips this and
                                        costs the block 2 × gutter of width */
  padding: clamp(48px,7vh,96px) 0 clamp(56px,8vh,110px);
  color: var(--ink);
  font-family: var(--body);

  /* THE HOUSE CARBON WEAVE — the exact recipe about, contact, faq, privacy
     and terms share, so this section sits on the same surface they do.
     Both diagonals are needed: the light one at 45deg is the sheen on the
     tow, the dark one at -45deg is the shadow under it, and with only one
     of them it reads as corduroy.

     background-attachment: fixed is part of the recipe, not an extra. It is
     what makes the weave read as one surface the page moves over rather
     than a texture glued to each band — and it is the reason this section
     looked different from the rest before. */
  background-color: var(--page);
  background-image:
    repeating-linear-gradient( 45deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.35)        0 2px, transparent 2px 4px);
  background-attachment: fixed;

  /* NO overflow here. overflow:hidden would make this a scroll container and
     anything scroll-driven inside would measure against it instead of the
     viewport — the defect that cost follow-wall a round of debugging. */
}

#sfsc,
#sfsc *{ box-sizing: border-box; }

.sf-social__wrap{
  position: relative;
  z-index: 1;
  width: min(1500px, 100%);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 72px);

  /* The row slides in from x: clientWidth * 0.2, and the head column drifts a
     quarter of the viewport the other way. overflow-x: clip on the row itself
     catches the card fan but NOT the row's own box, so the whole page gained a
     horizontal scrollbar on desktop: measured 152px of document overflow at
     1014px wide and 214px at 1440px, scaling with the viewport. Clipped HERE
     for the same reason the row is: #sfsc carries a written-down prohibition
     on overflow, and `clip` (unlike `hidden`) is not a scroll container, so
     nothing scroll-driven inside starts measuring against it. Nothing in this
     wrap is sticky, so the clipping context costs nothing. */
  overflow-x: clip;
}

/* ── the rule ────────────────────────────────────────────────────────────
   Drawn, not faded. transform-origin left is the whole trick. */
.sf-social__line{
  border: 0;
  height: 1px;
  margin: 0 0 clamp(28px,4vw,56px);
  background: var(--ink3);
  opacity: .28;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* ── head ──────────────────────────────────────────────────────────────── */
.sf-social__head{
  display: grid;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
@media (min-width:1024px){
  .sf-social__head{ grid-template-columns: 4fr 6fr; }
}

.sf-social__eyebrow{
  margin: 0;
  display: flex;
  align-items: center;
  gap: .625em;
  /* 11px / .22em / magenta — about, faq, contact, privacy and terms all set
     their eyebrow this way. The dot stays; it is this section's own mark and
     the house has no rule against it. */
  font: 700 11px/1 var(--tech);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--mag);
}
.sf-social__eyebrow::before{
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mag); flex: none;
}

.sf-social__headcol{
  display: grid;
  gap: clamp(24px, 3vw, 48px);
  /* the reference's own lift: it puts the title's cap line level with the
     eyebrow instead of a line below it. Without this the left column reads
     as a caption floating above nothing. */
  margin-top: -.18em;
  will-change: transform;            /* it drifts left as the cards arrive */
}

/* THE HOUSE MASTHEAD, not the reference's.

   About, FAQ, contact, privacy and terms all set their big title at exactly
   clamp(32px,6vw,68px) on line-height .92 and -.025em in Archivo Black.
   Five pages agree, so that is the standard and this follows it — the
   condensed-Archivo 172px treatment this section used to carry is
   follow-wall's, and follow-wall is the only thing on the site that does it.

   font-weight: 400 is load-bearing. Archivo Black is a SINGLE-WEIGHT family;
   ask for 700 and the browser synthesises a fake bold on top of an already
   black face, which smears at this size. about.css writes the same warning. */
.sf-social__title{
  margin: 0;
  max-width: var(--sfsc-title-measure);
  text-transform: uppercase;
  font-family: var(--black);
  font-weight: 400;
  font-size: clamp(32px, 6vw, 68px);
  line-height: .92;
  letter-spacing: -.025em;
  color: var(--ink);
}

/* The house puts the second line of a masthead on its own line in magenta —
   about.css does exactly this with `.superfly-about-title span`.

   The element SURVIVES the split: splitChars() walks child nodes and
   rebuilds inside a shallow clone of any element it meets, so the span
   keeps its class and its display:block. This is also what breaks the
   headline, and it is not the <br> the repo warns about — a <br> has no
   content for the splitter to rebuild and comes back malformed, whereas
   this is an ordinary element the splitter is written to handle. */
.sf-social__accent{
  display: block;
  color: var(--mag);
}

/* Written by the splitter. The clip is per WORD, which is what lets one word
   be half-risen while the one before it is already home.

   THE PADDING/MARGIN PAIR IS LOAD-BEARING, and it is sized, not guessed.
   overflow:hidden clips to the padding box, and at line-height .8 that box
   is SHORTER THAN THE LETTERS — the glyphs overhang it top and bottom, so a
   bare clip shaves the caps and the descenders. The padding gives the clip
   that room back and the equal negative margin takes the space away again,
   leaving line spacing untouched. These values are follow-wall's, which
   carry about twice the measured overhang; the slack is worth having
   because the whole thing moves with font-size and the failure is silent. */
.sf-social__word{
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: .22em .04em .28em;
  margin: -.22em -.04em -.28em;
}
.sf-social__char{
  display: inline-block;
  transform: translateY(100%);
  will-change: transform;
}

/* The house subtitle: 52ch, line-height 1.6, muted ink — terms.css's
   .superfly-terms-intro, which faq, privacy and return-refund all echo
   within a pixel or two of the same clamp. */
.sf-social__lede{
  margin: 0;
  max-width: 52ch;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--ink2);
  opacity: 0;
  transform: translateY(5rem);
}

/* ── the card row ───────────────────────────────────────────────────────── */
.sf-social__row{
  list-style: none;
  margin: clamp(56px, 9vw, 140px) 0 0;
  padding: 0;
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  will-change: transform;

  /* The fan throws the last card 45% of its own width to the right, which
     is past the measure and would widen the document. Clipped HERE and not
     on #sfsc — that element carries a written-down prohibition on overflow
     (it would become a scroll container and anything scroll-driven inside
     would measure against it). Nothing in this grid is sticky, so clipping
     it is free. overflow-x: clip leaves the y axis visible, which the
     staircase needs — overflow-x: hidden would not. */
  overflow-x: clip;
}
@media (min-width:760px){
  /* 320, not a fraction of the measure. A 1fr row put these at 450px wide,
     which is bigger than anything else on the page: the reference's own
     cards are 272 (it fits four) and follow-wall's are 380, which is sized
     for a photograph. These carry a glyph, not a photograph, so they do not
     need that generosity. Centred at the house's 28px gap, like follow-wall. */
  .sf-social__row{
    grid-template-columns: repeat(3, minmax(0, 320px));
    justify-content: center;
  }
}

.sf-social__card{ will-change: transform; }

.sf-social__link{
  display: grid;
  height: 100%;
  padding: 16px 16px 24px;
  gap: 24px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border-radius: 8px;
  transition: background-color .5s ease-out,
              color            .5s ease-out,
              transform        .9s cubic-bezier(.22,1,.36,1);
}
.sf-social__link:hover,
.sf-social__link:focus-visible{
  background-color: var(--mag);
  color: #fff;
}
.sf-social__link:focus-visible{ outline: 2px solid var(--ink); outline-offset: 3px; }

/* The panel. Square and 8px, the same shape the card photographs take
   everywhere else on this page — there is simply no photograph that means
   "TikTok", so the platform's own glyph sits on the house bed instead. The
   bed is brand-tinted rather than black for the same reason the picture
   beds are: if anything is ever slow or missing the card still reads as a
   card rather than a hole cut in the page. */
.sf-social__panel{
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(236,30,121,.22), rgba(10,10,10,0) 60%),
    #141418;
  transition: filter .5s ease-out;
}

.sf-social__glyph{
  position: relative;
  width: 36%; height: auto;
  color: var(--ink);
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.sf-social__link:hover .sf-social__glyph,
.sf-social__link:focus-visible .sf-social__glyph{ transform: scale(1.06); }
.sf-social__link:hover .sf-social__panel,
.sf-social__link:focus-visible .sf-social__panel{ filter: saturate(1.15) contrast(1.04); }

.sf-social__meta{
  display: grid;
  gap: 8px;
}

.sf-social__row1{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.sf-social__name{
  font-family: var(--black);
  font-weight: 400;
  /* the reference is 52px at line-height .74. That is a condensed-face
     trick; Archivo Black at .74 puts the caps of one line into the line
     above, so this is .9 and a size down. follow-wall caps at 34px on a
     380px card; these cards are 320, and 28 keeps the same ratio —
     INSTAGRAM is the longest name here and it has to fit on one line
     beside the arrow. */
  font-size: clamp(20px, 1.9vw, 28px);
  line-height: .9;
  letter-spacing: -.025em;
  text-transform: uppercase;
}

.sf-social__arrow{
  flex: none;
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.sf-social__link:hover .sf-social__arrow,
.sf-social__link:focus-visible .sf-social__arrow{ transform: translateX(4px); }

.sf-social__handle{
  font: 700 12px/1 var(--tech);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mag);
  transition: color .5s ease-out;
}
.sf-social__link:hover .sf-social__handle,
.sf-social__link:focus-visible .sf-social__handle{ color: #fff; }

.sf-social__copy{
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink2);
  transition: color .5s ease-out;
}
.sf-social__link:hover .sf-social__copy,
.sf-social__link:focus-visible .sf-social__copy{ color: rgba(255,255,255,.9); }

/* There is no follower count on these cards. There was a placeholder while
   this was a concept; it was removed before the section went on the home
   page, because we do not have the numbers and nothing invented belongs in
   front of a visitor. Add a .sf-social__count span back when they are real. */

@media (max-width:900px){
  .sf-social__name{ font-size: 24px; }
}

/* ── ≤1023px: the class-toggle version ───────────────────────────────────
   JS adds .is-in once and these transitions run. The per-character delay is
   written inline by the script, 18ms apart — the house sweep, the same
   figure follow-wall uses. */
@media (max-width:1023px){
  .sf-social__line,
  .sf-social__char{
    transition: transform .9s cubic-bezier(.22,1,.36,1);
  }
  .sf-social__lede,
  .sf-social__card{
    transition: transform .9s cubic-bezier(.22,1,.36,1),
                opacity   .9s cubic-bezier(.22,1,.36,1);
  }
  .sf-social__lede{ transition-delay:.3s; }
  .sf-social__card{ opacity:0; transform: translateY(4rem); }
  .sf-social__card:nth-child(2){ transition-delay:.10s; }
  .sf-social__card:nth-child(3){ transition-delay:.20s; }

  #sfsc.is-in .sf-social__line{ transform: scaleX(1); }
  #sfsc.is-in .sf-social__char{ transform: translateY(0); }
  #sfsc.is-in .sf-social__lede{ transform: translateY(0); opacity:1; }
  #sfsc.is-in .sf-social__card{ transform: translateY(0); opacity:1; }
}

/* ── no motion wanted ────────────────────────────────────────────────────
   Everything lands. The script checks the same query and never builds a
   timeline, so these are not fighting a scrub. */
@media (prefers-reduced-motion: reduce){
  .sf-social__line{ transform: scaleX(1); }
  .sf-social__char{ transform:none; }
  .sf-social__lede{ opacity:1; transform:none; }
  .sf-social__card{ opacity:1; transform:none; }
  .sf-social__link,
  .sf-social__glyph,
  .sf-social__arrow{ transition:none; }
}
