/* Post-export fixes for the Framer build.
   Loaded after Framer's own styles on every page. Kept in one file so a re-export
   only needs this <link> re-added, not the individual patches re-found.

   Framer's hashed class names (.framer-xxxxxx) change on every re-export, so these
   rules lean on [data-framer-name] and structural position instead wherever possible.
   The two :nth-child rules are the exception and are called out below. */

/* ---------------------------------------------------------------------------
   1. The nav is just the wordmark, for now.

   The nav has always carried a "Receipts" link; it used to point at the retired
   Playground and is now repointed at the build log at /receipts (the href is
   edited directly in the markup of index.html and subpages/works.html, three
   responsive copies each - it survives hydration, so no rule is needed for it).

   The page is live and reachable, but it is not being announced in the nav yet.
   So both side links stay hidden, exactly as before.

   Each nav link sits in its own wrapper div inside a centred flex row, and the
   wrapper keeps its width when only the <a> is hidden - so the wrappers have to
   go too, or the wordmark sits off centre. They come back together or not at
   all; see rule 5.

   TO LAUNCH THE NAV: delete this rule and rule 5. Nothing else. Both are in this
   file, which is no-cache, so it is a one-file deploy.
   --------------------------------------------------------------------------- */
nav div:has(> a[href="/receipts"]) {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   2. Phone layout fixes (Framer's phone breakpoint is max-width: 809px).
   --------------------------------------------------------------------------- */
@media (max-width: 809px) {

  /* 2a. The hero headline and standfirst were laid out edge to edge - text ran
     into both screen bezels. Give the hero column a real gutter. */
  [data-framer-name="Hero Content"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
  }

  /* 2b. "This is Michelle" is an SVG arc positioned for the desktop headline.
     On a phone the headline wraps to two lines and grows upward into it, so the
     arc printed straight through the words. Lift the arc clear. */
  [data-framer-name="Arc text"] {
    transform: translateY(-58px) !important;
  }

  /* 2c. The two upper collage photos overlapped the first line of the headline
     at phone widths (they clear it on desktop). Nudge them up.
     `translate` is used rather than `transform` on purpose: these elements carry
     a rotation matrix in `transform`, and the shorthand would wipe the rotation.
     Children 2 and 5 of the hero are the upper-left and upper-right photos;
     3 and 4 are the lower pair, which already sit clear. */
  section[data-framer-name="Hero"] > :nth-child(2),
  section[data-framer-name="Hero"] > :nth-child(5) {
    translate: 0 -38px !important;
  }
}

/* ---------------------------------------------------------------------------
   3. Case-study body grids: stack on narrow screens.

   The case-study rich text ships its own stylesheet, which already intends to
   stack these at <=860px:
       @media(max-width:860px){ .strip,.four,.chan,.chan.two,.nums{grid-template-columns:1fr} }
   ...but the .chan elements also carry an INLINE style="grid-template-columns:repeat(3,1fr)",
   and an inline declaration outranks any stylesheet rule. So the three-up card
   rows stayed three-up on a phone.

   Two visible symptoms, one cause: the cards were squeezed into ~110px columns
   AND, because the grid's min-content floor (375px) exceeded the viewport, the
   whole .wrap was pushed wider than the screen - which is why headings and body
   copy on those pages looked off-centre and clipped on the right.

   !important is what actually beats the inline style here.
   --------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .chan, .strip, .four, .nums,
  .pair, .two, .cols2, .smallpair {
    grid-template-columns: 1fr !important;
  }
}

/* ---------------------------------------------------------------------------
   4. Phone-only layout, part two.
   --------------------------------------------------------------------------- */
@media (max-width: 809px) {

  /* 4a. Centre the opening frame. The hero is a fixed 333px composition pinned
     208px down the page, so on a tall phone it sat high with a large dead gap
     beneath it. Push it down by whatever it takes to centre the visible
     composition (which starts at the photos, ~136px, and ends at the Winnow
     callout, ~583px - midpoint 360px) in the viewport. max() keeps it at 0 on
     short screens so it can never be pushed off the top.
     The vh line is a fallback for browsers without svh. */
  section[data-framer-name="Hero"] { margin-top: max(0px, calc(50vh - 360px)) !important; }
  section[data-framer-name="Hero"] { margin-top: max(0px, calc(50svh - 360px)) !important; }

  /* 4b. Testimonials were laid out as fixed 536px cards inside a 1048px ticker
     window, both wider than the screen, so every quote was cut off at both
     edges. Size the card, its wrapper, the track and the ticker window to the
     viewport so one testimonial reads full width with a comfortable margin. */
  [data-framer-name="Testimonial Card"],
  div:has(> [data-framer-name="Testimonial Card"]) {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
  }
  li:has([data-framer-name="Testimonial Card"]),
  li:has([data-framer-name="Testimonial Card"]) > div,
  li:has([data-framer-name="Testimonial Card"]) > div > div {
    width: max-content !important;
  }
  section[data-framer-name="Sneak peak"] { overflow: hidden !important; }
  section[data-framer-name="Sneak peak"] > div,
  section[data-framer-name="Sneak peak"] > div > section,
  section[data-framer-name="Sneak peak"] ul:has([data-framer-name="Testimonial Card"]) {
    width: 100% !important;
  }

  /* 4c. Narrowing the cards makes the quotes wrap to more lines, so the cards
     grow taller than the ticker's fixed desktop height (346px window, 293px row).
     The row bottom-aligns its cards and clips overflow, so the top of every
     quote was cut off. Let the whole chain size to the tallest card. */
  section[data-framer-name="Sneak peak"] > div,
  section[data-framer-name="Sneak peak"] > div > section,
  section[data-framer-name="Sneak peak"] ul:has([data-framer-name="Testimonial Card"]),
  li:has([data-framer-name="Testimonial Card"]),
  li:has([data-framer-name="Testimonial Card"]) > div,
  li:has([data-framer-name="Testimonial Card"]) > div > div {
    height: auto !important;
  }

  /* 4d. Swipeable testimonials instead of the auto-scrolling ticker.
     Framer's Ticker loops the <ul> with a Web Animations API transform and
     appends copies of the card row to fill the loop. An !important author rule
     outranks a running animation, so `transform: none` parks it. The copies
     (every <li> after the first) are hidden, and the ticker window becomes a
     native horizontal scroller that snaps one card at a time.
     The card row ("Variant 1") ships with overflow: hidden, which would make it
     the scroll container the cards snap to, so it is opened up here. */
  section[data-framer-name="Sneak peak"] > div > section {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
  section[data-framer-name="Sneak peak"] > div > section::-webkit-scrollbar {
    display: none;
  }
  section[data-framer-name="Sneak peak"] ul:has([data-framer-name="Testimonial Card"]) {
    transform: none !important;
    will-change: auto !important;
    width: max-content !important;
    flex-shrink: 0 !important;
  }
  li:has([data-framer-name="Testimonial Card"]) ~ li {
    display: none !important;
  }
  li:has([data-framer-name="Testimonial Card"]) > div > div {
    overflow: visible !important;
  }
  div:has(> [data-framer-name="Testimonial Card"]) {
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }
}

/* ---------------------------------------------------------------------------
   5. The other half of rule 1: the "Work" link ("./works" on Home and Work,
   "../works" on case studies). Scoped to <nav> so in-page links to the work are
   unaffected. Hidden with its wrapper for the same centring reason.

   Deleted together with rule 1 when the nav is launched.
   --------------------------------------------------------------------------- */
nav a[href$="works"],
nav div:has(> a[href$="works"]) {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   6. Filter tags with no case studies behind them: "AI" and "Front-End
   Development". They come from the Categories CMS collection, and the category
   list is also baked into each page's hydration data, so they are hidden here
   rather than deleted from the CMS.

   Another :nth-child exception: the tag row is All, E-commerce, Research,
   Product Design, AI, UI & UX, Front-End Development, so AI is child 5 and
   Front-End Development is child 7. The row is found as the element whose
   children wrap the tag components (data-framer-name "Default" / "Active").
   If a category gets a case study, or the order changes, update this rule.
   --------------------------------------------------------------------------- */
section[data-framer-name="Design in actiion"] div:has(> div > [data-framer-name="Default"]) > :is(:nth-child(5), :nth-child(7)),
section[data-framer-name="Works"] div:has(> div > [data-framer-name="Default"]) > :is(:nth-child(5), :nth-child(7)) {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   7. "Just shipped: Winnow" callout under the hero CTA (added 2026-09-14).

   The markup is real page content, not injected by script. It is in all three
   SSR copies of the hero in index.html AND in the home page bundle
   (pNTy2VRDo9...r3.mjs, right after the "See the work" button), so hydration
   matches. A fresh Framer re-export drops both; re-add them, or build the
   callout in Framer itself.

   Hero Content is bottom-anchored inside a fixed-height hero, so a row added
   under the CTA would push the headline up into the arc text. Instead the hero
   grows by exactly the callout's footprint (flex gap + callout height), and
   every bottom-anchored sibling is pulled back by the same amount so nothing
   above the CTA moves: the two lower photos (children 3 and 4) and the arc
   text, whose height is set by its top/bottom offsets.
     desktop, tablet: 40px gap + 48px callout (24 + 4 + 20) = 88px
     phone:           28px gap + 42px callout (22 + 2 + 18) = 70px
   If the callout's line-heights change, update these numbers and rule 4a.
   --------------------------------------------------------------------------- */
.mw-winnow {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  order: 2; /* the phone layout orders Title 0 and CTA 1; keep this after both */
  position: relative;
  border-radius: 8px;
  color: var(--token-0ba7cc43-9dd6-43f5-bf85-fd56e07a2fea, rgb(42, 49, 50));
  font-family: "DM Sans", "DM Sans Placeholder", sans-serif;
  text-align: center;
  text-decoration: none;
  animation: mw-winnow-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 1.7s both; /* lands just after the CTA's appear spring */
}
.mw-winnow-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 400;
  line-height: 24px;
}
.mw-winnow-spark {
  flex: none;
  width: 18px;
  height: 18px;
  fill: var(--token-a2418e68-b41d-46d1-9e27-1a488bd30077, rgb(255, 89, 0));
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mw-winnow-name {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease;
}
.mw-winnow-arrow {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mw-winnow-sub {
  font-size: 14px;
  line-height: 20px;
  color: rgba(42, 49, 50, 0.62);
}
.mw-winnow:hover .mw-winnow-name {
  text-decoration-color: var(--token-a2418e68-b41d-46d1-9e27-1a488bd30077, rgb(255, 89, 0));
}
.mw-winnow:hover .mw-winnow-arrow { transform: translate(2px, -2px); }
.mw-winnow:hover .mw-winnow-spark { transform: rotate(45deg) scale(0.9); }
.mw-winnow:focus-visible {
  outline: 2px solid var(--token-a2418e68-b41d-46d1-9e27-1a488bd30077, rgb(255, 89, 0));
  outline-offset: 6px;
}
@keyframes mw-winnow-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mw-winnow { animation: none; }
  .mw-winnow-spark, .mw-winnow-arrow { transition: none; }
}

/* Desktop: hero 397px -> 485px. */
@media (min-width: 1200px) {
  section[data-framer-name="Hero"] { height: 485px !important; }
  section[data-framer-name="Hero"] > :nth-child(3) { bottom: -17px !important; }
  section[data-framer-name="Hero"] > :nth-child(4) { bottom: -4px !important; }
  section[data-framer-name="Hero"] > [data-framer-name="Arc text"] { bottom: -106px !important; }
}

/* Tablet: hero 340px -> 428px. */
@media (min-width: 810px) and (max-width: 1199.98px) {
  section[data-framer-name="Hero"] { height: 428px !important; }
  section[data-framer-name="Hero"] > :nth-child(3) { bottom: 43px !important; }
  section[data-framer-name="Hero"] > :nth-child(4) { bottom: 68px !important; }
  section[data-framer-name="Hero"] > [data-framer-name="Arc text"] { bottom: -196px !important; }
  .mw-winnow-row { font-size: 16px; }
}

/* Phone: hero 333px -> 403px. The CTA has no appear animation at this size, so
   the callout does not wait for one either. */
@media (max-width: 809.98px) {
  section[data-framer-name="Hero"] { height: 403px !important; }
  section[data-framer-name="Hero"] > :nth-child(3),
  section[data-framer-name="Hero"] > :nth-child(4) { bottom: 110px !important; }
  section[data-framer-name="Hero"] > [data-framer-name="Arc text"] { bottom: -168px !important; }
  .mw-winnow { margin-top: -12px; gap: 2px; animation-delay: 0.4s; }
  .mw-winnow-row { gap: 8px; font-size: 15px; line-height: 22px; }
  .mw-winnow-spark { width: 16px; height: 16px; }
  .mw-winnow-arrow { width: 14px; height: 14px; }
  .mw-winnow-sub { font-size: 13px; line-height: 18px; }
}
