/* R20 home/AI: keep the approved material and existing centered 1320px rail.
   No selector touches the company lead or the #ai cinematic scene. */
html[data-r20-home="home"] #formats.r20-company-formats {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
  box-sizing: border-box;
}
html[data-r20-home="home"] #formats.r20-company-formats .r8-formats-body {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-inline: auto;
  box-sizing: border-box;
}
html[data-r20-home="home"] #formats.r20-company-formats .r19-format-card {
  margin: 0;
  align-self: stretch;
}

/* Additional decision copy is part of the same glass object, without nested
   cards. The established deployment drawings retain their geometry. */
html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r17k-mode-heading {
  min-height: 228px;
}
html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r17k-mode-heading > .r20-mode-benefit {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--r19-ink);
}
html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r20-mode-decision {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 20px;
  padding: 24px;
}
html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-mode-decision h4 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 550;
  color: var(--r19-ink);
}
html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-mode-decision > div > p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--r19-muted);
}
html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r17k-deployment-note {
  max-width: 90ch;
  margin-top: 36px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--r19-muted);
}

@media (max-width: 900px) {
  html[data-r20-home="home"] #formats.r20-company-formats .r8-formats-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r17k-mode-heading {
    min-height: 0;
  }
  html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r18-deployment > .r17k-mode {
    grid-template-columns: minmax(0, 1fr);
  }
  html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment :is(.r17k-mode-heading, .r18-deployment-map, .r17k-work) {
    grid-area: auto;
  }
  html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r18-deployment-map {
    margin-block: 0;
  }
}
@media (max-width: 650px) {
  html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r20-mode-decision {
    padding-inline: 23px;
  }
}

@media (min-width:1001px) {
  html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r18-deployment-map { min-height:374px; }
  html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-deployment .r18-map-terminal { min-height:80px; }
  html:is([data-r20-home="agents"],[data-r20-home="rag"]) .r20-mode-decision > div:first-child { min-height:100px; }
}

