/* Setup */

/* Portrait Text Regular by Commercial Type */
@font-face {
  font-family: 'Portrait Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/portrait-text-regular.woff2') format('woff2'),
       url('../fonts/portrait-text-regular.woff') format('woff');
}

:root {
  font-size: 1rem;

  --font-stack: "Portrait Text", "Times New Roman", serif;
  --base-unit: 0.5rem;
  --base-line-height: 1.333;

  /* Unit scale */
  --spoint5: calc(var(--base-unit)*0.0625);
  --s1:  calc(var(--base-unit)*0.125);
  --s2:  calc(var(--base-unit)*0.25);
  --s4:  calc(var(--base-unit)*0.5);
  --s5:  calc(var(--base-unit)*0.625);
  --s6:  calc(var(--base-unit)*0.75);
  --s8:       var(--base-unit);
  --s10: calc(var(--base-unit)*1.25);
  --s12: calc(var(--base-unit)*1.5);
  --s14: calc(var(--base-unit)*1.75);
  --s16: calc(var(--base-unit)*2);
  --s18: calc(var(--base-unit)*2.25);
  --s20: calc(var(--base-unit)*2.5);
  --s22: calc(var(--base-unit)*2.25);
  --s24: calc(var(--base-unit)*3);
  --s26: calc(var(--base-unit)*3.25);
  --s28: calc(var(--base-unit)*3.5);
  --s30: calc(var(--base-unit)*3.75);
  --s32: calc(var(--base-unit)*4);
  --s36: calc(var(--base-unit)*4.5);
  --s40: calc(var(--base-unit)*5);
  --s44: calc(var(--base-unit)*5.5);
  --s48: calc(var(--base-unit)*6);
  --s50: calc(var(--base-unit)*6.25);
  --s52: calc(var(--base-unit)*6.5);
  --s54: calc(var(--base-unit)*6.75);
  --s56: calc(var(--base-unit)*7);
  --s60: calc(var(--base-unit)*7.5);
  --s64: calc(var(--base-unit)*8);
  --s72: calc(var(--base-unit)*9);
  --s80: calc(var(--base-unit)*10);
  --s120: calc(var(--base-unit)*15);
  --s128: calc(var(--base-unit)*16);
  --s144: calc(var(--base-unit)*18);
  --s160: calc(var(--base-unit)*20);

  /* Colours */
  --c-grey-mid: #666;
  --c-grey-light-1: #B5B4B3;
  --c-grey-light-2: #C6C6C4;
  --c-grey-light-3: #E2E1DF;
  --c-grey-light-4: #F8F7F5;

  --c-background: var(--c-grey-light-4);
  --c-text: black;
  --c-text-light: var(--c-grey-light-1);
  --c-stroke: var(--c-grey-light-3);
}

@media screen and (min-width: 380px) {

  :root {
    font-size: 4.21052632vw;
  }
}

@media screen and (min-width: 600px) and (min-aspect-ratio: 2/3) {

  :root {
    font-size: 3.5vw;
  }
}

@media screen and (min-width: 1000px) and (min-aspect-ratio: 2/3) {

  :root {
    font-size: 3.2vw;
  }
}

@media screen and (min-width: 1000px) and (min-aspect-ratio: 1) {

  :root {
    font-size: 2.4vw;
  }
}

@media screen and (min-width: 1000px) and (min-aspect-ratio: 3/2) {

  :root {
    font-size: 1.875vw;
  }
}

@media screen and (min-width: 1400px) and (min-aspect-ratio: 1) {

  :root {
    font-size: 1.75vw;
  }
}

/*
 * Helpers
 */

.skip-to-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.skip-to-content:focus {
  z-index: 4;
  width: auto;
  height: auto;
  overflow: visible;
  white-space: normal;
  clip-path: none;
}

.visually-hidden {
  position: absolute;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; /* added line */
}

/* Animations */

@keyframes fade-in {
  0%  {opacity: 0;}
  100% {opacity: 1;}
}

[data-animate-order="1"],
[data-animate-order="2"],
[data-animate-order="3"],
[data-animate-order="4"] {
  opacity: 0;
  animation-name: fade-in;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  animation-duration: 1s;
}

[data-animate-order="1"] {
  animation-delay: 1s;
}

