/* =====================================================================================================
   Site-wide responsive rules (Gloria's site, Nov 30). Loaded last by every page, so it wins over page CSS.
   Written down in the vault note "Website design rules", section "Responsive rules".

   Breakpoints follow the content, not devices:
     phone    under 600px     one column, 24px side margins, diagrams drawn top to bottom
     tablet   600 to 1239px   one column, section title above its content
     rail     1240px and up   section title pinned in a left rail, content from grid column 5
     wide     1600px and up   nothing grows: the content stays capped and centred
   Components decide by their own width (container queries), not the window's:
     a diagram is drawn wide when its column is at least 780px and top to bottom below that.

   Draft-only options (set from the responsive playground; the option script is removed before publishing):
     data-r-dg    tall (default) | scale | scroll       how diagrams behave in a narrow column
     data-r-rail  1240 (default) | 861                  where the left rail starts
     data-r-story top (default) | side                  phone story layout on phones
     data-r-body  17 (default) | 18 | 16                body size on phones
     data-r-gut   20 (default) | 24 | 16                phone side margins
     data-r-lbl   12 (default) | 11                     small tags inside diagrams
   Defaults set by Claude on Nov 30 from the recommendations (Gloria: too many choices; she didn't pick).
     data-r-home  816 (default) | wide                  homepage list width on very wide screens
   ===================================================================================================== */

/* ---- 1. Intro: on one column, the facts go under the paragraph (bug found Nov 30: they stayed in a
         second column and squeezed the paragraph to two or three words a line on every case study) ---- */
@media (max-width:860px){
  .intro .facts,.intro .nda,.intro > *{grid-column:auto!important;grid-row:auto!important}
}

/* ---- 2. Diagrams: wide drawing when the column has room, top-to-bottom drawing when it doesn't ---- */
.dg-wrap,.sysd-wrap,.isys-wrap{container-type:inline-size;overflow:visible!important}
.dg-wrap .dg,.sysd-wrap .sysd{min-width:0!important}
.dgt{display:none}
@container (max-width:779px){
  .dg-wrap > .dgw,.sysd-wrap > .dgw{display:none}
  .dg-wrap > .dgt,.sysd-wrap > .dgt{display:block}
}
@container (max-width:847px){
  .isys-wrap > .dgw{display:none}
  .isys-wrap > .dgt{display:block}
}
/* option: shrink the wide drawing to fit (text gets small) */
html[data-r-dg="scale"] .dgw{display:block!important}
html[data-r-dg="scale"] .dgt{display:none!important}
html[data-r-dg="scale"] .isys-wrap{overflow-x:auto!important}
/* option: keep the wide drawing and scroll sideways (how it was before Nov 30) */
html[data-r-dg="scroll"] .dgw{display:block!important}
html[data-r-dg="scroll"] .dgt{display:none!important}
html[data-r-dg="scroll"] .dg-wrap,html[data-r-dg="scroll"] .sysd-wrap,html[data-r-dg="scroll"] .isys-wrap{overflow-x:auto!important}
html[data-r-dg="scroll"] .dg-wrap .dg,html[data-r-dg="scroll"] .sysd-wrap .sysd{min-width:720px!important}
/* option: small tags inside the wide diagrams at 12px, her 12px minimum for text in images */
html:not([data-r-lbl="11"]) .sysd .l,html:not([data-r-lbl="11"]) .sysd .s{font-size:12px}

