/* =============================================================
   EMPIRIUM SOLUTIONS · GLOBAL STYLESHEET
   ES.DS · REV. C · MMXXVI
   Imports tokens.css — do not define values here, reference --es-* vars
   ============================================================= */

@import "./tokens.css";

@layer reset, base, typography, layout, components, utilities;

/* -----------------------------------------------------------
   LAYER: RESET
   ----------------------------------------------------------- */
@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    tab-size: 4;
    color-scheme: dark light;
  }

  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
  }

  input, button, textarea, select {
    font: inherit;
    color: inherit;
  }

  p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
  }

  nav ol,
  nav ul {
    list-style: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }
}

/* -----------------------------------------------------------
   LAYER: BASE
   Styled bare HTML elements — consumed by all pages
   ----------------------------------------------------------- */
@layer base {
  html {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-size);
    line-height: var(--es-type-body-lh);
    color: var(--es-color-bone);
    background-color: var(--es-color-surface);
  }

  body {
    min-height: 100dvh;
    background-color: var(--es-color-surface);
    color: var(--es-color-bone);
  }

  /* --- Headings default to editorial font --- */
  h1, h2, h3 {
    font-family: var(--es-font-editorial);
    font-weight: var(--es-weight-regular);
    letter-spacing: var(--es-tracking-tight);
    line-height: 1.1;
  }

  h4, h5, h6 {
    font-family: var(--es-font-operating);
    font-weight: var(--es-weight-medium);
    letter-spacing: var(--es-tracking-normal);
  }

  h1 { font-size: var(--es-type-title-size); line-height: var(--es-type-title-lh); }
  h2 { font-size: var(--es-type-section-size); line-height: var(--es-type-section-lh); }
  h3 { font-size: var(--es-type-heading-size); line-height: var(--es-type-heading-lh); }
  h4 { font-size: var(--es-type-body-lg-size); }
  h5 { font-size: var(--es-type-body-size); }
  h6 { font-size: var(--es-type-body-sm-size); }

  p {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-size);
    line-height: var(--es-type-body-lh);
    font-weight: var(--es-weight-regular);
    max-width: 68ch;
  }

  a {
    transition: color var(--es-duration-fast) var(--es-ease-out);
  }

  a:hover {
    color: var(--es-color-signal);
  }

  strong, b {
    font-weight: var(--es-weight-semibold);
  }

  em, i {
    font-style: italic;
  }

  code, kbd {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-mono-size);
    letter-spacing: var(--es-tracking-wide);
  }

  pre {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-mono-size);
    overflow-x: auto;
  }

  hr {
    border: none;
    border-top: var(--es-border-thin) solid var(--es-color-border);
    width: 100%;
  }

  ol, ul {
    padding-left: var(--es-space-6);
  }

  li {
    font-size: var(--es-type-body-size);
    line-height: var(--es-type-body-lh);
  }

  ol { list-style: decimal; }
  ul { list-style: disc; }
}

/* -----------------------------------------------------------
   LAYER: TYPOGRAPHY
   Utility classes — apply to any element to set type role
   ----------------------------------------------------------- */
