/* GENESIS S+16 PROGRAM 1A — Light Authority Structural Reconciliation
   Font authority is intentionally untouched. This layer changes no font-family. */

:root{
  --p1a-canvas:#f3f7f7;
  --p1a-canvas-cool:#edf4f4;
  --p1a-surface:#ffffff;
  --p1a-surface-soft:#f8fbfb;
  --p1a-surface-nested:#f1f6f6;
  --p1a-line:rgba(28,72,78,.14);
  --p1a-line-strong:rgba(28,72,78,.24);
  --p1a-ink:#102a30;
  --p1a-muted:#5d7379;
  --p1a-shadow-rest:0 1px 2px rgba(20,54,60,.035),0 12px 30px rgba(20,54,60,.055);
  --p1a-shadow-raised:0 2px 6px rgba(20,54,60,.045),0 24px 64px rgba(20,54,60,.09);
  --p1a-shadow-command:0 5px 16px rgba(20,54,60,.055),0 36px 88px rgba(20,54,60,.12);
}

html:not(.dark) body.t16-p1a{
  --t16-bg:var(--p1a-canvas);
  --t16-bg-soft:var(--p1a-canvas-cool);
  --t16-surface:var(--p1a-surface);
  --t16-surface-raised:var(--p1a-surface);
  --t16-surface-muted:var(--p1a-surface-soft);
  --t16-text:var(--p1a-ink);
  --t16-muted:var(--p1a-muted);
  --t16-line:#d6e1e2;
  --t16-line-strong:#b9cccf;
  --t16-shadow-1:var(--p1a-shadow-rest);
  --t16-shadow-2:var(--p1a-shadow-raised);
  --t16-shadow-3:var(--p1a-shadow-command);
}