/* ---- the top-to-bottom drawings (built by work/build/dgt.py), same parts as the wide ones ---- */
.dgt{--ln:#9aa0a6;max-width:440px;margin:0 auto;font-family:Inter,sans-serif;color:#0b0b0c;letter-spacing:0}
.dgt.ink{--ln:#0b0b0c}
.dgt p,.dgt h3,.dgt ul{margin:0;max-width:none}
.dgt .bx{background:#f4f5f6;border-radius:8px;padding:12px 14px;text-align:center;font-size:14px;line-height:1.35;position:relative}
.dgt .bx > span{display:block}
.dgt .bx > b{display:block;margin-top:2px;font-size:16px;font-weight:600;font-variant-numeric:tabular-nums}
.dgt .bx.ink{background:#0b0b0c;color:#fff}
.dgt .bx.g{background:#07c160;color:#fff}
/* a vertical line with one arrowhead; .up points up; .da is dashed; a tag sits on the line */
.dgt .v{position:relative;height:40px}
.dgt .v:before{content:"";position:absolute;left:50%;top:0;bottom:8px;border-left:1.25px solid var(--ln);transform:translateX(-.6px)}
.dgt .v:after{content:"";position:absolute;left:50%;bottom:1px;transform:translateX(-50%);border:4.5px solid transparent;border-bottom:0;border-top:8px solid var(--ln)}
.dgt .v.up:before{top:8px;bottom:0}
.dgt .v.up:after{bottom:auto;top:1px;border-top:0;border-bottom:8px solid var(--ln)}
.dgt .v.da:before{border-left-style:dashed}
.dgt .tg{position:absolute;left:50%;top:50%;transform:translate(-50%,-55%);background:#fff;padding:2px 4px;font-size:12px;line-height:1.2;color:#6b6f76;white-space:nowrap;font-variant-numeric:tabular-nums}
.dgt .v.k{height:46px}
.dgt .kt{display:inline-flex;align-items:center;gap:6px;background:#07c160;color:#fff;border-radius:99px;padding:3px 10px 3px 3px;font-size:12px;font-weight:600}
.dgt .kt i{font-style:normal;display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:#fff;color:#067f40;font-size:10px}
.dgt .v.k .tg{background:none;padding:0}
/* two parallel arrows between two layers */
.dgt .pair{position:relative;height:56px}
.dgt .pair i{position:absolute;top:0;bottom:0;width:0}
.dgt .pair .a-up{left:calc(50% - 22px)}.dgt .pair .a-dn{left:calc(50% + 22px)}
.dgt .pair i:before{content:"";position:absolute;top:0;bottom:0;border-left:1.25px solid var(--ln);transform:translateX(-.6px)}
.dgt .pair .a-up:before{top:8px}.dgt .pair .a-dn:before{bottom:8px}
.dgt .pair i:after{content:"";position:absolute;left:0;transform:translateX(-50%);border:4.5px solid transparent}
.dgt .pair .a-up:after{top:1px;border-top:0;border-bottom:8px solid var(--ln)}
.dgt .pair .a-dn:after{bottom:1px;border-bottom:0;border-top:8px solid var(--ln)}
.dgt .pair span{position:absolute;top:50%;transform:translateY(-50%);font-size:12px;color:#6b6f76;white-space:nowrap}
.dgt .pair .l{right:calc(50% + 32px)}.dgt .pair .r{left:calc(50% + 32px)}

/* funnel */
.fnt .split{position:relative;height:58px}
.fnt .split:before{content:"";position:absolute;left:50%;top:0;height:16px;border-left:1.25px solid var(--ln);transform:translateX(-.6px)}
.fnt .split i{position:absolute;left:calc(25% - 3px);right:calc(25% - 3px);top:16px;bottom:8px;border:1.25px solid var(--ln);border-bottom:0;border-radius:8px 8px 0 0}
.fnt .split i:before,.fnt .split i:after{content:"";position:absolute;bottom:-8px;border:4.5px solid transparent;border-bottom:0;border-top:8px solid var(--ln)}
.fnt .split i:before{left:-5.5px}.fnt .split i:after{right:-5.5px}
.fnt .split .tg{top:62%}.fnt .split .tg.l{left:calc(25% - 3px)}.fnt .split .tg.r{left:calc(75% + 3px)}
.fnt .cols{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.fnt .col{display:flex;flex-direction:column}
.fnt .col .bx{font-size:13.5px;padding:10px 8px}
.fnt .run{flex:1;align-self:center;border-left:1.25px solid var(--ln);min-height:10px}
.fnt .merge{position:relative;height:46px}
.fnt .merge i{position:absolute;left:calc(25% - 3px);right:calc(25% - 3px);top:0;height:20px;border:1.25px solid var(--ln);border-top:0;border-radius:0 0 8px 8px}
.fnt .merge:before{content:"";position:absolute;left:50%;top:20px;bottom:8px;border-left:1.25px solid var(--ln);transform:translateX(-.6px)}
.fnt .merge:after{content:"";position:absolute;left:50%;bottom:1px;transform:translateX(-50%);border:4.5px solid transparent;border-bottom:0;border-top:8px solid var(--ln)}
.fnt .gaps{display:grid;gap:12px;margin-top:28px}
.fnt .gapc{background:#eff7f2;border-radius:8px;padding:16px 18px;text-align:left}
.fnt .gapc .gl{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:#067f40}
.fnt .gapc .gl em{font-style:normal;display:grid;place-items:center;width:17px;height:17px;border-radius:50%;background:#07c160;color:#fff;font-size:10px}
.fnt .gapc .q{font-size:18px;font-weight:600;line-height:1.3;margin-top:8px}
.fnt .gapc .sub{font-size:14px;line-height:1.45;color:#3d4045;margin-top:4px}
.fnt .gapc table{border-collapse:collapse;width:100%;margin-top:12px;font-size:13.5px;line-height:1.4}
.fnt .gapc th,.fnt .gapc td{text-align:left;vertical-align:top;padding:8px 0;border-top:1px solid rgba(6,127,64,.16);font-weight:400;color:#3d4045}
.fnt .gapc th{width:42%;padding-right:12px;font-weight:600;color:#0b0b0c}
.fnt .caps{background:#07c160;border-radius:8px;color:#fff;padding:18px 18px 8px}
.fnt .caps p{font-size:15px;font-weight:600;color:#fff}
.fnt .caps ul{list-style:none;padding:0;margin:10px 0 0}
.fnt .caps li{display:flex;align-items:center;gap:14px;padding:8px 0;font-size:14px;font-weight:500;color:#fff}
.fnt .caps svg{width:34px;height:34px;flex:none;overflow:visible}

/* three layers ("Guiding, not selling") */
.lbt .user{display:flex;align-items:center;justify-content:center;gap:8px;width:120px;height:44px;margin:0 auto;border-radius:22px;background:#0b0b0c;color:#fff;font-size:15px;font-weight:500}
.lbt .user svg{width:18px;height:18px}
.lbt .lm{display:flex;gap:14px;align-items:center;text-align:left;padding:12px 16px 12px 12px}
.lbt .lm img{width:72px;height:72px;object-fit:cover;flex:none;clip-path:inset(7%)}
.lbt .lm h3{font-size:16px;font-weight:600;line-height:1.3;color:#fff}
.lbt .lm p{font-size:14px;line-height:1.45;color:#fff;margin-top:4px}
.lbt .cards{display:grid;gap:12px}
.lbt .lc{text-align:left;padding:16px 18px}
.lbt .lc h3{font-size:16px;font-weight:600}
.lbt .lc ul{list-style:none;padding:0;margin-top:8px}
.lbt .lc li{position:relative;padding-left:14px;font-size:14px;line-height:1.45;margin-top:6px;color:#3d4045}
.lbt .lc li:before{content:"";position:absolute;left:0;top:.62em;width:5px;height:5px;border-radius:50%;background:#07c160}
.lbt .lc li b{font-weight:600;color:#0b0b0c}

/* Phase 3 system */
.p3t .l3{text-align:left;padding:14px 16px}
.p3t .lb{font-family:"IBM Plex Mono",monospace;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:#067f40}
.p3t h3{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;margin-top:2px}
.p3t h3 img{width:20px;height:20px}
.p3t .l3 > p:last-child{font-size:14px;line-height:1.45;color:#3d4045;margin-top:2px}
.p3t .g .bx,.p3t .l3.g .lb{color:#e6ffee}
.p3t .bx.g h3,.p3t .bx.g > p:last-child{color:#fff}
.p3t .bx.g .lb{color:#e6ffee}
.p3t .svc{display:grid;gap:20px}
.p3t .svc .g{display:grid;grid-template-columns:1fr;gap:10px;margin-top:10px}
.p3t .svc span{display:flex;align-items:center;gap:10px;font-size:14px;color:#2b2d31}
.p3t .svc span img{width:20px;height:20px}
@container (min-width:420px){.p3t .svc .g{grid-template-columns:1fr 1fr}}

/* agent workflow, top to bottom */
.sysdt{display:block;width:100%;max-width:400px;height:auto;margin:0 auto;font-family:Inter,sans-serif;overflow:visible}
.sysdt .s,.sysdt .l{font-size:12px}
.sysdt .et{font-size:15px;font-weight:600}

/* Albedo interactive system, top to bottom */
.alt{text-align:center}
.alt .who{display:flex;align-items:flex-end;justify-content:center;gap:4px;height:220px}
.alt .who .p{height:100%;filter:brightness(.86)}
.alt .who .k{height:80%}
.alt .ins{display:grid;gap:14px;text-align:left}
.alt .ins > div{display:grid;grid-template-columns:72px 1fr;gap:14px;align-items:center}
.alt .ins img{width:72px;border-radius:10px}
.alt .ins p,.alt .c{font-size:14px;line-height:1.45;color:#3d4045}
.alt .ins b{display:block;color:#0b0b0c;font-weight:600;margin-bottom:2px}
.alt .oval{display:inline-block;border:2px dashed #0b0b0c;border-radius:50%;padding:22px 34px;font-size:15px;font-weight:600}
.alt .c{max-width:320px;margin:10px auto 0}
.alt .pumps{width:150px;display:block;margin:0 auto}

/* ---- 3. Phone story (7 steps) on phones ---- */
@media (max-width:860px){
  html:not([data-r-story="side"]) .story{display:block}
  html:not([data-r-story="side"]) .stage{position:sticky;top:0;height:auto;z-index:4;padding:12px 0 28px;background:linear-gradient(#fff 82%,rgba(255,255,255,0))}
  html:not([data-r-story="side"]) .stack{width:min(200px,48vw)}
  html:not([data-r-story="side"]) .beats li{min-height:52vh!important;justify-content:flex-start}
  html:not([data-r-story="side"]) .beats li:first-child{margin-top:8px}
}

/* ---- 4. Where the left rail starts ---- */
@media (min-width:861px) and (max-width:1239px){
  html:not([data-r-rail="861"]) .sec{display:block!important}
  html:not([data-r-rail="861"]) .sec > .side,html:not([data-r-rail="861"]) .sec > h2:first-child,html:not([data-r-rail="861"]) .sec > .lbl:first-child{position:static!important;padding-right:0!important;margin-bottom:12px}
}

/* ---- 5. Phones: body size and side margins ---- */
@media (max-width:599px){
  html:not([data-r-body="18"]):not([data-r-body="16"]) body{font-size:17px}
  html[data-r-body="16"] body{font-size:16px}
  html:not([data-r-gut="24"]):not([data-r-gut="16"]) .wrap{padding-left:20px;padding-right:20px}
  html[data-r-gut="16"] .wrap{padding-left:16px;padding-right:16px}
  html:not([data-r-gut="24"]):not([data-r-gut="16"]) main{width:calc(100% - 40px)!important}
  html[data-r-gut="16"] main{width:calc(100% - 32px)!important}
}

/* ---- 6. Homepage list on very wide screens ---- */
@media (min-width:1600px){html[data-r-home="wide"] main{--layout-content-width:1088px}}

/* ---- 7. Touch: anything tappable is at least 44px tall to the finger (WCAG 2.5.8 asks 24, Apple 44) ---- */
@media (pointer:coarse){
  footer a,.contact a{display:inline-block;padding-top:12px;padding-bottom:12px;margin-top:-12px;margin-bottom:-12px}
}

/* ---- 8. Phones held sideways (short screens): the cover fits the screen instead of running 560px tall ---- */
@media (max-height:500px) and (orientation:landscape){
  .hero{min-height:0!important;height:calc(100vh - 24px)!important;height:calc(100svh - 24px)!important}
}
.dgt .bx.ink > b,.dgt .bx.g > b{color:#fff}
.dgt .caps,.dgt .cards,.dgt .gaps{margin-bottom:0}
.fnt .caps{margin-top:0!important}
