/* Font Face Definitions */
@font-face {
  font-family: 'franklin-gothic';
  src: url('/fonts/franklin-gothic-book.ttf') format('truetype');
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'franklin-gothic';
  src: url('/fonts/franklin-gothic-demi.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'franklin-gothic';
  src: url('/fonts/franklin-gothic-heavy.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Global Variables */
:root {
  /* Typography */
  font-family: 'franklin-gothic', sans-serif;
  --font-min: .9rem;
  --font-max: 2rem;
  --font-pref: calc(1vw + 1vh);
  font-size: clamp(var(--font-min), var(--font-pref), var(--font-max));
  font-style: normal;
  font-optical-sizing: auto;
  font-weight: 500;

  /* Colors */
  --solid-gold: #dda63a;
  --sterling-silver: #9da2aa;
  --ruby: #ff3131;
  --sapphire: #242c43;
  /* Grays */
  --jet: #000;
  --onyx: #161616;
  --obsidian: #393939;
  --magnetite: #5a5a5a;
  --basalt: #808080;
  --shale: #9a9a9a;
  --topaz: #bdbdbd;
  --alabaster: #edf0f2;
  --moonstone: #fff;

  /* Default Colors */
  background-color: var(--alabaster);
  color: var(--onyx);

  /* Stacking Order (layers) */
  --stack-sub: -2;
  --stack-deep: -1;
  --stack-over: 1;
  --stack-lift: 10;
  --stack-frost: 100;
  --stack-menu: 1001;
  --stack-menu-toggle: 1000;

  --page-width: 85vw;
  --max-page-width: 48rem;
  --line-group-width: min(66vw, calc(var(--max-page-width) * .66));
  --air: 4rem;
  --airhead: 1rem;
  --logomark-width: 8rem;
  --logomark-ratio: .261;
  --nav-height: calc((var(--logomark-width) * var(--logomark-ratio)) + (2 * var(--airhead)));
  --hero-height: min(180vw, calc(100dvh - var(--nav-height)));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  position: relative;
  margin-block-start: 0;
  margin-block-end: 0;
}

.begin {
  color: var(--ruby);
  display: block;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .2em;
  margin: 1em auto auto;
  text-decoration: none;
  transition: color .5s;
  z-index: var(--stack-frost);

  &:hover {
    color: var(--solid-gold);
  }
}
.connect {
  letter-spacing: .1em;
}

.dark {
  background-color: var(--onyx);
  color: var(--alabaster);
}

html,
body {
  height: 100%;
  width: 100vw;
  overflow-x: hidden;
  padding: 0;
  margin: 0;
}
body > header,
body > footer {
  background-color: var(--jet);
  color: var(--sterling-silver);
  width: 100vw;

  .logomark {
    vertical-align: bottom;
    width: var(--logomark-width);
  }
}

h1 {
  font-size: 2.4rem;
  letter-spacing: -.03rem;
}
h2 {
  font-size: 2rem;
  padding-top: 4rem;
}
h1, h2 {
  line-height: 1em;
}
p, ul {
  line-height: 1.5em;
  margin-top: 1.4em;
  font-size: .9rem;
}
ul li {
  list-style-type: none;
  padding-left: 1rem;
  position: relative;

    &:after {
      content: '';
      height: .55em;
      width: .55em;
      background: var(--ruby);
      display: block;
      position: absolute;
      top: .4em;
      left: 0;
    }

  &:not(:first-of-type) {
    margin-top: 1em;
  }
}

svg {
  overflow: visible;
}

body>footer {
  padding: 2rem;

  a, a:visited {
    text-decoration: none;
  }

  menu {
    width: var(--page-width);
    max-width: var(--max-page-width);
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;

    > a, > a:visited {
      color: var(--solid-gold);
      font-size: .85rem;
      font-weight: 600;
      text-transform: uppercase;
      display: flex;
      gap: .5rem;
      align-items: center;

      svg {
        width: 1.2rem;
      }
    }
  }

  p {
    font-size: .55rem;
    letter-spacing: .1em;
    text-align: center;
    text-transform: uppercase;

    a, a:visited {
      color: var(--sterling-silver);
    }
  }
}

body > main > article {
  header,
  section {
    container: flex-swap / inline-size;
  }

  header {
    height: var(--hero-height);
    display: flex;
    flex-direction: column;
    justify-content: center;

    figure {
      height: 100%;

      figcaption {
        position: relative;
        flex: 1;
        width: var(--page-width);
        max-width: var(--max-page-width);
        margin: 0 auto;
      }

      picture {
        display: flex;
        height: 100vw;

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

    p {
      font-size: .9rem;
      line-height: 1.2rem;
    }

    #scroll-indicator {
      display: block;
      position: absolute;
      bottom: 0;
      left: calc(50% - .5rem);
      margin: 1rem 0;
      animation: bump 4s ease 0s infinite;

      &:hover {
        animation-play-state: paused;
        cursor: pointer;
      }

      path {
        stroke: var(--basalt);
      }
    }
  }

  section {
    figure {
      width: var(--page-width);
      max-width: var(--max-page-width);
      margin: 0 auto;
      padding: var(--air) 0;
    }
  }
}

figure {
  display: flex;
  flex-direction: column;

  figcaption {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
  }
  
  &.sit figcaption {
    margin-top: 0;
  }
}
@media screen and (min-width: 801px) {
  figure {
    flex-direction: row-reverse;
    gap: 4rem;
    align-items: center;
    justify-content: center;
    width: var(--page-width);
    max-width: var(--max-page-width);
    margin: 0 auto;

    picture {
      flex: 5;
    }

    figcaption {
      display: block;
      flex: 7;
      margin-top: 0;
    }

    &.sit {
      align-items: last baseline;
    }
  }
  #services section:last-of-type figure {
    picture {
      flex: 7;

      img {
        max-width: 100%;
      }
    }

    figcaption {
      flex: 5;
    }
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.8rem;
  }

  body > main > article {
    header {
      max-height: 70vw !important;

      figure {
        gap: 2rem;
        height: auto;

        picture {
          flex: 7;
          height: unset;
        }

        figcaption {
          flex: 5;
        }
      }
    }

    > section {
      h2 {
        padding: 0;
      }
    }
  }

  p, ul {
    font-size: .7em;
  }

  section.dark > figure {
    flex-direction: row;
  }
  section.dark + section.dark > figure {
    flex-direction: row-reverse;
  }
}

@media (min-width: 801px) and (min-height: 80vw) {
  #scroll-indicator {
    display: none !important;
  }
}
@media (max-width: 635px) and (min-height: 200vw) {
  #scroll-indicator {
    display: none !important;
  }
}

@media (max-width: 800px) and (min-aspect-ratio: 4/7) {
  body > main > article > header > figure > picture {
    height: auto;
  }
}

/* MOVE */

@keyframes fade-left {
  0% {
    opacity: 0;
    translate: -100vw 0;
  }
  100% {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes fade-right {
  0% {
    opacity: 0;
    translate: 60vw 0;
  }
  100% {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes bump {
  0% { transform: translateY(0); }
  4% { transform:translateY(.2rem); }
  8% { transform:translateY(0); }
  12% { transform:translateY(.2rem); }
  16% { transform:translateY(0); }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .slide-in,
  .dark line.slide-in,
  .dark + .dark .slide-in,
  .rev.dark .slide-in {
    animation: fade-left 1s ease-out;
  }
  .dark .slide-in,
  .cert .slide-in,
  .from-right line.slide-in,
  line[stroke-dasharray].slide-in,
  .rev.dark line[stroke-dasharray].slide-in {
    animation: fade-right 1s ease-out;
  }
}
/* reduced motion fallbacks */
.slide-in {
  opacity: 1;
  translate: none;
}

.cert {
  figure {
    flex-direction: column !important;
    align-items: unset;
    max-width: 48rem;
  }

  figcaption {
    justify-content: unset;
  }

  h2 {
    padding-top: 0;
  }

  picture {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2em;
    margin-top: 3.2em;

    svg {
      width: 85vw;
      max-width: 85vw;
    }
  }
}
@media (min-width: 801px) {
  .cert {
    figure {
      gap: 0;
    }
    picture {
      flex-direction: row;

      svg {
        width: 30vw;
        max-width: 16rem;
      }
    }
  }
}
.sd {
  max-width: min(85vw, 24rem);
}

.the-way {
  figure {
    figcaption {
      justify-content: flex-start;
    }
  }
}
