:root {
  /* https://github.com/Set-Creative-Studio/cube-boilerplate/blob/main/src/design-tokens/text-sizes.json */
  --size-step--1: clamp(0.9574rem, 0.8654rem + 0.4461vw, 1.2rem);
  --size-step-0: clamp(1.125rem, 0.9828rem + 0.6897vw, 1.5rem);
  --size-step-1: clamp(1.3219rem, 1.1121rem + 1.0172vw, 1.875rem);
  --size-step-2: clamp(1.5532rem, 1.2533rem + 1.4539vw, 2.3438rem);
  --size-step-3: clamp(1.825rem, 1.406rem + 2.0316vw, 2.9297rem);
  --size-step-4: clamp(2.1444rem, 1.5687rem + 2.7912vw, 3.6621rem);
  --size-step-5: clamp(2.5197rem, 1.739rem + 3.7848vw, 4.5776rem);
  --size-step-6: clamp(2.9606rem, 1.9132rem + 5.0785vw, 5.722rem);
  --size-step-7: clamp(3.4787rem, 2.0852rem + 6.7565vw, 7.1526rem);

  /* https://github.com/Set-Creative-Studio/cube-boilerplate/blob/main/src/design-tokens/spacing.json */
  --space-3xs: clamp(0.3125rem, 0.2888rem + 0.1149vw, 0.375rem);
  --space-2xs: clamp(0.5625rem, 0.4914rem + 0.3448vw, 0.75rem);
  --space-xs: clamp(0.875rem, 0.7802rem + 0.4598vw, 1.125rem);
  --space-s: clamp(1.125rem, 0.9828rem + 0.6897vw, 1.5rem);
  --space-m: clamp(1.6875rem, 1.4741rem + 1.0345vw, 2.25rem);
  --space-l: clamp(2.25rem, 1.9655rem + 1.3793vw, 3rem);
  --space-xl: clamp(3.375rem, 2.9483rem + 2.069vw, 4.5rem);
  --space-2xl: clamp(4.5rem, 3.931rem + 2.7586vw, 6rem);
  --space-3xl: clamp(6.75rem, 5.8966rem + 4.1379vw, 9rem);
  --space-4xl: clamp(9rem, 7.8621rem + 5.5172vw, 12rem);

  --space-3xs-2xs: clamp(0.3125rem, 0.1466rem + 0.8046vw, 0.75rem);
  --space-2xs-xs: clamp(0.5625rem, 0.3491rem + 1.0345vw, 1.125rem);
  --space-xs-s: clamp(0.875rem, 0.6379rem + 1.1494vw, 1.5rem);
  --space-s-m: clamp(1.125rem, 0.6983rem + 2.069vw, 2.25rem);
  --space-m-l: clamp(1.6875rem, 1.1897rem + 2.4138vw, 3rem);
  --space-l-xl: clamp(2.25rem, 1.3966rem + 4.1379vw, 4.5rem);
  --space-xl-2xl: clamp(3.375rem, 2.3793rem + 4.8276vw, 6rem);
  --space-2xl-3xl: clamp(4.5rem, 2.7931rem + 8.2759vw, 9rem);
  --space-3xl-4xl: clamp(6.75rem, 4.7586rem + 9.6552vw, 12rem);

  --space-s-l: clamp(1.125rem, 0.4138rem + 3.4483vw, 3rem);
  --space-s-xl: clamp(1.125rem, -0.1552rem + 6.2069vw, 4.5rem);

  /* https://github.com/Set-Creative-Studio/cube-boilerplate/blob/main/src/css/global/variables.css */
  --gutter: var(--space-s-l);
}

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

:root {
  color: light-dark(oklch(37.3% 0.034 259.733), oklch(87.1% 0.006 286.286));
  color-scheme: light dark;
  line-height: 1.5;
  font-family: sans-serif;
}

body,
h1,
p {
  margin: 0;
}

body {
  font-size: var(--size-step--1);
}

h1 {
  font-size: var(--size-step-1);
  line-height: 1.2;
}

.box {
  background-color: rgba(255, 45, 85, 0.3);
  padding: var(--space-xs);
}

/* https://github.com/Set-Creative-Studio/cube-boilerplate/tree/main/src/css/compositions */

/*
CLUSTER
More info: https://every-layout.dev/layouts/cluster/
A layout that lets you distribute items with consitent
spacing, regardless of their size

CUSTOM PROPERTIES AND CONFIGURATION
--gutter (var(--space-s-m)): This defines the space
between each item.

--cluster-horizontal-alignment (flex-start) How items should align
horizontally. Can be any acceptable flexbox aligmnent value.

--cluster-vertical-alignment How items should align vertically.
Can be any acceptable flexbox alignment value.
*/

