/* V7 page rhythm + section dividers (prototype base, continued). */
/*
 siblings, so ~ not +; child
   backgrounds can't cover it), and on the top edge of a section that follows another inside the same part.
   None into or out of the dark chapter, the sister line or the closing band: each is its own edge.
   10-22 (Kriste): the dark chapter now uses the same rhythm; the calmer flip (shell SG.chapter) no longer needs extra air. */
.pg{--sec:clamp(44px,5.2cqi,76px)}
.pg[data-page="home"]{--air:0px}
.pg[data-page="home"] > #p-home-sister,.pg[data-page="home"] > #p-home-d{margin-top:0}
.pg > .part ~ .part:not(.sg-net):not([data-chapter])::before{
  content:"";display:block;height:1px;background:var(--line);
  width:min(var(--max), calc(100% - var(--gut) * 2));margin:0 auto}
/* no divider into or out of the dark chapter or onto the sister line (ids outrank the class rule above) */
.pg > #p-home-sb::before,.pg > #p-home-svc::before,.pg > #p-home-sister::before{content:none}
/* the services list already ends on a hairline row, so the founder part needs no second rule under it */
.pg > #p-home-cred::before{content:none}
.pg .part > section.sg-sec + section.sg-sec{
  background-image:linear-gradient(var(--line),var(--line));background-repeat:no-repeat;background-position:top center;
  background-size:min(var(--max), calc(100% - var(--gut) * 2)) 1px}
@container site (max-width: 600px){ .pg{--sec:36px} .pg > #p-home-sb{--sec:56px} }
/* V7 agents-first order: services now follows the hero and the founder part follows the testimonials, so both get
   the hairline; How it works now follows the dark Single Brain band, which is its own edge */
.pg > #p-home-svc::before,.pg > #p-home-cred::before{content:""}
.pg > #p-home-how::before{content:none}

/* Kriste 10-22: on phone the mono button text and the 24-hour note go to 14px (was 12.5px);
   phone has no dark flip, so the chapter and the services part drop the extra air */
@container site (max-width: 600px){
  .sg-btn,.sg-btn--sm{font-size:14px}
  .sg-note{font-size:14px;white-space:normal;text-align:left}
  .pg[data-page="home"] > #p-home-sb,.pg[data-page="home"] > #p-home-svc{--air:0px}
}

/* ---------- phone pass from the mobile Jev review (media-os-b1, Kriste 10-22) ----------
   Touch screens: the 24-hour note is a plain line under its button (green dot + text, no pill, no border).
   The button group follows its section's alignment: centred heroes centre the button, left-aligned pages keep it left
   (inline-block children obey the inherited text-align; the old flex column left the button off-centre). */
@media (hover:none){
  .sg-act,.sg-act--center{display:inline-block}
  .sg-act .sg-note,.sg-act--center .sg-note{display:block;margin-top:10px;background:none;border:0;border-radius:0;padding:0;box-shadow:none;white-space:normal;text-align:inherit}
  .sg-act .sg-note::before{display:inline-block;vertical-align:.06em;margin-right:9px}
  /* V5 review 10-26 (group D): on touch tablets the note sits under the button, so a text link beside the pair lines up
     with the button's middle instead of the pair's (it sat 46px low) */
  @container site (min-width: 601px){
    .sg-btns:has(> .sg-act){align-items:flex-start}
    .sg-btns:has(> .sg-act) > .sg-link{display:inline-flex;align-items:center;min-height:48px}
  }
}
@container site (max-width: 600px){
  /* every text link gets a 44px-tall hit area without moving anything (was homepage only) */
  .sg-link{position:relative}
  .sg-link::after{content:"";position:absolute;left:-6px;right:-6px;top:-12px;bottom:-12px}
  /* device mockups: the cropped desktop hero, no phone beside it, zoomed so the client's headline reads */
  .sg-mock{padding-right:0;padding-bottom:0}
  .sg-mock .sg-phone{display:none}
  .sg-mock .sg-browser__view .sg-scroll{width:160%;max-width:none}
  .sg-browser__url{font-size:12px}
}


/* ---------- phone: every main button is centred, with its 24-hour note shown under it (Kriste 10-22) ----------
   V4 comments 93b71107 + a396605b: on phone there's no hover, so the "Senior strategists available within 24 hours"
   note is always shown, as a plain line right under its button, and every main button sits centred on the page.
   Where a group also has a secondary link ("See the work", "More … results"), it is centred below.
   Width-based (not hover-based), so the review's Mobile frame on a desktop browser shows the same thing.
   Scoped through #site .pg .part so it outranks the parts' own button rules. Buttons keep their natural width. */
@container site (max-width: 600px){
  #site .pg .part .sg-btns:has(> .sg-act),#site .pg .part .cs-actions{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;gap:14px;width:100%;text-align:center}
  #site .pg .part .sg-act{display:flex;flex-direction:column;align-items:center;width:fit-content;max-width:100%;margin:0 auto;align-self:center;text-align:center}
  /* V5 10-26 (Kriste: "unified style through all pages"): on phone width the note is ALWAYS the plain line, dot + text,
     no box, matching real touch phones; desktop and tablet keep the square note on hover/focus */
  #site .pg .part .sg-act .sg-note{position:static;left:auto;opacity:1;transform:none;pointer-events:auto;margin-top:10px;
    display:block;background:none;border:0;border-radius:0;padding:0;box-shadow:none;white-space:normal;text-align:center}
  #site .pg .part .sg-act .sg-note::before{display:inline-block;vertical-align:.06em;margin-right:9px}
  #site .pg .part .sg-btns:has(> .sg-act) > .sg-link,#site .pg .part .cs-actions > .sg-link{align-self:center;padding-block:12px}
}

