/* polish-f.css — final review polish, loaded last */
/* Scope: the whole page as one system (rhythm, seams, gutters, focus, anchors, overflow) */

/* ---------- 1. No sideways scroll on phones ----------
   At 390px and 360px the design section's demo cursors and their name tags sat past the
   right edge (document 581px wide in a 375px window). Clip each section on the x axis only:
   `clip` is not a scroll container, so sticky stages and vertical bleed still work. */
main > section { overflow-x: clip; }

/* ---------- 2. Nav anchors land flush under the fixed header ----------
   html keeps its 12px of extra scroll padding (it keeps focused form fields clear of the
   header), but for whole sections it left a 12px strip of the previous section showing
   under the header, e.g. a dark band above the cream "Design & web" and "Contact" sections.
   The section's own top padding already gives the breathing room. */
main > section[id] { scroll-margin-top: -12px; }

/* ---------- 3. Section rhythm ----------
   Every section uses --section-pad (88 → 168px) except "Design & web", which was at
   80 → 104px and read as cramped between two full-height dark sections, and "Why us" at
   88 → 140px. Bring both onto the shared rhythm. */
.section.design { padding-block: var(--section-pad); }
.section.why2 { padding-block: var(--section-pad); }

/* ---------- 4. Softer seams between the dark sections ----------
   "How it works" (near-black ink) met "Why us" (deep green) on a hard horizontal line, and
   "Why us" met the black city band of the call to action on another. Fade the green in from
   the ink at the top and back out to the band's black at the bottom. Light (cream) sections
   keep their clean edges. */
.why2::before,
.why2::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  z-index: -1;
  pointer-events: none;
}
.why2::before {
  top: 0;
  height: clamp(120px, 12vw, 220px);
  background: linear-gradient(180deg, #06110D 0%, rgba(6, 17, 13, .6) 38%, rgba(6, 17, 13, 0) 100%);
}
.why2::after {
  bottom: 0;
  height: clamp(100px, 10vw, 180px);
  background: linear-gradient(0deg, #030806 0%, rgba(3, 8, 6, .55) 40%, rgba(3, 8, 6, 0) 100%);
}
/* the fine top hairline marked the old hard edge; across the fade it read as a stray line */
.why2 .why2__bg::after { content: none; }

/* ---------- 5. Focus rings on light sections ----------
   Guard: `.btn--primary:focus-visible` sets a cream ring and wins over the green ring used on
   the cream sections. Only the form button had its own fix; any primary button added later to
   "Bright", "Design & web" or "Contact" would show a cream ring on a cream background. */
:is(.sun, .design, .contact) .btn--primary:focus-visible { outline-color: var(--green); }

/* ---------- 6. "Pause animation" holds every status light still ----------
   The red "Real installs" light on the work reel kept pulsing after the visitor pressed
   Pause. Same treatment for every light that uses the led-pulse loop. */
html.is-paused :is(.live-led, .dtile__badge i, .reelstage__badge i, .code__kds i) {
  animation-play-state: paused !important;
}

/* Round 2 */
/* The page as one system: light at the seams, the progress line, scrollbar, selection, wrapping */

/* ---------- 7. Seams: where a dark section meets a cream one ----------
   Dark above cream (Displays > Sunlight, Our work > Design, call to action > Contact): the
   dark slab casts a short, soft shade onto the paper, with a fine lit edge, so the cream
   reads as a sheet tucked under it instead of a flat colour change.
   Cream above dark (Design > How it works): a little of the cream's light spills over the
   edge into the dark. Static gradients only; nothing animates. */
.sun::after,
#design::after,
.contact::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: clamp(48px, 5vw, 84px);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 17, 13, .10) 0%, rgba(6, 17, 13, .045) 30%, rgba(6, 17, 13, .012) 66%, rgba(6, 17, 13, 0) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
}
.process::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: clamp(110px, 11vw, 180px);
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(244, 240, 230, 0) 0%, rgba(244, 240, 230, .12) 30%, rgba(244, 240, 230, .18) 50%, rgba(244, 240, 230, .12) 70%, rgba(244, 240, 230, 0) 100%) 0 0 / 100% 1px no-repeat,
    radial-gradient(60% 100% at 50% 0%, rgba(244, 240, 230, .065), rgba(244, 240, 230, 0) 72%);
}

/* Displays > Sunlight: warm sunlight leaks up into the bottom of the dark section from where
   the sun sits in the next one (top right), so the jump from night to noon has a lead-in. */
.dshow::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: clamp(140px, 14vw, 240px);
  pointer-events: none;
  background:
    radial-gradient(46% 100% at 86% 100%, rgba(255, 226, 170, .075), rgba(255, 226, 170, .02) 52%, rgba(255, 226, 170, 0) 78%),
    linear-gradient(0deg, rgba(244, 240, 230, .035), rgba(244, 240, 230, 0) 60%);
}

