/* =========================================================
   EMBR — HOME (v2) — focused homepage layer.
   Loads AFTER embr.css. Adds: graphic constellation hero,
   teal-duotone photo treatment, credibility band, tighter
   editorial rhythm, prominent newsletter capture.
   Tweakable via body[data-*] attributes (see tweaks panel).
   ========================================================= */

/* ---------- PHOTO TREATMENT : teal duotone (default) ----------
   Grayscale the source, then re-tint into the measurement-teal
   register so stock reads as on-brand "instrument" imagery. */
.duo { position: relative; overflow: hidden; }
/* flagship images must still fill the card (fcard__img is absolute) —
   keep that, since the generic .duo position:relative would break the crop.
   isolation:isolate contains the duotone z-indexes so the card body/links
   (tag, title, chips, meta) still render ABOVE the photo. */
.fcard__img.duo { position: absolute; inset: 0; isolation: isolate; }
.fcard .fcard__body { position: relative; z-index: 2; }
.duo > img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) brightness(0.82) contrast(1.08);
  mix-blend-mode: normal; opacity: 1;
}
.duo::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(150deg, #0A1416 0%, #163134 45%, #57B0B5 130%);
  mix-blend-mode: color; opacity: 0.92;
}
.duo::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,12,13,0) 30%, rgba(8,12,13,0.55) 72%, rgba(8,12,13,0.95) 100%);
}
.duo > * { position: relative; z-index: 3; }

/* ember-tinted variant */
[data-photo='ember'] .duo::before {
  background: linear-gradient(150deg, #140a07 0%, #3a1a0e 45%, #F15A24 130%);
}
/* natural — drop the duotone, keep legibility veil */
[data-photo='natural'] .duo > img { filter: none; }
[data-photo='natural'] .duo::before { opacity: 0; }

[data-theme='light'] .duo > img { filter: grayscale(1) brightness(1.02) contrast(1.02); }
[data-theme='light'] .duo::before { opacity: 0.8; }
[data-theme='light'] .duo::after { background: linear-gradient(180deg, rgba(244,238,227,0) 35%, rgba(244,238,227,0.4) 78%, rgba(244,238,227,0.92) 100%); }

/* natural must win in BOTH themes (placed after the light overrides) */
[data-photo='natural'] .duo > img { filter: none !important; }
[data-photo='natural'] .duo::before { opacity: 0 !important; }

/* ---------- HERO : graphic instrument ---------- */
.hero__constellation {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(80% 75% at 64% 42%, #000 32%, transparent 88%);
          mask-image: radial-gradient(80% 75% at 64% 42%, #000 32%, transparent 88%);
}
.hero__constellation canvas { width: 100%; height: 100%; display: block; }

/* compact inline email capture inside hero */
.minisub { margin-top: 2rem; max-width: 30rem; }
.minisub__form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.minisub__input {
  flex: 1 1 13rem; min-width: 0;
  background: var(--surface-1); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 0.55rem; padding: 0.85rem 1rem; font-family: var(--font-body); font-size: 0.95rem;
  transition: border-color .18s, box-shadow .18s;
}
.minisub__input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-dim); }
.minisub__note {
  margin-top: 0.85rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.02em; font-weight: 500;
  color: var(--teal); display: inline-flex; align-items: center; gap: 0.5rem;
}
.minisub__note::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px -1px var(--teal); }

/* ---------- RECURRING TRUST PROMISE ---------- */
.promise {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em; font-weight: 500;
  color: var(--teal); display: inline-flex; align-items: center; gap: 0.6rem; text-align: center;
}
.promise::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 10px -1px var(--teal); flex-shrink: 0;
}
.promise-band {
  display: flex; align-items: center; justify-content: center;
  padding-block: clamp(1.1rem, 2.6vw, 1.6rem);
  border-block: 1px solid var(--line);
  background: color-mix(in oklab, var(--teal) 6%, transparent);
}
.promise-band .promise { letter-spacing: 0.04em; }
@media (max-width: 520px) { .promise { font-size: 0.7rem; } }

