/* Done by Default - base: reset, typography, layout primitives */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  /* Fine engineering grid paper - tiled inline SVG, few bytes */
  background-image:
    linear-gradient(to right, rgba(30, 58, 95, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 58, 95, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--color-text);
  text-wrap: balance;
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
  font-weight: 600;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-link-hover);
}

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

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section {
  padding-block: var(--space-2xl);
}

/* Accent typographic device - Martian Mono spec label / kicker */
.kicker {
  font-family: var(--font-accent);
  font-weight: 500;
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.kicker::before {
  content: "";
  width: 1.8em;
  height: 1px;
  background: var(--color-accent);
}

.mono {
  font-family: var(--font-accent);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* Keep hyphenated compounds whole so the hyphen never becomes a line break */
.nowrap {
  white-space: nowrap;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--color-dark);
  color: var(--color-text-invert);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
  color: var(--color-text-invert);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Registration-mark corner motif (reusable) */
.reg-corners {
  position: relative;
}

.reg-corners::before,
.reg-corners::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--color-accent);
  border-style: solid;
  pointer-events: none;
}

.reg-corners::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.reg-corners::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1px 1px 0;
}