@layer typography {

  .es-text-display {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-display-size);
    line-height: var(--es-type-display-lh);
    letter-spacing: var(--es-tracking-tight);
    font-weight: var(--es-weight-regular);
  }

  .es-text-title {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-title-size);
    line-height: var(--es-type-title-lh);
    letter-spacing: var(--es-tracking-tight);
    font-weight: var(--es-weight-regular);
  }

  .es-text-section {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-section-size);
    line-height: var(--es-type-section-lh);
    letter-spacing: var(--es-tracking-tight);
    font-weight: var(--es-weight-regular);
  }

  .es-text-heading {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-heading-size);
    line-height: var(--es-type-heading-lh);
    letter-spacing: var(--es-tracking-tight);
    font-weight: var(--es-weight-regular);
  }

  .es-text-subheading {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-subheading-size);
    line-height: var(--es-type-subheading-lh);
    letter-spacing: var(--es-tracking-tight);
    font-weight: var(--es-weight-regular);
  }

  .es-text-editorial-italic {
    font-family: var(--es-font-editorial);
    font-style: italic;
    font-weight: var(--es-weight-regular);
    color: var(--es-color-signal);
  }

  .es-text-body-lg {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-lg-size);
    line-height: var(--es-type-body-lg-lh);
    font-weight: var(--es-weight-regular);
  }

  .es-text-body {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-size);
    line-height: var(--es-type-body-lh);
    font-weight: var(--es-weight-regular);
  }

  .es-text-body-sm {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-sm-size);
    line-height: var(--es-type-body-sm-lh);
    font-weight: var(--es-weight-regular);
  }

  .es-text-caption {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-caption-size);
    line-height: var(--es-type-caption-lh);
    font-weight: var(--es-weight-regular);
  }

  .es-text-mono {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-mono-size);
    line-height: var(--es-type-mono-lh);
    font-weight: var(--es-weight-regular);
    letter-spacing: var(--es-tracking-wide);
  }

  .es-text-label {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    line-height: var(--es-type-label-lh);
    font-weight: var(--es-weight-regular);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
  }

  .es-text-signal   { color: var(--es-color-signal); }
  .es-text-archive  { color: var(--es-color-archive); }
  .es-text-bone     { color: var(--es-color-bone); }
  .es-text-ink      { color: var(--es-color-ink); }
  .es-text-dim      { color: var(--es-color-bone-dim); }
  .es-text-dim-ink  { color: var(--es-color-ink-dim); }
  .es-text-directive { color: var(--es-color-directive); }
}

/* -----------------------------------------------------------
   LAYER: LAYOUT
   ----------------------------------------------------------- */
@layer layout {

  .es-container {
    width: 100%;
    max-width: var(--es-container-xl);
    margin-inline: auto;
    padding-inline: var(--es-margin);
  }

  .es-container--wide   { max-width: var(--es-container-2xl); }
  .es-container--narrow { max-width: var(--es-container-md); }

  .es-section {
    width: 100%;
    padding-block: var(--es-space-24);
  }

  .es-section--sm { padding-block: var(--es-space-16); }
  .es-section--lg { padding-block: var(--es-space-32); }

  .es-grid {
    display: grid;
    grid-template-columns: repeat(var(--es-grid-cols), minmax(0, 1fr));
    gap: var(--es-gutter);
  }

  .es-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .es-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .es-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .es-col-span-2 { grid-column: span 2; }
  .es-col-span-3 { grid-column: span 3; }
  .es-col-span-4 { grid-column: span 4; }
  .es-col-span-6 { grid-column: span 6; }
  .es-col-span-8 { grid-column: span 8; }

  .es-surface-dark {
    background-color: var(--es-color-surface);
    color: var(--es-color-bone);
    --es-ctx-fg:              var(--es-color-bone);
    --es-ctx-fg-dim:          var(--es-color-bone-dim);
    --es-ctx-border:          var(--es-color-border);
    --es-ctx-surface-raised:  var(--es-color-surface-raised);
  }

  .es-surface-dark--deep {
    background-color: var(--es-color-surface-deep);
    color: var(--es-color-bone);
    --es-ctx-fg:              var(--es-color-bone);
    --es-ctx-fg-dim:          var(--es-color-bone-dim);
    --es-ctx-border:          var(--es-color-border);
    --es-ctx-surface-raised:  var(--es-color-surface-raised);
  }

  .es-surface-paper {
    background-color: var(--es-color-surface-paper);
    color: var(--es-color-ink);
    --es-ctx-fg:              var(--es-color-ink);
    --es-ctx-fg-dim:          var(--es-color-ink-dim);
    --es-ctx-border:          var(--es-color-border-paper);
    --es-ctx-surface-raised:  var(--es-color-surface-overlay);
  }

  .es-flex         { display: flex; }
  .es-flex-col     { display: flex; flex-direction: column; }
  .es-flex-center  { display: flex; align-items: center; justify-content: center; }
  .es-flex-between { display: flex; align-items: center; justify-content: space-between; }
  .es-flex-gap-2   { gap: var(--es-space-2); }
  .es-flex-gap-4   { gap: var(--es-space-4); }
  .es-flex-gap-6   { gap: var(--es-space-6); }
  .es-flex-gap-8   { gap: var(--es-space-8); }

  .es-page         { display: flex; flex-direction: column; min-height: 100dvh; }
  .es-page__content { flex: 1; }

  .es-grid-paper {
    background-image:
      linear-gradient(var(--es-paper-300) 1px, transparent 1px),
      linear-gradient(90deg, var(--es-paper-300) 1px, transparent 1px);
    background-size: var(--es-space-8) var(--es-space-8);
    background-position: -0.5px -0.5px;
    opacity: 0.35;
  }

  .es-section--gridpaper {
    position: relative;
  }

  .es-section--gridpaper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(var(--es-paper-300) 1px, transparent 1px),
      linear-gradient(90deg, var(--es-paper-300) 1px, transparent 1px);
    background-size: var(--es-space-8) var(--es-space-8);
    opacity: 0.3;
    pointer-events: none;
  }
}

