/* Variable and globals */
:root {
  --scale: 1.5;
  --s-5: calc(var(--s-4) / var(--scale));
  --s-4: calc(var(--s-3) / var(--scale));
  --s-3: calc(var(--s-2) / var(--scale));
  --s-2: calc(var(--s-1) / var(--scale));
  --s-1: calc(var(--s) / var(--scale));
  --s: 1rem;
  --s1: calc(var(--s) * var(--scale));
  --s2: calc(var(--s1) * var(--scale));
  --s3: calc(var(--s2) * var(--scale));
  --s4: calc(var(--s3) * var(--scale));
  --s5: calc(var(--s4) * var(--scale));
  --s6: calc(var(--s5) * var(--scale));
  --measure: 65ch;
  --large-measure: 90ch;
  line-height: var(--scale);
  font-size: calc(0.5vw + 1em);
  font-family: Inter, sans-serif;
  font-feature-settings: 'liga' 1, 'calt' 1; /* fix for Chrome */
}

@supports (font-variation-settings: normal) {
  :root { font-family: InterVariable, sans-serif; }
}

/* CSS RESET BY ANDY BELL */
/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, h3, h4, p,
figure, blockquote, dl, dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
}

/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4,
button, input, label {
  line-height: 1.1;
}

/* Balance text wrapping and remove margins on headings */
h1, h2,
h3, h4 {
  text-wrap: balance;
  margin: 0
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input, button,
textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* Dark theme specifics */
.cb-logo {
  width: 25vw;
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #222;
    color: #fff;
  }
  a {
    color: #fff;
  }
  a:visited {
    color: ivory;
  }
  .cb-logo {
    filter: none;
  }
}

/* Layout Components */

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

.stack > * {
  margin-top: 0;
  margin-bottom: 0;
}

.stack > * + * {
  margin-top: var(--s);
}

.stack-large,
.stack-large + * {
  margin-top: var(--s3);
}

.cover {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--s2);
}

.cover > * {
  margin-top: var(--s2);
  margin-bottom: var(--s2);
}

.cover > :first-child:not(.centered) {
  margin-top: 0;
}

.cover > :last-child:not(.centered) {
  margin-bottom: 0;
}

.cover > .centered {
  margin-top: auto;
  margin-bottom: auto;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s);
  align-items: center;
}

.center {
  box-sizing: content-box;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  display:flex;
  flex-direction: column;
  align-items: center;
}

.frame {
  --n: 6;
  --d: 16;
  padding-bottom: calc(var(--n) / var(--d) * 100%);
  position: relative;
}

.frame-large {
  --n: 9;
}

.frame > * {
  overflow: hidden;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.frame > img,
.frame > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cb-grid {
  display: grid;
  grid-gap: 1rem;
}

@supports (width: min(20rem, 100%)) {
  .cb-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  }
}

/* Styling */

hr {
  border-top: var(--s-5) solid currentColor;
}

.menu-item {
  border-right: var(--s-5) solid currentColor;
}

/* 
.nav-item {
  text-decoration: overline;
} 
*/

/* Utilities */

.font-size-base {
  font-size: var(--s);
}

.font-size-big {
  font-size: calc(1vw + 1rem)
}

.font-size-bigger {
  font-size: calc(3vw + 1rem)
}

.font-size-jumbo {
  font-size: calc(5vw + 1rem);
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.text-lowercase {
  text-transform: lowercase;
}