/* ---------- phone: the landing blends into its illustration (Kriste 10-23, comment f93c3942) ----------
   On phone each inner-page hero was white text on white, with the illustration parked below it in its own box.
   Now one full-bleed backdrop runs under the whole hero: a warm light that pools where the illustration sits and a
   fine pixel-dot grid that is dense around the illustration and dissolves upward behind the headline. The illustration
   drops its own box and sits straight in that field, so text and image read as one picture. Home keeps its own pixel scene.
   Two layers: ::before = warm light, ::after = dots (each masked on its own). Desktop and tablet are untouched.
   10-23 refinement (Kriste: "a bit too orangey… the dotted background a bit too strong"): the light is a near-neutral
   warm sand that is faint across the top and pools around the illustration, with a faint orange tint right at the image; the dots are
   bone grey, finer and wider apart, and start below the text, so the orange comes from the illustration, not the ground. */
@container site (max-width: 600px){
  #p-services .services-hero,#p-service .sv-hero,#p-paid-media .pm-hero,#p-about .ab-hero,#p-work .work-hero,
  :is(#p-case,#p-case-smartrent,#p-case-ls,#p-case-simon-pearce,#p-case-prolite,#p-case-klassy,#p-case-wine-deals,#p-case-single-grain,#p-case-interchain,#p-case-bierman,#p-case-crushing-it) .cs-hero{
    position:relative;isolation:isolate;--blend:60%}
  #p-service .sv-hero{--blend:56%}
  #p-paid-media .pm-hero{--blend:56%}
  #p-about .ab-hero{--blend:58%}
  #p-services .services-hero::before,#p-service .sv-hero::before,#p-paid-media .pm-hero::before,#p-about .ab-hero::before,#p-work .work-hero::before,
  :is(#p-case,#p-case-smartrent,#p-case-ls,#p-case-simon-pearce,#p-case-prolite,#p-case-klassy,#p-case-wine-deals,#p-case-single-grain,#p-case-interchain,#p-case-bierman,#p-case-crushing-it) .cs-hero::before{
    content:"";position:absolute;inset:0;z-index:-2;pointer-events:none;
    -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 78%,transparent 100%);mask-image:linear-gradient(to bottom,#000 0%,#000 78%,transparent 100%);
    background:
      radial-gradient(42% 12% at 50% calc(var(--blend) + 22%),rgba(242,112,56,.05) 0%,rgba(242,112,56,0) 100%),
      radial-gradient(150% 44% at 50% calc(var(--blend) + 20%),rgba(243,238,232,.97) 0%,rgba(246,243,239,.72) 46%,rgba(250,249,247,0) 80%),
      linear-gradient(to bottom,rgba(247,244,240,.95) 0%,rgba(249,247,244,.55) 38%,rgba(250,249,247,0) 62%)}
  #p-services .services-hero::after,#p-service .sv-hero::after,#p-paid-media .pm-hero::after,#p-about .ab-hero::after,#p-work .work-hero::after,
  :is(#p-case,#p-case-smartrent,#p-case-ls,#p-case-simon-pearce,#p-case-prolite,#p-case-klassy,#p-case-wine-deals,#p-case-single-grain,#p-case-interchain,#p-case-bierman,#p-case-crushing-it) .cs-hero::after{
    content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
    background:radial-gradient(circle,rgba(150,138,124,.42) .9px,transparent 1.5px) 10px 0/20px 20px;
    -webkit-mask-image:linear-gradient(to bottom,transparent 0%,transparent calc(var(--blend) - 18%),rgba(0,0,0,.85) calc(var(--blend) + 6%),rgba(0,0,0,.85) 84%,transparent 100%);
            mask-image:linear-gradient(to bottom,transparent 0%,transparent calc(var(--blend) - 18%),rgba(0,0,0,.85) calc(var(--blend) + 6%),rgba(0,0,0,.85) 84%,transparent 100%)}
  /* the illustrations drop their own panels and sit in the shared field */
  .site #p-work .wh-stage{background:none;border-radius:0;overflow:visible}   /* .site: outranks work.html's own phone rule, which loads later */
  .site #p-work .wh-stage::after{display:none}
  #p-services .sh-viz{background:none;border-radius:0;overflow:visible}
  #p-services .sh-viz::after{display:none}
  :is(#p-case,#p-case-smartrent,#p-case-ls,#p-case-simon-pearce,#p-case-prolite,#p-case-klassy,#p-case-wine-deals,#p-case-single-grain,#p-case-interchain,#p-case-bierman,#p-case-crushing-it) .cs-stage{background:none;border-radius:0;overflow:visible}
  :is(#p-case,#p-case-smartrent,#p-case-ls,#p-case-simon-pearce,#p-case-prolite,#p-case-klassy,#p-case-wine-deals,#p-case-single-grain,#p-case-interchain,#p-case-bierman,#p-case-crushing-it) .cs-stage::after{display:none}
  /* the pill note under the main button reads on the warm field */
  #p-services .services-hero .sg-note,#p-service .sv-hero .sg-note,#p-about .ab-hero .sg-note,#p-work .work-hero .sg-note,.cs-hero .sg-note{background:transparent}
}
/* 10-27 (Kriste comment on the Learning A-Z opening: the light sand backdrop "looks very old-school and scattered"):
   case openings on phone are plain white; the other inner pages keep the field */
@container site (max-width: 600px){
  :is(#p-case,#p-case-smartrent,#p-case-ls,#p-case-simon-pearce,#p-case-prolite,#p-case-klassy,#p-case-wine-deals,#p-case-single-grain,#p-case-interchain,#p-case-bierman,#p-case-crushing-it) .cs-hero::before,:is(#p-case,#p-case-smartrent,#p-case-ls,#p-case-simon-pearce,#p-case-prolite,#p-case-klassy,#p-case-wine-deals,#p-case-single-grain,#p-case-interchain,#p-case-bierman,#p-case-crushing-it) .cs-hero::after{display:none}
}

/* ---- r34 (Kriste 11-18, after the UX/Jev review) ---- */
:root{--heat-s:#B85422}   /* Orange Heat for text under 24 px: 4.85:1 on white (--heat #C45B26 is 4.3:1, large type only) */
/* B. pre-launch notes and their footnote numbers stay in the HTML as the record, never on screen */
.cs-notes,.ct-notes,sup.cs-fn,.ct-fn{display:none!important}
/* J. every text link gets a taller hit area on every device (phone already had 44 px) */
.sg-link{position:relative}
.sg-link::after{content:"";position:absolute;left:-6px;right:-6px;top:-8px;bottom:-8px}
@container site (max-width: 600px){
  /* C. closing bands: the agent network under the card goes on phone (it was cut by the screen edge and cross-faded its labels) */
  .sg-net .home-d-stage{display:none!important}
  /* D. disclosure toggles */
  .sg-disc{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;margin:4px 0 0;padding:10px 0;
    border-top:1px solid var(--line-2);border-bottom:1px solid var(--line-2);font:500 15px/1.3 var(--f);color:var(--ink);cursor:pointer;-webkit-tap-highlight-color:transparent}
  .sg-disc::after{content:"+";font:400 22px/1 var(--f);color:var(--ink);transition:color .2s ease}
  .sg-disc[aria-expanded="true"]::after{content:"\2212";color:var(--orange)}
  .sg-disc:focus-visible{outline:2px solid var(--orange);outline-offset:3px}
  .sg-disc-l:not(.is-open){display:none!important}
  .sv-ar-lab,.pm-ar-lab,.pc-ar-lab,.ai-ar-lab{display:none!important}
  .sg-disc--more{justify-content:center;gap:10px;border-bottom:0}
  .sg-disc-ft:not(.is-open) > li:nth-child(n+7){display:none!important}
  .cs-map .sg-disc{order:2;margin-top:12px}
}
.sg-disc{display:none}
@container site (max-width: 600px){ .sg-disc{display:flex} }
/* G. small orange text */
#p-services .pk-facts li:nth-child(2),#p-services .s-proof b,#p-work .w-proof b,#p-home-a .home-a-proof b,#p-home-a .hs-bs,
#p-article .ar-tw td:nth-child(2),#p-work .wp-d,#p-about .ab-only{color:var(--heat-s)}

/* ---- r35 (Jev-tested levers, 11-18) ---- */
/* case-card screenshots in one frame: a soft panel with the client site inset (photos stay full-bleed) */
.cs-card__vis:not(.cs-card__vis--photo){background:#F1EDE6;padding:12px 12px 0;box-sizing:border-box}
.cs-card__vis:not(.cs-card__vis--photo) img{border-radius:6px 6px 0 0;box-shadow:0 10px 24px -14px rgba(0,0,0,.35);object-position:top center}
@container site (max-width: 600px){
  /* section rhythm on phone: every other section on a cool neutral (closing bands keep their own field) */
  .pg > .part:nth-child(even):not(.sg-net):not(.sg-dark){background:#F6F6F7}  /* r40 D: never over a dark band (its light text went cloudy) */
  /* r46 (Kriste 11-19, a2532579; replaces the r35 2-column grid): case results in ONE row between hairlines. Two results sit side
     by side; three show two and the edge of the third, and the row swipes (dots under it, from SG.casePage in case.html) */
  .pg .cs-res{display:grid!important;grid-template-columns:none!important;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:0!important}
  .pg .cs-res:has(> .cs-r:nth-child(4)){grid-auto-columns:calc((100% - var(--gut)) / 2.2);overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;
    scroll-padding-inline:var(--gut);padding-inline:var(--gut);margin-inline:calc(var(--gut) * -1);scrollbar-width:none}
  .pg .cs-res::-webkit-scrollbar{display:none}
  .pg .cs-r,.pg .cs-r:nth-child(odd){grid-column:auto!important;scroll-snap-align:start;min-width:0;padding:0 12px!important;border:0!important;border-left:1px solid var(--line)!important}
  .pg .cs-res > .cs-r:first-child,.pg .cs-res > .cs-r--key:first-child + .cs-r{border-left:0!important}
  .pg .cs-r b{font-size:30px!important;line-height:1!important}
  .pg .cs-res:not(:has(> .cs-r:nth-child(4))) .cs-r b{font-size:34px!important}
  .pg .cs-r .l{font-size:14.5px!important;margin-top:8px;text-wrap:balance}
  .pg .cs-r .d{font-size:13px!important;margin-top:4px;text-wrap:balance}
}

/* ---- r38 A (Kriste 11-19, c35bd92a): hovering a case card must never stop the page from scrolling. The r34 J link hit
   area (8px below every .sg-link) made each sideways case row scroll 8px vertically, and a trackpad gesture latched onto
   the row. Rows that scroll sideways never scroll vertically. ---- */
.cs-rel{overflow-y:hidden;overscroll-behavior-y:auto}
@container site (max-width: 600px){ .sg-swipe{overflow-y:hidden;overscroll-behavior-y:auto} }

/* ---- r40 I (Kriste 11-19, a7ee0bc4: on phone "it's only the click itself"): the orange wipe and label swap run only
   where a pointer can really hover, so a tap never leaves a button stuck half-orange; keyboard focus still shows it ---- */
@media (hover:hover){
  .sg-btn:hover::before{transform:scaleX(1)}
  .sg-btn:not(.has-l):hover{color:#0B0B0C;border-color:var(--orange)}
  .sg-btn.has-l:hover .sg-btn__l{clip-path:inset(0 0 0 100%)}
  .sg-btn.has-l:hover .sg-btn__h{clip-path:inset(0 0 0 0)}
  .sg-btn--line:not(.has-l):hover{color:var(--bg);border-color:var(--ink)}
  .sg-btn:disabled:hover{color:var(--ink);border-color:var(--ink)}
}

/* r30 (Kriste 11-16, Eric could not comment on his phone): our own comment sheet when the view has no composer */
.rv-note{position:fixed;left:12px;right:12px;bottom:12px;z-index:130;max-width:520px;margin-inline:auto;box-sizing:border-box;padding:16px;
  background:var(--rv-bg);color:var(--rv-fg);border:1px solid var(--rv-line);border-radius:14px;box-shadow:0 24px 60px -20px rgba(0,0,0,.5);font:400 14px/1.4 var(--f, system-ui)}
.rv-note[hidden]{display:none}
.rv-note__h{margin:0 0 10px;color:var(--rv-mute)}
.rv-note__h b{color:var(--rv-fg);font-weight:500}
.rv-note textarea{display:block;width:100%;box-sizing:border-box;min-height:96px;resize:vertical;padding:10px 12px;border-radius:10px;border:1px solid var(--rv-line);
  background:#17171A;color:var(--rv-fg);font:400 16px/1.4 var(--f, system-ui)}
.rv-note textarea:focus{outline:2px solid var(--rv-acc);outline-offset:1px}
.rv-note__a{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
.rv-note__a button{appearance:none;border:1px solid var(--rv-line);background:transparent;color:var(--rv-fg);font:inherit;padding:10px 14px;border-radius:10px;cursor:pointer}
.rv-note__a #rv-note-go{background:var(--rv-acc);border-color:var(--rv-acc);color:#0B0B0C;font-weight:500}
.rv-note__a button:disabled{opacity:.5;cursor:default}
.rv-note__s{margin:10px 0 0;color:var(--rv-mute)}
.rv-note__s:empty{display:none}

/* Phone bands as the prototype actually renders them. Its nth-child(2n) counted hidden <style>/<script>
   siblings, so the real result was: hero grey, services white, testimonials grey, sister grey.
   WordPress has no such siblings, so pin those two explicitly. */
@container site (max-width:600px){
  .pg > #p-home-a{background:var(--surface)}
  .pg > #p-home-svc{background:transparent}
}
