/* Standard OSiris + Horus two-seal footer attribution bar.
 * Tokens: --ohs-text, --ohs-text-hover, --ohs-mark, --ohs-dot-1, --ohs-dot-2, --ohs-state,
 *         --ohs-dot-1-hover, --ohs-dot-2-hover, --ohs-state-hover,
 *         --ohs-horus, --ohs-horus-hover, --ohs-horus-eye, --ohs-horus-eye-hover,
 *         --ohs-horus-line, --ohs-horus-line-hover, --ohs-line-hover, --ohs-surface-hover, --ohs-focus.
 * The rule (the CEO, 27 Nov 2026): plain at rest, colour on hover, on every property. At rest the
 * mono tone takes the page's own colours. On hover, focus or press the OSiris dots and square take
 * the OSiris colours and the Horus strip turns gold (marks only; text is never gold).
 * Accent-invariant: none of the tokens read --a / --accent / data-accent. */
.ohs {
  --ohs-text: currentColor;
  --ohs-text-hover: var(--ohs-text);
  --ohs-mark: currentColor;
  --ohs-dot-1: var(--ohs-mark);
  --ohs-dot-2: var(--ohs-mark);
  --ohs-state: var(--ohs-mark);
  --ohs-dot-1-hover: #00918f;
  --ohs-dot-2-hover: #ff2e93;
  --ohs-state-hover: #6c1cff;
  --ohs-horus: var(--ohs-mark);
  --ohs-horus-hover: #a67c00;
  --ohs-horus-eye: #ffffff;
  --ohs-horus-eye-hover: #ffffff;
  --ohs-horus-line: currentColor;
  --ohs-horus-line-hover: #a67c00;
  --ohs-line-hover: currentColor;
  --ohs-surface-hover: transparent;
  --ohs-focus: var(--ohs-text-hover);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  width: 100%;
  max-width: 100%;
  color: var(--ohs-text);
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: normal;
  text-transform: none;
}

.oxs .ohs,
.osi .ohs {
  --ohs-text: var(--ink-secondary);
  --ohs-text-hover: var(--ink-primary);
  --ohs-mark: var(--ink-primary);
  --ohs-horus: var(--ink-primary);
  --ohs-horus-hover: #a67c00;
  --ohs-horus-eye: var(--bg-surface);
  --ohs-horus-eye-hover: #ffffff;
  --ohs-horus-line: var(--ink-muted);
  --ohs-horus-line-hover: #cab066;
  --ohs-line-hover: var(--ink-muted);
  --ohs-surface-hover: var(--bg-canvas);
  --ohs-focus: var(--ink-primary);
}

/* On a dark ground the hover colours are the lighter OSiris pair. A client site on a dark ground
 * that has none of these hooks passes surface="on-dark". */
[data-theme='obsidian'] .ohs,
[data-theme='night'] .ohs,
.on-dark .ohs,
.ohs[data-surface='on-dark'] {
  --ohs-dot-1-hover: #1fe0d0;
  --ohs-state-hover: #a07bff;
}

.ohs[data-tone='brand'] {
  --ohs-dot-1: #00918f;
  --ohs-dot-2: #ff2e93;
  --ohs-state: #6c1cff;
  --ohs-horus: var(--ohs-mark);
}

[data-theme='obsidian'] .ohs[data-tone='brand'],
[data-theme='night'] .ohs[data-tone='brand'],
.on-dark .ohs[data-tone='brand'],
.ohs[data-tone='brand'][data-surface='on-dark'] {
  --ohs-dot-1: #1fe0d0;
  --ohs-dot-2: #ff2e93;
  --ohs-state: #a07bff;
  --ohs-horus: var(--ohs-mark);
}

[data-theme='paper'] .ohs[data-tone='brand'],
.on-light .ohs[data-tone='brand'],
.ohs[data-tone='brand'][data-surface='on-light'] {
  --ohs-dot-1: #00918f;
  --ohs-dot-2: #ff2e93;
  --ohs-state: #6c1cff;
  --ohs-horus: var(--ohs-mark);
}

.ohs .ohs-seal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  margin-inline: -13px;
  max-width: calc(100% + 26px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ohs-text);
  text-decoration: none;
  font-style: normal;
  letter-spacing: normal;
  box-sizing: border-box;
  transition:
    color 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease;
}

/* Hover brings the colour and brightens the words; it draws no frame. */
@media (hover: hover) {
  .ohs .ohs-seal:hover {
    color: var(--ohs-text-hover);
  }

  .ohs .ohs-seal-osiris:hover .ohs-d1 {
    fill: var(--ohs-dot-1-hover);
  }

  .ohs .ohs-seal-osiris:hover .ohs-d2 {
    fill: var(--ohs-dot-2-hover);
  }

  .ohs .ohs-seal-osiris:hover .ohs-st {
    fill: var(--ohs-state-hover);
  }

  .ohs .ohs-seal-horus:hover .ohs-horus-strip {
    border-color: var(--ohs-horus-line-hover);
  }

  .ohs .ohs-seal-horus:hover .ohs-horus-tile {
    background: var(--ohs-horus-hover);
  }

  .ohs .ohs-seal-horus:hover .ohs-wedjat {
    fill: var(--ohs-horus-eye-hover);
  }

  .ohs .ohs-seal-horus:hover .ohs-status {
    background: var(--ohs-horus-hover);
  }
}

