/* ─── TrustLedger Mesh — native section embedded in Hero_mesh.html ─── */

.tlm-root {
  /* Light mode (default) */
  --tlm-fg:           #1a1a1a;
  --tlm-fg-2:         rgba(26, 26, 26, .68);
  --tlm-fg-3:         rgba(26, 26, 26, .46);
  --tlm-line:         rgba(26, 26, 26, .18);
  --tlm-line-2:       rgba(26, 26, 26, .28);
  --tlm-line-stroke:  rgba(102, 102, 102, .55);
  --tlm-halo-outer:   rgba(26, 26, 26, .08);
  --tlm-sweep-stop:   rgba(26, 26, 26, .10);

  position: relative;
  display: block;
  width: min(82.5vw, 1408px);  /* +10% scale */
  margin: 0 auto;
  padding: 6vh 0;
  color: var(--tlm-fg);
  font-family: var(--sans, "Geist", -apple-system, BlinkMacSystemFont, system-ui, sans-serif);
  font-feature-settings: "ss01","ss02","cv01","cv11";
  -webkit-font-smoothing: antialiased;
  background: transparent;
  overflow: hidden;
}

:root.dark .tlm-root {
  --tlm-fg:           #FAFAFA;
  --tlm-fg-2:         rgba(250, 250, 250, .72);
  --tlm-fg-3:         rgba(250, 250, 250, .50);
  --tlm-line:         rgba(250, 250, 250, .14);
  --tlm-line-2:       rgba(250, 250, 250, .32);
  --tlm-line-stroke:  rgba(250, 250, 250, .32);
  --tlm-halo-outer:   rgba(250, 250, 250, .06);
  --tlm-sweep-stop:   rgba(250, 250, 250, .10);
}

/* ── Meta bars ────────────────────────────────────────────────────────── */
.tlm-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  font-family: var(--mono, "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tlm-fg-3);

  /* Hidden by default; fade in on hover */
  opacity: 0;
  transition: opacity 500ms ease;
}
.tlm-meta-bar--top { margin-bottom: 32px; }
.tlm-meta-bar--bot { margin-top: 32px; }
.tlm-meta-bar .tlm-lead { color: var(--tlm-fg); letter-spacing: .22em; }
.tlm-meta-bar .tlm-utc  { color: var(--tlm-fg-2); font-variant-numeric: tabular-nums; }
.tlm-meta-bar .tlm-rule { flex: 1; height: 1px; background: var(--tlm-line); margin: 0 16px; align-self: center; }

/* ── Stage / canvas ───────────────────────────────────────────────────── */
.tlm-stage {
  position: relative;
  width: 100%;
  height: 0;       /* set by JS once scaled */
  overflow: visible;
}
.tlm-canvas {
  position: relative;
  width: 1600px;
  height: 1000px;
  transform-origin: top left;
  background: transparent;
}

/* ── SVG mesh layer ───────────────────────────────────────────────────── */
.tlm-mesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Lines + ring dots + cluster-side dots are HIDDEN by default. They
   reveal staggered on hover: lines draw outward from the ring → ring dots
   appear at the ring contact → cluster-side dots appear at the cluster
   anchor → clusters fade in → chrome (halo/sweep/meta-bars) appears. */
.tlm-mesh .tlm-line {
  stroke: var(--tlm-line-stroke);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
  transition: stroke-dashoffset 600ms cubic-bezier(.2,.7,.2,1);
}
.tlm-mesh .tlm-endpoint {
  fill: transparent;
  stroke: var(--tlm-fg);
  stroke-width: 1;
  opacity: 0;
  transition: opacity 300ms ease;
}
.tlm-mesh .tlm-pulse {
  fill: var(--tlm-fg);
  opacity: 0;
}
.tlm-ring-dot {
  fill: transparent;
  stroke: var(--tlm-fg);
  stroke-width: 1;
  opacity: 0;
  transition: opacity 300ms ease;
}

/* ── Domain callouts ─────────────────────────────────────────────────── */
.tlm-node {
  position: absolute;
  width: 240px;
  z-index: 4;
  color: var(--tlm-fg);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.tlm-node .tlm-node-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.tlm-node .tlm-node-name {
  font-family: var(--sans, inherit);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -.015em;
  line-height: 1.15;
  color: var(--tlm-fg);
}
.tlm-node .tlm-node-rule {
  height: 1px;
  background: var(--tlm-line-2);
  margin: 8px 0 10px;
}
.tlm-node ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 14px;
}
.tlm-node ul.tlm-col1 { grid-template-columns: 1fr; }
.tlm-node li {
  font-family: var(--sans, inherit);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--tlm-fg-2);
  letter-spacing: -.002em;
}
.tlm-node.tlm-right { text-align: right; }
.tlm-node.tlm-right .tlm-node-head { justify-content: flex-end; }
.tlm-node.tlm-right ul { direction: rtl; }
.tlm-node.tlm-right li { direction: ltr; }

/* ── Halos — only the inner ring is visible by default ─────────────────
   The inner ring pulses 30% → 65% → 30% over 2.2s ease-in-out as an idle
   affordance — a subtle "tap me" cue on the only interactive surface
   visible at rest. Two `::before` / `::after` ghost rings ripple outward
   from it on a 2.4s loop (offset 1.2s) so the cue reads as an active,
   "tap me" sonar rather than a flat fade. Everything freezes the first
   time the user hovers the wordmark — `.has-interacted` is sticky. */
.tlm-halo {
  position: absolute;
  left: 50%; top: 50%;
  width: 520px; height: 520px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid var(--tlm-line);
  z-index: 3;
  pointer-events: none;
}
/* Inner ring: pulse by default, freeze after first interaction. The
   outer halo deliberately omits the animation so it stays at opacity 0
   until hover reveals it. */
