/* Globals */

@font-face {
  font-family: 'Raleway';
  src: url('/assets/fonts/raleway.ttf') format("truetype-variations");
  font-weight: 1 999;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('/assets/fonts/playfair-display.ttf') format("truetype-variations");
  font-weight: 1 999;
}

:root {
  --c-white: #fff;
  --c-link: rgb(30, 161, 225);
  --c-select: rgba(248, 223, 112, 0.616);
  --font-family-primary: 'Raleway', Verdana, sans-serif;
  --font-family-secondary: 'Playfair Display', 'Times New Roman', serif;
  --font-size-huge: clamp(3rem, 10vw, 8rem);
  --font-size-large: clamp(1rem, 2.5vw, 1.2rem);
  --font-size-regular: 1rem;
  --font-size-small: 0.90rem;
}

html {
  font-family: var(--font-family-primary);
}

a {
  display: inline-block;
  text-decoration: none;
}

a::after {
  display: block;
  position: relative;
  top: 0.15em;
  transform: translateY(0.5em);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  opacity: 0;
  background-color: currentColor;
  width: 100%;
  height: 0.05rem;
  content: '';
  pointer-events: none;
}

@media (prefers-reduced-motion) {
  a::after {
    transform: none;
  }
}

a:hover::after,
a:focus-visible::after {
  transform: none;
  opacity: 1;
}

::selection {
  background-color: var(--c-select);
}

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

p a {
  color: var(--c-link);
}

.page {
  margin: 0;
}

:focus-visible {
  outline: 0.15rem dashed currentColor;
  outline-offset: 0.25rem;
}

/* Header */

.header {
  box-sizing: border-box;
  display: flex;
  position: absolute;
  top: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
  padding: 2rem;
  width: 100%;
  color: var(--c-white);
}

.header__name {
  flex-shrink: 0;
  margin: 0;
  text-transform: uppercase;
}

.header__nickname {
  display: inline-block;
  transform: rotate(-20deg) translateY(-0.4em);
  margin: 0 -1.5em 0 -0.3em;
  vertical-align: super;
  text-transform: capitalize;
  font-family: var(--font-family-secondary);
  font-size: 0.75em;
  font-weight: 400;
  font-style: italic;
}

.header__menu {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  list-style: none;
  gap: 2rem;
}

.header__menu-item {
  font-size: var(--font-size-small);
}

.header__menu-item-link {
  display: block;
  color: var(--c-white);
}

/* Intro */

.intro {
  position: relative;
  min-height: 100vh;
  overflow: hidden; /* To clip crooked line */
  color: var(--c-white);
}

.intro::after { /* Crooked line at bottom */
  content: '';
  display: block;
  transform: rotate(-5deg);
  margin-bottom: -20rem;
  background-color: var(--c-white);
  width: 110%;
  height: 25rem;
}

.intro__backdrop {
  pointer-events: none;
  user-select: none;
}

.intro__backdrop-picture {
  position: absolute;
  top: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  transform: translateY(calc(max(-40vh,-20vw) + var(--scroll-offset, 0px))); /* Var set via JS */
}

@media (prefers-reduced-motion) {
  .intro__backdrop-picture {
    transform: none;
  }
}

@media (max-width: 1024px) {
  /* Parallax on mobile is not so smooth, so just don't. */
  .intro__backdrop-picture {
    transform: none;
  }
}

.intro__backdrop::after { /* Backdrop gradient overlay */
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: -1;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
  width: 100%;
  height: calc(20% + (var(--scroll-offset, 0px) * 1.2)); /* Var set via JS */
}

@media (prefers-reduced-motion) {
  .intro__backdrop::after {
    height: 30%;
  }
}

.intro__backdrop-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 28% center;
}

.intro__inner {
  box-sizing: border-box;
  padding: 40vh 3rem 15vh 8vw;
  max-width: 70rem;
}

/* About text */
.about-text {
  max-width: 40rem;
  font-weight: 600;
}

/* Expertise List */

.expertise-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--font-size-huge);
  font-weight: 600;
}

.expertise-list__item {
  margin: 0.5em 0;
  line-height: 0.8;
}

.expertise-list__item:last-child {
  margin-bottom: 0.7em;
}

/* About text and expertise list animations */

.about-text .animated__target,
.expertise-list__item .animated__target {
  display: inline-block;
  transform: translateY(10rem);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  opacity: 0;
}

.about-text.animated--up .animated__target,
.expertise-list__item.animated--up .animated__target {
  transform: translateY(-10rem);
}

.about-text.animated--visible .animated__target,
.expertise-list__item.animated--visible .animated__target {
  transform: none;
  opacity: 1;
}

@media (prefers-reduced-motion) {
  .about-text .animated__target,
  .about-text.animated--up .animated__target,
  .expertise-list__item .animated__target,
  .expertise-list__item.animated--up .animated__target {
    transform: none;
  }
}
