@import url('https://fonts.googleapis.com/css2?family=Baskervville:ital,wght@0,400..700;1,400..700&display=swap');

@import url('https://use.typekit.net/umv2vnl.css');

/* Modern reset: https://piccalil.li/blog/a-more-modern-css-reset/ */

/* 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: 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;
  line-height: 1.5;
}

/* Set shorter line heights on headings and interactive elements */

h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* 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: 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;
}

:root{
  --color-dark: #272251;
  --color-dark-glare: #322984;
  --color-mid: #a9a7ba;
  --color-light: #ffffff;
  --color-primary: #f7c0d0;
  --space-xs: clamp(0.4375rem, 0.42rem + 0.10vw, 0.5rem);
  --space-s: clamp(0.875rem, 0.83rem + 0.20vw, 1rem);
  --space-m: clamp(1.3125rem, 1.25rem + 0.29vw, 1.5rem);
  --space-l: clamp(2.1875rem, 2.09rem + 0.49vw, 2.5rem);
  --space-xl: clamp(3.0625rem, 2.92rem + 0.69vw, 3.5rem);
  --space-2xl: clamp(3.5rem, 3.34rem + 0.78vw, 4rem);
  --space-3xl: clamp(4.375rem, 4.17rem + 0.98vw, 5rem);
  --space-4xl: clamp(6.5625rem, 6.26rem + 1.47vw, 7.5rem);
  --space-xs-l: clamp(0.4375rem, -0.23rem + 3.24vw, 2.5rem);
  --space-m-l: clamp(1.3125rem, 0.93rem + 1.86vw, 2.5rem);
  --space-l-xl: clamp(2.1875rem, 1.76rem + 2.06vw, 3.5rem);
  --space-xl-2xl: clamp(3.0625rem, 2.76rem + 1.47vw, 4rem);
  --space-2xl-4xl: clamp(3.5rem, 2.21rem + 6.27vw, 7.5rem);
  --size-step-000: clamp(0.740625rem, 0.73rem + 0.06vw, 0.78125rem);
  --size-step-00: clamp(0.833125rem, 0.80rem + 0.16vw, 0.9375rem);
  --size-step-0: clamp(0.9375rem, 0.88rem + 0.29vw, 1.125rem);
  --size-step-1: clamp(1.055rem, 0.96rem + 0.46vw, 1.35rem);
  --size-step-2: clamp(1.18625rem, 1.05rem + 0.68vw, 1.62rem);
  --size-step-3: clamp(1.335rem, 1.14rem + 0.95vw, 1.94375rem);
  --size-step-4: clamp(1.501875rem, 1.23rem + 1.30vw, 2.3325rem);
  --size-step-5: clamp(1.689375rem, 1.33rem + 1.74vw, 2.799375rem);
  --size-step-6: clamp(1.900625rem, 1.43rem + 2.29vw, 3.359375rem);
  --size-step-7: clamp(2.138125rem, 1.53rem + 2.97vw, 4.03125rem);
  --size-step-8: clamp(2.405625rem, 1.62rem + 3.81vw, 4.8375rem);
  --size-step-9: clamp(2.70625rem, 1.70rem + 4.86vw, 5.805rem);
  --size-step-10: clamp(3.03125rem, 1.76rem + 6.17vw, 6.965625rem);
  --size-step-11: clamp(3.78875rem, 1.63rem + 10.45vw, 10.448125rem);
  --size-step-12: clamp(3.78875rem, 0.36rem + 16.61vw, 14.375rem);
  --leading-micro: 0.85;
  --leading-flat: 1;
  --leading-fine: 1.2;
  --leading-standard: 1.4;
  --leading-loose: 1.7;
  --font-base: Baskerville,serif;
  --font-fancy: nautica,cursive;
  --font-regular: 400;
  --font-medium: 500;
  --font-bold: 600;
  --font-black: 700;
  --gutter: var(--space-l-xl);
  --transition-base: 250ms ease;
  --transition-movement: 200ms linear;
  --transition-fade: 300ms ease;
  --transition-bounce: 500ms cubic-bezier(0.5, 0.05, 0.2, 1.5);
  --stroke-width: 1px;
  --stroke: var(--stroke-width) dashed var(--color-mid);
  --stroke-solid: var(--stroke-width) solid var(--color-mid);
  --indent-size: var(--space-xs-l);
  --radius-s: 0.2rem;
  --radius-m: 0.75rem;
  --radius-l: 2.5rem;
  --uppercase-kerning: 0.32ch;
  --inset-size: clamp(0.875rem, 3vw, 3rem);
}

