@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,700;1,400;1,700&display=swap");

/* reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

img,
picture {
  display: block;
  max-inline-size: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

@media (prefers-reduced-motion: no-preference) {
  html:focus-within {
    scroll-behavior: smooth;
  }
}

/* variables */
:root {
  --gray-0: hsl(210 17% 98%);
  --gray-1: hsl(210 17% 95%);
  --gray-2: hsl(210 16% 93%);
  --gray-3: hsl(210 14% 89%);
  --gray-4: hsl(210 14% 83%);
  --gray-5: hsl(210 11% 71%);
  --gray-6: hsl(210 7% 56%);
  --gray-7: hsl(210 9% 31%);
  --gray-8: hsl(210 10% 23%);
  --gray-9: hsl(210 11% 15%);
  --gray-10: hsl(214 14% 10%);
  --gray-11: hsl(216 16% 6%);
  --gray-12: hsl(210 40% 2%);

  --red-0: hsl(0 100% 98%);
  --red-1: hsl(0 100% 95%);
  --red-2: hsl(0 100% 89%);
  --red-3: hsl(0 100% 83%);
  --red-4: hsl(0 100% 76%);
  --red-5: hsl(0 100% 71%);
  --red-6: hsl(0 94% 65%);
  --red-7: hsl(0 86% 59%);
  --red-8: hsl(0 74% 54%);
  --red-9: hsl(0 65% 48%);
  --red-10: hsl(0 65% 42%);
  --red-11: hsl(0 65% 36%);
  --red-12: hsl(0 66% 30%);

  --step--2: clamp(0.7813rem, 0.7813rem + 0vw, 0.7813rem);
  --step--1: clamp(0.9375rem, 0.9375rem + 0vw, 0.9375rem);
  --step-0: clamp(1.125rem, 1.125rem + 0vw, 1.125rem);
  --step-1: clamp(1.35rem, 1.35rem + 0vw, 1.35rem);
  --step-2: clamp(1.62rem, 1.62rem + 0vw, 1.62rem);
  --step-3: clamp(1.944rem, 1.944rem + 0vw, 1.944rem);
  --step-4: clamp(2.3328rem, 2.3328rem + 0vw, 2.3328rem);
  --step-5: clamp(2.7994rem, 2.7994rem + 0vw, 2.7994rem);
  --step-6: clamp(3.3592rem, 3.3592rem + 0vw, 3.3592rem);
  --step-7: clamp(4.0311rem, 4.0311rem + 0vw, 4.0311rem);

  --space-3xs: clamp(0.3125rem, 0.3125rem + 0vw, 0.3125rem);
  --space-2xs: clamp(0.5625rem, 0.5408rem + 0.1087vw, 0.625rem);
  --space-xs: clamp(0.875rem, 0.8533rem + 0.1087vw, 0.9375rem);
  --space-s: clamp(1.125rem, 1.0815rem + 0.2174vw, 1.25rem);
  --space-m: clamp(1.6875rem, 1.6223rem + 0.3261vw, 1.875rem);
  --space-l: clamp(2.25rem, 2.163rem + 0.4348vw, 2.5rem);
  --space-xl: clamp(3.375rem, 3.2446rem + 0.6522vw, 3.75rem);
  --space-2xl: clamp(4.5rem, 4.3261rem + 0.8696vw, 5rem);
  --space-3xl: clamp(6.75rem, 6.4891rem + 1.3043vw, 7.5rem);

  --measure-s: 40ch;
  --measure-m: 60ch;
  --measure-l: 80ch;
  --measure-xl: 100ch;

  --font-base: system-ui;
  --font-display: "Poppins", serif;
  --weight-base: 400;
  --weight-display: 700;
}

/* global */
body {
  color-scheme: light;
  --link: var(--red-9);
  --text-1: var(--gray-12);
  --text-2: var(--gray-9);
  --surface-1: var(--gray-0);
  --surface-2: var(--gray-2);
  --surface-3: var(--gray-3);
  --surface-4: var(--gray-4);

  font-size: var(--step-0);
  font-family: var(--font-base);
  font-weight: var(--weight-base);
  min-block-size: 100svb;
  line-height: 1.5;
  padding-inline: var(--space-xs);

  color: var(--text-1);
  background: var(--surface-2);
}

@media (prefers-color-scheme: dark) {
  body {
    color-scheme: dark;

    --link: var(--red-7);
    --text-1: var(--gray-0);
    --text-2: var(--gray-3);
    --surface-1: var(--gray-9);
    --surface-2: var(--gray-8);
    --surface-3: var(--gray-7);
    --surface-4: var(--gray-6);
  }
}

:is(h1, h2, h3) {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: 1.1;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  line-height: 1;
}

h2 {
  font-size: var(--step-2);
}

:is(h3, h4) {
  font-size: var(--step-1);
}

a {
  color: var(--link);
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

body::before {
  z-index: -1;
  background-image: radial-gradient(var(--text-2) 1.45px, transparent 1.45px);
  background-size: 20px 20px;
  content: "";
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
  position: fixed;
}

nav ul {
  font-size: var(--step--1);
  list-style: none;
  margin: 0;
  padding: var(--space-2xs) var(--space-2xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

nav ul li:first-child {
  font-weight: var(--weight-display);
  margin-inline-end: auto;
}

nav a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--link);
}

footer {
  color: var(--text-2);
  font-size: var(--step--1);
  padding: var(--space-l) var(--space-m);
  margin-block-start: var(--space-m);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

footer > *:first-child {
  margin-inline-end: auto;
}

footer #languages button {
  padding: var(--space-3xs);
  cursor: pointer;
  border: none;
  background: none;
}

footer #languages button:hover {
  text-decoration: underline;
}

#logo {
  color: var(--text-2);
  margin-block: var(--space-l) var(--space-xl);
}

#logo p:first-child {
  font-size: var(--step-3);
  font-weight: var(--weight-base);
}

#logo p:first-child span {
  color: var(--text-1);
  font-size: var(--step-7);
  font-weight: var(--weight-display);
}

.btn-link {
  display: inline-block;
  text-transform: capitalize;
  padding: 1ex 1.5ex;
  color: var(--link);
  background: var(--surface-1);
  border: 1px solid var(--link);
  border-radius: 1e5px;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.btn-link:hover {
  color: var(--surface-1);
  background: var(--link);
}

/* utils */
.visually-hidden:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}