[data-animate-order="2"] {
  animation-delay: 2s;
}

[data-animate-order="3"] {
  animation-delay: 3s;
}

[data-animate-order="4"] {
  animation-delay: 4s;
}

/*
 * Elements
 */

html {
  font-family: var(--font-stack);
  line-height: var(--base-line-height);
  background-color: var(--c-background)
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-style: none;
  font-synthesis-weight: none;
}

figure {
  margin: 0;
}

figure img:not(:last-child) {
  margin-bottom: var(--s8);
}

img {
  display: block;
  width: 100%;
}

ul,
ol {
  margin-top: 0;
  margin-bottom: var(--s16);
  padding-left: 0;
  list-style-type: none;
  list-style-position: inside;
}

li {
  margin: 0;
  padding: 0;
}

hr {
  border-top-width: 0;
  border-left-width: 0;
  border-right-width: 0;
  border-bottom-width: var(--s1);
  border-style: solid;
}

button {
  cursor: pointer;
  transition-property: background-color, color;
  transition-timing-function: linear;
  transition-duration: 0.1s;
  transition-delay: 0s;
  -webkit-appearance: none;
}

/*
 * Typography
 */

body {
  font-size: var(--s16);
}

h1, h2, h3,
h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--s16);
  font-style: normal;
  font-weight: normal;
}

h1 {
  font-size: var(--s32);
}

h2, h3, h4, h5, h6, p, li {
  font-size: var(--s16);
}

p {
  margin-top: 0;
  margin-bottom: var(--s16);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--c-text);
  text-decoration-color: var(--c-grey-light-2);
  transition-property: text-decoration-color, color;
  transition-duration:  0.2s;
  transition-delay: 0s;
}

a:hover,
a:focus {
  text-decoration-color: #000;
}

strong {
  font-weight: normal;
}

em, i {
  font-style: italic;
}

button.trigger {
  display: inline-block;
  padding: 0;
  border: 0;
  height: auto;
  color: var(--c-text);
  text-decoration: underline;
  text-decoration-color: var(--c-grey-light-2);
  background-color: transparent;
  text-align: left;
  transition: text-decoration-color 0.1s linear;
  transition-delay: 0s;
}

button.trigger:hover,
button.trigger:focus {
  text-decoration-color: #000;
}

::selection {
  color: #fff;
  background: #000; /* WebKit/Blink Browsers */
}

::-moz-selection {
  color: #fff;
  background: #000; /* Gecko Browsers */
}

.small-caps {
  font-variant-caps: all-small-caps;
  font-size: 0.9em;
}

