/*
 * Typography, focus and the page shell. Everything here is world-agnostic: it reads the semantic
 * tokens pretor-worlds maps, so the same rule renders stone on the expedientes and dark on the
 * conversation without a second declaration.
 */

/*
 * CSS Zero's components set border-width and leave border-color to be inherited, which its own
 * base.css supplies and this file replaced. Without it every bordered component falls back to
 * currentColor, so a card on the account page drew a near-black frame where a hairline belongs.
 * One rule, and cards, inputs, tables and badges all pick up the world they are rendered in.
 */
* {
  border-color: var(--color-border);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/*
 * Cinzel is the Roman half of the brand and it carries the tradition, so it sets headings in stone.
 * The dark world drops to Inter for the same elements: on the site the AI column is deliberately
 * the sans one, and a serif heading over a chat bubble reads as a mistake rather than as heritage.
 */
.world-stone h1,
.world-stone h2,
.world-stone h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: .01em;
}

.world-dark h1,
.world-dark h2,
.world-dark h3 {
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
}

h1 { font-size: var(--step-2); }
h2 { font-size: var(--step-1); }
h3 { font-size: var(--step-0); }

a {
  color: var(--color-link);
  text-underline-offset: 3px;
}

/* Metadata is monospaced throughout: timestamps, agent names, codes, sizes. It is the site's own
   signal for "this is the machine talking", and reusing it keeps the two surfaces honest. */
time,
code,
.mono {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: .02em;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Keyboard users reach the conversation without tabbing the whole nav first. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-text-reversed);
  transition: top .2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
