/* ═══════════════════════════════════════════════════════════
   HYPERSPHERE — TACTICAL EDGE MICROSITE
   Loaded after tokens.css → global.css → components.css on /tactical-edge
   pages only.
   Every styling decision for the microsite lives here; the shared site CSS
   is untouched.

   Accessibility notes (WCAG 2.2 AA / Section 508):
   - Text uses --te-ink / --te-text / --te-accent only. The brand
     orange and bright teal fail 4.5:1 on light grounds, so they appear here
     as decoration (rules, markers, illustrations), never as text.
   - No .reveal: it hides content until JavaScript runs.
   ═══════════════════════════════════════════════════════════ */

:root {
  --te-ink:        var(--text-heading);   /* headings, strong labels */
  --te-text:       var(--text-body);      /* body copy (9.1:1 on white) */
  --te-accent:     var(--hs-teal);        /* eyebrows, links, current page */
  --te-mark:       var(--hs-orange-mid);  /* decorative rules + markers only */
  --te-rule:       var(--border);
  --te-surface:    var(--hs-warm-white);
  --te-surface-2:  var(--white);
  --te-panel:      var(--hs-sand-light);
  --te-focus:      var(--hs-teal);

  --te-header-h:   68px;                  /* global fixed nav */
  --te-subnav-h:   52px;
  --te-measure:    68ch;
}

body.te { background: var(--te-surface); }

/* Anchor targets clear both bars */
.te [id] { scroll-margin-top: calc(var(--te-header-h) + var(--te-subnav-h) + var(--space-4)); }

/* ── Focus ─────────────────────────────────────────────── */
.te a:focus-visible,
.te button:focus-visible,
.te summary:focus-visible,
.te input:focus-visible,
.te select:focus-visible,
.te textarea:focus-visible {
  outline: 3px solid var(--te-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Skip link ─────────────────────────────────────────── */
.te-skip {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: calc(var(--z-nav) + 1);
  background: var(--te-ink);
  color: var(--white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
}
.te-skip:focus { top: var(--space-4); }

/* ── Secondary nav ─────────────────────────────────────── */
.te-subnav {
  position: sticky;
  top: var(--te-header-h);
  margin-top: var(--te-header-h);
  z-index: calc(var(--z-nav) - 1);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--te-rule);
}

.te-subnav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  max-width: var(--container-max);
  min-height: var(--te-subnav-h);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.te-subnav-label {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--te-ink);
  padding-right: var(--space-6);
  border-right: 1px solid var(--te-rule);
}
.te-subnav-label abbr { text-decoration: none; }

.te-subnav ul {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0;
}
.te-subnav ul::-webkit-scrollbar { display: none; }

.te-subnav a {
  display: block;
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--te-text);
  padding: 0.9rem var(--space-3) calc(0.9rem - 2px);
  border-bottom: 2px solid transparent;
  transition: color var(--ease-fast), border-color var(--ease-fast);
}
.te-subnav a:hover { color: var(--te-accent); }
.te-subnav a[aria-current="page"] {
  color: var(--te-accent);
  font-weight: var(--weight-semi);
  border-bottom-color: var(--te-mark);
}

@media (max-width: 900px) {
  .te-subnav-label { display: none; }
  .te-subnav-inner { padding-inline: var(--space-2); }
}

/* ── Hero ──────────────────────────────────────────────── */
.te-hero {
  padding-block: var(--space-16) var(--space-16);
  padding-inline: var(--container-pad);
  background: var(--te-surface-2);
  border-bottom: 1px solid var(--te-rule);
}

.te-hero-inner {
  max-width: var(--container-max);
  margin-inline: auto;
}

.te-hero--split .te-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-12);
  align-items: center;
}

.te-hero h1 {
  max-width: 18ch;
  margin-bottom: var(--space-6);
}

.te-hero--page h1 { max-width: 24ch; }

.te-lede {
  font-size: var(--text-md);
  line-height: var(--leading-loose);
  color: var(--te-text);
  max-width: 60ch;
}

.te-hero .te-actions { margin-top: var(--space-8); }

.te-hero-figure img {
  width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .te-hero--split .te-hero-inner { grid-template-columns: 1fr; gap: var(--space-8); }
  .te-hero-figure { max-width: 420px; }
}

.te-eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--te-accent);
  margin-bottom: var(--space-3);
}

/* ── Buttons row ───────────────────────────────────────── */
.te-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.te .btn { white-space: normal; text-align: center; line-height: 1.3; }

/* ── Sections ──────────────────────────────────────────── */
.te-section { padding-block: var(--space-20); }
.te-section--alt { background: var(--te-surface-2); border-block: 1px solid var(--te-rule); }
.te-section--panel { background: var(--te-panel); }
.te-section--tight { padding-block: var(--space-12); }