/* 
  Global styles 

  Low-specificity, global styles that apply to the whole 
  project: https://cube.fyi/css.html
*/

body {
  background: var(--color-dark);
  color: var(--color-light);
  font-size: var(--size-step-1);
  font-family: var(--font-base);
  line-height: var(--leading-standard);
  font-weight: var(--font-regular);
  font-size-adjust: from-font;
  margin: 0;
}

:is(h1, h2, h3, h4) {
  line-height: var(--leading-fine);
  text-wrap: balance;
}

h1 {
  font-size: var(--size-step-6);
  max-width: 20ch;
}

h2 {
  font-size: var(--size-step-5);
  font-weight: var(--font-medium);
  max-width: 35ch;
}

h3 {
  font-size: var(--size-step-4);
  font-weight: var(--font-medium);
  max-width: 35ch;
}

:is(h1, h2, h3, h4):where(
  [class*='text-step-10'],
  [class*='text-step-11'],
  [class*='text-step-12']
) {
  line-height: var(--leading-micro);
  font-weight: var(--font-medium);
}

:is(h4, h5, h6) {
  font-size: var(--size-step-3);
}

small {
  font-size: var(--size-step-0);
}

ins {
  text-decoration: none;
  background: var(--color-primary);
  color: var(--color-dark);
  padding-inline: 0.3em;
}

address {
  font-style: normal;
}

:is(code, kbd, samp) {
  font-family: monospace;
  padding: 0.2em 0.2em 0.05em 0.2em;
  hyphens: none;
  tab-size: 2;
  text-align: left;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  box-decoration-break: clone;
}

/* This is quite a new property, so we want code styles to at least, not be huge or tiny */

@supports not (font-size-adjust: from-font) {
  :is(code, kbd, samp) {
    font-size: 0.8em;
  }
}

pre:has(code) {
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}

pre code {
  border: none;
  background: none;
  padding: 0;
}

kbd {
  border: 1px solid;
  padding-block-end: 0.1em;
}

var {
  font-style: normal;
  font-weight: var(--font-medium);
}

q {
  font-style: italic;
}

ul {
  padding-inline-start: 1.7ch;
  list-style-type: disc;
}

ul:not([class]) > li {
  padding-inline-start: var(--space-xs);
}

:is(ol, ul):not([class]) li + * {
  margin-block-start: var(--flow-space, var(--space-xs));
}

ul ::marker {
  font-size: 0.8lh;
}

ol ::marker {
  font-size: 1em;
  font-weight: var(--font-bold);
}

/* Lists with classes and roles will be out of standard flow, so remove the default spacing */

[role='list'][class],
[role='tablist'][class] {
  margin-block: 0;
  padding: 0;
}

dt {
  font-weight: var(--font-medium);
}

dt + dd {
  margin-block-start: var(--space-xs);
}

dd + dt {
  margin-block-start: var(--space-s);
}

dd {
  margin-inline-start: 1.5ch;
}

blockquote {
  margin-inline: 0;
  color: var(--color-light);
}

blockquote footer {
  margin-block-start: var(--space-s);
  color: var(--color-primary);
  font-size: var(--size-step-0);
}

blockquote q {
  font-style: normal;
}

:is(video, iframe[src*='youtube'], iframe[src*='vimeo']) {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
}

:is(img, picture) {
  height: auto;
  max-width: 100%;
  display: block;
}

picture {
  width: max-content;
}

figcaption {
  padding-block-start: 0.5em;
  font-size: var(--size-step-0);
  font-family: var(--font-medium);
}

table {
  border: var(--stroke);
  border-collapse: collapse;
  width: 100%;
}

th {
  text-align: left;
  font-weight: var(--font-bold);
  line-height: var(--leading-fine);
  background: rgb(0 0 0 / 2%);
}

thead th {
  padding-block: var(--space-s);
}

td,
th {
  padding: var(--space-xs) var(--space-s);
}

th:not(:only-of-type) {
  border-block-end: var(--stroke);
}

th:only-of-type {
  border-inline-end: var(--stroke);
}

:is(th, td) ~ :is(th, td) {
  border-inline-start: var(--stroke);
}

tr + tr :is(th, td) {
  border-block-start: var(--stroke);
}