/* -----------------------------------------------------------
   LAYER: COMPONENTS
   ----------------------------------------------------------- */
@layer components {

  /* =========================================================
     NAV · .es-nav
     ========================================================= */
  .es-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--es-z-sticky);
    background-color: var(--es-color-surface);
    border-bottom: var(--es-border-thin) solid var(--es-color-border);
    padding-block: var(--es-space-4);
  }

  .es-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--es-space-8);
    max-width: var(--es-container-xl);
    margin-inline: auto;
    padding-inline: var(--es-margin);
  }

  .es-nav__logo {
    display: flex;
    align-items: center;
    gap: var(--es-space-3);
    flex-shrink: 0;
  }

  .es-nav__wordmark {
    display: flex;
    flex-direction: column;
    gap: var(--es-space-half);
  }

  .es-nav__wordmark-primary {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-body-size);
    line-height: 1;
    font-weight: var(--es-weight-regular);
    color: var(--es-color-bone);
    letter-spacing: var(--es-tracking-normal);
  }

  .es-nav__wordmark-primary span {
    font-style: italic;
    color: var(--es-color-signal);
  }

  .es-nav__wordmark-sub {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-xs);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-bone-dim);
  }

  .es-nav__links {
    display: flex;
    align-items: center;
    gap: var(--es-space-8);
    list-style: none;
  }

  .es-nav__link {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-sm-size);
    font-weight: var(--es-weight-regular);
    color: var(--es-color-bone-dim);
    letter-spacing: var(--es-tracking-wide);
    transition: color var(--es-duration-fast) var(--es-ease-out);
    cursor: pointer;
  }

  .es-nav__link:hover,
  .es-nav__link--active {
    color: var(--es-color-bone);
  }

  .es-nav__cta { flex-shrink: 0; }

  .es-nav-offset { padding-top: var(--es-nav-height); }

  /* =========================================================
     BUTTONS · .es-btn
     ========================================================= */
  .es-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--es-space-2);
    padding: var(--es-space-3) var(--es-space-6);
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    font-weight: var(--es-weight-medium);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    border: var(--es-border-thin) solid transparent;
    border-radius: var(--es-radius-none);
    cursor: pointer;
    transition:
      background-color var(--es-duration-fast) var(--es-ease-out),
      color            var(--es-duration-fast) var(--es-ease-out),
      border-color     var(--es-duration-fast) var(--es-ease-out);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
  }

  .es-btn--primary {
    background-color: var(--es-color-archive);
    color: var(--es-color-surface);
    border-color: var(--es-color-archive);
  }

  .es-btn--primary:hover {
    background-color: var(--es-color-archive-hi);
    border-color: var(--es-color-archive-hi);
    color: var(--es-color-surface);
  }

  .es-surface-paper .es-btn--primary {
    background-color: var(--es-color-surface);
    color: var(--es-color-bone);
    border-color: var(--es-color-surface);
  }

  .es-surface-paper .es-btn--primary:hover {
    background-color: var(--es-color-surface-raised);
    border-color: var(--es-color-surface-raised);
  }

  .es-btn--ghost {
    background-color: transparent;
    color: var(--es-color-bone);
    border-color: var(--es-color-border);
  }

  .es-btn--ghost:hover {
    border-color: var(--es-color-bone-dim);
    color: var(--es-color-bone);
  }

  .es-btn--outline {
    background-color: transparent;
    color: var(--es-color-ink);
    border-color: var(--es-color-border-paper);
  }

  .es-btn--outline:hover {
    border-color: var(--es-color-ink);
    color: var(--es-color-ink);
  }

  .es-btn--signal {
    background-color: transparent;
    color: var(--es-color-signal);
    border-color: var(--es-color-signal);
  }

  .es-btn--signal:hover {
    background-color: var(--es-color-signal);
    color: var(--es-color-surface);
  }

  .es-btn--sm {
    padding: var(--es-space-2) var(--es-space-4);
    font-size: var(--es-type-btn-sm);
  }

  .es-btn--lg {
    padding: var(--es-space-4) var(--es-space-8);
    font-size: var(--es-type-btn-lg);
  }

  /* =========================================================
     CARD · .es-card
     ========================================================= */
  .es-card {
    border: var(--es-border-thin) solid var(--es-ctx-border, var(--es-color-border));
    background-color: transparent;
    padding: var(--es-space-8);
    display: flex;
    flex-direction: column;
    gap: var(--es-space-6);
    transition: border-color var(--es-duration-base) var(--es-ease-out);
  }

  .es-card:hover { border-color: var(--es-color-archive); }

  .es-card__eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .es-card__div-label {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-archive);
  }

  .es-card__role-codes {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    color: var(--es-ctx-fg-dim, var(--es-color-bone-dim));
  }

  .es-card__icon {
    width: var(--es-space-8);
    height: var(--es-space-8);
    color: var(--es-color-archive);
  }

  .es-card__title {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-heading-size);
    line-height: var(--es-type-heading-lh);
    font-weight: var(--es-weight-regular);
    color: var(--es-ctx-fg, var(--es-color-bone));
  }

  .es-card__body {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-sm-size);
    line-height: var(--es-type-body-sm-lh);
    color: var(--es-ctx-fg-dim, var(--es-color-bone-dim));
    flex: 1;
  }

  .es-card__footer {
    border-top: var(--es-border-thin) solid var(--es-ctx-border, var(--es-color-border));
    padding-top: var(--es-space-4);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--es-space-2);
  }

  .es-card__sub-item {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-sm-size);
    color: var(--es-ctx-fg-dim, var(--es-color-bone-dim));
  }

  .es-card__sub-item::before {
    content: attr(data-index) ' ';
    color: var(--es-color-signal);
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
  }

  .es-card--file {
    border: var(--es-border-thin) solid var(--es-ctx-border, var(--es-color-border));
    background-color: var(--es-ctx-surface-raised, var(--es-color-surface-raised));
    padding: var(--es-space-6);
    display: flex;
    flex-direction: column;
    gap: var(--es-space-4);
  }

  .es-card--file:hover { border-color: var(--es-color-archive); }

  .es-card--file__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .es-card--file__dossier-id {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    color: var(--es-ctx-fg-dim, var(--es-color-bone-dim));
    text-transform: uppercase;
  }

  .es-card--file__title {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-subheading-size);
    line-height: 1.3;
    font-weight: var(--es-weight-regular);
    color: var(--es-ctx-fg, var(--es-color-bone));
  }

  .es-card--file__meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--es-space-4);
    border-top: var(--es-border-thin) solid var(--es-ctx-border, var(--es-color-border));
    padding-top: var(--es-space-4);
  }

  .es-card--file__meta-label {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-ctx-fg-dim, var(--es-color-bone-dim));
    margin-bottom: var(--es-space-1);
  }

  .es-card--file__meta-value {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-sm-size);
    color: var(--es-ctx-fg, var(--es-color-bone));
  }

  .es-card--file__result {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-heading-size);
    color: var(--es-ctx-fg, var(--es-color-bone));
    letter-spacing: var(--es-tracking-tight);
  }

  .es-card--file__read {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-signal);
    align-self: flex-end;
    transition: color var(--es-duration-fast) var(--es-ease-out);
  }

  .es-card--file__read:hover { color: var(--es-color-signal-hi); }

  /* =========================================================
     SECTION LABEL · .es-section-label
     ========================================================= */
  .es-section-label {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-archive);
    display: flex;
    align-items: center;
    gap: var(--es-space-2);
  }

  /* =========================================================
     BADGE · .es-badge
     ========================================================= */
  .es-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--es-space-1);
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
  }

  .es-badge::before {
    content: '●';
    font-size: var(--es-type-xs);
  }

  .es-badge--active    { color: var(--es-color-signal); }
  .es-badge--filed     { color: var(--es-ctx-fg-dim, var(--es-color-bone-dim)); }
  .es-badge--on-duty   { color: var(--es-color-archive); }
  .es-badge--directive { color: var(--es-color-directive); }

  /* =========================================================
     STAT BLOCK · .es-stat
     ========================================================= */
  .es-stat {
    display: flex;
    flex-direction: column;
    gap: var(--es-space-2);
  }

  .es-stat__label {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-archive);
  }

  .es-stat__value {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-title-size);
    line-height: 1;
    font-weight: var(--es-weight-regular);
    letter-spacing: var(--es-tracking-tight);
    color: var(--es-ctx-fg, var(--es-color-bone));
  }

  .es-stat--sm .es-stat__value { font-size: var(--es-type-heading-size); }

  /* =========================================================
     DIVIDER · .es-divider
     ========================================================= */
  .es-divider {
    display: flex;
    align-items: center;
    gap: var(--es-space-4);
    width: 100%;
  }

  .es-divider::before,
  .es-divider::after {
    content: '';
    flex: 1;
    height: var(--es-border-thin);
    background-color: var(--es-ctx-border, var(--es-color-border));
  }

  .es-divider--bare {
    height: var(--es-border-thin);
    background-color: var(--es-ctx-border, var(--es-color-border));
    display: block;
  }

  .es-divider--bare::before,
  .es-divider--bare::after {
    display: none;
  }

  /* =========================================================
     QUOTE · .es-quote
     ========================================================= */
  .es-quote {
    border-left: var(--es-border-medium) solid var(--es-color-archive);
    padding-left: var(--es-space-6);
    display: flex;
    flex-direction: column;
    gap: var(--es-space-3);
  }

  .es-quote__text {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-body-lg-size);
    line-height: 1.6;
    font-style: italic;
    color: var(--es-ctx-fg, var(--es-color-bone));
  }

  .es-quote__attribution {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-archive);
  }

  /* =========================================================
     INSIGNIA · .es-insignia
     ========================================================= */
  .es-insignia {
    width: var(--es-space-12);
    height: var(--es-space-12);
    border-radius: 50%;
    border: var(--es-border-thin) solid var(--es-ctx-fg-dim, var(--es-color-bone-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--es-font-editorial);
    font-size: var(--es-insignia-font);
    color: var(--es-ctx-fg, var(--es-color-bone));
    letter-spacing: var(--es-tracking-normal);
    position: relative;
  }

  .es-insignia--sm { width: var(--es-space-8); height: var(--es-space-8); font-size: var(--es-type-body-sm-size); }
  .es-insignia--lg { width: var(--es-space-16); height: var(--es-space-16); font-size: var(--es-type-heading-size); }

  /* =========================================================
     PHASE TIMELINE · .es-phases
     ========================================================= */
  .es-phases {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--es-space-4);
  }

  .es-phase {
    display: flex;
    flex-direction: column;
    gap: var(--es-space-4);
    padding-top: var(--es-space-6);
    border-top: var(--es-border-thin) solid var(--es-ctx-border, var(--es-color-border));
    position: relative;
  }

  .es-phase::before {
    content: '';
    position: absolute;
    top: var(--es-phase-dot-offset);
    left: 0;
    width: var(--es-space-2);
    height: var(--es-space-2);
    border-radius: 50%;
    border: var(--es-border-thin) solid var(--es-ctx-fg-dim, var(--es-color-bone-dim));
    background-color: transparent;
  }

  .es-phase__number {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-archive);
  }

  .es-phase__duration {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-ctx-fg-dim, var(--es-color-bone-dim));
  }

  .es-phase__title {
    font-family: var(--es-font-editorial);
    font-size: var(--es-type-heading-size);
    line-height: 1.2;
    font-weight: var(--es-weight-regular);
    color: var(--es-ctx-fg, var(--es-color-bone));
  }

  .es-phase__body {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-sm-size);
    line-height: var(--es-type-body-sm-lh);
    color: var(--es-ctx-fg-dim, var(--es-color-bone-dim));
    flex: 1;
  }

  .es-phase__meta {
    display: flex;
    flex-direction: column;
    gap: var(--es-space-1);
  }

  .es-phase__deliverable-label {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-ctx-fg-dim, var(--es-color-bone-dim));
    margin-bottom: var(--es-space-1);
  }

  .es-phase__deliverable-value {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-sm-size);
    color: var(--es-ctx-fg, var(--es-color-bone));
  }

  /* =========================================================
     INTAKE FORM · .es-intake
     ========================================================= */
  .es-intake {
    border: var(--es-border-thin) solid var(--es-color-border);
    background-color: var(--es-color-surface-raised);
    padding: var(--es-space-6);
    display: flex;
    flex-direction: column;
    gap: var(--es-space-6);
  }

  .es-intake__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: var(--es-border-thin) solid var(--es-color-border);
    padding-bottom: var(--es-space-4);
  }

  .es-intake__id {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-archive);
  }

  .es-intake__fields {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .es-intake__field {
    display: flex;
    flex-direction: column;
    gap: var(--es-space-2);
    padding-block: var(--es-space-4);
    border-bottom: var(--es-border-thin) solid var(--es-color-border);
  }

  .es-intake__field:last-of-type { border-bottom: none; }

  .es-intake__label {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-bone-dim);
  }

  .es-intake__input {
    background: transparent;
    border: none;
    border-bottom: var(--es-border-thin) solid var(--es-color-border);
    color: var(--es-color-bone);
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-size);
    padding-block: var(--es-space-2);
    width: 100%;
    outline: none;
    transition: border-color var(--es-duration-fast) var(--es-ease-out);
  }

  .es-intake__input::placeholder { color: var(--es-color-bone-dim); }

  .es-intake__input:focus-visible { border-bottom-color: var(--es-color-archive); }

  .es-intake__input--prefilled {
    color: var(--es-color-bone-dim);
    font-family: var(--es-font-mono);
    font-size: var(--es-type-body-sm-size);
    letter-spacing: var(--es-tracking-wide);
  }

  .es-intake__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: var(--es-border-thin) solid var(--es-color-border);
    padding-top: var(--es-space-4);
  }

  .es-intake__received {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-bone-dim);
  }

  /* =========================================================
     FOOTER · .es-footer
     ========================================================= */
  .es-footer {
    background-color: var(--es-color-surface-deep);
    border-top: var(--es-border-thin) solid var(--es-color-border);
  }

  .es-footer__body {
    max-width: var(--es-container-xl);
    margin-inline: auto;
    padding-inline: var(--es-margin);
    padding-block: var(--es-space-16);
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--es-space-8);
  }

  .es-footer__brand {
    display: flex;
    flex-direction: column;
    gap: var(--es-space-4);
  }

  .es-footer__brand-lockup {
    display: flex;
    align-items: center;
    gap: var(--es-space-3);
  }

  .es-footer__tagline {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-sm-size);
    line-height: var(--es-type-body-sm-lh);
    color: var(--es-color-bone-dim);
    max-width: 28ch;
  }

  .es-footer__col-title {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-archive);
    margin-bottom: var(--es-space-4);
  }

  .es-footer__links {
    display: flex;
    flex-direction: column;
    gap: var(--es-space-3);
    list-style: none;
  }

  .es-footer__link {
    font-family: var(--es-font-operating);
    font-size: var(--es-type-body-sm-size);
    color: var(--es-color-bone-dim);
    transition: color var(--es-duration-fast) var(--es-ease-out);
  }

  .es-footer__link:hover { color: var(--es-color-bone); }

  .es-footer__legal {
    border-top: var(--es-border-thin) solid var(--es-color-border);
    max-width: var(--es-container-xl);
    margin-inline: auto;
    padding-inline: var(--es-margin);
    padding-block: var(--es-space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--es-space-8);
  }

  .es-footer__copyright {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    text-transform: uppercase;
    color: var(--es-color-bone-dim);
  }

  .es-footer__coords {
    font-family: var(--es-font-mono);
    font-size: var(--es-type-label-size);
    letter-spacing: var(--es-tracking-caps);
    color: var(--es-color-bone-dim);
  }

  .es-footer__status {
    display: flex;
    align-items: center;
    gap: var(--es-space-2);
  }

} /* end @layer components */