/* Scene rhythm: alternate by engineering chapter, not simple white/grey striping. */
html:not(.dark) body.t16-p1a .genesis-main{
  background:
    radial-gradient(circle at 8% 4%,rgba(15,117,106,.045),transparent 28rem),
    var(--p1a-canvas)!important;
}
html:not(.dark) body.t16-p1a .genesis-main>.genesis-scene{
  position:relative;
  isolation:isolate;
  background:linear-gradient(180deg,var(--p1a-canvas) 0%,#f7fafa 100%)!important;
  border-top:1px solid rgba(28,72,78,.055);
}
html:not(.dark) body.t16-p1a .genesis-main>.genesis-scene:nth-of-type(3n+2){
  background:linear-gradient(180deg,#ffffff 0%,#f8fbfb 100%)!important;
}
html:not(.dark) body.t16-p1a .genesis-main>.genesis-scene:nth-of-type(3n){
  background:
    radial-gradient(circle at 86% 12%,rgba(15,117,106,.055),transparent 24rem),
    linear-gradient(180deg,#edf4f4 0%,#f5f9f9 100%)!important;
}
html:not(.dark) body.t16-p1a .genesis-main>.genesis-scene::after{
  content:"";position:absolute;z-index:-1;inset-inline:clamp(18px,5vw,80px);bottom:0;height:1px;
  background:linear-gradient(90deg,transparent,rgba(28,72,78,.13),transparent);
}
html:not(.dark) body.t16-p1a .genesis-scene-head{
  position:relative;padding-bottom:24px;
}
html:not(.dark) body.t16-p1a .genesis-scene-head::after{
  content:"";position:absolute;inset-inline-start:0;bottom:0;width:clamp(64px,8vw,112px);height:3px;border-radius:999px;
  background:linear-gradient(90deg,var(--t16-brand),color-mix(in srgb,var(--t16-gold) 70%,var(--t16-brand)));
}

/* Header and hero are integrated with the light canvas instead of floating as unrelated white objects. */
html:not(.dark) body.t16-p1a #header{
  background:rgba(250,253,253,.86)!important;border-bottom-color:rgba(36,78,84,.11)!important;
}
html:not(.dark) body.t16-p1a #header.t16-scrolled{
  background:rgba(255,255,255,.96)!important;box-shadow:0 1px 0 rgba(36,78,84,.08),0 18px 48px rgba(22,59,65,.075)!important;
}
html:not(.dark) body.t16-p1a .genesis-hero{
  background:
    linear-gradient(180deg,rgba(255,255,255,.72),rgba(243,247,247,.94)),
    radial-gradient(circle at 78% 24%,rgba(15,117,106,.13),transparent 30%),
    radial-gradient(circle at 15% 78%,rgba(215,173,39,.09),transparent 25%),
    var(--p1a-canvas)!important;
  border-bottom:1px solid rgba(28,72,78,.09);
}
html:not(.dark) body.t16-p1a .genesis-authority-shell{
  background:linear-gradient(145deg,#fff 0%,#f4f9f8 100%)!important;
  border-color:rgba(15,117,106,.25)!important;
  box-shadow:0 2px 5px rgba(20,54,60,.045),0 34px 90px rgba(20,54,60,.14)!important;
}

/* Three-level surface hierarchy: navigation rail, evidence surface, command surface. */
html:not(.dark) body.t16-p1a :is(
 .g01-story-tabs,.g02-journey,.g03-plant-rail,.g04-articles,.g05-index,.g06-standards,
 .g07-library,.g08-role-rail,.g09-nav,.g10-nav
){
  background:rgba(238,245,245,.72)!important;border:1px solid var(--p1a-line)!important;
  border-radius:22px!important;padding:9px!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.82)!important;
}
html:not(.dark) body.t16-p1a :is(
 .g01-story-card,.g02-evidence-card,.g02-decision-card,.g03-plant-stage,
 .g05-proof-grid>*,.g06-rule-grid>*,.g07-grid>*,.g08-decision-grid>*,.g08-signal-row>*,.g09-grid>*
){
  background:linear-gradient(180deg,#fff,#f9fbfb)!important;border:1px solid var(--p1a-line)!important;
  box-shadow:var(--p1a-shadow-rest)!important;
}
html:not(.dark) body.t16-p1a :is(
 .g02-main-panel,.g04-authority-panel,.g05-stage,.g06-command,.g07-command,
 .g08-command,.g09-panel,.g10-panel,.g11-command
){
  position:relative;background:linear-gradient(145deg,#fff 0%,#f7faf9 100%)!important;
  border:1px solid var(--p1a-line-strong)!important;box-shadow:var(--p1a-shadow-command)!important;
}
html:not(.dark) body.t16-p1a :is(
 .g02-main-panel,.g04-authority-panel,.g05-stage,.g06-command,.g07-command,
 .g08-command,.g09-panel,.g10-panel,.g11-command
)::after{
  content:"";position:absolute;pointer-events:none;inset:0;border-radius:inherit;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92);opacity:.95;
}

/* Nested surfaces remain visibly subordinate to command surfaces. */
html:not(.dark) body.t16-p1a :is(
 .g02-workspace-body,.g02-evidence-layout,.g03-plant-canvas,.g04-body,.g05-body,.g06-body,
 .g07-body,.g08-body,.g09-body,.g10-body,.g01-story-columns,.g08-before-after
){
  background:color-mix(in srgb,var(--p1a-surface-nested) 76%,transparent)!important;
  border-color:var(--p1a-line)!important;
}

/* State authority: selected and operational states must be read before decoration. */
html:not(.dark) body.t16-p1a :is(
 .g01-story-tab,.g02-journey-step,.g03-plant-rail button,.g04-article-tab,.g05-index button,
 .g06-standard-tab,.g07-library button,.g08-role-rail button,.g09-tab,.g10-tab
){
  background:rgba(255,255,255,.74)!important;border:1px solid transparent!important;
  color:var(--p1a-muted)!important;box-shadow:none!important;
}
html:not(.dark) body.t16-p1a :is(
 .g01-story-tab,.g02-journey-step,.g03-plant-rail button,.g04-article-tab,.g05-index button,
 .g06-standard-tab,.g07-library button,.g08-role-rail button,.g09-tab,.g10-tab
):hover{
  background:#fff!important;border-color:var(--p1a-line)!important;color:var(--p1a-ink)!important;
  transform:translateY(-1px);box-shadow:0 8px 20px rgba(20,54,60,.06)!important;
}
html:not(.dark) body.t16-p1a :is(
 .g01-story-tab,.g02-journey-step,.g03-plant-rail button,.g04-article-tab,.g05-index button,
 .g06-standard-tab,.g07-library button,.g08-role-rail button,.g09-tab,.g10-tab
).active,
html:not(.dark) body.t16-p1a :is(
 .g01-story-tab,.g02-journey-step,.g03-plant-rail button,.g04-article-tab,.g05-index button,
 .g06-standard-tab,.g07-library button,.g08-role-rail button,.g09-tab,.g10-tab
)[aria-selected="true"]{
  background:linear-gradient(135deg,#e3f3f0,#f4faf8)!important;
  border-color:rgba(15,117,106,.36)!important;color:#0a5f57!important;
  box-shadow:0 0 0 1px rgba(15,117,106,.05),0 12px 30px rgba(15,117,106,.10)!important;
}

html:not(.dark) body.t16-p1a :is(.g02-authority-state,.g04-state,.g05-state,.g06-status,.g07-status,.g08-state){
  border:1px solid rgba(15,117,106,.28)!important;background:#e7f5f2!important;color:#09665d!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85)!important;
}
html:not(.dark) body.t16-p1a :is([class*="warning"],[data-state="warning"],[data-status="warning"]){
  border-color:rgba(184,129,22,.34)!important;background:#fff7df!important;color:#80580c!important;
}
html:not(.dark) body.t16-p1a :is([class*="blocked"],[class*="danger"],[data-state="blocked"],[data-status="blocked"]){
  border-color:rgba(180,79,67,.32)!important;background:#fff0ed!important;color:#903d34!important;
}
html:not(.dark) body.t16-p1a :is([class*="approved"],[class*="released"],[class*="success"],[data-state="approved"],[data-status="released"]){
  border-color:rgba(18,128,109,.30)!important;background:#e9f7f3!important;color:#086456!important;
}

/* Controls and floating utilities belong to the same authority system. */
html:not(.dark) body.t16-p1a :is(.s16-icon-button,.genesis-btn.secondary,.back-to-top){
  background:rgba(255,255,255,.9)!important;border-color:var(--p1a-line)!important;
  box-shadow:0 8px 24px rgba(20,54,60,.055)!important;
}
html:not(.dark) body.t16-p1a .genesis-demo-dock{
  background:rgba(255,255,255,.94)!important;border:1px solid var(--p1a-line-strong)!important;
  box-shadow:0 18px 52px rgba(20,54,60,.13)!important;backdrop-filter:blur(18px) saturate(130%);
}
html:not(.dark) body.t16-p1a .t16-chapter-rail{
  background:rgba(255,255,255,.82)!important;border-color:var(--p1a-line)!important;
  box-shadow:0 18px 50px rgba(20,54,60,.10)!important;backdrop-filter:blur(16px);
}

/* Secondary-page parity: prevent authority collapse after leaving the homepage. */
html:not(.dark) body.t16-p1a:not(.genesis-site) main,
html:not(.dark) body.t16-p1a:not(.s16-site) main{background:var(--p1a-canvas)!important}
html:not(.dark) body.t16-p1a :is(.service-card,.project-card,.offer-card,.about-card,.contact-card,.s16-card){
  background:linear-gradient(180deg,#fff,#f8fbfb)!important;border:1px solid var(--p1a-line)!important;
  box-shadow:var(--p1a-shadow-rest)!important;
}

/* Motion communicates hierarchy only. */
@media(prefers-reduced-motion:no-preference){
  html:not(.dark) body.t16-p1a :is(
   .g01-story-card,.g02-evidence-card,.g02-decision-card,.g05-proof-grid>*,.g06-rule-grid>*,
   .g07-grid>*,.g08-decision-grid>*,.g08-signal-row>*,.g09-grid>*
  ){transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,background .2s ease}
  html:not(.dark) body.t16-p1a :is(
   .g01-story-card,.g02-evidence-card,.g02-decision-card,.g05-proof-grid>*,.g06-rule-grid>*,
   .g07-grid>*,.g08-decision-grid>*,.g08-signal-row>*,.g09-grid>*
  ):hover{transform:translateY(-2px);border-color:var(--p1a-line-strong)!important;box-shadow:var(--p1a-shadow-raised)!important}
}

@media(max-width:1180px){
  html:not(.dark) body.t16-p1a :is(
   .g01-story-tabs,.g02-journey,.g03-plant-rail,.g04-articles,.g05-index,.g06-standards,
   .g07-library,.g08-role-rail,.g09-nav,.g10-nav
  ){background:rgba(239,246,245,.92)!important;border-radius:18px!important}
}
@media(max-width:700px){
  html:not(.dark) body.t16-p1a .genesis-main>.genesis-scene{border-top-color:rgba(28,72,78,.07)}
  html:not(.dark) body.t16-p1a .genesis-scene-head{padding-bottom:18px!important}
  html:not(.dark) body.t16-p1a :is(
   .g02-main-panel,.g04-authority-panel,.g05-stage,.g06-command,.g07-command,
   .g08-command,.g09-panel,.g10-panel,.g11-command
  ){box-shadow:0 2px 5px rgba(20,54,60,.04),0 18px 48px rgba(20,54,60,.09)!important}
  html:not(.dark) body.t16-p1a .genesis-demo-dock{inset-inline:12px!important}
}
