/* Sparse section controls. Every rule requires an explicit, validated override;
   the existing styles remain authoritative when section design is absent. */
.hero[data-rigel-section="hero"][style*="--rigel-hero-spacing:"] {
  padding-block:calc(var(--rigel-hero-outer-space,2rem) * var(--rigel-hero-spacing));
}
.hero[data-rigel-section="hero"][style*="--rigel-hero-spacing:"] .heromain {
  padding-top:calc(var(--rigel-hero-main-top,100px) * var(--rigel-hero-spacing));
  padding-bottom:calc(var(--rigel-hero-main-bottom,4rem) * var(--rigel-hero-spacing));
}
.hero[data-rigel-section="hero"][style*="--rigel-hero-text-width:"] :is(.heromain,h1,.herocopy) {max-width:min(100%,var(--rigel-hero-text-width))}
.hero[data-rigel-hero-layout="centered"] .heromain {width:100%;margin-inline:auto;text-align:center}
.hero[data-rigel-hero-layout="centered"] :is(h1,.herocopy) {margin-inline:auto}
.hero[data-rigel-hero-layout="centered"] .actions {justify-content:center}
.hero[data-rigel-hero-background="light"] {--rigel-hero-surface:var(--paper);color:var(--ink)}
.hero[data-rigel-hero-background="dark"] {--rigel-hero-surface:var(--ink);color:#fff}
.hero[data-rigel-hero-background="accent"] {--rigel-hero-surface:var(--red);color:#fff}
.hero[data-rigel-hero-background] {background:var(--rigel-hero-surface)}
.hero[data-rigel-hero-background] .heroshade {
  background:linear-gradient(90deg,color-mix(in srgb,var(--rigel-hero-surface) 94%,transparent),color-mix(in srgb,var(--rigel-hero-surface) 68%,transparent));
}
.hero[data-rigel-hero-background] :is(h1 em,.herocopy,.caption) {color:inherit}
.hero[data-rigel-hero-background] :is(.heroindex,.herobottom) {border-color:color-mix(in srgb,currentColor 30%,transparent)}
.hero[data-rigel-hero-layout="split"] {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:1.5rem 3rem;
}
.hero[data-rigel-hero-layout="split"] .heroimage {inset:0 0 0 50%;width:50%;height:100%}
.hero[data-rigel-hero-layout="split"] .heroshade {
  background:linear-gradient(90deg,var(--rigel-hero-surface,#252b2d) 48%,transparent 65%);
}
.hero[data-rigel-hero-layout="split"] :is(.herotop,.heromain,.herobottom) {grid-column:1;min-width:0}
.hero[data-rigel-hero-layout="split"] .heromain {--rigel-hero-main-top:36px;--rigel-hero-main-bottom:36px;padding-block:calc(36px * var(--rigel-hero-spacing,1))}
.hero[data-rigel-hero-alignment="start"] .heromain {margin-inline:0 auto;text-align:start}
.hero[data-rigel-hero-alignment="center"] .heromain {margin-inline:auto;text-align:center}
.hero[data-rigel-hero-alignment="end"] .heromain {margin-inline:auto 0;text-align:end}
.hero[data-rigel-hero-alignment="start"] :is(h1,.herocopy) {margin-inline:0 auto}
.hero[data-rigel-hero-alignment="center"] :is(h1,.herocopy) {margin-inline:auto}
.hero[data-rigel-hero-alignment="end"] :is(h1,.herocopy) {margin-inline:auto 0}
.hero[data-rigel-hero-alignment="start"] .actions {justify-content:flex-start}
.hero[data-rigel-hero-alignment="center"] .actions {justify-content:center}
.hero[data-rigel-hero-alignment="end"] .actions {justify-content:flex-end}
.hero[data-rigel-hero-cta-style="solid"] .actions>.primary {background:var(--red);border-color:var(--red);color:#fff}
.hero[data-rigel-hero-background="accent"] .actions>.primary {background:var(--paper);border-color:var(--paper);color:var(--ink)}
.hero[data-rigel-hero-cta-style="outline"] .actions>.primary {background:transparent;border-color:currentColor;color:inherit}
.hero[data-rigel-hero-cta-style="outline"] .actions>.primary:hover {background:color-mix(in srgb,currentColor 12%,transparent)}

#projects[data-rigel-section="projects"][style*="--rigel-projects-columns:"] :is(.category-grid,.portfolio-grid) {
  grid-template-columns:repeat(var(--rigel-projects-columns),minmax(0,1fr));
  gap:40px 20px;
}
#projects.section[data-rigel-section="projects"][style*="--rigel-projects-spacing:"] {
  padding-block:calc(clamp(64px,8vw,128px) * var(--rigel-section-spacing,1) * var(--rigel-projects-spacing));
}
#projects.portfolio-archive[data-rigel-section="projects"][style*="--rigel-projects-spacing:"] .archive-heading {
  padding-block:calc(var(--rigel-archive-top,70px) * var(--rigel-projects-spacing)) calc(var(--rigel-archive-bottom,52px) * var(--rigel-projects-spacing));
}
#projects.portfolio-archive[data-rigel-section="projects"][style*="--rigel-projects-spacing:"] .archive-results {
  padding-block:calc(var(--rigel-results-top,56px) * var(--rigel-projects-spacing)) calc(110px * var(--rigel-projects-spacing));
}
#projects[data-rigel-section="projects"][style*="--rigel-projects-image-ratio:"] :is(.category-image,.inline-project .portfolio-image) {aspect-ratio:var(--rigel-projects-image-ratio)}
#projects[data-rigel-projects-background="light"] {--rigel-project-surface:var(--paper);color:var(--ink)}
#projects[data-rigel-projects-background="dark"] {--rigel-project-surface:var(--ink);color:#fff}
#projects[data-rigel-projects-background="accent"] {--rigel-project-surface:var(--red);color:#fff}
#projects[data-rigel-projects-background] {
  --rigel-project-card:color-mix(in srgb,currentColor 7%,transparent);
  --rigel-project-line:color-mix(in srgb,currentColor 28%,transparent);
  --muted:color-mix(in srgb,currentColor 78%,transparent);
  background:var(--rigel-project-surface);
}
#projects[data-rigel-projects-background] :is(.category-caption p,.project-description) {color:inherit}
#projects[data-rigel-projects-background] .category-nav {background:var(--rigel-project-surface);color:inherit;border-color:var(--rigel-project-line)}
#projects[data-rigel-projects-background] .slider-tools button {color:inherit}
#projects[data-rigel-projects-background] .slider-tools button:is(:hover,[aria-expanded="true"]) {background:var(--rigel-project-card);color:inherit}
#projects[data-rigel-projects-background] .service-scope-card {color:var(--ink)}
#projects[data-rigel-projects-background="accent"] .category-scroll a[aria-current="page"],
#projects[data-rigel-projects-background="accent"] .service-faq summary::after {color:inherit;border-color:currentColor}
#projects[data-rigel-projects-background="accent"] .slider-progress {color:var(--paper)}
#projects[data-rigel-projects-background="accent"] .slider-progress::-webkit-progress-value {background:var(--paper)}
#projects[data-rigel-projects-background="accent"] .slider-progress::-moz-progress-bar {background:var(--paper)}
#projects[data-rigel-projects-card-style="outlined"] :is(.category-card,.portfolio-card) {border:1px solid var(--rigel-project-line,var(--line));min-width:0}
#projects[data-rigel-projects-card-style="filled"] :is(.category-card,.portfolio-card) {background:var(--rigel-project-card,var(--soft));min-width:0}
#projects[data-rigel-projects-card-style] :is(.category-caption,.portfolio-caption) {padding:24px;margin-top:0}
#projects[data-rigel-section="projects"][style*="--rigel-projects-columns:"] :is(.category-card,.portfolio-card) {container-type:inline-size;min-width:0}
#projects[data-rigel-section="projects"][style*="--rigel-projects-columns:"] .slider-toolbar {flex-wrap:wrap}
#projects[data-rigel-section="projects"][style*="--rigel-projects-columns:"] .slider-tools {flex-wrap:wrap}
#projects[data-rigel-section="projects"] .section-project-metadata {display:flex;flex-wrap:wrap;gap:14px 24px;margin:20px 0 0}
#projects[data-rigel-section="projects"] .section-project-metadata div {min-width:0}
#projects[data-rigel-section="projects"] .section-project-metadata dt {font-size:calc(12px * var(--rigel-font-factor,1));opacity:.8}
#projects[data-rigel-section="projects"] .section-project-metadata dd {margin:3px 0 0;font-size:calc(14px * var(--rigel-font-factor,1));overflow-wrap:anywhere}

