/* Tokens */
:root {
  --color-bg: #111;
  --color-text: #fff;
  --color-text-soft: rgb(255 255 255 / 0.85);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(1.5rem, 8vw, 3rem);
  --space-top: clamp(3rem, 15svh, 9rem);
  --space-bottom: clamp(2.5rem, 9svh, 5.5rem);

  --fs-name: clamp(2.75rem, 15vw, 5rem);
  --fs-email: clamp(0.9375rem, 0.85rem + 0.4vw, 1.0625rem);
  --fs-nav: clamp(1.0625rem, 0.8rem + 1.6vw, 1.375rem);
  --nav-tracking: 0.08em;
  --fs-label: clamp(0.9375rem, 0.85rem + 0.35vw, 1.0625rem);

  --play-size: clamp(7rem, 28vw, 9.5rem);
  --play-bg: rgb(255 255 255 / 0.14);
  --line: rgb(255 255 255 / 0.18);

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --dur: 200ms;
}

/* Base */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  overflow: hidden;
}

/* Background */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--color-bg) url("img/bg_reel_poster.jpg") center / cover no-repeat;
}

@media (orientation: portrait) {
  .hero__media { background-image: url("img/bg_reel_vertical_poster.jpg"); }
}

.hero__layer {
  position: absolute;
  inset: 0;
  transform: translateZ(0);
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero__layer--overlay {
  opacity: 0;
  will-change: opacity;
  transition: opacity 500ms ease-in-out;
}

.hero__layer--overlay.is-active { opacity: 1; }

/* Noise */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("img/bg_noise.png") 0 0 repeat;
  opacity: 0.6;
  pointer-events: none;
}

/* Layout */
.hero__content {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(2rem, 6svh, 4rem);
  padding:
    calc(var(--space-top) + env(safe-area-inset-top))
    calc(var(--gutter) + env(safe-area-inset-right))
    calc(var(--space-bottom) + env(safe-area-inset-bottom))
    calc(var(--gutter) + env(safe-area-inset-left));
}

.intro {
  display: contents;
}

.intro__name {
  font-size: var(--fs-name);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.intro__head {
  grid-row: 1;
  text-align: center;
}

.intro__email {
  margin-top: 0.75em;
  font-size: var(--fs-email);
  font-weight: 300;
  color: rgb(255 255 255);
  min-height: 1.4em;
}

.intro__nav {
  grid-row: 3;
  justify-self: center;
  width: 100%;
  max-width: 30rem;
  font-size: var(--fs-nav);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--nav-tracking);
}

.intro__nav ul { border-top: 1px solid var(--line); }
.intro__nav li { border-bottom: 1px solid var(--line); }
.intro__nav .desktop-only { display: none; }

/* Links */
.nav-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 0.8em;
  -webkit-tap-highlight-color: transparent;
}

.nav-link__label {
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.25em;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--dur) var(--ease);
}

.nav-link:focus-visible .nav-link__label { text-decoration-color: currentColor; }

@media (hover: hover) {
  .nav-link:hover .nav-link__label { text-decoration-color: currentColor; }
}

/* Reel button */
.reel {
  grid-row: 2;
  justify-self: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  -webkit-tap-highlight-color: transparent;
}

.reel__button {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--play-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--play-bg);
  isolation: isolate;
}

/* Hover layer */
.reel__button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgb(255 255 255 / 0.19);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  will-change: opacity;
}

.reel__button svg {
  width: calc(var(--play-size) * 0.42);
  height: calc(var(--play-size) * 0.42);
  fill: currentColor;
  translate: 6% 0;
}

.reel__label {
  font-size: var(--fs-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  opacity: 0.55;
  transition: opacity var(--dur) var(--ease);
  will-change: opacity;
}

.reel:hover .reel__button::before,
.reel:focus-visible .reel__button::before { opacity: 1; }

.reel:hover .reel__label,
.reel:focus-visible .reel__label { opacity: 1; }

.reel:focus-visible { outline: none; }
.reel:focus-visible .reel__button {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

/* Desktop */
@media (min-width: 56em), (min-width: 40em) and (orientation: landscape) and (max-height: 32em) {
  :root {
    --gutter: 11vw;
    --space-top: clamp(3rem, 10svh, 8rem);
    --space-bottom: clamp(3rem, 10svh, 8rem);
    --fs-name: clamp(5rem, 5vw, 6.5rem);
    --fs-nav: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem);
    --nav-tracking: 0.02em;
    --play-size: clamp(7.5rem, 9.25vw, 11rem);
  }

  .hero__content {
    grid-template-columns: max-content 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 0;
    padding-right: env(safe-area-inset-right);
  }

  .intro {
    display: block;
    grid-row: 1;
    grid-column: 1;
  }

  .intro__head { text-align: left; }

  .intro__name { margin-left: -0.04em; }

  .intro__email {
    margin-top: 0.4em;
  }

  .intro__nav {
    justify-self: stretch;
    width: auto;
    max-width: none;
    margin-top: clamp(2rem, 5svh, 3.5rem);
    contain: inline-size;
  }

  .intro__nav ul {
    display: flex;
    column-gap: clamp(2rem, 3vw, 3.5rem);
    white-space: nowrap;
    border-top: 0;
  }

  .intro__nav li { border-bottom: 0; }
  .intro__nav .desktop-only { display: block; }

  .nav-link {
    display: inline-block;
    padding-block: 0.5em;
  }

  .reel {
    grid-row: 1;
    grid-column: 2;
    margin-top: clamp(1rem, 4svh, 3rem);
  }
}

@media (min-width: 56em) and (hover: hover) {
  .nav-link {
    opacity: 0.75;
    transition: opacity var(--dur) var(--ease);
  }

  .nav-link:hover,
  .nav-link:focus-visible { opacity: 1; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Short landscape */
@media (orientation: landscape) and (max-height: 32em) {
  :root {
    --space-top: 2rem;
    --space-bottom: 2rem;
    --fs-name: clamp(3rem, 15svh, 4rem);
    --play-size: clamp(5.5rem, 22svh, 7.5rem);
    --fs-nav: 0.875rem;
  }

  .intro__nav { margin-top: 1rem; }
  .intro__nav ul { column-gap: 1rem; }
}

/* Short portrait */
@media (orientation: portrait) and (max-height: 42em) {
  :root {
    --space-top: 2.5rem;
    --space-bottom: 1.5rem;
    --play-size: clamp(6rem, 24vw, 7rem);
  }

  .hero__content { gap: 1.5rem; }
  .nav-link { padding-block: 0.6em; }
}
