@font-face {
  font-family: "font";
  src: url("../font/FunnelDisplay.ttf") format("truetype");
  font-weight: 200 700;
  font-display: swap;
}

/* tokens */

:root {
  color-scheme: light dark;

  --mode: 0%;

  --brand: 345, 91%, 48%;
  --base: 345, 91%, 48%;
  --spot: 34, 100%, 71%;

  --wht: 0, 0%, calc(100% - var(--mode));
  --blk: 0, 0%, calc(var(--mode) + 10%);
  --hr: hsla(var(--blk), 0.1);

  --sp: clamp(2rem, calc(1.4286vw + 1.7143rem), 3rem);
  --sp-xs: calc(var(--sp) * 0.566);
  --sp-s: calc(var(--sp) * 0.752);
  --sp-m: var(--sp);
  --sp-l: calc(var(--sp) * 1.33);
  --sp-xl: calc(var(--sp) * 1.769);
  --sp-xx: calc(var(--sp) * 2.353);

  --fs: clamp(0.938rem, calc(0.1329vw + 0.9114rem), 1.031rem);
  --fs-xs: calc(var(--fs) * 0.75);
  --fs-s: calc(var(--fs) * 0.85);
  --fs-m: var(--fs);
  --fs-l: calc(var(--fs) * 1.25);

  --hs: clamp(1.2rem, calc(1.1429vw + 0.9714rem), 2rem);
  --h6: var(--hs);
  --h5: var(--hs);
  --h4: var(--hs);
  --h3: calc(var(--hs) * 1.1);
  --h2: calc(var(--hs) * 1.2);
  --h1: calc(var(--hs) * 1.3);
  --h-h: calc(var(--hs) * 2);

  --rs-s: 0.25rem;
  --rs-m: 0.5rem;
  --rs-l: 1rem;

  --font-text: "font", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: ui-monospace, "Cascadia Code", monospace;
  --transition: 200ms ease;
  --max-width: 75rem;
  --container-width: min(var(--max-width), 100% - var(--sp-m) * 2.2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --mode: 95%;
  }
}

@media (prefers-contrast: more) {
  :root {
    --hr: hsla(var(--blk), 0.5);
  }

  :focus-visible {
    outline-width: 4px;
    outline-offset: 4px;
  }

  a:not([class]) {
    text-decoration-thickness: 2px;
  }
}

/* reset */

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

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

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

input,
button,
textarea,
select {
  font: inherit;
}

textarea {
  resize: vertical;
}

fieldset {
  border: none;
  padding: 0;
}

address {
  font-style: normal;
}

details > summary {
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
}

[hidden] {
  display: none !important;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* base */

a {
  color: inherit;
  text-decoration: none;
}

a:not([class]) {
  color: hsl(var(--brand));
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a:not([class]):hover {
  color: hsl(var(--spot));
}

button,
.btn {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  text-align: inherit;
}

hr {
  border: none;
  border-top: 1px solid var(--hr);
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: var(--fs-s);
}

pre {
  overflow-x: auto;
  padding: var(--sp-m);
  background-color: var(--surface);
  border-radius: var(--rs-m);
}

/* a11y */

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  color: hsl(var(--brand));
  text-decoration: underline;
  text-underline-offset: 0.2em;
  font-size: var(--fs-s);
  z-index: 9999;
}

.skip-link:focus {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  padding: var(--sp-xs) var(--sp-m);
  background-color: hsl(var(--wht));
  color: hsl(var(--brand));
  text-align: center;
}

:focus-visible {
  outline: 3px solid hsl(var(--brand));
  outline-offset: 3px;
  border-radius: var(--rs-s);
}

:focus:not(:focus-visible) {
  outline: none;
}

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

/* layout */

body {
  min-height: 100dvh;
  background-color: hsl(var(--wht));
  color: hsl(var(--blk));
  font-family: var(--font-text);
  font-size: var(--fs-m);
  line-height: 1.7;
  dont-weight: 300;
  font-synthesis: none;
}

.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
}

header,
main,
footer {
  width: 100%;
  position: relative;
}

section {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  scroll-margin-top: var(--sp-l);
}

:where([class*="container"]) {
  width: var(--container-width);
  margin-inline: auto;
  padding: var(--sp-m) 0;
}

/* typography */

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
blockquote {
  margin-bottom: 1em;
}

:is(h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote):last-child {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 550;
  scroll-margin-top: var(--sp-l);
  text-wrap: balance;
}

h1 {
  font-size: var(--h1);
  line-height: 1.05;
}
h2 {
  font-size: var(--h2);
  line-height: 1.1;
}
h3 {
  font-size: var(--h3);
  line-height: 1.15;
}
h4 {
  font-size: var(--h4);
  line-height: 1.2;
}
h5 {
  font-size: var(--h5);
  line-height: 1.25;
}
h6 {
  font-size: var(--h6);
  line-height: 1.3;
}

small {
  font-size: var(--fs-xs);
}

/* style */

.navbar {
  background-color: hsl(var(--hr));
  color: hsl(var(--blk));
}
.navbar a {
  color: hsl(var(--blk));
}
.navbar a:hover {
  color: hsl(var(--brand));
}