caption {
  caption-side: bottom;
  margin-block-start: var(--space-s);
}

a:not([class]):hover {
  text-underline-offset: 0.2lh;
}

:is(h1, h2, h3, h4) a:not([class]) {
  text-decoration-thickness: 0.1ex;
  text-underline-offset: 0.2ex;
}

:is(h1, h2, h3, h4) a:not([class]):hover {
  text-underline-offset: 0.3ex;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--focus-color, currentColor);
  outline-offset: var(--focus-offset, 0.2lh);
}

:target {
  scroll-margin-block: 5lh;
}

::selection {
  color: var(--color-dark);
  background: var(--color-light);
}

hr {
  border: none;
  border-block-start: var(--hr-stroke, var(--stroke));
  margin-block: var(--flow-space, var(--space-xl));
}

svg:not([class]) {
  width: auto;
  height: 1lh;
}

svg {
  flex-shrink: 0;
}

svg[role='img'][width][height] {
  /* Allow the width and height attributes to take over */
  width: revert;
  height: revert;

  /* We've got a dark theme on this site, so if there's no background, dark lines will be hard to see */
  background: var(--color-light);

  /* A tiny bit of padding frames the image nicely */
  padding: var(--space-xs);
}

/* There's a .flow composition, but this prevents forms from having to have that applied where markup is harder to control in certain systems. It still uses the --flow-space variables though to make managing space easier */

form > * + * {
  --flow-space: var(--space-l);
  margin-top: var(--flow-space, 1rem);
}

:is(input, select, textarea) {
  --flow-space: var(--space-s);
  accent-color: var(--color-primary);
}

:is(input:not([type='checkbox'], [type='radio'], [type='color']), select, textarea) {
  padding: 0.5em 0.8em;
  border-radius: var(--radius-s);
  border: var(--stroke-solid);
  background: var(--color-dark-glare);
  color: var(--color-light);
  width: 100%;
}

:is(input:not([type='checkbox'], [type='radio'], [type='color']), select, textarea)::placeholder {
    color: var(--color-mid);
    opacity: 1;
  }

label {
  display: inline-block;
  line-height: var(--leading-fine);
  font-weight: var(--font-medium);
}

/* Creates a line break, but maintains its inline behaviour */

label::after {
  content: '\A';
  white-space: pre;
}

/* Usually label wraps checkbox and radio buttons, so we give ourselves more layout and text-flow control with flex */

label:has(input) {
  display: flex;
  align-items: baseline;
  gap: var(--space-s);
  font-weight: var(--font-normal);
}

label:has(input) + label:has(input) {
  --flow-spce: var(--space-s-m);
}

/* Slightly adjusts the vertical position of the check/radio */

label:has(input) input {
  transform: translateY(-0.1ex);
}

input:disabled {
  background: var(--color-mid);
}

input:disabled,
label input:disabled + * {
  cursor: not-allowed;
}

fieldset {
  border: var(--stroke);
  padding: var(--space-s);
}

fieldset > * + * {
  --flow-space: var(--space-s);
  margin-top: var(--flow-space, 1rem);
}

fieldset > label:first-of-type {
  margin-top: 0;
}

legend {
  font-weight: var(--font-medium);
  padding-inline: var(--space-xs);
}

/* Details and summary */

summary {
  font-weight: var(--font-bold);
  cursor: pointer;
}

details[open] summary {
  margin-block-end: var(--space-s);
}

.button {
  --button-bg: var(--color-primary);
  --button-text: var(--color-dark);
  --button-x-padding: 2em;
  --button-y-padding: 1.1em;
  --button-gutter: 0.5ch;
  --focus-color: var(--color-primary);

  display: inline-flex;
  gap: var(--button-gutter);
  align-items: center;
  line-height: var(--leading-flat);
  position: relative;
  border: none;
  cursor: pointer;
  background: var(--button-bg);
  color: var(--button-text);
  padding: var(--button-y-padding) var(--button-x-padding);
  text-transform: uppercase;
  letter-spacing: var(--uppercase-kerning);
  text-decoration: none;
  font-size: var(--size-step-00);
  font-weight: var(--font-bold);
}

.button:hover {
  filter: brightness(105%);
}

.button:hover .corner {
  --corner-offset: 60%;
}

.button:active {
  transform: scale(99%);
}

/* Variant exceptions */