/* ---------- 8. Scroll progress line: a lit filament ----------
   It was a flat 2px coral-to-cream bar. It now fades in from the left, warms through coral
   to a bright tip and carries a soft coral glow. The bar is still scaled with transform only. */
.site-header .anim-progress {
  background: linear-gradient(90deg, rgba(255, 107, 61, .15) 0%, #FF6B3D 22%, #FF8A5C 64%, #FFC9AE 92%, #FFF3EA 100%);
  box-shadow: 0 0 2px rgba(255, 107, 61, .9), 0 0 10px rgba(255, 107, 61, .5);
}

/* ---------- 9. Scrollbar ----------
   The page scrollbar was the system grey. It now sits on the brand ink with a soft cream
   thumb. Set on html only (the viewport); body resets it so the form's text box and the
   work strip keep their own scrollbars. */
html { scrollbar-color: rgba(244, 240, 230, .26) #040A08; }
body { scrollbar-color: auto; }
@supports not (scrollbar-color: auto) {
  html::-webkit-scrollbar { width: 12px; }
  html::-webkit-scrollbar-track { background: #040A08; }
  html::-webkit-scrollbar-thumb {
    background: rgba(244, 240, 230, .24);
    border: 3px solid #040A08;
    border-radius: 999px;
  }
  html::-webkit-scrollbar-thumb:hover { background: rgba(255, 107, 61, .75); }
}

/* ---------- 10. Text selection ----------
   Same coral highlight, but glows and shadows on headings no longer smear through it, and
   images, icons and videos don't take a coloured wash when someone selects a whole block. */
::selection { background: #FF6B3D; color: #06110D; text-shadow: none; }
:is(img, svg, video, canvas)::selection { background: transparent; }

/* ---------- 11. Wrapping ----------
   Body copy avoids single-word last lines. Zero specificity, so any section that already
   sets its own wrapping keeps it. */
:where(main, .site-footer) :where(p, li, figcaption, dd) { text-wrap: pretty; }

/* Round 3 */
/* One lighting model for every seam: the dark sections are raised slabs. Their top edge catches
   the light (a fine lit horizon where cream sits above dark) and their bottom edge casts a soft
   shade onto the cream below (rule 7). Static gradients only. */

/* ---------- 12. "Why us" > call to action: no hard edge on the city film ----------
   The green fades neatly to black, but the city film started on a hard horizontal cut at the
   band's top edge (a visible line across the page on desktop and phone). Fade the film in from
   the band's black. A plain gradient layer above the film, so nothing is masked per frame. */
.cta .cta__city::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 1;
  height: clamp(110px, 12vw, 200px);
  pointer-events: none;
  background: linear-gradient(180deg, #030806 0%, rgba(3, 8, 6, .82) 26%, rgba(3, 8, 6, .4) 62%, rgba(3, 8, 6, 0) 100%);
}

/* ---------- 13. Cream above dark: one lit horizon for every such seam ----------
   "Bright" > "Our work" met on a bare hard edge, while "Design" > "How it works" had a lit
   edge so faint it read as nothing. Both now share one recipe: a fine cream line, brightest in
   the middle, with a 3px soft halo under it and a gentle pool of light below. (Contact > footer
   keeps its own coral-hearted horizon, the finale of the same idea.) */
#work::before,
.process::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: clamp(110px, 11vw, 180px);
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(244, 240, 230, 0) 4%, rgba(244, 240, 230, .16) 26%, rgba(244, 240, 230, .3) 50%, rgba(244, 240, 230, .16) 74%, rgba(244, 240, 230, 0) 96%) 0 0 / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(244, 240, 230, 0) 12%, rgba(244, 240, 230, .06) 50%, rgba(244, 240, 230, 0) 88%) 0 1px / 100% 3px no-repeat,
    radial-gradient(56% 100% at 50% 0%, rgba(244, 240, 230, .075), rgba(244, 240, 230, .02) 46%, rgba(244, 240, 230, 0) 74%);
}
/* the film sits right under the edge in "Our work", so keep the pool short there */
#work::before { height: clamp(48px, 5vw, 84px); }

/* ---------- 14. Displays > Sunlight: a lead-in you can actually see ----------
   The warm leak from round 2 was too faint to read on most screens. A little stronger, still
   low, and still coming from where the sun sits in the next section (top right). */
.dshow::after {
  background:
    radial-gradient(46% 100% at 86% 100%, rgba(255, 226, 170, .12), rgba(255, 226, 170, .035) 52%, rgba(255, 226, 170, 0) 78%),
    linear-gradient(0deg, rgba(244, 240, 230, .05), rgba(244, 240, 230, 0) 60%);
}

/* ---------- 15. Section intros never start a line with a dash ----------
   At 1280px and wider the "Bright" intro broke before "— up to ten times brighter…", so a
   line began with a dash. Pretty wrapping keeps the dash on the line before. */
#bright .section-head .sun__body { text-wrap: pretty; }
