/* ------------------------- Fonts -------------------------------------------------- */

@font-face {
  font-family: Haffer XH;
  src: url("assets/HafferXHRegular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Haffer;
  src: url("assets/HafferRegular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ------------------------- Scaling System by Osmo [https://osmo.supply/] -------------------------  */

/* Desktop */
:root {
  --size-unit: 16; /* body font-size in design - no px */
  --size-container-ideal: 1440; /* screen-size in design - no px */
  --size-container-min: 992px;
  --size-container-max: 1920px;
  --size-container: clamp(var(--size-container-min), 100vw, var(--size-container-max));
  --size-font: calc(var(--size-container) / (var(--size-container-ideal) / var(--size-unit)));
}

/* Tablet */
@media screen and (max-width: 991px) {
  :root {
    --size-container-ideal: 834; /* screen-size in design - no px */
    --size-container-min: 768px;
    --size-container-max: 991px;
  }
}

/* Mobile Landscape */
@media screen and (max-width: 767px) {
  :root {
    --size-container-ideal: 550; /* screen-size in design - no px */
    --size-container-min: 480px;
    --size-container-max: 767px;
  }
}

/* Mobile Portrait */
@media screen and (max-width: 479px) {
  :root {
    --size-container-ideal: 390; /* screen-size in design - no px */
    --size-container-min: 320px;
    --size-container-max: 479px;
  }
}

/* ------------------------- Hide Scrollbar -------------------------------------------------- */

body ::-webkit-scrollbar,
body::-webkit-scrollbar {display: none;} /* Chrome, Safari, Opera */
body {-ms-overflow-style: none;} /* IE & Edge */
html {scrollbar-width: none;} /* Firefox */

/* ------------------------- Reset -------------------------------------------------- */

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

html {
  scroll-behavior: initial;
}

html,
body {
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
}

/* ------------------------- Demo -------------------------------------------------- */

body {
  color: #201d1d;
  background-color: #f4f4f4;
  font-family: Haffer, Arial, sans-serif;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.25;
}

.body {
  font-size: var(--size-font);
  background-color: #000;
}

.demo-section {
  color: #fff;
  padding-top: max(10em, 22.5svh);
  /* Match the grid's top padding plus the heading's quarter-em margin. */
  padding-bottom: calc(max(4em, 120px) + min(1.375em, 1.6vw));
}

.container {
  width: 100%;
  max-width: var(--size-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 8em;
  padding-right: 8em;
}

.demo-grid {
  grid-column-gap: 4em;
  grid-row-gap: 4em;
  flex-flow: wrap;
  padding-top: max(4em, 120px);
  display: flex;
}

.demo-grid__item {
  width: calc((100% - 8em) / 3);
}

.demo-section__title {
  justify-content: center;
  display: flex;
}

.demo-section__title-h {
  text-align: center;
  letter-spacing: -.04em;
  width: 100%;
  margin-top: 0;
  margin-bottom: .25em;
  font-family: Haffer XH, Arial, sans-serif;
  font-size: min(5.5em, 6.4vw);
  font-weight: 400;
  line-height: 1;
}

.demo-section__title-h > span {
  display: block;
  white-space: nowrap;
}

.demo-section__portfolio {
  font-family: 'Nothin Neue Montreal', Arial, sans-serif;
  font-weight: 700;
}

.demo-grid-card {
  aspect-ratio: 5 / 6;
  border-radius: .75em;
  justify-content: center;
  align-items: center;
  width: 100%;
  display: flex;
  position: relative;
}

.demo-grid-card.is--black {
  background-color: #000;
  outline: 2px solid #ffffff2b;
}

.demo-grid-card[data-card-title] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.demo-grid-card[data-pointer-focus]:focus { outline: none; }
.demo-grid-card:not([data-pointer-focus]):focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
}

.demo-grid-card.is--white {
  color: #000;
  background-color: #fff;
}

/* PORT's card captions, scoped to the gallery's existing card surfaces. */
.demo-grid-card .dome-grid__caption {
  z-index: 1;
  grid-column-gap: .5em;
  grid-row-gap: .5em;
  pointer-events: none;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  transform-style: preserve-3d;
  background-image: linear-gradient(#fff0 40%, #0009);
  border-radius: inherit;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1.25em;
  transition-property: opacity;
  transition-duration: .35s;
  transition-timing-function: ease-out;
  display: flex;
  position: absolute;
  inset: 0%;
  transform: translateZ(0);
}

.demo-grid-card .dome-grid__caption .dome-grid__text {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 1em;
  line-height: 1.2;
}

.demo-grid-card .dome-grid__caption .dome-grid__meta {
  opacity: .6;
  margin-top: 0;
  margin-bottom: 0;
  font-size: .75em;
  line-height: 1.2;
}

.demo-grid-card[aria-expanded="true"] .dome-grid__caption {
  opacity: 0;
  visibility: hidden;
}

.cover-image {
  object-fit: cover;
  border-radius: inherit;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.cover-image--grassroots {
  object-position: left center;
}

.demo-grid-card__letter {
  font-family: Haffer XH, Arial, sans-serif;
  font-size: min(6em, 15vw);
  position: absolute;
}

.demo-grid-card__osmo-icon {
  width: .75em;
}

@media screen and (max-width: 991px) {
  .container {
    padding-left: 2em;
    padding-right: 2em;
  }

  .demo-grid__item {
    width: calc(33.33% - 2.66667em);
  }
}

/* The cards' dates: a date that needs two lines breaks after its dash and keeps to the card's right edge. PORT's
   Grassroots picture carries its logo bottom left, so on a card too narrow for the date beside it the date sits just
   above it instead (the logo's top is 15.6 % of the 5:6 card's height, 18.8 % of its width, above its foot). */
.demo-grid-card .dome-grid__caption .dome-grid__meta { text-align: right; }
.demo-grid-card[data-dome-grid-still] { container-type: inline-size; }

@container (max-width: 19.5em) {
  .demo-grid-card[data-dome-grid-still] .dome-grid__caption {
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding-bottom: calc(18.8% + .5em);
  }

  .demo-grid-card[data-dome-grid-still] .dome-grid__caption .dome-grid__meta { text-align: left; }
}

@media screen and (max-width: 767px) {
  .demo-grid__item {
    width: calc(49.995% - 2em);
  }
}

@media screen and (max-width: 479px) {
  .demo-grid__item {
    width: 100%;
  }
}
