/* schema.css — the data → Teramot → AI schematic */

.tm-schema {
  position: relative;
  padding: 100px 0 80px;
  background: var(--ground);
  border-top: 1px solid var(--rule);
}

/* Compact mode — full-height panel in the hero right column */

/* The anonymous <div class=""> wrapper between schema and perimeter */
.tm-schema.tm-schema--compact > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tm-schema.tm-schema--compact {
  padding: 0;
  background: transparent;
  border-top: 0;
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.tm-schema.tm-schema--compact .tm-schema-perimeter {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
}
.tm-schema.tm-schema--compact .tm-schema-board {
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: 20px;
  padding: 0;
  margin: 0;
  max-width: none;
  justify-items: stretch;
  align-items: stretch;
}
.tm-schema.tm-schema--compact .tm-schema-col {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.tm-schema.tm-schema--compact .tm-schema-col--core {
  width: auto;
  align-items: center;
  justify-content: center;
}
.tm-schema.tm-schema--compact .tm-schema-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
}
.tm-schema.tm-schema--compact .tm-schema-card {
  grid-template-columns: 22px minmax(0, 1fr);
  padding: 11px 15px;
  border-radius: 11px;
  font-size: 13px;
  gap: 11px;
  min-width: 0;
}
.tm-schema.tm-schema--compact .tm-schema-card > span:not([class]) {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm-schema.tm-schema--compact .tm-schema-card-meta { display: none; }
.tm-schema.tm-schema--compact .tm-schema-card-ico { font-size: 18px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.tm-schema.tm-schema--compact .tm-schema-ai-ico { width: 22px; height: 22px; border-radius: 5px; font-size: 14px; }
.tm-schema.tm-schema--compact .tm-schema-ai-ico--img img { width: 18px; height: 18px; }
.tm-schema.tm-schema--compact .tm-schema-core-foot { display: none; }
.tm-schema.tm-schema--compact .tm-schema-col-label {
  font-size: 11px;
  margin-bottom: 24px;
  letter-spacing: 0.16em;
}
/* Right column — AI cards clustered in center, not stretched top-to-bottom */
.tm-schema.tm-schema--compact .tm-schema-col--right .tm-schema-stack {
  justify-content: center;
  gap: 16px;
}
.tm-schema.tm-schema--compact .tm-schema-core {
  width: 210px;
  height: 210px;
}
.tm-schema.tm-schema--compact .tm-schema-core-ring-1 { width: 210px; height: 210px; }
.tm-schema.tm-schema--compact .tm-schema-core-ring-2 { width: 158px; height: 158px; }
.tm-schema.tm-schema--compact .tm-schema-core-ring-3 { width: 112px; height: 112px; }
.tm-schema.tm-schema--compact .tm-schema-mark { width: 70px; height: auto; }
.tm-schema.tm-schema--compact .tm-schema-pill {
  font-size: 11px;
  padding: 4px 10px;
}
.tm-schema.tm-schema--compact .tm-schema-col--sources::after,
.tm-schema.tm-schema--compact .tm-schema-col--core::after { content: none; }
.tm-schema.tm-schema--compact .tm-schema-wires {
  inset: 24px 0 0 0;
  height: calc(100% - 24px);
  display: block;
}

.tm-schema-head {
  text-align: center;
  margin: 0 auto 56px;
  max-width: 720px;
}
.tm-schema-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 14px;
}
.tm-schema-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

/* ── Board ────────────────────────────────────────────────── */

.tm-schema-board {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 8px;
}
@media (max-width: 900px) {
  .tm-schema-board {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .tm-schema-wires { display: none; }
}

.tm-schema-col {
  position: relative;
  z-index: 2;
}
.tm-schema-col-label {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 16px;
}

.tm-schema-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tm-schema-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(11,15,20,0.04);
  transition: transform var(--fast) var(--ease), box-shadow var(--base) var(--ease);
  min-width: 0;
}
.tm-schema-card > span:not([class]) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.tm-schema-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -8px rgba(11,15,20,0.12);
}
.tm-schema-card-ico {
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tm-schema-card-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
}

/* AI card variant — icon is a colored chip */
.tm-schema-ai-ico {
  width: 28px; height: 28px;
  border-radius: 7px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.tm-schema-ai-ico--img {
  background: transparent;
  border-radius: 0;
}
.tm-schema-ai-ico--img img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

/* Center — Teramot mark with concentric rings */
.tm-schema-col--core { text-align: center; }
.tm-schema-core {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tm-schema-core-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
}
.tm-schema-core-ring-1 { width: 200px; height: 200px; opacity: 0.55; }
.tm-schema-core-ring-2 { width: 150px; height: 150px; opacity: 0.75; }
.tm-schema-core-ring-3 {
  width: 110px; height: 110px;
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: 0 10px 30px -10px rgba(37, 61, 229, 0.25);
}
.tm-schema-mark {
  position: relative;
  z-index: 2;
}
.tm-schema-core-foot {
  margin-top: 12px;
}
.tm-schema-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(11,15,20,0.04);
}
.tm-schema-pill-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--brand-mint);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand-mint) 30%, transparent);
  animation: tm-schema-pulse 1.8s ease-in-out infinite;
}
@keyframes tm-schema-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand-mint) 30%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in oklab, var(--brand-mint) 0%, transparent); }
}

