/* Evulgare RC54 — global density, readability, navigation separation, and
   whitespace control. Loaded after route CSS and the semantic surface layer.
   The contract is intentionally conservative: primary content remains severe
   and technical without using scale or empty space as a substitute for
   hierarchy. */

:root {
  --header-h: 4.15rem;
  --header-height: var(--header-h);
  --site-header-height: var(--header-h);
  --ui-display-1: clamp(2.65rem, 4.55vw, 4.8rem);
  --ui-display-2: clamp(1.95rem, 3.15vw, 3.4rem);
  --ui-display-3: clamp(1.35rem, 2.1vw, 2rem);
  --ui-page-hero-space: clamp(3.25rem, 5.6vw, 5.75rem);
  --ui-section-space: clamp(3.25rem, 5.1vw, 5.75rem);
  --ui-readable: 68ch;
  --ui-readable-wide: 78ch;
  --ui-card-gap: clamp(.8rem, 1.5vw, 1.25rem);
  --ui-panel-pad: clamp(1rem, 1.8vw, 1.45rem);
}

/* -------------------------------------------------------------------------
   Global type and section rhythm
   ------------------------------------------------------------------------- */
.page-hero {
  min-height: 0;
  padding-block: var(--ui-page-hero-space);
}
.page-hero h1,
.hero-home h1,
.sim-explorer-copy h1 {
  font-size: var(--ui-display-1);
  line-height: .96;
  letter-spacing: -.042em;
}
.page-hero h1 { max-width: 18ch; }
.page-hero .hero-lede,
.hero-home .hero-lede,
.sim-explorer-copy .hero-lede {
  max-width: var(--ui-readable);
  font-size: clamp(1.05rem, 1.45vw, 1.3rem);
  line-height: 1.52;
}
.section { padding-block: var(--ui-section-space); }
.section h2,
.split-heading h2,
.final-cta h2,
.ecosystem-section h2,
.sim-explorer-heading-row h2 {
  font-size: var(--ui-display-2);
  line-height: .98;
  letter-spacing: -.038em;
}
.section h3 { line-height: 1.08; }
.section-intro { font-size: clamp(1.02rem, 1.35vw, 1.25rem); }
:where(.section, .page-hero) p { line-height: 1.62; }

.split-heading {
  gap: clamp(1.5rem, 3.2vw, 3.25rem);
  align-items: start;
  margin-bottom: clamp(1.6rem, 3vw, 2.5rem);
}

/* -------------------------------------------------------------------------
   Primary navigation — readable labels with visible separation
   ------------------------------------------------------------------------- */
.site-header { height: 4.15rem; --header-h: 4.15rem; }
.header-rail { gap: clamp(.85rem, 1.4vw, 1.35rem); }
.brand { gap: .65rem; flex: 0 0 auto; }
.brand img { width: 2.15rem; height: 2.15rem; }
.brand-word { font-size: .95rem; letter-spacing: .145em; }
.primary-nav {
  flex: 0 1 auto;
  gap: .08rem;
  min-height: 2.7rem;
  font-size: clamp(.81rem, .77rem + .06vw, .86rem);
  font-weight: 760;
  letter-spacing: .006em;
}
.primary-nav a {
  min-height: 2.7rem;
  padding: .57rem .5rem;
  border: 0;
  border-radius: .28rem;
  box-shadow: inset 0 -2px transparent;
}
.primary-nav a + a:not(.nav-contact) {
  margin-left: .08rem;
  border-left: 1px solid rgba(255,255,255,.13);
  border-radius: 0 .28rem .28rem 0;
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: #fff;
  background: rgba(110,208,219,.09);
  box-shadow: inset 0 -2px var(--cyan);
}
.primary-nav .nav-contact {
  min-height: 2.7rem;
  margin-left: .38rem;
  padding: .55rem .82rem;
  border: 1px solid rgba(255,255,255,.44);
  box-shadow: none;
}
.primary-nav .nav-contact:hover,
.primary-nav .nav-contact[aria-current="page"] {
  color: var(--ink);
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: none;
}

