/* Card of a promise: the "prom", "glow", "spot", "proof" and "est" rules of the Unisson model, and its code colours.
   The host is display: contents, so the article is the grid item of bythium-pack-promises. */
:host {
  display: contents;
}
:host([hidden]) {
  display: none;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
[part="heading"],
p {
  margin: 0;
}

/* glow border + spotlight */
[part="card"] {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: var(--pack-panel);
  border: 1px solid var(--pack-line);
  box-shadow: var(--pack-shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--pack-ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: normal;
  font-feature-settings: normal;
}
[part="card"]::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--pack-c1), transparent 35%, transparent 65%, var(--pack-c2));
  opacity: 0.55;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(var(--pack-ink) 0 0) content-box,
    linear-gradient(var(--pack-ink) 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(var(--pack-ink) 0 0) content-box exclude,
    linear-gradient(var(--pack-ink) 0 0);
}
[part="card"]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--pack-a1), var(--pack-a2) 45%, transparent 75%);
}
[part="card"]:hover::before {
  opacity: 0.55;
}
[part="card"] > * {
  position: relative;
}

[part="number"] {
  font:
    700 12px ui-monospace,
    "JetBrains Mono",
    Menlo,
    Consolas,
    monospace;
  color: var(--pack-link);
}
[part="heading"] {
  font:
    700 20px / 1.25 Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  letter-spacing: -0.02em;
}
[part="text"] {
  color: var(--pack-mut);
  font-size: 15px;
}
[part="status"] {
  display: inline-block;
  margin-block-start: 2px;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px dashed var(--pack-c4);
  font:
    600 11px ui-monospace,
    "JetBrains Mono",
    Menlo,
    Consolas,
    monospace;
  color: var(--pack-ink);
}

[part="proof"] {
  margin-block-start: auto;
  border-radius: 10px;
  border: 1px solid var(--pack-line);
  background: var(--pack-code);
  overflow: hidden;
}
[part="caption"] {
  padding: 5px 12px;
  border-block-end: 1px solid var(--pack-line);
  font:
    600 11px ui-monospace,
    "JetBrains Mono",
    Menlo,
    Consolas,
    monospace;
  color: var(--pack-mut);
}
[part="code"] {
  margin: 0;
  padding: 12px;
  font:
    12px / 1.6 ui-monospace,
    "JetBrains Mono",
    Menlo,
    Consolas,
    monospace;
  color: var(--pack-codeink);
  overflow-inline: auto;
}
[part="code"] code {
  font: inherit;
}
[part="code"]:focus-visible {
  outline: 2px solid var(--pack-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* code colouring */
.t {
  color: var(--pack-tok-t);
}
.s {
  color: var(--pack-tok-s);
}
.c {
  color: var(--pack-tok-c);
}
.k {
  color: var(--pack-tok-k);
}
.p {
  color: var(--pack-c3);
}

/* The spotlight fades in only when motion is welcome, as the model's reduced-motion rule leaves it. */
@media (prefers-reduced-motion: no-preference) {
  [part="card"]::before {
    transition: opacity 0.3s;
  }
}
/* Forced colours: the glow border and the spotlight are decoration; the plain border and the text stay. */
@media (forced-colors: active) {
  [part="card"]::before,
  [part="card"]::after {
    display: none;
  }
  [part="status"] {
    border-color: CanvasText;
  }
}