/* Wires SVG overlay */
.tm-schema-wires {
  position: absolute;
  inset: 24px 0 0 0;
  width: 100%;
  height: calc(100% - 24px);
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.tm-schema-footer {
  margin: 56px auto 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--text-md);
  color: var(--muted);
  max-width: 50ch;
}

/* ── Security cues: perimeter + SOC 2 badge + lock chips ──── */

.tm-schema-perimeter {
  position: relative;
  border: 1.5px dashed color-mix(in oklab, var(--accent) 32%, transparent);
  border-radius: 20px;
  padding: 16px 16px 14px;
  background: color-mix(in oklab, var(--accent) 2.5%, transparent);
}

.tm-schema-perimeter-label {
  position: absolute;
  top: -10px;
  left: 24px;
  background: var(--ground, var(--brand-paper, #FAFAF7));
  padding: 1px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  z-index: 4;
}
.tm-schema-perimeter-label i {
  font-size: 16px;
}

.tm-schema-soc2 {
  position: absolute;
  top: -12px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  box-shadow: 0 2px 6px -2px rgba(37, 61, 229, 0.18);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  z-index: 4;
}
.tm-schema-soc2 i { font-size: 16px; color: var(--accent); }

/* Lock chips that visually sit on the wires */
.tm-schema-lock {
  position: absolute;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  line-height: 1;
  box-shadow: 0 2px 6px -1px rgba(37, 61, 229, 0.35), 0 1px 2px rgba(11, 15, 20, 0.08);
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.tm-schema-lock i { font-size: 16px; color: #fff; line-height: 1; }

/* Positions — tuned to fall on each wire visually. */
.tm-schema-lock--l-1 { left: 42%; top: 30%; }
.tm-schema-lock--l-2 { left: 44%; top: 43%; }
.tm-schema-lock--l-3 { left: 44%; top: 57%; }
.tm-schema-lock--l-4 { left: 42%; top: 70%; }
.tm-schema-lock--r-1 { left: 58%; top: 34%; }
.tm-schema-lock--r-2 { left: 56%; top: 50%; }
.tm-schema-lock--r-3 { left: 58%; top: 66%; }

.tm-schema.tm-schema--compact .tm-schema-lock {
  width: 22px;
  height: 22px;
  border-width: 1.5px;
}
.tm-schema.tm-schema--compact .tm-schema-lock i { font-size: 13px; }

/* Compact mode tweaks — perimeter padding, label/badge smaller */
.tm-schema.tm-schema--compact .tm-schema-perimeter {
  padding: 32px 20px 24px;
  border-radius: 16px;
}
.tm-schema.tm-schema--compact .tm-schema-perimeter-label,
.tm-schema.tm-schema--compact .tm-schema-soc2 {
  font-size: 11px;
}
.tm-schema.tm-schema--compact .tm-schema-perimeter-label i,
.tm-schema.tm-schema--compact .tm-schema-soc2 i {
  font-size: 14px;
}
.tm-schema.tm-schema--compact .tm-schema-soc2 { padding: 4px 10px; right: 16px; }
.tm-schema.tm-schema--compact .tm-schema-perimeter-label { left: 18px; }

@media (max-width: 900px) {
  .tm-schema-lock { display: none; }
}
