/* jaimesa.nz: shared type, color and focus tokens for the landing page and the CV. */

@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* True off-white with a trace of the accent's hue; one orange accent. The light-mode orange is
     darker than the dark-mode one so small text keeps 4.5:1 contrast. */
  --bg: oklch(0.985 0.003 44);
  --ink: oklch(0.23 0.012 44);
  --ink-2: oklch(0.45 0.012 44);
  --rule: oklch(0.88 0.008 44);
  --accent: oklch(0.56 0.155 44);
  --accent-strong: oklch(0.48 0.15 44);
  --focus: oklch(0.56 0.155 44);

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: clamp(3rem, 6vw, 5rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.2 0.008 40);
    --ink: oklch(0.93 0.006 40);
    --ink-2: oklch(0.75 0.01 40);
    --rule: oklch(0.34 0.01 40);
    --accent: oklch(0.74 0.15 42);
    --accent-strong: oklch(0.82 0.12 45);
    --focus: oklch(0.74 0.15 42);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 160ms var(--ease-out), text-decoration-color 160ms var(--ease-out);
}

a:hover {
  color: var(--accent-strong);
}

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

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
  vertical-align: -0.125em;
}

.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;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
