/* Base styles and the shared component vocabulary (public site + admin panel). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--size-header) + var(--space-md));
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-heading);
  color: var(--color-primary);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-deep);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.on-dark :focus-visible,
.on-dark:focus-visible {
  outline-color: var(--color-on-dark);
}

::selection {
  background: var(--color-primary);
  color: var(--color-on-dark);
}

[hidden] {
  display: none !important;
}

.icon {
  flex: none;
}

/* ---------------------------------------------------------------- type */

.t-hero {
  font-size: var(--type-hero);
}

.t-display-lg {
  font-size: var(--type-display-lg);
}

.t-display {
  font-size: var(--type-display);
}

.t-title-lg {
  font-size: var(--type-title-lg);
}

.t-title {
  font-size: var(--type-title);
  font-weight: 600;
}

.t-lead {
  font-size: var(--type-body-lg);
  color: var(--color-muted);
}

.t-small {
  font-size: var(--type-body-sm);
}

.t-caption {
  font-size: var(--type-caption);
  color: var(--color-muted);
}

.t-muted {
  color: var(--color-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: var(--type-body-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.eyebrow::before {
  content: "";
  width: var(--space-lg);
  height: 2px;
  background: var(--color-accent);
}

.on-dark .eyebrow {
  color: var(--color-on-dark);
}

/* ---------------------------------------------------------------- layout */

.container {
  width: 100%;
  max-width: calc(var(--layout-grid) + 2 * var(--layout-gutter));
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

.container--content {
  max-width: calc(var(--layout-content) + 2 * var(--layout-gutter));
}

.readable {
  max-width: var(--layout-readable);
}

.stack > * + * {
  margin-top: var(--space-md);
}

.stack-sm > * + * {
  margin-top: var(--space-sm);
}

.stack-lg > * + * {
  margin-top: var(--space-lg);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

.cluster--sm {
  gap: var(--space-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: var(--space-sm);
  z-index: 200;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: var(--color-on-dark);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: var(--color-on-dark);
}