/* Switch to the deliberate menu before desktop labels must be compressed. */
@media (max-width: 72rem) {
  :root { --header-h: 4.15rem; }
  .nav-toggle { display: block; }
  .primary-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: .25rem;
    padding: .85rem;
    background: #101820;
    border-bottom: 1px solid var(--line-dark);
    box-shadow: var(--shadow);
    max-height: calc(100vh - var(--header-h));
    overflow: auto;
    font-size: .94rem;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a,
  .primary-nav a + a:not(.nav-contact) {
    min-height: 2.9rem;
    margin: 0;
    padding: .75rem .9rem;
    border: 1px solid transparent;
    border-radius: .3rem;
    box-shadow: none;
  }
  .primary-nav a:hover,
  .primary-nav a[aria-current="page"] {
    border-color: rgba(110,208,219,.42);
    background: rgba(110,208,219,.11);
    box-shadow: inset 3px 0 var(--cyan);
  }
  .primary-nav .nav-contact { margin-top: .25rem; text-align: center; }
}

/* -------------------------------------------------------------------------
   Company hero — use the second column for evidence rather than atmosphere
   ------------------------------------------------------------------------- */
.company-hero-grid,
.ecosystem-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(19rem, .82fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.company-hero-copy h1 { max-width: 14ch; }
.company-hero-copy > p:last-child { max-width: var(--ui-readable); color: #c4ced4; }
.company-hero-panel,
.ecosystem-relationship-map {
  align-self: stretch;
  display: grid;
  align-content: center;
  min-height: 0;
  padding: clamp(1.15rem, 2.5vw, 2rem);
  color: var(--surface-dark-fg);
  background: rgba(7,16,22,.6);
  border: 1px solid var(--surface-dark-border-strong);
  box-shadow: 0 18px 55px rgba(0,0,0,.18);
}
.company-hero-panel ol,
.ecosystem-relationship-map ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--surface-dark-border);
}
.company-hero-panel li,
.ecosystem-relationship-map li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0,1fr);
  gap: .8rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--surface-dark-border);
}
.company-hero-panel li span,
.ecosystem-relationship-map li > span {
  color: var(--surface-dark-accent);
  font: 800 .72rem/1.4 var(--font-mono);
}
.company-hero-panel li strong,
.ecosystem-relationship-map li strong {
  display: block;
  color: var(--surface-dark-fg);
  font-size: .9rem;
  letter-spacing: .045em;
}
.company-hero-panel li small,
.ecosystem-relationship-map li small {
  display: block;
  margin-top: .18rem;
  color: var(--surface-dark-body);
  font-size: .84rem;
  line-height: 1.45;
}

/* -------------------------------------------------------------------------
   Ecosystem hero — relationship map fills the previously empty field
   ------------------------------------------------------------------------- */
.ecosystem-hero-copy h1 { max-width: 14ch; }
.ecosystem-relationship-map li { grid-template-columns: 2.25rem minmax(0,1fr); align-items: center; }
.ecosystem-relationship-map li.is-parent {
  background: rgba(110,208,219,.075);
  box-shadow: inset 3px 0 var(--cyan);
  padding-inline: .75rem;
}
.ecosystem-map-note {
  max-width: 48ch;
  margin: 1rem 0 0;
  color: var(--surface-dark-body) !important;
  font-size: .9rem;
}
.ecosystem-large { gap: var(--ui-card-gap); }
.ecosystem-panel { min-height: 22rem; padding: clamp(1.25rem, 2.3vw, 2rem); }
.ecosystem-panel h2 { font-size: clamp(1.9rem, 3vw, 3.2rem); }

/* -------------------------------------------------------------------------
   Home mission-assurance sequence — fill the canvas with useful structure
   ------------------------------------------------------------------------- */