.button[data-button-variant='secondary'] {
  --button-bg: var(--color-dark-glare);
  --button-text: var(--color-primary);
  --focus-color: var(--color-dark);
}

.card {
  --focus-color: var(--color-primary);

  border: var(--stroke);
  border-radius: var(--radius-m);
  padding: var(--space-m);
  position: relative;
}

.card__heading {
  font-size: var(--size-step-00);
  text-transform: uppercase;
  letter-spacing: var(--uppercase-kerning);
  color: var(--color-light);
}

.card__meta {
  --flow-space: var(--space-s);

  font-size: var(--size-step-2);
  line-height: var(--leading-flat);
}

.card__content {
  --flow-space: var(--space-s);
  font-size: var(--size-step-0);
}

.card__alert {
  /* This element is in a flow context so we need to remove the inherited margin */
  --flow-space: 0;

  display: grid;
  place-items: center;
  width: 10em;
  height: 10em;
  background: var(--color-light);
  color: var(--color-dark);
  text-transform: uppercase;
  letter-spacing: var(--uppercase-kerning);
  font-size: var(--size-step-000);
  font-weight: bold;
  position: absolute;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  z-index: 1;
  top: calc(var(--stroke-width, 1px) * -1);
  right: calc(var(--stroke-width, 1px) * -1);
}

.card__alert > span {
  transform: rotate(45deg) translateY(-1lh);
  line-height: var(--leading-flat);
}

.card img {
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius-m);
}

.card .button {
  --flow-space: var(--space-l);
}

.card:has([href]:hover) {
  background: rgb(from var(--color-light) r g b / 5%);
  transition: background var(--transition-fade);
}

.card__map {
  display: block;
  width: 100%;
  height: 16rem;
  border: none;
  border-radius: var(--radius-m);
}

.card .grid {
  --gutter: var(--space-l);
  --flow-space: var(--space-s);
}

.closer {
  background: var(--color-primary);
  color: var(--color-dark);
  padding-block: clamp(10rem, 50vh, 20rem) var(--gutter);
  font-weight: var(--font-bold);
}

.closer svg[role='img'][width][height] {
  width: 100%;
  height: auto;
  background: unset;
  padding: unset;
}

.container-fill-text {
  --container-fill-text-captured-length: initial;

  display: flex;
  container-type: inline-size;

  /* Overrides a global style on headings */
  max-width: unset;

  line-height: var(--leading-micro);
  font-weight: var(--font-black);
}

.container-fill-text__reference {
  visibility: hidden;
}

.container-fill-text__container {
  flex-grow: 1;
  container-type: inline-size;

  --container-fill-text-captured-length: 100cqi;
  --available-space: var(--container-fill-text-captured-length);
}

.container-fill-text__display {
  --container-fill-text-captured-length: 100cqi;
  --ratio: tan(
    atan2(
      var(--available-space),
      var(--available-space) - var(--container-fill-text-captured-length)
    )
  );

  display: block;

  /* AKA, width */
  inline-size: var(--available-space);

  /* Apply the calculated size with sensible fallbacks for no support */
  font-size: var(--size-step-11);

  /* The initial fallback value for no support now becomes our minimum clamp value */
  font-size: clamp(
    var(--size-step-11),
    1em * var(--ratio),
    var(--max-font-size, infinity * 1px)
  );
}

@property --container-fill-text-captured-length {
  syntax: '<length>';
  initial-value: 0px;
  inherits: true;
}

.corner {
  display: block;
  position: relative;
  aspect-ratio: 1/1;
  height: var(--corner-size, 100px);
}

.corner::before,
.corner::after {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  transition: clip-path var(--transition-bounce);
}

/* The large clip path */

.corner::before {
  background: var(--corner-primary-color, var(--color-light));
  clip-path: polygon(100% 0, var(--corner-offset, 30%) 0, 100% 100%);
}

/* The small clip path */

.corner::after {
  background: var(--corner-secondary-color, var(--color-dark));
  clip-path: polygon(var(--corner-offset, 30%) 0, 0 0, 100% 100%);
}

.corner[data-corner-docked] {
  position: absolute;
  top: 0;
  right: 0;
}

.corner[data-corner-theme='primary'] {
  --corner-secondary-color: var(--color-primary);
}

/* ── Wrapper ─────────────────────────────────────────────────── */

.details {
  --wrapper-max-width: 1024px;
  padding-block-end: var(--space-4xl);
}