.tlm-halo:not(.tlm-halo--outer) {
  /* Use the full foreground color (not the muted line tokens) so the
     pulse reads clearly. A 1.5px stroke gives the ring presence without
     looking heavy. */
  border: 1.5px solid var(--tlm-fg);
  opacity: 0.32;
  animation: tlmRingPulse 2.2s ease-in-out infinite;
}
.tlm-halo:not(.tlm-halo--outer)::before,
.tlm-halo:not(.tlm-halo--outer)::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  border: 1.5px solid var(--tlm-fg);
  opacity: 0;
  pointer-events: none;
  animation: tlmRingSonar 2.4s cubic-bezier(.22,.61,.36,1) infinite;
}
.tlm-halo:not(.tlm-halo--outer)::after {
  animation-delay: 1.2s;
}
.tlm-root.has-interacted .tlm-halo:not(.tlm-halo--outer) {
  animation: none;
  opacity: 0.45;
  transition: opacity 400ms ease;
}
.tlm-root.has-interacted .tlm-halo:not(.tlm-halo--outer)::before,
.tlm-root.has-interacted .tlm-halo:not(.tlm-halo--outer)::after {
  animation: none;
  opacity: 0;
}
.tlm-halo.tlm-halo--outer {
  width: 620px; height: 620px;
  border-color: var(--tlm-halo-outer);
  opacity: 0;                /* outer halo hidden until hover */
  transition: opacity 500ms ease;
}

/* ── Sweep — hidden by default, fades in + rotates on hover ─────────── */
.tlm-sweep {
  position: absolute;
  left: 50%; top: 50%;
  width: 520px; height: 520px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  background: conic-gradient(from -90deg,
    transparent 0deg,
    var(--tlm-sweep-stop) 8deg,
    transparent 55deg,
    transparent 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0%, rgba(0, 0, 0, .55) 30%, #000 70%, #000 94%, transparent 100%);
          mask: radial-gradient(circle, transparent 0%, rgba(0, 0, 0, .55) 30%, #000 70%, #000 94%, transparent 100%);
  transition: opacity 600ms ease;
}

/* ── Wordmark — always visible, the hover target ─────────────────────── */
.tlm-wordmark {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--sans, inherit);
  letter-spacing: -.035em;
  line-height: 1;
  color: var(--tlm-fg);
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
  transition: transform 400ms cubic-bezier(.22,.61,.36,1);
}
.tlm-wordmark:hover { transform: translate(-50%, -50%) scale(1.04); }
.tlm-wm-static { font-weight: 700; font-size: 56px; }

/* Marquee — fades through phrases one at a time (only one ever visible) */
.tlm-wm-marquee {
  --count: 12;
  --slot: 2s;
  position: relative;
  width: 480px;
  height: 72px;
  pointer-events: none;
}
.tlm-wm-track { position: relative; height: 100%; }
.tlm-wm-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-weight: 300;
  font-size: 56px;
  letter-spacing: -.035em;
  line-height: 1;
  opacity: 0;
  --duration: calc(var(--count) * var(--slot));
  --delay: calc(var(--index) * var(--slot) - var(--duration) + (var(--slot) * 0.5));
  animation: tlmPhraseCycle var(--duration) var(--delay) infinite ease-in-out;
  will-change: opacity, transform;
}

/* Each item is hidden for the bulk of the cycle, then fades in, holds,
   and fades out within its assigned slot (slot = duration / count). */
@keyframes tlmPhraseCycle {
  0%                     { opacity: 0; transform: translateY(6px); }
  1.5%                   { opacity: 1; transform: translateY(0); }
  6.8%                   { opacity: 1; transform: translateY(0); }
  8.333%, 100%           { opacity: 0; transform: translateY(-6px); }
}

/* ── Revealed state (hover on the central wordmark) ───────────────────
   Stagger order: lines draw out of the ring, ring dots land, cluster-side
   dots appear, then clusters/chrome fade in. Reverse on leave. */
.tlm-root.is-revealed .tlm-meta-bar         { opacity: 1; transition-delay: 0ms; }
.tlm-root.is-revealed .tlm-meta-bar--bot    { transition-delay: 100ms; }
.tlm-root.is-revealed .tlm-halo--outer      { opacity: 1; transition-delay: 200ms; }
.tlm-root.is-revealed .tlm-sweep            { opacity: .22; transition-delay: 200ms; }

.tlm-root.is-revealed .tlm-mesh .tlm-line {
  stroke-dashoffset: 0;
  transition-delay: calc(0ms + var(--i, 0) * 40ms);
}
.tlm-root.is-revealed .tlm-ring-dot {
  opacity: 1;
  transition-delay: calc(550ms + var(--ti, 0) * 25ms);
}
.tlm-root.is-revealed .tlm-mesh .tlm-endpoint {
  opacity: 1;
  transition-delay: calc(700ms + var(--i, 0) * 25ms);
}
.tlm-root.is-revealed .tlm-node {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(850ms + var(--i, 0) * 35ms);
}

/* ── Keyframes (marquee only — everything else uses transitions) ────── */
@keyframes tlmRingPulse {
  0%, 100% { opacity: 0.22; }
  50%      { opacity: 0.55; }
}
@keyframes tlmRingSonar {
  0%   { transform: scale(1);    opacity: 0;    }
  20%  { opacity: 0.32; }
  100% { transform: scale(1.32); opacity: 0;    }
}

@media (max-width: 900px) {
  .tlm-root { width: 96vw; }
  .tlm-meta-bar { font-size: 10px; }
  .tlm-meta-bar .tlm-rule { margin: 0 10px; }
}