.home-defense-posture {
  padding-block: clamp(3rem, 4.8vw, 5rem);
}
.home-defense-posture .split-heading {
  grid-template-columns: minmax(0, 1.15fr) minmax(17rem, .85fr);
  margin-bottom: 1.5rem;
}
.home-defense-posture .split-heading h2 {
  max-width: 14ch;
  font-size: clamp(2.15rem, 3.9vw, 3.9rem);
}
.home-defense-posture .section-intro {
  max-width: 32ch;
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(.86rem, 1vw, 1rem);
  line-height: 1.55;
  letter-spacing: .035em;
}
.home-defense-posture .defense-sequence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  color: var(--surface-dark-fg);
  background: var(--surface-dark-border);
  border: 1px solid var(--surface-dark-border);
}
.home-defense-posture .defense-sequence-grid article {
  min-width: 0;
  min-height: 9.3rem;
  padding: var(--ui-panel-pad);
  color: var(--surface-dark-fg);
  background: #0a1720;
}
.home-defense-posture .defense-sequence-grid article:hover,
.home-defense-posture .defense-sequence-grid article:focus-within {
  background: #10232c;
}
.home-defense-posture .defense-sequence-grid .mono {
  display: block;
  margin-bottom: .45rem;
  color: var(--surface-dark-accent);
  font-size: .7rem;
  font-weight: 800;
}
.home-defense-posture .defense-sequence-grid h3 {
  margin: 0 0 .45rem;
  color: var(--surface-dark-fg);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  letter-spacing: -.015em;
}
.home-defense-posture .defense-sequence-grid p {
  margin: 0;
  color: var(--surface-dark-body) !important;
  font-size: .93rem;
  line-height: 1.5;
}
.home-defense-posture > .button-row { margin-top: 1.5rem; }

/* -------------------------------------------------------------------------
   Simulation cards — explicit light and dark surface ownership
   ------------------------------------------------------------------------- */
.simulation-index-page .simulation-card {
  min-height: 26rem;
  padding: clamp(1.2rem, 2vw, 1.55rem);
  color: var(--surface-light-fg);
  background: #faf9f5;
  border-color: #77868d;
  box-shadow: 0 8px 22px rgba(16,24,32,.08);
}
.simulation-index-page .simulation-card:hover,
.simulation-index-page .simulation-card:focus-within {
  color: var(--surface-light-fg);
  background: #fff;
  border-color: var(--surface-light-border-strong);
  box-shadow: 0 16px 34px rgba(16,24,32,.13);
}
.simulation-index-page .simulation-card h3,
.simulation-index-page .simulation-card:hover h3,
.simulation-index-page .simulation-card:focus-within h3 {
  color: var(--surface-light-fg);
  font-size: clamp(1.45rem, 2vw, 2rem);
}
.simulation-index-page .simulation-card p,
.simulation-index-page .simulation-card:hover p,
.simulation-index-page .simulation-card:focus-within p {
  color: #44565f;
  font-size: 1rem;
  line-height: 1.56;
}
.simulation-index-page .simulation-card :where(dt, dd) { color: var(--surface-light-fg); }
.simulation-index-page .simulation-card .button-secondary {
  color: var(--surface-light-fg);
  background: transparent;
  border-color: var(--surface-light-border-strong);
}
.simulation-index-page .simulation-card .button-secondary:hover,
.simulation-index-page .simulation-card .button-secondary:focus-visible {
  color: #fff;
  background: var(--surface-light-fg);
  border-color: var(--surface-light-fg);
}

.home-simulation-section .simulation-card {
  min-height: 25rem;
  padding: clamp(1.2rem, 2vw, 1.55rem);
  color: var(--surface-dark-fg);
  background: #0b171f;
  border-color: var(--surface-dark-border-strong);
  box-shadow: none;
}
.home-simulation-section .simulation-card:hover,
.home-simulation-section .simulation-card:focus-within {
  color: var(--surface-dark-fg);
  background: #10232d;
  border-color: #8cf2f7;
  box-shadow: 0 16px 38px rgba(0,0,0,.28);
}
.home-simulation-section .simulation-card h3,
.home-simulation-section .simulation-card:hover h3,
.home-simulation-section .simulation-card:focus-within h3 {
  color: var(--surface-dark-fg);
  font-size: clamp(1.45rem, 2vw, 2rem);
}
.home-simulation-section .simulation-card p,
.home-simulation-section .simulation-card:hover p,
.home-simulation-section .simulation-card:focus-within p {
  color: #cfdae0;
  font-size: 1rem;
  line-height: 1.56;
}
.home-simulation-section .simulation-card-badges span {
  color: #dce8eb;
  border-color: rgba(255,255,255,.34);
}
.home-simulation-section .simulation-card .button-secondary {
  color: var(--surface-dark-fg);
  background: #0d1d25;
  border-color: var(--surface-dark-border-strong);
}
.home-simulation-section .simulation-card .button-secondary:hover,
.home-simulation-section .simulation-card .button-secondary:focus-visible {
  color: var(--surface-dark-bg);
  background: var(--surface-dark-fg);
  border-color: var(--surface-dark-fg);
}


.simulation-index-page .simulation-card-grid { align-items: start; }

