/* ============================================================
   components.css — reusable primitives
   nav, buttons, eyebrow, chips, cards
   ============================================================ */

/* ---------- Announcement bar -----------------------------
   Ported from opus.com verbatim. Sits above the sticky nav, so it
   scrolls away while the nav stays pinned. The whole strip is one link.
   Its #0426CD matches --btn-primary-bg — the same Opus brand blue as the
   primary CTA, not the DS --blue-500. */

.announcement {
  display: block;
  position: relative;
  isolation: isolate;
  border-bottom: 1px solid var(--border);
  color: #fff;
  background: var(--btn-primary-bg);
}

.announcement:hover {
  color: #fff;
}

.announcement__inner {
  position: relative;
  z-index: 1;
  width: var(--rail-width);
  margin-inline: auto;
  min-height: 40px;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.announcement__text {
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  text-align: center;
  /* Single line on desktop; wraps rather than truncating on narrow. */
  white-space: nowrap;
}

.announcement__arrow {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  flex: none;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8H13M9 4L13 8L9 12' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8H13M9 4L13 8L9 12' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: transform var(--t-fast) ease;
}

.announcement:hover .announcement__arrow,
.announcement:focus-visible .announcement__arrow {
  transform: translateX(3px);
}

@media (max-width: 767px) {
  .announcement__inner {
    width: 100%;
    padding: 8px var(--gutter);
  }

  .announcement__text {
    white-space: normal;
    text-wrap: balance;
  }
}

/* ---------- Sticky nav ------------------------------------
   Lifted from opus.com so the header reads as the same site.
   The nav here carries no link list: brand on the left, and the same
   ghost + primary CTA pair opus.com uses on the right. */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  isolation: isolate;
  background: rgb(var(--white-rgb) / 0.62);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgb(var(--white-rgb) / 0.55);
}

.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgb(var(--white-rgb) / 0.42),
    transparent 44%
  );
}

.nav__inner {
  position: relative;
  z-index: 1;
  width: var(--rail-width);
  margin-inline: auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}

/* Ghost + primary pair, gap matching opus.com's .nav__actions. */
.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 24px;
  width: auto;
  -webkit-user-drag: none;
}

/* ---------- Buttons --------------------------------------
   opus.com's button system verbatim: 4px radius, 6px/14px padding,
   trailing arrow-up-right mask, lift on hover. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 20px;
  font-weight: 500;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--radius-btn);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--t-med) ease,
    color var(--t-med) ease,
    box-shadow var(--t-med) ease,
    transform var(--t-med) ease;
}

.btn:hover {
  transform: scale(1.03);
}

.btn::after {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4.5 4H11.5V11' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M4.5 11L11.5 4' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4.5 4H11.5V11' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M4.5 11L11.5 4' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 16px 16px;
  mask-size: 16px 16px;
  transition: transform var(--t-med) ease;
}

.btn:hover::after {
  transform: translate(2px, -2px);
}

.btn--primary {
  background: var(--btn-primary-bg);
  color: #fff;
}

.btn--primary:hover {
  background: var(--btn-primary-bg-hover);
  color: #fff;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn--ghost {
  background: var(--gray);
  color: #0c0c0e;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
}

.btn--ghost:hover {
  background: #e2e2e2;
  color: #0c0c0e;
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.1),
    0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ---------- Eyebrow -------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

/* Icons are inlined in the source rather than referenced from
   images/icons/. Their paths are authored with fill="currentColor",
   which does not resolve reliably inside a CSS mask-image, so they are
   tinted here via `color` on an inline <svg>. The standalone files in
   images/icons/ remain the design source of truth. */
.eyebrow__icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: block;
  color: var(--blue-500);
  fill: currentColor;
}

.eyebrow__text {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-500);
}

/* ---------- Small mono label ----------------------------- */

.label-mono {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-500);
}

.label-mono--muted {
  color: var(--fg-muted);
}

/* ---------- Chip link ------------------------------------ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--fg-base);
  border: 1px solid var(--bd-primary);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  transition:
    background var(--t-fast) ease,
    color var(--t-fast) ease;
}

.chip:hover {
  background: var(--bg-subtle);
  color: var(--fg-strong);
}

.chip--lg {
  padding: 8px 14px;
}

.chip__icon {
  width: 14px;
  height: 14px;
  flex: none;
  fill: currentColor;
}

/* ---------- Section header ------------------------------- */

.section-head {
  margin-bottom: 40px;
}

.section-head__title {
  font-size: var(--fs-display-3);
  line-height: 1.1;
  letter-spacing: var(--ls-display);
  text-wrap: pretty;
}

/* Trailing muted clause in a two-tone headline */
.section-head__title span {
  color: var(--fg-muted);
}

.section-head__lead {
  margin-top: 20px;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 62ch;
  text-wrap: pretty;
}

/* ---------- Card grid ------------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* ---------- Reduced motion ------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  .btn:hover,
  .btn:hover::after {
    transform: none;
  }
}
