/* Element defaults: fonts, base typography, links, selection, focus states. */

/*
  Headings and labels are set in the system mono (see the type note in tokens.css).
  Reading text is Ubuntu (Ubuntu Font Licence, self-hosted Latin files), Frankie's
  pick for the body in Sept 2026, replacing General Sans. It ships 400, 500 and 700;
  a request for 600 resolves to the 700 file rather than a synthesized weight.

  Coolvetica has no @font-face and needs none: the logo lockup and wordmark are
  outlined vector artwork in assets/brand/. See ARCHITECTURE.md §2.
*/
@font-face {
  font-family: 'Ubuntu';
  src: url('/assets/fonts/ubuntu-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Ubuntu';
  src: url('/assets/fonts/ubuntu-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Ubuntu';
  src: url('/assets/fonts/ubuntu-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* The page is the scanned paper (see --texture-scan in tokens.css). It lives on
   html so it covers the whole canvas, however short the page. */
html {
  background-color: var(--paper);
  background-image: var(--texture-scan);
  background-size: var(--texture-scan-size);
  background-blend-mode: multiply;
  color-scheme: light;
}

body {
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
}

/*
  The dark bands get their own tooth.

  The paper scan multiplies, and multiplying into a near-black ground does nothing,
  so every ink surface would be perfectly smooth while the paper around it has
  fibres. This lays a white grain over them instead. Applied to the surface itself
  rather than to a wrapper, and never to .site-header: a filter or a transform there
  would make it a containing block and break the mobile nav panel (see the note on
  .site-header in components.css).
*/
.marquee,
.site-footer,
.cs-results {
  position: relative;
}

.marquee::after,
.site-footer::after,
.cs-results::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--texture-ink);
  background-size: 320px 320px;
  opacity: 0.55;
  mix-blend-mode: soft-light;
}

/* Mono headings sit tighter than the mono's default spacing, which is built for
   code; at display sizes the open fit reads as gappy. One weight throughout: the
   hierarchy comes from size, never from bold. */
h1, h2, h3, h4 {
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-tight);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* Emphasis stays in the face it sits in: a real Menlo italic inside a heading, and
   Ubuntu slanted inside body copy. */
em, i {
  font-style: italic;
}

p {
  max-width: 66ch;
}

a {
  transition: color var(--duration-short) var(--ease-default);
}

::selection {
  background: var(--color-accent);
  color: var(--color-ink-text);
}

/* Focus states must stay visible - never suppressed. */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Elements that only take focus programmatically (tabindex="-1", such as <main>
   after the entry gate hands focus over) should not wear a ring: nothing the
   visitor did put it there. */
[tabindex="-1"]:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-5);
  background: var(--color-ink);
  color: var(--color-ink-text);
  border-radius: var(--radius-sm);
  transition: top var(--duration-short) var(--ease-default);
}

.skip-link:focus {
  top: var(--space-4);
}