/* Modern Explorer density remains scene-first without reducing readability. */
.sim-explorer-hero { min-height: 0; padding-block: clamp(3.25rem, 5.5vw, 5.75rem); }
.sim-explorer-copy h1 { max-width: 13ch; }
.sim-explorer-hero-visual { min-height: clamp(18rem, 32vw, 28rem); }
.sim-explorer-section { padding-block: clamp(3.25rem, 5vw, 5.75rem); }
.sim-explorer-heading-row h2 { max-width: 22ch; }
.sim-card-body h3 { font-size: clamp(1.35rem, 1.8vw, 1.9rem); }
.sim-card-purpose { font-size: .98rem; line-height: 1.55; }

/* -------------------------------------------------------------------------
   Footer — balanced groups instead of a single overlong sitemap column
   ------------------------------------------------------------------------- */
.site-footer { padding: clamp(2.75rem, 4.5vw, 4rem) 0 1.15rem; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(15rem, 1.25fr) repeat(4, minmax(10rem, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
.footer-brand p { max-width: 34ch; }
.footer-principle { margin-top: 1.25rem; }
.site-footer h2 { margin-bottom: .85rem; font-size: .76rem; }
.site-footer nav { gap: .43rem; }
.site-footer nav a {
  max-width: 25ch;
  color: #c6d1d6;
  font-size: .86rem;
  line-height: 1.35;
}
.footer-base { margin-top: 2.25rem; padding-top: 1.1rem; }

@media (max-width: 92rem) {
  .primary-nav { font-size: .8rem; }
  .primary-nav a { padding-inline: .42rem; }
  .company-hero-grid,
  .ecosystem-hero-grid { gap: clamp(1.75rem, 3vw, 3rem); }
}

@media (max-width: 78rem) {
  .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem 2rem; align-items: start; }
  .footer-brand .brand { grid-row: 1 / span 2; }
  .footer-brand .footer-principle { margin: 0; }
  .footer-brand p:last-child { margin: 0; }
}

@media (max-width: 64rem) {
  .company-hero-grid,
  .ecosystem-hero-grid { grid-template-columns: 1fr; }
  .company-hero-panel,
  .ecosystem-relationship-map { max-width: 48rem; width: 100%; }
  .home-defense-posture .split-heading { grid-template-columns: 1fr; }
  .home-defense-posture .section-intro { max-width: var(--ui-readable); }
  .home-defense-posture .defense-sequence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 46rem) {
  :root {
    --ui-display-1: clamp(2.45rem, 12vw, 4rem);
    --ui-display-2: clamp(1.85rem, 9vw, 3rem);
    --ui-page-hero-space: clamp(2.75rem, 10vw, 4rem);
    --ui-section-space: clamp(2.8rem, 10vw, 4.25rem);
  }
  .page-hero h1 { max-width: 15ch; }
  .company-hero-panel,
  .ecosystem-relationship-map { padding: 1rem; }
  .home-defense-posture .defense-sequence-grid { grid-template-columns: 1fr; }
  .home-defense-posture .defense-sequence-grid article { min-height: 0; }
  .simulation-card-grid { gap: .75rem; }
  .simulation-index-page .simulation-card,
  .home-simulation-section .simulation-card { min-height: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; display: block; }
  .footer-brand .footer-principle { margin-top: 1rem; }
}

@media (prefers-contrast: more) {
  .primary-nav a + a:not(.nav-contact) { border-left-color: rgba(255,255,255,.6); }
  .company-hero-panel,
  .ecosystem-relationship-map,
  .home-defense-posture .defense-sequence-grid,
  .simulation-index-page .simulation-card,
  .home-simulation-section .simulation-card { border-width: 2px; }
}

@media (forced-colors: active) {
  .primary-nav a + a:not(.nav-contact) { border-left: 1px solid CanvasText; }
  .company-hero-panel,
  .ecosystem-relationship-map,
  .home-defense-posture .defense-sequence-grid article,
  .simulation-index-page .simulation-card,
  .home-simulation-section .simulation-card { color: CanvasText; background: Canvas; border-color: CanvasText; forced-color-adjust: auto; }
}

/* RC54 corrective detail: descriptive copy in the command-integrity chain
   shares the content column instead of collapsing into the numeric rail. */
.company-hero-panel li small { grid-column: 2; }