.cluster {
  display: flex;
  flex-wrap: wrap;
  justify-content: var(--cluster-horizontal-alignment, flex-start);
  align-items: var(--cluster-vertical-alignment, center);
  gap: var(--gutter, var(--space-s-m));
}

/*
FLOW COMPOSITION
Like the Every Layout stack: https://every-layout.dev/layouts/stack/
Info about this implementation: https://piccalil.li/quick-tip/flow-utility/
*/
.flow > * + * {
  margin-top: var(--flow-space, 1em);
}

/* AUTO GRID
Related Every Layout: https://every-layout.dev/layouts/grid/
More info on the flexible nature: https://piccalil.li/tutorial/create-a-responsive-grid-layout-with-no-media-queries-using-css-grid/
A flexible layout that will create an auto-fill grid with
configurable grid item sizes

CUSTOM PROPERTIES AND CONFIGURATION
--gutter (var(--space-s-m)): This defines the space
between each item.

--grid-min-item-size (14rem): How large each item should be
ideally, as a minimum.

--grid-placement (auto-fill): Set either auto-fit or auto-fill
to change how empty grid tracks are handled */

.grid {
  display: grid;
  grid-template-columns: repeat(
    var(--grid-placement, auto-fill),
    minmax(var(--grid-min-item-size, 16rem), 1fr)
  );
  gap: var(--gutter, var(--space-s-l));
}

/* A split 50/50 layout */
.grid[data-layout='halves'] {
  --grid-placement: auto-fit;
  --grid-min-item-size: clamp(16rem, 50vw, 33rem);
}

/* Three column grid layout */
.grid[data-layout='thirds'] {
  --grid-placement: auto-fit;
  --grid-min-item-size: clamp(16rem, 33%, 20rem);
}

/*
REPEL
A little layout that pushes items away from each other where
there is space in the viewport and stacks on small viewports

CUSTOM PROPERTIES AND CONFIGURATION
--gutter (var(--space-s-m)): This defines the space
between each item.

--repel-vertical-alignment How items should align vertically.
Can be any acceptable flexbox alignment value.
*/
.repel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: var(--repel-vertical-alignment, center);
  gap: var(--gutter, var(--space-s-m));
}

.repel[data-nowrap] {
  flex-wrap: nowrap;
}

/*
SIDEBAR
More info: https://every-layout.dev/layouts/sidebar/
A layout that allows you to have a flexible main content area
and a "fixed" width sidebar that sits on the left or right.
If there is not enough viewport space to fit both the sidebar
width *and* the main content minimum width, they will stack
on top of each other

CUSTOM PROPERTIES AND CONFIGURATION
--gutter (var(--space-size-1)): This defines the space
between the sidebar and main content.

--sidebar-target-width (20rem): How large the sidebar should be

--sidebar-content-min-width(50%): The minimum size of the main content area

EXCEPTIONS
.sidebar[data-direction='rtl']: flips the sidebar to be on the right
*/
.sidebar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter, var(--space-s-l));
}

.sidebar > :first-child {
  flex-grow: 1;
  flex-basis: var(--sidebar-target-width, 20rem);
}

.sidebar > :last-child {
  flex-grow: 999;
  flex-basis: 0;
  min-width: var(--sidebar-content-min-width, 50%);
}

/*
SWITCHER
More info: https://every-layout.dev/layouts/switcher/
A layout that allows you to lay **2** items next to each other
until there is not enough horizontal space to allow that.

CUSTOM PROPERTIES AND CONFIGURATION
--gutter (var(--space-size-1)): This defines the space
between each item

--switcher-target-container-width (40rem): How large the container
needs to be to allow items to sit inline with each other

--switcher-vertical-alignment How items should align vertically.
Can be any acceptable flexbox alignment value.
*/
.switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: var(--switcher-vertical-alignment, flex-start);
  gap: var(--gutter, var(--space-s-l));
}

.switcher > * {
  flex-grow: 1;
  flex-basis: calc((var(--switcher-target-container-width, 40rem) - 100%) * 999);
}

/* Max 2 items,
so anything greater than 2 is full width */
.switcher > :nth-child(n + 3) {
  flex-basis: 100%;
}

/*
WRAPPER COMPOSITION
A common wrapper/container
*/
.wrapper {
  position: relative;
  margin-inline: auto;
  padding-right: var(--gutter);
  padding-left: var(--gutter);
  max-width: clamp(16rem, var(--wrapper-max-width, 100vw), 80rem);
}