.custom-page section[data-rigel-cta-variant] {padding:clamp(24px,4vw,56px)}
.custom-page [data-rigel-cta-variant="light"] {background:var(--soft);color:var(--ink)}
.custom-page [data-rigel-cta-variant="dark"] {background:var(--ink);color:#fff}
.custom-page [data-rigel-cta-variant="accent"] {background:var(--red);color:#fff}
.custom-page [data-rigel-cta-alignment="start"] {text-align:start}
.custom-page [data-rigel-cta-alignment="center"] {text-align:center}
.custom-page [data-rigel-cta-alignment="end"] {text-align:end}
.custom-page [data-rigel-cta-alignment="start"] :is(h2,p) {margin-inline:0 auto}
.custom-page [data-rigel-cta-alignment="center"] :is(h2,p) {margin-inline:auto}
.custom-page [data-rigel-cta-alignment="end"] :is(h2,p) {margin-inline:auto 0}
.custom-page [data-rigel-cta-button-style="solid"] .btn {background:var(--red);border-color:var(--red);color:#fff}
.custom-page [data-rigel-cta-variant="accent"] .btn {background:var(--paper);border-color:var(--paper);color:var(--ink)}
.custom-page [data-rigel-cta-button-style="outline"] .btn {background:transparent;border-color:currentColor;color:inherit}
.custom-page [data-rigel-cta-button-style="outline"] .btn:hover {background:color-mix(in srgb,currentColor 12%,transparent)}

@container (max-width:360px) {
  #projects[data-rigel-section="projects"][style*="--rigel-projects-columns:"] .portfolio-caption>div {grid-template-columns:minmax(0,1fr);gap:12px}
  #projects[data-rigel-section="projects"][style*="--rigel-projects-columns:"] :is(.category-caption h3,.portfolio-caption h2) {font-size:calc(22px * var(--rigel-font-factor,1));line-height:calc(1.4 * var(--rigel-line-height-scale,1))}
  #projects[data-rigel-section="projects"] .slider-toolbar {gap:10px}
  #projects[data-rigel-section="projects"] .slider-tools {margin-left:auto;gap:6px}
  #projects[data-rigel-section="projects"] .slider-tools button {padding:10px;min-width:44px;min-height:44px}
  #projects[data-rigel-section="projects"] .slider-tools button>span {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  #projects[data-rigel-section="projects"] .slider-progress {flex-basis:100%;order:3}
}
@media(max-width:1100px) {
  #projects[data-rigel-section="projects"][style*="--rigel-projects-columns:"] :is(.category-grid,.portfolio-grid) {grid-template-columns:repeat(min(2,var(--rigel-projects-columns)),minmax(0,1fr))}
}
@media(max-width:800px) {
  .hero[data-rigel-hero-layout="split"] {grid-template-columns:minmax(0,1fr);min-height:0;gap:24px}
  .hero[data-rigel-hero-layout="split"] .heroimage {position:relative;inset:auto;grid-column:1;grid-row:1;width:100%;height:clamp(220px,65vw,420px);z-index:0}
  .hero[data-rigel-hero-layout="split"] .heroshade {display:none}
  .hero[data-rigel-hero-layout="split"] .heromain {--rigel-hero-main-top:20px;--rigel-hero-main-bottom:20px;padding-block:calc(20px * var(--rigel-hero-spacing,1))}
}
@media(max-width:700px) {
  .hero[data-rigel-section="hero"][style*="--rigel-hero-spacing:"] {--rigel-hero-main-top:48px;--rigel-hero-main-bottom:48px}
  .hero[data-rigel-section="hero"][style*="--rigel-hero-text-width:"] .heromain {width:100%;max-width:100%}
  #projects[data-rigel-section="projects"][style*="--rigel-projects-spacing:"] {--rigel-archive-top:46px;--rigel-archive-bottom:32px;--rigel-results-top:32px}
  #projects[data-rigel-section="projects"][style*="--rigel-projects-columns:"] :is(.category-grid,.portfolio-grid) {grid-template-columns:minmax(0,1fr)}
  #projects[data-rigel-projects-card-style] :is(.category-caption,.portfolio-caption) {padding:20px}
}
@media(max-width:560px) {
  .hero[data-rigel-section="hero"][style*="--rigel-hero-spacing:"] {--rigel-hero-outer-space:1.5rem}
}