/* ---------- CREDIBILITY BAND (replaces 3 pillar cards) ---------- */
.trust { border-block: 1px solid var(--line); background: var(--surface-1); }
.trust__inner {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
@media (max-width: 880px) { .trust__inner { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .trust__inner { grid-template-columns: 1fr; } }
.trust__cell {
  padding: clamp(1.6rem, 3vw, 2.4rem) clamp(1.4rem, 2.6vw, 2rem);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.7rem;
}
.trust__cell:last-child { border-right: none; }
@media (max-width: 880px) {
  .trust__cell:nth-child(2n) { border-right: none; }
  .trust__cell { border-bottom: 1px solid var(--line); }
}
@media (max-width: 480px) { .trust__cell { border-right: none; } }
.trust__ico {
  width: 30px; height: 30px; color: var(--teal);
  display: inline-flex; align-items: center; justify-content: center;
}
.trust__ico svg { width: 100%; height: 100%; }
.trust__num {
  font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; letter-spacing: -0.03em; color: var(--text);
  line-height: 1;
}
.trust__lab { font-size: 0.86rem; color: var(--text-muted); line-height: 1.45; }
.trust__lab b { color: var(--text); font-weight: 600; }

/* ---------- SECTION HEAD — index numbers ---------- */
.sec-index {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.18em; color: var(--text-faint);
  display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.1rem;
}
.sec-index::after { content: ''; flex: 1; height: 1px; background: var(--line); max-width: 4rem; }

/* ---------- FLAGSHIP — refined feature row ---------- */
.flagrid { display: grid; grid-template-columns: 1.32fr 1fr; gap: 1.25rem; align-items: stretch; }
@media (max-width: 900px) {
  .flagrid { grid-template-columns: 1fr; }
  .fcard--lead, .flagrid .fcard:not(.fcard--lead) { min-height: 300px; }
}
.fcard--lead { min-height: 440px; }
.flagrid .fcard:not(.fcard--lead) { min-height: 440px; }

/* ---- flagship size variants (tweakable: data-flag) ---- */
[data-flag='compact'] .fcard--lead { min-height: 360px; }
[data-flag='compact'] .flagrid .fcard:not(.fcard--lead) { min-height: 300px; }
[data-flag='equal'] .flagrid { align-items: stretch; }
[data-flag='equal'] .fcard--lead,
[data-flag='equal'] .flagrid .fcard:not(.fcard--lead) { min-height: 420px; }
[data-flag='tall'] .fcard--lead { min-height: 520px; }
[data-flag='tall'] .flagrid .fcard:not(.fcard--lead) { min-height: 440px; }

/* ---------- ATLAS PREVIEW — add a framing rail ---------- */
.atlas__count {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; color: var(--teal);
  border: 1px solid color-mix(in oklab, var(--teal) 35%, transparent);
  background: var(--teal-dim); border-radius: 0.4rem; padding: 0.35rem 0.75rem; white-space: nowrap;
}

/* ---------- METHODOLOGY STRIP (compact) ---------- */
.evidence { display: grid; grid-template-columns: 1.1fr 1.9fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (max-width: 820px) { .evidence { grid-template-columns: 1fr; } }
.evrow { display: flex; flex-direction: column; gap: 0.6rem; }
.evtag {
  display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.9rem; align-items: baseline;
  padding: 1rem 1.15rem; border: 1px solid var(--line); border-left-width: 3px; border-radius: 0.6rem;
  background: var(--surface-1);
}
.evtag__name { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.evtag__desc { font-size: 0.85rem; color: var(--text-muted); grid-column: 2; line-height: 1.45; }
.evtag--peer { border-left-color: var(--teal); } .evtag--peer .evtag__name { color: var(--teal); }
.evtag--inf  { border-left-color: #E9B247; }     .evtag--inf  .evtag__name { color: #E9B247; }
.evtag--spec { border-left-color: var(--text-faint); } .evtag--spec .evtag__name { color: var(--text-faint); }

/* ---------- NEWSLETTER CTA — elevated ---------- */
.subcta { position: relative; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 1.5rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1) 60%);
  padding: clamp(2.4rem, 5vw, 4rem); text-align: center; }
.subcta__glow { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 80% at 50% -10%, rgba(var(--accent-glow),0.16), transparent 65%),
              radial-gradient(50% 70% at 50% 120%, var(--teal-dim), transparent 70%); }
.subcta > * { position: relative; }
.subcta__form { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.8rem; }
.subcta__input {
  flex: 0 1 22rem; background: var(--bg); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 0.6rem; padding: 0.95rem 1.15rem; font-family: var(--font-body); font-size: 1rem;
  transition: border-color .18s, box-shadow .18s;
}
.subcta__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-glow),0.18); }
.subcta__row { display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.subcta__row span { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.03em; color: var(--text-faint);
  display: inline-flex; align-items: center; gap: 0.45rem; }
.subcta__row span::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }

/* ---------- DENSITY tweak ---------- */
[data-density='compact'] .section { padding-block: clamp(3rem, 6vw, 5rem); }
[data-density='roomy']   .section { padding-block: clamp(5.5rem, 11vw, 9.5rem); }
/* (.reveal / .in defined in embr.css) */

/* ---------- HERO CHECK — tighten empty state (less dead space) ---------- */
.hmod__result--empty { min-height: 0; padding-top: 1rem; margin-top: 1rem; }

/* ---------- BUILD SECTION — "certification gap" data viz ---------- */
.build__viz {
  position: relative; min-height: 360px; display: flex; flex-direction: column;
  border: 1px solid var(--line-strong); border-radius: 1rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1) 62%);
  padding: clamp(1.4rem, 3vw, 1.9rem);
  box-shadow: 0 30px 70px -45px rgba(0,0,0,0.6), inset 0 1px 0 rgba(237,232,223,0.05);
}
.viz-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.viz-eyebrow {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 0.55rem;
}
.viz-eyebrow::before { content: ''; width: 1.4rem; height: 1px; background: var(--accent); }
.viz-tag {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint); border: 1px solid var(--line-strong); border-radius: 0.3rem; padding: 0.2rem 0.5rem; white-space: nowrap;
}
.viz-chart { flex: 1; display: flex; align-items: center; margin-top: 0.5rem; }
.viz-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-grid { stroke: var(--line); stroke-width: 1; }
.viz-axis { stroke: var(--line-strong); stroke-width: 1; }
.viz-area { fill: var(--accent); opacity: 0.13; }
.viz-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.viz-band { fill: var(--teal); opacity: 0.16; }
.viz-band-line { stroke: var(--teal); stroke-width: 1.5; stroke-dasharray: 3 4; }
.viz-dot { fill: var(--accent); }
.viz-dot-ring { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.4; }
.viz-label { font-family: var(--font-mono); font-size: 11px; fill: var(--text-faint); letter-spacing: 0.04em; }
.viz-label--teal { fill: var(--teal); font-weight: 500; }
.viz-label--accent { fill: var(--accent); font-weight: 500; }
.viz-cap { margin-top: 0.9rem; font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; }
.viz-cap b { color: var(--text); font-weight: 600; }

/* ---------- INTERACTIVE CERTIFICATION-GAP FEATURE ---------- */
.gap {
  position: relative; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 1.25rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1) 64%);
  box-shadow: 0 40px 90px -55px rgba(0,0,0,0.65), inset 0 1px 0 rgba(237,232,223,0.05);
  padding: clamp(1.4rem, 3vw, 2.2rem);
}
.gap__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.gap__eyebrow {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal); display: inline-flex; align-items: center; gap: 0.55rem;
}
.gap__eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px -1px var(--teal); }
.gap__hint {
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); display: inline-flex; align-items: center; gap: 0.4rem;
  animation: gapHintPulse 2.6s ease-in-out infinite;
}
@keyframes gapHintPulse { 0%,100%{opacity:.45} 50%{opacity:1} }
@media (prefers-reduced-motion: reduce) { .gap__hint { animation: none; } }

