:root {
  /* Vertical ratio */
  --ratio: 1.5;
  /* Default font size in any browser */
  --s0:  1rem;
  /* Positive harmonic scale, s1 = 1.5 */
  --s1: calc(var(--s0) * var(--ratio));
  --s2: calc(var(--s1) * var(--ratio));
  --s3: calc(var(--s2) * var(--ratio));
  --s4: calc(var(--s3) * var(--ratio));
  /* Negative harmonic scale */
  --s-1: calc(var(--s0) / var(--ratio));
  --s-2: calc(var(--s-1) / var(--ratio));
  --s-3: calc(var(--s-2) / var(--ratio));
  --s-4: calc(var(--s-3) / var(--ratio));

  /* Colors */
  --bg: hsl(0, 0%, 0%);
  --fg: hsl(0, 0%, 100%);
  --act: hsl(5, 74%, 48%);

  /* Max width measure */
  --max-measure: 60ch;

  /* Viewport dependent font size */
  /* font-size: calc(var(--s0) + 0.5vw); */

  font-family: "Inter", sans-serif;
  font-weight: 400;
  color: var(--fg);
  line-height: var(--ratio);
}

* {
  /* Count border inside box */
  box-sizing: border-box;
  /* Prevent wide text */
  max-inline-size: var(--max-measure);
}

/* Fix MacOS font smoothing. */
body {
  -webkit-font-smoothing: antialiased;
}

/* Override max measure */
html,
body,
div,
header,
nav,
main,
footer,
cluster {
  max-inline-size: none;
}

h1 {
  font-size: var(--s2);
  color: var(--fg);
}

h2 {
  font-size: var(--s1);
  color: var(--fg);
}

h3 {
  font-size: var(--s0);
  color: var(--fg);
}

/* Vertical stack */
.stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;  
}

/* Reset vertical margins (> * stop recursion) */
.stack > * {
  margin-block: 0;
}

/* Add marging start fron 2nd element  (> * + * stop recursion) */
.stack > * + * {
  margin-block-start: var(--s2);
}

/* Shorter stack */
.stack.short > * + * {
  margin-block-start: var(--s-1);
}

/* Box */
.box {
  border: 1px solid var(--fg);
  border-radius: 5px;
}

/* Force colors on all elements */
.box * {
  color: inherit;
}

/* Invert colors */
.box.invert {
  filter: invert(100%);
}

/* Center */
center, .center {
  box-sixing: content-box;
  max-inline-size: var(--max-measure);
  margin-inline: auto;
  padding-inline-start: var(--s1);
  padding-inline-end: var(--s1);
}

/* Cluster */
cluster, .cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  justify-content: space-between;
  align-items: center;
}

/* Frame */
/* Supports single child, img or video */
/* Pick aspect ratio (16/9, 4/3, 1/1) */
.frame {
  --n: 4;
  --d: 3;
  aspect-ratio: var(--n) / var(--d);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.frame > img,
.frame > video,
.frame > iframe {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* Icon */
.icon {
  height: 2cap;
  width: 2cap;
  color: var (--fg);

  &:hover {
    opacity: 0.8;
  }
}

/* --- */

/* Custom */
body {
  background-color: var(--bg);
  padding: clamp(var(--s0), 2vw, var(--s2));
}

.center {
  padding: clamp(0, 2vw, var(--s1));
}

.home {
  background-image: url('/img/background.webp');
  background-size: cover;
  background-repeat: no-repeat;
  /* 100% of visible viewport height */
  /* height: 100dvh; */
  /* Move down by x dvh */
  /* background-position: center 0dvh; */
  /* background-size: 130%; */

  background-position: center 0;
  background-position: center calc(80% + var(--s0));

  .empty {
    /* Take 80% of viewport height */
    /* height: 80dvh; */
    /* height: 100rem; */

    height: calc(25 * var(--s0) + 30vw);
  }
}

a {
  color: var(--fg);
  text-decoration: none;
}

a.button {
  display: block;
  background-color: var(--fg);
  font-family: "Inter", sans-serif;
  font-weight: 700;
  color: var(--bg);
  padding: var(--s0) var(--s1);
  border-radius: 5px;
  text-decoration: none;
  text-align: center;

  &:hover {
    text-decoration: none;
    opacity: 0.8;
  }
}

.cta {
  text-align: center;
  color: var(--fg);
  opacity: 0.9;

  a {
    text-decoration: underline;

    &:hover {
      text-decoration: none;
    }
  }
}


header {
  .logo {
    width: 100%;
  }

  h3 {
    font-family: "Baskervville", serif;
    font-weight: 600;
    display: block;
    margin: auto;
    font-size: var(--s0);
    opacity: 0.5;
    text-align: center;
    /* line-height: 1; */
  }

  nav.cluster {
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-size: clamp(var(--s0), 2vw, var(--s1));
    gap: clamp(var(--s-4), 1vw, var(--s0));
    justify-content: space-around;

    a {
      border-bottom: 2px solid transparent;
      transition: border-bottom-color 0.4s ease;
    }

    a:hover,
    .current {
      border-bottom-color: var(--act);
    }
  }
}

.content {
  a {
    font-weight: bold;
  }

  a:hover {
    text-decoration: underline;
  }
}

footer {
  font-size: var(--s-1);

  ul, li {
    all: unset;
  }

  nav.cluster {
    justify-content: space-around;
    align-items: center;
    gap: var(--s1) var(--s4);
  }

  nav ul:first-child li:first-child .icon {
    width: 2.5cap;
    height: 2.5cap;
  }

  nav ul:nth-child(2) li {
    padding: var(--s-3) var(--s-1);
  }

  nav ul:last-child a {
    color: var(--fg);
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;

    &:hover {
      border-bottom-color: var(--fg);
    }
  }
}