.te-section h2 { font-size: var(--text-2xl); margin-bottom: var(--space-5); max-width: 28ch; }
.te-section h3 { font-size: var(--text-md); margin-bottom: var(--space-3); }

.te-prose { max-width: var(--te-measure); }
.te-prose p + p { margin-top: var(--space-4); }
.te-prose a,
.te-link {
  color: var(--te-accent);
  font-weight: var(--weight-semi);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.te-prose a:hover,
.te-link:hover { text-decoration-thickness: 2px; }

/* Two-column section: heading left, body right */
.te-split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--space-12);
  align-items: start;
}
@media (max-width: 900px) { .te-split { grid-template-columns: 1fr; gap: var(--space-4); } }

/* ── Bulleted list with square markers ─────────────────── */
.te-list li {
  position: relative;
  padding-left: var(--space-6);
  line-height: var(--leading-loose);
}
.te-list li + li { margin-top: var(--space-2); }
.te-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  background: var(--te-mark);
}
.te-list--neg li::before { background: none; border: 1.5px solid var(--te-ink); width: 8px; height: 8px; }

/* ── Three parallel facts (not numbered) ───────────────── */
.te-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-10);
}
.te-fact {
  border-top: 2px solid var(--te-ink);
  padding-top: var(--space-5);
}
.te-fact h3 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
@media (max-width: 900px) { .te-facts { grid-template-columns: 1fr; gap: var(--space-8); } }

/* ── Proof block (Deployed today) ──────────────────────── */
.te-proof {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
  background: var(--te-surface-2);
  border: 1px solid var(--te-rule);
  border-left: 3px solid var(--te-mark);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  max-width: 880px;
}
.te-proof img { width: 96px; height: 96px; border-radius: var(--radius-sm); }
.te-proof p { font-size: var(--text-md); color: var(--te-ink); }
@media (max-width: 600px) { .te-proof { grid-template-columns: 1fr; gap: var(--space-5); } }

/* ── Next steps ────────────────────────────────────────── */
.te-next {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--te-rule);
  margin-block: var(--space-8) var(--space-10);
}
.te-next a {
  display: block;
  padding: var(--space-6) var(--space-6) var(--space-6) 0;
  border-bottom: 1px solid var(--te-rule);
  color: var(--te-ink);
}
.te-next a + a { padding-left: var(--space-6); border-left: 1px solid var(--te-rule); }
.te-next strong { display: block; font-size: var(--text-base); color: var(--te-accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.te-next span { display: block; font-size: var(--text-sm); color: var(--te-text); margin-top: var(--space-1); }
.te-next a:hover strong { text-decoration-thickness: 2px; }
@media (max-width: 760px) {
  .te-next { grid-template-columns: 1fr; }
  .te-next a + a { padding-left: 0; border-left: 0; }
}

/* ── Related links (outbound, existing site pages) ─────── */
.te-related {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  font-size: var(--text-sm);
}
.te-related-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--te-ink);
  width: 100%;
}

/* ── Mission scenarios ─────────────────────────────────── */
.te-scenario {
  padding-block: var(--space-16);
  border-top: 1px solid var(--te-rule);
}
.te-scenario:first-of-type { border-top: 0; }

.te-scenario-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}
.te-scenario-num {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  color: var(--te-ink);
  border-bottom: 2px solid var(--te-mark);
  line-height: 1.1;
}
.te-scenario h2 { font-size: var(--text-2xl); margin: 0; max-width: 30ch; }

/* The four labelled parts */
.te-parts { display: grid; grid-template-columns: 12rem minmax(0, 1fr); border-top: 1px solid var(--te-rule); }
.te-parts dt,
.te-parts dd { padding-block: var(--space-4); border-bottom: 1px solid var(--te-rule); }
.te-parts dt {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--te-ink);
  padding-top: calc(var(--space-4) + 0.3em);
  padding-right: var(--space-4);
}
.te-parts dd { line-height: var(--leading-loose); color: var(--te-text); }
.te-parts .is-stop { background: var(--te-panel); }
.te-parts dt.is-stop { padding-left: var(--space-3); border-left: 3px solid var(--te-mark); }
.te-parts dd.is-stop { padding-right: var(--space-4); }
@media (max-width: 600px) {
  .te-parts { grid-template-columns: 1fr; }
  .te-parts dt { border-bottom: 0; padding-bottom: 0; }
  .te-parts dd { padding-top: var(--space-2); }
  .te-parts dt.is-stop { padding-top: var(--space-4); }
  .te-parts dd.is-stop { padding-left: var(--space-3); border-left: 3px solid var(--te-mark); }
}

