/* ============================================================
   Detail — engraved seals, bespoke sigils, full-temario panels,
   enriched Legión, hero seal. Layered on top of the base system.
   ============================================================ */

/* --- Engraved seal medallion (replaces generic icon boxes) --- */
.seal {
  --seal: var(--gold);
  --seal-soft: oklch(0.66 0.15 62 / 0.5);
  --seal-faint: oklch(0.66 0.15 62 / 0.28);
  position: relative;
  display: grid; place-items: center;
  width: 54px; height: 54px; flex: none;
  border-radius: 50%;
  color: var(--seal);
  background:
    radial-gradient(circle at 50% 36%, oklch(0.66 0.15 62 / 0.22), transparent 62%),
    var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--seal-soft), 0 3px 12px -6px oklch(0 0 0 / 0.8);
}
.seal::before { /* engraved radial tick ring */
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: repeating-conic-gradient(var(--seal) 0deg 1.3deg, transparent 1.3deg 9deg);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%, #000 69%, transparent 70%);
          mask: radial-gradient(circle, transparent 60%, #000 61%, #000 69%, transparent 70%);
  opacity: 0.5;
}
.seal::after { /* inner hairline ring */
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  border: 1px solid var(--seal-faint);
}
.seal svg { width: 24px; height: 24px; position: relative; z-index: 1; }
.seal--arcane {
  --seal: var(--arcane);
  --seal-soft: oklch(0.6 0.13 230 / 0.5);
  --seal-faint: oklch(0.6 0.13 230 / 0.3);
  background: radial-gradient(circle at 50% 36%, oklch(0.6 0.13 230 / 0.2), transparent 62%), var(--bg-2);
}
.seal--lg { width: 62px; height: 62px; }
.seal--lg svg { width: 28px; height: 28px; }
.seal--sm { width: 44px; height: 44px; }
.seal--sm svg { width: 20px; height: 20px; }

/* Hexagon rune (bento) — forged plate instead of rounded box */
.rune {
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0% 50%);
  border-radius: 0;
  border: 0;
  box-shadow: inset 0 0 0 1px oklch(0.66 0.15 62 / 0.4);
  background: radial-gradient(120% 120% at 50% 15%, oklch(0.66 0.15 62 / 0.25), transparent 70%), var(--bg-2);
  width: 50px; height: 50px;
}
.rune--arcane { box-shadow: inset 0 0 0 1px oklch(0.6 0.13 230 / 0.42); background: radial-gradient(120% 120% at 50% 15%, oklch(0.6 0.13 230 / 0.25), transparent 70%), var(--bg-2); }

/* --- Agent avatar as a seal --- */
.agent__avatar { width: 56px; height: 56px; border-radius: 50%; }
.agent__avatar.seal { border: 0; }

/* --- Rank medal as a seal --- */
.rank__medal { border: 0; }
.rank__medal.seal { --seal: var(--faint); box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12), 0 3px 12px -6px oklch(0 0 0 / 0.8); background: var(--bg-2); }
.rank__medal.seal::after { border-color: oklch(1 0 0 / 0.12); }
.rank.is-lit .rank__medal.seal, .rank:hover .rank__medal.seal { --seal: var(--gold); box-shadow: inset 0 0 0 1px oklch(0.66 0.15 62 / 0.55), 0 3px 16px -6px var(--gold-glow); }
.rank[data-final] .rank__medal.seal { --seal: var(--gold); box-shadow: inset 0 0 0 1px oklch(0.66 0.15 62 / 0.65), 0 0 26px -6px var(--gold-glow); }

/* ============================================================
   Hero seal — the Order's seal (guilloché + circular text)
   ============================================================ */
.hero-seal { position: relative; width: 100%; max-width: 460px; margin-inline: auto; aspect-ratio: 1; }
.hero-seal svg { width: 100%; height: 100%; overflow: visible; }
.hero-seal__glow { position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, var(--ember-glow), transparent 68%); filter: blur(38px); z-index: -1; }
.hero-seal .rotate-cw { transform-box: fill-box; transform-origin: center; animation: spin-slow 60s linear infinite; }
.hero-seal .rotate-ccw { transform-box: fill-box; transform-origin: center; animation: spin-slow 90s linear infinite reverse; }
.hero-seal .core-pulse { transform-box: fill-box; transform-origin: center; animation: seal-pulse 5s var(--ease-in-out) infinite; }
@keyframes seal-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.86; } }
.hero-seal__badge {
  position: absolute; bottom: -2%; left: 50%; transform: translateX(-50%);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.5rem; box-shadow: var(--sh-3);
  font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap; z-index: 2;
}
.hero-seal__badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

/* ============================================================
   Full-temario product panels (value ladder)
   ============================================================ */
.products { grid-template-columns: 1fr; gap: 0.85rem; max-width: 1000px; }

