/* ============================================================
   Layer 2 surface system  ·  canonical surface file
   Reusable chrome for sub-layer surfaces triggered from CTAs on
   Layer 1 (the main proposal flow). Examples: Maintenance &
   Clarifications, Insurance & Fire Safety. Future sub-layers
   (S2 lightbox, S3 drill-down, certifications hub) consume the
   same wrapper for consistency.

   Canonical, consumed not forked. Built on the locked design
   system tokens only — no new tokens. Loaded after components.css.

   Principles
   ----------
   1. SURFACE, not page. No display-block "page" treatment, no folio,
      no PDF-style chrome. Smaller heading scale than a Layer 1 page.
   2. CONTAINED. Content width tighter than a Layer 1 page; paper
      background reads as "elevated".
   3. PROVENANCE. Top bar always shows the surface identifier; bottom
      bar always shows proposal and client name.
   4. CLOSE AFFORDANCE. Persistent top-right, same position on every
      surface so muscle memory carries between them.
   5. SINGLE FOCUS. No nav within.
   6. NO NEW TOKENS.

   Form factor (drawer / modal / takeover) is a host concern. The
   surface chrome is invariant; the host owns entry, position, and
   may own the backdrop.
   ============================================================ */

.tf-layer2 {
  background: var(--tf-paper);
  color: var(--tf-offblack);
  font-family: var(--font-ui);
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ─── Top bar ──────────────────────────────────────────────── */
.tf-layer2__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--tf-border);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--tf-muted);
  background: var(--tf-paper);
}
.tf-layer2__topbar-left {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.tf-layer2__topbar-tag {
  /* Fixed sub-layer identifier across the family. Outline pill, mono caps. */
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--tf-border);
  border-radius: var(--r-xs);
  background: var(--tf-white);
  color: var(--tf-muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-eyebrow);
}
.tf-layer2__topbar-title {
  color: var(--tf-offblack);
}

.tf-layer2__close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--tf-border);
  border-radius: var(--r-pill);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--tf-offblack);
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  line-height: 1;
  letter-spacing: 0;
  transition: background 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.tf-layer2__close:hover {
  background: var(--tf-fixed);
  border-color: var(--tf-offblack);
}
.tf-layer2__close-glyph {
  display: block;
  width: 12px;
  height: 12px;
}

/* ─── Header (smaller than a Layer 1 display header) ───────── */
.tf-layer2__head {
  padding: 56px 56px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 48px;
  align-items: end;
  border-bottom: 1px solid var(--tf-border);
}
.tf-layer2__head--single { grid-template-columns: 1fr; }

.tf-layer2__eyebrow {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--tf-muted);
  margin-bottom: 12px;
}

/* Brand-accent pill variant: eyebrow on neon-yellow brand fill, dark text,
   mono caps. Use sparingly on hero-leaning surfaces. */
.tf-layer2__head--pill .tf-layer2__eyebrow {
  display: inline-flex;
  background: var(--tf-fixed);
  color: var(--tf-offblack);
  padding: 5px 9px;
  border-radius: var(--r-xs);
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-weight: var(--fw-regular);
}
.tf-layer2__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.6vw, 44px);
  font-weight: var(--fw-regular);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--tf-offblack);
  text-wrap: balance;
}
.tf-layer2__lede {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.2vw, 18px);
  letter-spacing: -0.005em;
  line-height: 1.4;
  color: var(--tf-offblack);
  margin: 0;
  text-wrap: pretty;
}
.tf-layer2__lede em {
  font-style: normal;
  background: var(--tf-fixed);
  padding: 0 4px;
}

/* ─── Body ─────────────────────────────────────────────────── */
.tf-layer2__body {
  padding: 48px 56px 56px;
  flex: 1;
}

/* Tighter scale of shared page sections when nested inside a surface. */
.tf-layer2 .tf-section { margin-top: 48px; }
.tf-layer2 .tf-section:first-child { margin-top: 0; }
.tf-layer2 .tf-section__head {
  grid-template-columns: 1fr;
  gap: 4px;
  padding-bottom: 14px;
}
.tf-layer2 .tf-section__num { font-size: var(--text-xs); }
.tf-layer2 .tf-section__title { font-size: clamp(20px, 1.7vw, 24px); }

/* ─── Footer ───────────────────────────────────────────────── */
.tf-layer2__foot {
  padding: 18px 32px;
  border-top: 1px solid var(--tf-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-family: var(--font-ui);
  font-size: var(--text-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--tf-muted);
  background: var(--tf-paper);
}

/* ─── Density variants ─────────────────────────────────────── */
.tf-layer2[data-density="compact"] .tf-layer2__head { padding: 40px 40px 24px; }
.tf-layer2[data-density="compact"] .tf-layer2__body { padding: 32px 40px 40px; }
.tf-layer2[data-density="compact"] .tf-section { margin-top: 32px; }

.tf-layer2[data-density="airy"] .tf-layer2__head { padding: 72px 72px 40px; }
.tf-layer2[data-density="airy"] .tf-layer2__body { padding: 64px 72px 72px; }
.tf-layer2[data-density="airy"] .tf-section { margin-top: 64px; }

/* ─── Backdrop affordance ──────────────────────────────────── */
/* The surface assumes a stage wraps it providing the dim backdrop. A host
   that owns its own backdrop (production modal / drawer) can elide the
   stage and render only the self-contained panel. */
.tf-layer2-stage {
  background: rgba(20, 18, 16, 0.32);
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px;
  box-sizing: border-box;
}
.tf-layer2-stage__panel {
  width: 100%;
  max-width: 1040px;
  background: var(--tf-paper);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.32), 0 2px 8px rgba(0,0,0,0.08);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  height: auto;
}
