/* Stavice design tokens and self-hosted fonts
   Source of truth: docs/LANDING_PAGE_DESIGN_SPEC.md (Section 3) */

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-variable.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Six named colours. There is no seventh. */
  --stv-dial: #F2F4F3;
  --stv-plate: #E3E6E5;
  --stv-scribe: #80888D;
  --stv-graphite: #49525A;
  --stv-ink: #0E1317;
  --stv-minium: #B3241B;

  /* Typography */
  --stv-font-text: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --stv-font-data: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing scale, 4px base */
  --stv-space-1: 4px;
  --stv-space-2: 8px;
  --stv-space-3: 12px;
  --stv-space-4: 16px;
  --stv-space-5: 24px;
  --stv-space-6: 32px;
  --stv-space-7: 48px;
  --stv-space-8: 64px;
  --stv-space-9: 96px;
  --stv-space-10: 128px;

  /* Layout geometry */
  --stv-container: 1200px;
  --stv-gutter: 24px;
  --stv-margin: 120px;
  --stv-measure: 62ch;
  --stv-row: 28px;
  --stv-control: 48px;

  /* Rules */
  --stv-rule-hair: 1px solid var(--stv-scribe);
  --stv-rule-firm: 1px solid var(--stv-ink);
  --stv-rule-heavy: 2px solid var(--stv-ink);
  --stv-rule-exception: 2px solid var(--stv-minium);

  /* Shape */
  --stv-radius: 0;

  /* Motion */
  --stv-scan: 320ms linear;
}

/* Base reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: var(--stv-radius);
}

html {
  background-color: var(--stv-dial);
  color: var(--stv-ink);
  font-family: var(--stv-font-text);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--stv-dial);
  color: var(--stv-ink);
  font-family: var(--stv-font-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
  font-variant-numeric: lining-nums tabular-nums;
  overflow-x: clip;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
  border-radius: var(--stv-radius);
}

button {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--stv-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:visited {
  color: var(--stv-ink);
}

:focus-visible {
  outline: 2px solid var(--stv-ink);
  outline-offset: 2px;
}

/* Skip link */
.stv-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--stv-ink);
  color: var(--stv-dial);
  padding: 12px 20px;
  font-weight: 500;
  text-decoration: none;
}

.stv-skip-link:focus {
  left: 16px;
  top: 16px;
  outline: 2px solid var(--stv-ink);
  outline-offset: 2px;
}

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

/* Type utilities */
.stv-display {
  font-family: var(--stv-font-text);
  font-weight: 500;
  font-size: 64px;
  line-height: 68px;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.stv-h2 {
  font-family: var(--stv-font-text);
  font-weight: 500;
  font-size: 36px;
  line-height: 42px;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.stv-h3 {
  font-family: var(--stv-font-text);
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.005em;
}

.stv-lede {
  font-family: var(--stv-font-text);
  font-weight: 400;
  font-size: 20px;
  line-height: 32px;
  letter-spacing: 0;
  text-wrap: pretty;
}

.stv-body {
  font-family: var(--stv-font-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
  letter-spacing: 0;
  max-width: var(--stv-measure);
  text-wrap: pretty;
}

.stv-small {
  font-family: var(--stv-font-text);
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0;
}

.stv-label {
  font-family: var(--stv-font-text);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
}

.stv-data {
  font-family: var(--stv-font-data);
  font-weight: 400;
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0;
}

.stv-data-strong {
  font-family: var(--stv-font-data);
  font-weight: 500;
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0;
}

.stv-data-large {
  font-family: var(--stv-font-data);
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.01em;
}

.stv-margin-no {
  font-family: var(--stv-font-data);
  font-weight: 500;
  font-size: 14px;
  line-height: 42px;
  color: var(--stv-graphite);
}

/* Controls */
.stv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--stv-control);
  padding: 0 24px;
  font-family: var(--stv-font-text);
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
}

.stv-btn--primary {
  background-color: var(--stv-ink);
  color: var(--stv-dial);
  border: 1px solid var(--stv-ink);
}

.stv-btn--primary:visited {
  color: var(--stv-dial);
}

.stv-btn--primary:hover,
.stv-btn--primary:active {
  background-color: var(--stv-graphite);
  border-color: var(--stv-graphite);
  color: var(--stv-dial);
  text-decoration: none;
}

.stv-btn--secondary {
  background-color: transparent;
  color: var(--stv-ink);
  border: 1px solid var(--stv-ink);
}

.stv-btn--secondary:visited {
  color: var(--stv-ink);
}

.stv-btn--secondary:hover,
.stv-btn--secondary:active {
  background-color: var(--stv-plate);
  text-decoration: none;
}

.stv-text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--stv-ink);
  font-family: var(--stv-font-text);
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.stv-text-btn:hover {
  text-decoration-thickness: 2px;
}

.stv-text-btn:disabled {
  color: var(--stv-graphite);
  text-decoration: none;
  cursor: default;
}

/* Brand lockup */
.stv-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 9px; /* 3u where u = 3px */
  text-decoration: none;
  color: var(--stv-ink);
}

.stv-lockup:hover {
  text-decoration: none;
}

.stv-lockup__mark {
  display: block;
  width: 24px;
  height: 15px;
  flex-shrink: 0;
  /* Cap height alignment: mark sits on baseline with top flush to cap height */
  transform: translateY(0px);
}

.stv-lockup__word {
  font-family: var(--stv-font-text);
  font-weight: 600;
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.stv-lockup--dark,
.stv-lockup--dark:visited {
  color: var(--stv-dial);
}

@media (max-width: 1023px) {
  .stv-display {
    font-size: 48px;
    line-height: 52px;
  }
}

@media (max-width: 767px) {
  .stv-display {
    font-size: 38px;
    line-height: 42px;
  }

  .stv-h2 {
    font-size: 28px;
    line-height: 34px;
  }

  .stv-h3 {
    font-size: 18px;
    line-height: 26px;
  }

  .stv-lede {
    font-size: 18px;
    line-height: 28px;
  }

  .stv-data-large {
    font-size: 18px;
    line-height: 26px;
  }

  .stv-margin-no {
    line-height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
