/* Interaction skin ("design language v2"): hairline boxes, a blue edge that is strongest at the top-left corner and
   fades to nothing at the bottom-right, a faint wash from the same corner, quiet small-caps labels and serif italic
   outcomes. Shared by every ix-* module so they read as one system. Rules: sharp corners, no solid fills on containers,
   no shadows, blur, bevels or 3D, no pills, no bubbles, no count-up numbers. Tokens only; no hex colours. */

/* Tokens (--ix-*) live in tokens.css so pages without the interaction modules can use the same box language. */

/* Type roles ------------------------------------------------------------ */
.ix-label {
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.ix-title {
  font-size: var(--fs-h4);
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-1);
}

.ix-body { font-size: var(--fs-body); line-height: 1.55; color: var(--text-2); }

.ix-outcome {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-h3);
  line-height: 1.15;
  color: var(--text-1);
}

.ix-numeral {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 2rem + 4vw, 5.5rem);
  line-height: 1;
  color: var(--text-1);
}

/* The box: hairline outline, transparent centre -------------------------- */
.ix-box {
  position: relative;
  box-sizing: border-box;
  border: 1px solid var(--ix-hair);
  border-radius: 0;
  background: transparent;
  color: var(--text-2);
  transition: background var(--ix-t-fast) var(--ix-ease), color var(--ix-t-fast) var(--ix-ease), border-color var(--ix-t-fast) var(--ix-ease);
}

/* The edge: a hairline gradient border drawn with a mask, so there is no blur or shadow. */
.ix-box::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  background: linear-gradient(to bottom right, var(--ix-blue) 0%, transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ix-t-fast) var(--ix-ease);
}

@media (hover: hover) {
  .ix-box:is(button, a, [tabindex], [role="tab"], [role="radio"], .ix-hoverable):hover {
    background: linear-gradient(to bottom right, color-mix(in srgb, var(--ix-blue) var(--ix-wash-hover), transparent) 0%, transparent 62%);
    color: var(--text-1);
  }
  .ix-box:is(button, a, [tabindex], [role="tab"], [role="radio"], .ix-hoverable):hover::before { opacity: 0.6; }
}

.ix-box:is(.is-on, [aria-pressed="true"], [aria-selected="true"], [aria-checked="true"], [aria-expanded="true"], [aria-current="step"], [aria-current="true"]) {
  background: linear-gradient(to bottom right, color-mix(in srgb, var(--ix-blue) var(--ix-wash-on), transparent) 0%, transparent 62%);
  color: var(--text-1);
}

.ix-box:is(.is-on, [aria-pressed="true"], [aria-selected="true"], [aria-checked="true"], [aria-expanded="true"], [aria-current="step"], [aria-current="true"])::before { opacity: 1; }

.ix-box:active { background: linear-gradient(to bottom right, color-mix(in srgb, var(--ix-blue) var(--ix-wash-press), transparent) 0%, transparent 62%); }

.ix-box:focus-visible { outline: 2px solid var(--ix-blue); outline-offset: 3px; }

.ix-box:is(:disabled, [aria-disabled="true"]) { opacity: 0.4; border-color: color-mix(in srgb, var(--text-1) 8%, transparent); }

/* A static panel with the edge always on (result panels, document frames). */
.ix-box--edge::before { opacity: 0.7; }

/* Ruled list: rows share hairlines, no gaps and no cards. ------------------ */
.ix-ledger { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ix-rule); }
.ix-ledger > * { border-bottom: 1px solid var(--ix-hair); }

/* The selected item breathes: edge and wash dim and brighten slowly. Opacity only. */
@media (prefers-reduced-motion: no-preference) {
  .ix-box:is(.is-on, [aria-pressed="true"], [aria-selected="true"], [aria-checked="true"], [aria-current="step"])::before {
    animation: ix-pulse 4.4s ease-in-out infinite;
  }
}

@keyframes ix-pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ix-box, .ix-box::before { transition: none; }
}

/* The site-wide :focus-visible rule adds a rounded box-shadow ring; ix controls use the square outline only. */
[class*="ix-"]:focus-visible { box-shadow: none; border-radius: 0; }