.details .grid {
  --gutter: var(--space-m);
  margin-block-start: var(--space-m);
}

/* ── Table of contents ───────────────────────────────────────────── */

.details-toc {
  margin-block-end: var(--space-xl);
}

.details-toc__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-s) var(--space-l);
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.details-toc__list li {
  counter-increment: toc;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.details-toc__list li::before {
  content: counter(toc, decimal-leading-zero);
  font-size: var(--size-step-00);
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.details-toc__list a {
  font-size: var(--size-step-0);
  text-decoration: none;
}

.details-toc__list a:hover {
  text-decoration: underline;
}

/* ── Page header ─────────────────────────────────────────────────── */

.details-header {
  padding-block-end: var(--space-xl);
  text-align: center;
}

.details-header__title {
  font-family: var(--font-fancy);
  font-size: var(--size-step-9);
  font-weight: var(--font-regular);
  line-height: var(--leading-fine);
  color: var(--color-primary);
}

.gallery {
  --grid-placement: auto-fit;
  --flow-space: var(--space-m);
}

.gallery p {
  margin: 0;
}

.gallery img {
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius-m);
}

.gallery__byline {
  font-size: var(--size-step-00);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: var(--uppercase-kerning);
}

.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-l));
}

.headline {
  --repel-vertical-alignment: baseline;
  --gutter: var(--space-s);

  padding-block-end: var(--space-2xl);
  border-block-end: var(--stroke);
}

.headline__heading {
  font-size: var(--size-step-10);
  line-height: var(--leading-flat);
  font-weight: var(--font-black);
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: var(--space-4xl);
  overflow: hidden;
}

/* Thin inset border frame */

.hero::before {
  content: '';
  position: absolute;
  inset: var(--inset-size);
  border: 1px solid var(--color-primary);
  pointer-events: none;
  z-index: 0;
}

/* Corner ornaments */

.hero__corner {
  position: absolute;
  background-color: var(--color-dark);
  fill: var(--color-primary);
  width: clamp(140px, 27vw, 380px);
}

.hero__corner--top-right {
  top: 0;
  right: 0;
  aspect-ratio: 215 / 150;
}

.hero__corner--bottom-left {
  bottom: 0;
  left: 0;
  aspect-ratio: 205 / 150;
}

/* Content */

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 1;
  padding-block: var(--inset-size);
}

.hero__eyebrow {
  font-family: var(--font-base);
  font-size: var(--size-step-1);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-light);
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  font-family: var(--font-fancy);
  font-size: var(--size-step-11);
  font-weight: var(--font-regular);
  line-height: var(--leading-fine);
  color: var(--color-primary);
  max-width: 10ch;
}

.hero__sub {
  display: block;
  font-family: var(--font-base);
  color: var(--color-light);
  font-size: var(--size-step-3);
}

.hero__body {
  --flow-space: var(--space-3xl);
  color: var(--color-light);
  font-size: var(--size-step-1);
  font-style: italic;
  line-height: var(--leading-standard, 1.5);
  max-width: 60ch;
}

.inspo {
  --region-space: var(--space-2xl-4xl) 0;
  --indent-color: var(--color-dark);
}

.inspo__heading {
  font-weight: var(--font-black);
  line-height: var(--leading-micro);
  z-index: 1;
}

.inspo__grid {
  display: grid;
  font-size: var(--size-step-12);
  grid-template-rows: minmax(1cap, auto) max-content minmax(1cap, auto);
  grid-template-columns: 1fr;
}

.inspo__img {
  aspect-ratio: 1240/620;
  grid-row: 2;
  grid-column: 1;
  border-radius: var(--radius-m);
  overflow: hidden;
}

.inspo__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inspo__heading:first-of-type {
  grid-row: 1;
  transform: translateY(0.3cap);
}

.inspo__heading:last-of-type {
  grid-row: 3;
  transform: translateY(-0.5cap);
}

.inspo__stripe {
  --indent-color: var(--color-primary);

  background: var(--color-dark-glare);
  width: calc(100% + var(--indent-size));
  height: 40%;
  position: absolute;
  bottom: 0;
  left: calc(var(--indent-size) * -1);

  /* Ensure the stripe sits behind the content */
  z-index: 0;
}

/* All the content is in the wrapper, so we can sit it above the decorative stripe by setting z-index on it */

.inspo .wrapper {
  z-index: 1;
}