/* Layout variants — the five scenarios are deliberately not identical */
.te-scenario-body { display: grid; gap: var(--space-12); align-items: start; }
.te-scenario--figure-right .te-scenario-body { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr); }
.te-scenario--figure-wide .te-figure-wide { margin-bottom: var(--space-10); }
.te-scenario--split .te-scenario-body { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); }
.te-scenario--aside .te-scenario-body { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); }
.te-scenario--narrow .te-scenario-body { max-width: 860px; }
@media (max-width: 900px) {
  .te-scenario--figure-right .te-scenario-body,
  .te-scenario--split .te-scenario-body,
  .te-scenario--aside .te-scenario-body { grid-template-columns: 1fr; gap: var(--space-8); }
}

.te-scenario-summary {
  font-size: var(--text-md);
  color: var(--te-ink);
  line-height: var(--leading-loose);
}

.te-aside {
  background: var(--te-surface-2);
  border: 1px solid var(--te-rule);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  font-size: var(--text-sm);
}
.te-aside p { line-height: var(--leading-normal); }
.te-aside p + p { margin-top: var(--space-3); }

.te-figure img { width: 100%; height: auto; }
.te-scenario--figure-right .te-figure { max-width: 280px; justify-self: center; }
.te-figure-wide img { width: 100%; max-width: 820px; height: auto; margin-inline: auto; }
.te-figure figcaption,
.te-figure-wide figcaption,
.te-diagram figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--te-text);
}

/* ── Architecture diagram ──────────────────────────────── */
.te-diagram {
  margin-top: var(--space-10);
  background: var(--te-surface-2);
  border: 1px solid var(--te-rule);
  border-radius: var(--radius-md);
  padding: var(--space-8);
}
.te-diagram svg { width: 100%; max-width: 560px; height: auto; margin-inline: auto; }
.te-diagram .dg-box     { fill: var(--white); stroke: var(--te-ink); stroke-width: 1.5; }
.te-diagram .dg-box--dna { fill: var(--hs-ice); stroke: var(--hs-teal); stroke-width: 2; }
.te-diagram .dg-box--store { fill: var(--hs-sand-light); stroke: var(--te-ink); stroke-width: 1.5; }
.te-diagram .dg-line    { stroke: var(--te-ink); stroke-width: 1.5; fill: none; }
.te-diagram .dg-head    { fill: var(--te-ink); }
.te-diagram .dg-title   { font-family: var(--font-body); font-weight: 600; font-size: 19px; fill: var(--te-ink); }
.te-diagram .dg-sub     { font-family: var(--font-body); font-weight: 400; font-size: 16px; fill: var(--te-text); }
.te-diagram .dg-tag     { font-family: var(--font-body); font-weight: 600; font-size: 14px; letter-spacing: 0.06em; fill: var(--hs-teal); }
.te-diagram .dg-mark    { fill: var(--te-mark); }

/* ── Framework chips ───────────────────────────────────── */
.te-chips { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-block: var(--space-6) var(--space-8); }
.te-chips li {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hs-teal);
  background: var(--white);
  border: 1px solid rgba(37, 80, 94, 0.35);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
}

.te-fineprint-title { font-size: var(--text-base); margin-bottom: var(--space-3); }

.te-disclaimer {
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
  color: var(--te-text);
  max-width: var(--te-measure);
  border-left: 3px solid var(--te-rule);
  padding-left: var(--space-6);
}

/* ── CTA band ──────────────────────────────────────────── */
.te-cta {
  padding-block: var(--space-16);
  background: var(--hs-ice);
  border-top: 1px solid var(--hs-sea-light);
}
.te-cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.te-cta h2 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.te-cta p { max-width: 56ch; }

/* ── Briefing form page ────────────────────────────────── */
.te-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: var(--space-12);
  align-items: start;
}
@media (max-width: 900px) { .te-form-layout { grid-template-columns: 1fr; } }

.te-form-panel {
  background: var(--te-surface-2);
  border: 1px solid var(--te-rule);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
}
@media (max-width: 600px) { .te-form-panel { padding: var(--space-6); } }
.te-form-title { font-size: var(--text-xl); margin-bottom: var(--space-6); }

.te-notice {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  background: var(--te-panel);
  border-left: 3px solid var(--te-mark);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--te-ink);
  line-height: var(--leading-normal);
}

/* Shared intake form: keyboard focus must be visible, not just a border tint */
.te .hs-intake input:focus-visible,
.te .hs-intake select:focus-visible,
.te .hs-intake textarea:focus-visible { border-color: var(--te-focus); }

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html:has(body.te) { scroll-behavior: auto; }
  .te *, .te *::before, .te *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .te .btn:hover { transform: none; }
}