html:is([data-r20-home="agents"],[data-r20-home="rag"]) #benefits .r9-benefit-copy > h2 { grid-column:1; grid-row:1 / span 2; font:450 clamp(29px,3.5vw,53px)/1.1 Golos,Arial,sans-serif; letter-spacing:-.035em; max-width:19ch; color:var(--r19-ink); }
@media(max-width:700px) { html:is([data-r20-home="agents"],[data-r20-home="rag"]) #benefits .r9-benefit-copy > h2 { grid-column:auto; grid-row:auto; font-size:34px; } }

/* A single retained benefit owns its chapter background; no empty parent bands. */
html:is([data-r20-home="agents"],[data-r20-home="rag"]) #benefits { margin-block:0 !important; padding-block:0 !important; }
html:is([data-r20-home="agents"],[data-r20-home="rag"]) #benefits::before,
html:is([data-r20-home="agents"],[data-r20-home="rag"]) #benefits::after { content:none !important; }
html[data-r20-home="agents"] #requests { margin-bottom:0 !important; }

/* R21 company chapters inherit the approved glass, grain and typography.
   They explain the company's work; detailed AI scenes stay on service pages. */
html[data-r20-home="home"] main > :is(.r21-company-work, .r21-company-approach) {
  position:relative; isolation:isolate; width:100%; max-width:none;
  margin:0; padding:clamp(64px,7vw,108px) 0; color:var(--r19-ink);
}
html[data-r20-home="home"] :is(.r21-company-work, .r21-company-approach)::before {
  content:""; position:absolute; z-index:-2; inset:0 calc((100% - 100vw)/2);
  background:var(--r19-ground-b); pointer-events:none;
}
html[data-r20-home="home"] .r21-company-approach::before { background:var(--r19-ground-c); }
html[data-r20-home="home"] :is(.r21-company-work, .r21-company-approach)::after {
  content:""; position:absolute; z-index:-1; inset:0 calc((100% - 100vw)/2);
  background:url('assets/r11b-grain.png') repeat; opacity:.035; pointer-events:none;
}
html[data-r20-home="home"] .r21-company-heading {
  display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
  gap:32px clamp(28px,4vw,64px); align-items:start; margin-bottom:42px;
}
html[data-r20-home="home"] :is(.r21-company-heading, .r21-approach-intro) h2 {
  margin:0; font:450 clamp(34px,3.8vw,55px)/1.1 Golos,Arial,sans-serif;
  letter-spacing:-.035em; text-wrap:balance; color:var(--r19-ink);
}
html[data-r20-home="home"] :is(.r21-company-heading > p, .r21-approach-intro > p) {
  margin:0; font:400 19px/1.6 Golos,Arial,sans-serif; color:var(--r19-muted); max-width:48ch;
}
html[data-r20-home="home"] :is(.r21-work-surface, .r21-approach-story) {
  background:var(--r19-glass-background); border:1px solid var(--r19-line);
  border-radius:var(--r19-radius,22px); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
  box-shadow:inset 0 1px 0 var(--r19-rim),0 18px 50px var(--r19-shadow);
}
html[data-r20-home="home"] .r21-work-surface { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr); gap:clamp(32px,5vw,72px); padding:clamp(28px,4vw,56px); }
html[data-r20-home="home"] .r21-work-main { display:flex; flex-direction:column; align-items:start; min-width:0; }
html[data-r20-home="home"] .r21-work-main h3 { margin:0 0 26px; font:450 clamp(29px,3vw,43px)/1.15 Golos,Arial,sans-serif; letter-spacing:-.03em; text-wrap:balance; color:var(--r19-ink); }
html[data-r20-home="home"] .r21-work-main p { font:400 18px/1.65 Golos,Arial,sans-serif; margin:0 0 40px; color:var(--r19-muted); max-width:40ch; }
html[data-r20-home="home"] .r21-work-main a { margin-top:auto; }
html[data-r20-home="home"] .r21-work-aside { display:flex; flex-direction:column; gap:32px; border-left:1px solid var(--r19-line); padding-left:clamp(28px,4vw,56px); }
html[data-r20-home="home"] :is(.r21-work-aside, .r21-approach-story) h3 { margin:0 0 12px; font:450 25px/1.2 Golos,Arial,sans-serif; letter-spacing:-.025em; color:var(--r19-ink); }
html[data-r20-home="home"] :is(.r21-work-aside, .r21-approach-story) p { margin:0; font:400 16px/1.65 Golos,Arial,sans-serif; color:var(--r19-muted); }
html[data-r20-home="home"] :is(.r21-company-work, .r21-company-approach) a { display:inline-flex; align-items:center; min-height:44px; margin-top:18px; color:var(--r19-ink); font-size:16px; line-height:1.45; text-underline-offset:5px; }
html[data-r20-home="home"] :is(.r21-company-work, .r21-company-approach) a:focus-visible { outline:2px solid var(--r19-accent); outline-offset:5px; }
html[data-r20-home="home"] main > .r21-company-approach { display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:clamp(32px,5vw,72px); align-items:start; }
html[data-r20-home="home"] .r21-approach-intro > p { margin-top:28px; }
html[data-r20-home="home"] .r21-approach-story { padding:clamp(28px,3.5vw,48px); display:grid; gap:32px; }
html[data-r20-home="home"] .r21-approach-story article + article { border-top:1px solid var(--r19-line); padding-top:32px; }
@media(max-width:900px) {
  html[data-r20-home="home"] .r21-company-heading,
  html[data-r20-home="home"] main > .r21-company-approach { grid-template-columns:1fr; gap:32px; }
  html[data-r20-home="home"] .r21-work-surface { grid-template-columns:1fr; gap:30px; }
  html[data-r20-home="home"] .r21-work-aside { border-left:0; border-top:1px solid var(--r19-line); padding:30px 0 0; }
}
@media(max-width:650px) {
  html[data-r20-home="home"] :is(.r21-company-heading, .r21-approach-intro) h2 { font-size:34px; }
  html[data-r20-home="home"] :is(.r21-company-heading > p, .r21-approach-intro > p) { font-size:17px; }
  html[data-r20-home="home"] :is(.r21-work-surface, .r21-approach-story) { padding:26px 23px; }
  html[data-r20-home="home"] .r21-work-main h3 { font-size:30px; }
  html[data-r20-home="home"] .r21-work-main p { font-size:17px; margin-bottom:18px; }
}