.labelled-icon {
  display: flex;
  align-items: baseline;
  line-height: var(--leading-fine);
  gap: 0 var(--space-xs);
}

.labelled-icon svg {
  height: 1lh;
  transform: translateY(
    0.5ex
  ); /* Adjusts the position because icons have space around them */
}

.masthead {
  display: grid;
  grid-template-columns: 1fr 23%;
  gap: 0 1.5vw;
  grid-template-rows: repeat(4, auto);
}

.masthead svg {
  width: 100%;
  height: auto;
}

.masthead__logo-left {
  grid-row: 1;
  grid-column: 1;
  align-self: start;
}

.masthead__logo-right {
  grid-row: 1;
  grid-column: 2;
  align-self: start;
}

.masthead__heading {
  grid-row: 2;
  grid-column: 1/3;
  font-size: var(--size-step-6);
  font-weight: var(--font-medium);
  margin-block-start: var(--space-m);
  line-height: var(--leading-flat);
}

.masthead__location {
  grid-row: 3;
  grid-column: 1/3;
  margin-block-start: var(--space-2xs);
}

.masthead__meta {
  grid-row: 4;
  grid-column: 1/3;
  text-align: right;
  margin-block-start: var(--space-m);
}

@media (min-width: 940px) {
  .masthead {
    grid-template-rows: repeat(3, auto);
  }
  .masthead__heading {
    grid-row: 2;
    grid-column: 2;
  }

  .masthead__meta {
    grid-row: 3;
    grid-column: 2;
    text-align: left;
    margin-block-start: var(--space-s);
  }

  .masthead__location {
    grid-row: 3;
    grid-column: 1;
    margin-block-start: var(--space-s);
  }
}

/* Layouts are completely controlled by the layout compositions, flow and cluster. All we do in this component is configure their spacing and the visual appearance of links. */

.nav {
  --flow-space: var(--space-s);
  --gutter: var(--space-l);

  line-height: var(--leading-flat);
  display: flex;
  justify-content: center;
  text-align: center;
}

.nav .cluster {
  --gutter: var(--space-m);
  justify-content: center;
}

/* The default behaviour for links is to have an underline. We remove that only if the item isn't being hovered or is the current active page */

.nav a:not(:hover):not([aria-current='page']) {
  text-decoration: none;
}

.prose {
  --flow-space: var(--space-m);
  --wrapper-max-width: 800px;
}

.prose :is(h1, h2, h3) {
  /* Allow words to break by default. Great for small viewports */
  overflow-wrap: anywhere;
  hyphens: auto;
}

.prose :is(p, li, dl, figcaption, blockquote) {
  max-width: 60ch;
  text-wrap: pretty;
}

/* Heading flow for elements that follow them */

.prose :is(h1, h2, h3, h4) + *:not([class]) {
  --flow-space: var(--space-m);
}

/* Add more space on and around figures and tables */

.prose :is(figure, table),
.prose :is(figure, table) + * {
  --flow-space: var(--space-2xl);
}

/* Add more space to headings on block start */

.prose * + :is(h1, h2, h3, h4):not([class]) {
  --flow-space: var(--space-xl);
}

.prose :is(ul, ol):not([class]) li + li,
.prose :is(ul, ol):not([class]) li > :is(ol, ul) {
  --flow-space: var(--space-2xs);
}

.prose hr {
  --flow-space: var(--space-2xl);
}

.prose :is(img, picture, video) {
  border: var(--stroke-solid);
}

@media (min-width: 760px) {
  .prose :is(h1, h2, h3) {
    overflow-wrap: unset;
    hyphens: unset;
  }
}

.rolodex {
  --flow-space: var(--space-3xl);
  --gutter: var(--space-l);
}

.rolodex__item {
  --rolodex-text: var(--color-dark);
  --rolodex-bg: var(--color-light);
  --rolodex-clip: var(--rolodex-triangle-color, var(--color-dark));
  --focus-color: var(--color-light);

  padding: var(--space-l);
  background: var(--rolodex-bg);
  color: var(--rolodex-text);
  text-decoration: none;
  position: relative;
}

.rolodex__item::before {
  content: '';
  /* We want a smaller clip for smaller viewports */
  width: clamp(2rem, 10vw, 7.5rem);
  aspect-ratio: 1/1;
  pointer-events: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  background: var(--rolodex-clip);
  position: absolute;
  top: 0;
  right: 0;
}