.gap__chart { position: relative; margin-top: 0.6rem; cursor: ew-resize; touch-action: pan-y; border-radius: 0.5rem; }
.gap__chart:focus { outline: none; }
.gap__chart:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
.gap__chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.gap-grid { stroke: var(--line); stroke-width: 1; }
.gap-axis { stroke: var(--line-strong); stroke-width: 1; }
.gap-area-future { fill: var(--text-faint); opacity: 0.07; }
.gap-area-lived { fill: url(#gapFill); }
.gap-curve { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.gap-cert { fill: var(--teal); }
.gap-handle-line { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0.65; }
.gap-knob-ring { fill: var(--surface-1); stroke: var(--accent); stroke-width: 2; }
.gap-knob { fill: var(--accent); }
.gap-knob-pulse { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.4; }
.gap-lbl { font-family: var(--font-mono); font-size: 11px; fill: var(--text-faint); letter-spacing: 0.04em; }
.gap-lbl--teal { fill: var(--teal); font-weight: 500; }
.gap-lbl--accent { fill: var(--accent); font-weight: 600; }

.gap__readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 1.4rem; background: var(--line); border: 1px solid var(--line); border-radius: 0.8rem; overflow: hidden; }
@media (max-width: 620px) { .gap__readouts { grid-template-columns: 1fr; } }
.gap__stat { background: var(--surface-1); padding: clamp(1rem, 2.4vw, 1.4rem); display: flex; flex-direction: column; gap: 0.35rem; }
.gap__stat--hero { background: color-mix(in oklab, var(--accent) 9%, var(--surface-1)); }
.gap__stat-k { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.gap__stat-v { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -0.03em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.gap__stat--hero .gap__stat-v { color: var(--accent); }
.gap__stat--cert .gap__stat-v { color: var(--teal); }
.gap__stat-s { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.gap__cap { margin-top: 1.2rem; font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; max-width: 60ch; }
.gap__cap b { color: var(--text); font-weight: 600; }
.build--roadmap { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* build roadmap — align the stage column so all rows' text lines up */
.build .spec__stage { min-width: 8rem; flex-shrink: 0; }
/* don't fade the "Future" row into illegibility; keep colours readable */
.build .spec__row--soon { opacity: 1; }
.build .spec__stage.faint { color: var(--text-muted); }
.build .spec__stage.teal { color: var(--teal); }
.build .spec__stage.accent { color: var(--accent); }

/* ---------- NAV BRAND LOCKUP (larger + tagline) ---------- */
.brand--lockup { gap: 0.6rem; align-items: center; }
.brand--lockup .brand__mark { width: 33px; height: 33px; }
.brand--lockup .brand__text { display: flex; flex-direction: column; line-height: 1; gap: 0.22rem; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.34rem; letter-spacing: -0.045em; color: var(--text); }
.brand__tag { font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); white-space: nowrap; }
@media (max-width: 600px) { .brand__tag { display: none; } .brand--lockup .brand__name { font-size: 1.2rem; } }

/* ---------- "WHY IT MATTERS" — the problem, in three steps ---------- */
.problem {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden;
}
@media (max-width: 820px) { .problem { grid-template-columns: 1fr; } }
.problem__step {
  background: var(--surface-1); padding: clamp(1.7rem, 3vw, 2.4rem);
  display: flex; flex-direction: column; gap: 0.85rem; position: relative;
}
.problem__step--pivot { background: color-mix(in oklab, var(--teal) 7%, var(--surface-1)); }
.problem__ico { width: 34px; height: 34px; color: var(--accent); }
.problem__ico svg { width: 100%; height: 100%; }
.problem__step--pivot .problem__ico { color: var(--teal); }
.problem__k {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}
.problem__step--pivot .problem__k { color: var(--teal); }
.problem__step h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.22rem; letter-spacing: -0.02em; line-height: 1.1; color: var(--text); }
.problem__step p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.62; }
.problem__step p b { color: var(--text); font-weight: 600; }
/* connector arrows between steps (desktop) */
@media (min-width: 821px) {
  .problem__step:not(:last-child)::after {
    content: ''; position: absolute; right: -1px; top: 50%; transform: translate(50%, -50%);
    width: 26px; height: 26px; border-radius: 999px; z-index: 2;
    background: var(--bg); border: 1px solid var(--line);
    -webkit-mask: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239C948B' stroke-width='2'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 14px;
  }
}

/* problem as a vertical stack — used in the hero right column */
.problem--stack { grid-template-columns: 1fr; }
.problem--stack .problem__step { padding: clamp(1.1rem, 2.3vw, 1.5rem) clamp(1.3rem, 2.6vw, 1.7rem); gap: 0.5rem; }
.problem--stack .problem__step h3 { font-size: 1.08rem; }
.problem--stack .problem__step p { font-size: 0.86rem; }
.problem--stack .problem__step::after { display: none !important; }
.problem--stack .problem__ico { width: 28px; height: 28px; }

/* check-tool section (relocated interactive module) */
.checkrow { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 920px) { .checkrow { grid-template-columns: 1fr; } }