/* -----------------------------------------------------------
   LAYER: UTILITIES
   ----------------------------------------------------------- */
@layer utilities {

  .es-mt-0  { margin-top: 0; }
  .es-mt-2  { margin-top: var(--es-space-2); }
  .es-mt-4  { margin-top: var(--es-space-4); }
  .es-mt-6  { margin-top: var(--es-space-6); }
  .es-mt-8  { margin-top: var(--es-space-8); }
  .es-mt-12 { margin-top: var(--es-space-12); }
  .es-mt-16 { margin-top: var(--es-space-16); }

  .es-mb-0  { margin-bottom: 0; }
  .es-mb-2  { margin-bottom: var(--es-space-2); }
  .es-mb-4  { margin-bottom: var(--es-space-4); }
  .es-mb-6  { margin-bottom: var(--es-space-6); }
  .es-mb-8  { margin-bottom: var(--es-space-8); }
  .es-mb-12 { margin-bottom: var(--es-space-12); }
  .es-mb-16 { margin-bottom: var(--es-space-16); }

  .es-gap-2  { gap: var(--es-space-2); }
  .es-gap-4  { gap: var(--es-space-4); }
  .es-gap-6  { gap: var(--es-space-6); }
  .es-gap-8  { gap: var(--es-space-8); }
  .es-gap-12 { gap: var(--es-space-12); }

  .es-color-signal    { color: var(--es-color-signal) !important; }
  .es-color-archive   { color: var(--es-color-archive) !important; }
  .es-color-bone      { color: var(--es-color-bone) !important; }
  .es-color-ink       { color: var(--es-color-ink) !important; }
  .es-color-dim       { color: var(--es-color-bone-dim) !important; }
  .es-color-directive { color: var(--es-color-directive) !important; }

  .es-tracking-tight   { letter-spacing: var(--es-tracking-tight); }
  .es-tracking-normal  { letter-spacing: var(--es-tracking-normal); }
  .es-tracking-wide    { letter-spacing: var(--es-tracking-wide); }
  .es-tracking-wider   { letter-spacing: var(--es-tracking-wider); }
  .es-tracking-caps    { letter-spacing: var(--es-tracking-caps); }
  .es-tracking-widest  { letter-spacing: var(--es-tracking-widest); }

  .es-weight-regular  { font-weight: var(--es-weight-regular); }
  .es-weight-medium   { font-weight: var(--es-weight-medium); }
  .es-weight-semibold { font-weight: var(--es-weight-semibold); }
  .es-weight-bold     { font-weight: var(--es-weight-bold); }

  .es-uppercase { text-transform: uppercase; }
  .es-italic    { font-style: italic; }

  .es-hidden  { display: none; }
  .es-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
  }

  .es-prose    { max-width: 68ch; }
  .es-prose-sm { max-width: 48ch; }

  .es-border-t { border-top: var(--es-border-thin) solid var(--es-ctx-border, var(--es-color-border)); }
  .es-border-b { border-bottom: var(--es-border-thin) solid var(--es-ctx-border, var(--es-color-border)); }
}