.ordinal {
  font-variant-caps: all-small-caps;
  top: -0.5em;
  font-size: 60%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.w-column {
  font-variant-caps: all-small-caps;
  font-size: 0.9em;
}

.section-heading {
  font-size: var(--s16);
  font-variant-caps: all-small-caps;
  text-align: center;
  color: var(--c-text-light);
}

/*
 * Components
 */

/*
 ** Content area
 */

.content-area {
  text-align: justify;
  text-justify: inter-word;
  text-align-last: center;
}

/* Remove margin-bottom from the first element inside content-area */
.content-area > :first-child {
  margin-top: 0;
}

/* Remove margin-bottom from the last element inside content-area */
.content-area > :last-child {
  margin-bottom: 0;
}

/* Project meta */

.meta li {
  padding-top: var(--s6);
  padding-bottom: var(--s6);
  justify-content: space-between;
  align-items: center;
  border-bottom: var(--s1) solid var(--c-stroke);
}

.meta li:first-child {
  border-top: var(--s1) solid var(--c-stroke);
}

.meta .item-heading,
.meta .item-value {
  font-size: var(--s14);
  margin-bottom: 0;
}

.meta .item-heading {
  color: var(--c-grey-mid);
  margin-bottom: var(--s2);
}

/*
 * Layout
 */

:root {
  --s-gutter: var(--s24);
  --s-vgutter: var(--s24);
}

body {
  margin: 0;
  padding-top: 0;
  margin-left: var(--s-gutter);
  margin-right: var(--s-gutter);
  padding-bottom: var(--s-vgutter);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  top: var(--s-vgutter);
  bottom: var(--s-vgutter);
  display: block;
  width: var(--s2);
  background-color: var(--c-grey-light-3);
  opacity: 0;
  border-top: var(--s5) solid var(--c-grey-light-3);
  border-bottom: var(--s5) solid var(--c-grey-light-3);
  border-left: var(--s1) solid var(--c-background);
  border-right: var(--s1) solid var(--c-background);
  animation-name: fade-in;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
  animation-duration: 1s;
  animation-delay: 1.5s;
  content: none;
}

@media screen and (min-width: 1400px) {
  body::before,
  body::after {
    content: "";
  }
}

body::before {
  left: calc(var(--s-gutter) - var(--s2));
}

body::after {
  right: calc(var(--s-gutter) - var(--s2));
}

@media screen and (min-width: 1000px) {

  @media (min-aspect-ratio: 1) {

    :root {
      --s-gutter: 10vw;
      --s-vgutter: var(--s20);
    }

    body {
      padding-left: var(--s-gutter);
      padding-right: var(--s-gutter);
    }
  }
}

@media screen and (min-width: 1000px) and (min-aspect-ratio: 3/2),
       screen and (min-width: 1400px) {

  :root {
    --s-gutter: 12vw;
  }

  body::before {
    left: calc((1.25 * var(--s-gutter)) - var(--s2));
  }

  body::after {
    right: calc((1.25 * var(--s-gutter)) - var(--s2));
  }

  .introduction,
  .portfolio,
  .outro {
    transition: opacity 0.25s linear;
  }

  body[data-modal-state="active"] {
    overflow: hidden;

    .introduction,
    .portfolio,
    .outro {
      opacity: 0.25;
      animation-fill-mode: none;
    }
  }
}

/** Header */

header {
  display: flex;
  justify-content: space-around;
  position: fixed;
  top: var(--s-vgutter);
  left: 0;
  right: 0;
  z-index: 2;
}

.column-logo {
  width: 40%;
}

@media screen and (min-width: 600px) and (min-aspect-ratio: 2/3) {

  .column-logo {
    width: 30%;
  }
}

@media screen and (min-width: 1000px) {

  header {
    top: var(--s20);
  }

  @media (min-aspect-ratio: 1) {
    .column-logo {
      width: 20%;
    }
  }

  @media (min-aspect-ratio: 3/2) {
    .column-logo {
      width: 15%;
    }
  }
}

/** Introduction */

.introduction {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: calc(100vh - var(--s-vgutter));
  max-height: -webkit-fill-available;
}

.introduction .content-area {
  width: 92%;
  margin-left: auto;
  margin-right: auto;

  p {
    font-size: var(--s18);
  }
}

@media screen and (min-width: 1000px) and (min-aspect-ratio: 3/2),
       screen and (min-width: 1400px) {

  .introduction .content-area {
    width: 100%;
  }
}


/* Portfolio */

.portfolio .section-heading {
  margin-top: var(--s120);
  margin-bottom: 0;
}

/** Project */

.project {
  margin-top: var(--s80);
}

.project:first-child {
  margin-top: 0;
}

.project .title {
  text-align: center;
  line-height: 1.1;
  margin-bottom: var(--s8);
}

.project .client {
  font-variant-caps: all-small-caps;
}

.project .subtitle {
  display: block;
  text-align: center;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
}

.project figure {
  margin-top: var(--s40);
  margin-bottom: var(--s40);
}

.project figure {
  margin-left: calc(-1 * var(--s-gutter));
  margin-right: calc(-1 * var(--s-gutter));
}

@media screen and (min-width: 1000px) and (min-aspect-ratio: 3/2),
       screen and (min-width: 1400px) {

  .project figure {
    margin-left: calc(-1.25 * var(--s-gutter));
    margin-right: calc(-1.25 * var(--s-gutter));
  }
}

@media screen and (min-width: 2200px) {

  .project figure {
    margin-left: calc(-1 * var(--s-gutter));
    margin-right: calc(-1 * var(--s-gutter));
  }
}

.project .summary {
  hyphens: manual;
  margin-bottom: var(--s20);
  text-align-last: left;
}

.project .meta {
  font-variant-numeric: lining-nums;
}

.project .summary,
.project .meta,
.project .image-credit {
  width: 95%;
  margin-left: auto;
  margin-right: auto;
}

.project .image-credit {
  margin-top: var(--s8);
  color: var(--c-grey-mid);
  font-size: var(--s10);
  text-align: center;

  a {
    color: var(--c-grey-mid);

    &:hover, &:focus {
      color: var(--c-text);
    }
  }
}

[data-project="rm-marketing-strategy"] {

  .summary,
  .meta {
    width: 100%;
  }
}


@media screen and (min-width: 600px) and (min-aspect-ratio: 2/3) {

  .project .summary {
    margin-bottom: var(--s40);
  }
}

@media screen and (min-width: 1000px) and (min-aspect-ratio: 3/2),
       screen and (min-width: 1400px) {

  .project .summary,
  .project .meta,
  .project .image-credit {
    width: 100%;
  }
}


/** Outro */

.outro {
  margin-top: var(--s120);
  margin-bottom: var(--s120);
}

.outro p {
  text-align: justify;
  text-justify: inter-word;
  text-align-last: center;

  br {
    display: none;
  }
}

@media screen and (min-width: 375px) {

  .outro p br {
    display: block;
  }
}


/** Imprint */

.imprint {

  background-color: var(--c-background);

  p, li {
    font-size: var(--s14);
  }

  .aoc {
    margin-bottom: var(--s20);
  }

  button.trigger {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding-top: var(--s20);
    padding-bottom: var(--s20);
    text-align: center;
    text-transform: lowercase;
    background-color: var(--c-background);
    border-top: var(--s1) solid var(--c-stroke);
  }
}

.js-enabled .imprint {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  transform: translateY(105vh);

  &[data-state="active"] {
    transform: translateY(0);
    transition-property: transform;
    transition-timing-function: ease-in-out;
    transition-duration: 0.5s;
    transition-delay: 0;
  }

  .content-area {
    overflow-y: scroll;
    --webkit-overflow-scrolling: touch;
    padding-top: var(--s120);
    padding-bottom: var(--s80);
    padding-left: var(--s52);
    padding-right: var(--s52);
  }

  ul {
    text-align: center;
  }

  button.trigger {
    display: block;
  }
}

@media screen and (min-width: 1000px) and (min-aspect-ratio: 3/2),
       screen and (min-width: 1400px) {

  .imprint {
  }

  .js-enabled .imprint {
    box-sizing: border-box;
    left: auto;
    width: 30vw;
    border-left: var(--s1) solid var(--c-stroke);
    transform: translateY(0) translateX(30vw);

    &[data-state="active"] {
      transform: translateX(0);
    }

    .content-area {
      text-align: left;
      text-align-last: left;
      padding-top: var(--s40);
      padding-left: var(--s40);
      padding-right: var(--s40);

      ul {
        list-style-type: "» ";
        list-style-position: outside;
        text-align: left;
      }
    }

    .credits
  }
}



/** Footer */
footer nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-row-gap: var(--s8);
}

footer nav .trigger {
  grid-column: 1/3;
  text-align: center;
  color: var(--c-text-light);
}

@media screen and (min-width: 375px) {

  footer {
    margin-left: calc(-1 * var(--s8));
    margin-right: calc(-1 * var(--s8));
  }

  footer nav {
    display: flex;
    justify-content: space-between;
  }

  footer nav .trigger {
    color: var(--c-text);
  }
}

@media screen and (min-width: 1000px) and (min-aspect-ratio: 3/2),
       screen and (min-width: 1400px) {

  footer {
    margin-left: calc(-2 * var(--s-gutter));
    margin-right: calc(-2 * var(--s-gutter));
  }

  footer nav {
    display: grid;
    grid-template-columns: calc(1.25 * var(--s-gutter)) auto calc(1.25 * var(--s-gutter));
  }

  footer nav a,
  footer nav .trigger {
    color: var(--c-text-light);
    text-align: center;
    transition-property: color, text-decoration-color;

    &:hover,
    &:focus {
      color: black;
    }
  }

  footer nav .trigger {
    grid-column: auto;
  }
}

/*
 ** Base structure
 */

 /* safe area for Apple notch phones */
 /*@supports(padding: max(0px)) {

  .main-content {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}*/