/* Keyboard focus and press get the same colour, plus a quiet ground and line. */
.ohs .ohs-seal:focus-visible,
.ohs .ohs-seal:active {
  color: var(--ohs-text-hover);
  background: var(--ohs-surface-hover);
  border-color: var(--ohs-line-hover);
}

.ohs .ohs-seal:focus-visible {
  outline: 2px solid var(--ohs-focus);
  outline-offset: 2px;
}

.ohs .ohs-seal-osiris:focus-visible .ohs-d1,
.ohs .ohs-seal-osiris:active .ohs-d1 {
  fill: var(--ohs-dot-1-hover);
}

.ohs .ohs-seal-osiris:focus-visible .ohs-d2,
.ohs .ohs-seal-osiris:active .ohs-d2 {
  fill: var(--ohs-dot-2-hover);
}

.ohs .ohs-seal-osiris:focus-visible .ohs-st,
.ohs .ohs-seal-osiris:active .ohs-st {
  fill: var(--ohs-state-hover);
}

.ohs .ohs-seal-horus:focus-visible .ohs-horus-strip,
.ohs .ohs-seal-horus:active .ohs-horus-strip {
  border-color: var(--ohs-horus-line-hover);
}

.ohs .ohs-seal-horus:focus-visible .ohs-horus-tile,
.ohs .ohs-seal-horus:active .ohs-horus-tile {
  background: var(--ohs-horus-hover);
}

.ohs .ohs-seal-horus:focus-visible .ohs-wedjat,
.ohs .ohs-seal-horus:active .ohs-wedjat {
  fill: var(--ohs-horus-eye-hover);
}

.ohs .ohs-seal-horus:focus-visible .ohs-status,
.ohs .ohs-seal-horus:active .ohs-status {
  background: var(--ohs-horus-hover);
}

/*
 * OSiris seal: "created by" sits on the same line as the wordmark. The wordmark's letters stand
 * 12 units above the bottom of its 176-unit box, so the box drops by that share of its height.
 * Padding, not a minimum height, keeps the 44px touch target, so the pair stays centred.
 */
.ohs .ohs-seal-osiris {
  align-items: baseline;
  min-height: 0;
  padding-block: 9px;
}

.ohs .ohs-label,
.ohs .ohs-horus-clause,
.ohs .ohs-build-text {
  white-space: nowrap;
}

.ohs svg.ohs-wordmark {
  display: block;
  width: auto;
  height: 20px;
  margin-bottom: -1.36px;
  flex: none;
  shape-rendering: geometricPrecision;
}

/*
 * Horus seal: the words, then one strip. The strip is the eye tile with the build beside it inside
 * one thin line, and it is the part that takes the colour.
 */
.ohs .ohs-horus-strip {
  display: inline-flex;
  align-items: center;
  flex: none;
  box-sizing: border-box;
  height: 20px;
  border: 1px solid var(--ohs-horus-line);
  transition: border-color 0.16s ease;
}

.ohs .ohs-horus-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: none;
  background: var(--ohs-horus);
  transition: background-color 0.16s ease;
}

.ohs svg.ohs-horus {
  display: block;
  width: auto;
  height: 9px;
  flex: none;
  shape-rendering: geometricPrecision;
}

.ohs .ohs-build {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-inline: 7px;
  white-space: nowrap;
}

/*
 * Decorative centre between the seals: short thin rule, triad, short thin rule, as on the
 * approved separator. It stays short (about 180px) and sits centred; the space either side is empty.
 */
.ohs .ohs-mid {
  display: flex;
  flex: 0 1 180px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 48px;
  margin-inline: auto;
  color: var(--ohs-text);
}

.ohs .ohs-rule {
  flex: 1 1 8px;
  min-width: 8px;
  height: 1px;
  background: var(--ohs-horus-line);
  opacity: 0.6;
}

.ohs .ohs-fg {
  fill: var(--ohs-mark);
}

.ohs .ohs-d1 {
  fill: var(--ohs-dot-1);
  transition: fill 0.16s ease;
}

.ohs .ohs-d2 {
  fill: var(--ohs-dot-2);
  transition: fill 0.16s ease;
}

.ohs .ohs-st {
  fill: var(--ohs-state);
  transition: fill 0.16s ease;
}

.ohs .ohs-wedjat {
  fill: var(--ohs-horus-eye);
  transition: fill 0.16s ease;
}

.ohs .ohs-status {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--ohs-horus);
  transition: background-color 0.16s ease;
}

/* One centred column: row 1 "created by" + wordmark, row 2 rules + triad, row 3 "protected by Horus." + the strip. */
@media (max-width: 640px) {
  .ohs {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
  }

  .ohs .ohs-seal {
    margin-inline: 0;
    max-width: 100%;
  }

  .ohs .ohs-seal-osiris {
    padding-block: 12px;
  }

  .ohs svg.ohs-wordmark {
    height: 16px;
    margin-bottom: -1.09px;
  }

  .ohs .ohs-mid {
    flex: none;
    width: min(100%, 180px);
    min-width: 0;
  }

  .ohs .ohs-seal-horus {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ohs .ohs-seal,
  .ohs .ohs-horus-strip,
  .ohs .ohs-horus-tile,
  .ohs .ohs-wedjat,
  .ohs .ohs-status,
  .ohs .ohs-d1,
  .ohs .ohs-d2,
  .ohs .ohs-st {
    transition: none;
  }
}