.uprod {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  background: linear-gradient(180deg, oklch(1 0 0 / 0.02), transparent 26%), var(--surface);
  overflow: clip;
  transition: border-color var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.uprod.is-open { border-color: oklch(0.66 0.15 62 / 0.4); }
.uprod--arcane.is-open { border-color: oklch(0.6 0.13 230 / 0.4); }
.uprod[data-star] { border-color: oklch(0.66 0.15 62 / 0.35); }
.uprod.is-hidden { display: none; }

/* Locked auditor seals read muted */
.agent--locked .seal { --seal: var(--muted); --seal-soft: oklch(1 0 0 / 0.12); --seal-faint: oklch(1 0 0 / 0.12); box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12), 0 3px 12px -6px oklch(0 0 0 / 0.8); }

.uprod__head {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto;
  gap: clamp(0.9rem, 2vw, 1.4rem); align-items: start; text-align: left;
  padding: clamp(1.1rem, 2.3vw, 1.5rem) clamp(1.1rem, 2.3vw, 1.6rem);
}
.uprod__titles { min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.uprod__kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.uprod__name { font-family: var(--font-display); font-size: var(--step-2); color: var(--ink); line-height: 1.08; letter-spacing: -0.02em; }
.uprod__promise { color: var(--muted); font-size: 0.94rem; max-width: 56ch; }
.uprod__agent-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.7rem; margin-top: 0.35rem; }
.uprod__agent { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.86rem; color: var(--arcane); font-weight: 600; }
.uprod__agent svg { width: 15px; height: 15px; }
.uprod--arcane .uprod__agent { color: var(--arcane); }
.uprod:not(.uprod--arcane) .uprod__agent { color: var(--gold); }
.uprod__agent-rol { font-size: 0.82rem; color: var(--faint); }

.uprod__aside { display: flex; flex-direction: column; align-items: flex-end; gap: 0.7rem; flex: none; }
.uprod__price { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.uprod__price .price { font-size: 1.1rem; }
.uprod__starflag { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); }
.uprod__starflag svg { width: 12px; height: 12px; }
.uprod__more { display: inline-flex; align-items: center; gap: 0.7rem; }
.uprod__more-txt { font-family: var(--font-mono); font-size: 0.74rem; color: var(--faint); white-space: nowrap; }
.uprod .module__chev { width: 38px; height: 38px; }
.uprod.is-open .module__chev { transform: rotate(180deg); color: var(--gold); border-color: var(--gold); }

.uprod__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-4) var(--ease-out); }
.uprod.is-open .uprod__body { grid-template-rows: 1fr; }
.uprod__body-inner { overflow: hidden; }
.uprod__pad { padding: 0.4rem clamp(1.1rem, 2.3vw, 1.6rem) clamp(1.3rem, 2.3vw, 1.7rem); }

.uprod__note {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.85rem 1.1rem; margin-bottom: 1.4rem; border-radius: var(--r-2);
  background: oklch(0.66 0.15 62 / 0.07); border: 1px solid oklch(0.66 0.15 62 / 0.2);
}
.uprod--arcane .uprod__note { background: oklch(0.6 0.13 230 / 0.08); border-color: oklch(0.6 0.13 230 / 0.22); }
.uprod__note svg { width: 18px; height: 18px; color: var(--gold); flex: none; margin-top: 2px; }
.uprod--arcane .uprod__note svg { color: var(--arcane); }
.uprod__note p { font-size: 0.9rem; color: var(--ink-2); }

.uprod__mods { display: grid; gap: 1.5rem; }
.uprod__mod { padding-top: 1.3rem; border-top: 1px solid var(--hair); }
.uprod__mod:first-child { padding-top: 0.4rem; border-top: 0; }
.uprod__mod-head { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.uprod__mod-num { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); flex: none; }
.uprod--arcane .uprod__mod-num { color: var(--arcane); }
.uprod__mod-title { font-family: var(--font-display); font-size: 1.12rem; color: var(--ink); letter-spacing: -0.01em; }

/* ============================================================
   Enriched Legión cards
   ============================================================ */
.legion { grid-template-columns: repeat(3, 1fr); }
.ally { flex-direction: column; align-items: stretch; gap: 0.9rem; padding: 1.4rem; }
.ally__top { display: flex; align-items: center; gap: 0.9rem; }
.ally__meta { min-width: 0; }
.ally__prod { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.86rem; color: var(--ink-2); padding-top: 0.9rem; border-top: 1px solid var(--hair); }
.ally__prod svg { width: 14px; height: 14px; color: var(--arcane); flex: none; margin-top: 3px; }
.ally__note { font-size: 0.82rem; color: var(--gold); line-height: 1.45; }
.ally[data-star] { border-color: oklch(0.66 0.15 62 / 0.35); background: radial-gradient(120% 120% at 100% 0%, oklch(0.66 0.15 62 / 0.1), transparent 55%), var(--surface); }

@media (max-width: 900px) {
  .legion { grid-template-columns: 1fr 1fr; }
  .uprod__head { grid-template-columns: auto 1fr; }
  .uprod__aside { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; padding-top: 0.4rem; border-top: 1px solid var(--hair); }
  .uprod__price { flex-direction: row; align-items: center; gap: 0.7rem; }
}
@media (max-width: 560px) {
  .legion { grid-template-columns: 1fr; }
  .uprod__more-txt { display: none; }
  .uprod__name { font-size: 1.3rem; }
}