.rolodex__item:hover {
  filter: brightness(105%);
}

.rolodex__heading {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-l);
  margin: 0;
  font-weight: var(--font-black);
  font-size: var(--size-step-4);
}

.rolodex__number {
  font-size: var(--size-step-10);
}

.rolodex img {
  /* Pro tip: the dimensions in Figma are actually really useful for creating an aspect ratio */
  aspect-ratio: 787/524;
  object-fit: cover;
  border-radius: var(--radius-m);
}

/* THEME EXCEPTIONS */

.rolodex__item[data-rolodex-theme='primary'] {
  --rolodex-text: var(--color-dark);
  --rolodex-bg: var(--color-primary);
}

.rolodex__item[data-rolodex-theme='dark'] {
  --rolodex-text: var(--color-light);
  --rolodex-bg: var(--color-dark-glare);
}

/* Apply a sticky position treatment only for viewports that are large and up */

@media (min-width: 940px) {
  .rolodex__list li {
    position: sticky;
    top: var(--gutter);
  }

  .rolodex__list:has(.rolodex__item:focus-visible) li {
    position: relative;
  }
}

.site-foot {
  background: var(--color-dark-glare);
  color: var(--color-light);
  line-height: var(--leading-flat);
  padding-block: var(--space-m);
}

.site-foot .wrapper * {
  margin: 0;
}

.site-head {
  text-transform: uppercase;
  letter-spacing: var(--uppercase-kerning);
  line-height: var(--leading-flat);
  font-size: var(--size-step-00);
  font-weight: var(--font-regular);
  padding-block: var(--space-m);
}

.site-head__brand {
  display: flex;
  justify-content: center;
}

.site-head__brand svg {
  height: var(--size-step-10);
  min-height: 4.75rem;
  fill: var(--color-primary);
}

.timeline ol {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.timeline__item {
  display: grid;
  grid-template-columns: 5.5ch 1fr;
  gap: var(--space-l);
  padding-block: var(--space-s);
  border-block-end: var(--stroke);
  align-items: baseline;
}

.timeline__item:first-child {
  border-block-start: var(--stroke);
}

.timeline__time {
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  font-size: var(--size-step-0);
  white-space: nowrap;
  text-align: right;
}

/*
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-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;
  gap: var(--gutter, var(--space-m));
  justify-content: var(--cluster-horizontal-alignment, flex-start);
  align-items: var(--cluster-vertical-alignment, center);
}

/* 
FLOW COMPOSITION 
Like the Every Layout stack: https://every-layout.dev/layouts/stack/
Info about this implementation: https://piccalil.li/blog/my-favourite-3-lines-of-css/ 
*/

.flow > * + * {
  margin-block-start: 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-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-l));
}

/* A split 50/50 layout */

.grid[data-layout='50-50'] {
  --grid-placement: auto-fit;
  --grid-min-item-size: clamp(1rem, 50vw, 20rem);
}

/* 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-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-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:not([data-direction]) > :first-child {
  flex-basis: var(--sidebar-target-width, 20rem);
  flex-grow: 1;
}

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

.sidebar[data-reversed] {
  flex-direction: row-reverse;
}

.sidebar[data-direction='rtl'] > :last-child {
  flex-basis: var(--sidebar-target-width, 20rem);
  flex-grow: 1;
}

.sidebar[data-direction='rtl'] > :first-child {
  flex-basis: 0;
  flex-grow: 999;
  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;
  gap: var(--gutter, var(--space-l));
  align-items: var(--switcher-vertical-alignment, flex-start);
}

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

/* Max 2 items,
so anything greater than 2 is ful width */

.switcher > :nth-child(n + 3) {
  flex-basis: 100%;
}

/*
WRAPPER COMPOSITION 
A common wrapper/container
*/

.wrapper {
  margin-inline: auto;
  max-width: var(--wrapper-max-width, 1360px);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  position: relative;
}

.indent {
  border-inline-start: var(--indent-size, var(--space-xs-l)) solid
    var(--indent-color, currentColor);
}

/* 
REGION UTILITY
Consistent block padding for page sections
*/

.region {
  padding-block: var(--region-space, var(--space-m));
  position: relative;
}

/* 
VISUALLY HIDDEN UTILITY
Info: https://piccalil.li/quick-tip/visually-hidden/ 
*/

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 0;
  margin: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

.grid{
  display: grid;
}

.contents{
  display: contents;
}
