@font-face {
  font-family: "Druk Wide";
  src: url("../fonts/DrukWide-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Tall Dark";
  src: url("../fonts/talldark.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #000;
  --white: #fff;
  --accent: #9146ff;
}

::selection {
  color: var(--white);
  background: var(--accent);
}

html {
  font-size: 125%;
  min-height: 100vh;
  min-height: 100dvh;
  height: -webkit-fill-available;
  height: fill-available;
  overflow-x: hidden;
}

body {
  position: relative;
  background-color: var(--black);
  color: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  font-size: inherit;
}

a:hover {
  text-decoration: underline;
}

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

body > canvas {
  position: fixed;
  inset: 0;
  width: 100svw;
  height: 100svh;
  max-width: 100%;
  max-height: 100%;
  z-index: 0;
  opacity: 0;
  /* iOS Safari: fixed WebGL wins hit-testing over HTML, steals taps */
  pointer-events: none;
  transform: translateZ(0);
}

/* Desktop: keep canvas interactive for mouse */
@media (hover: hover) and (pointer: fine) {
  body > canvas {
    pointer-events: auto;
  }
}

body.loaded > canvas {
  animation: canvas-fade-in 1.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes canvas-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.25;
  }
}

@keyframes canvas-fade-in-mobile {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.11;
  }
}

@media (max-width: 767px) {
  body.loaded > canvas {
    animation: canvas-fade-in-mobile 1.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
}

h1 {
  hyphens: auto;
  text-wrap: balance;
}

/* Layout */

.hero {
  cursor: crosshair;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
  isolation: isolate;
  overflow-x: hidden;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  padding-block: env(safe-area-inset-top) env(safe-area-inset-bottom);

  --hero-gap-logo-heading: 2rem;
  --hero-gap-heading-footer: 2rem;
  --hero-gap-footer-social: 2rem;
  --hero-social-bar-reserve: 4.25rem;
  gap: 0;

  @media (max-width: 767px) {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-top: max(1.25rem, env(safe-area-inset-top));
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    --hero-gap-logo-heading: 1rem;
    --hero-gap-footer-social: 1rem;
  }

  @media (min-width: 768px) {
    --hero-gap-footer-social: 1.5rem;
    gap: var(--hero-gap-footer-social);
  }
}

/* Intro: centered logo on black, rest of layout off-screen until .loaded */

body.intro .hero__content > .logo,
body.intro .hero__content > .heading {
  margin-bottom: 0;
}

body.intro .hero {
  gap: 0;
}

body.intro .heading,
body.intro .social,
body.intro .footer {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body.intro .logo.animate-slide-up,
body.loaded .logo.animate-slide-up {
  animation: none;
  opacity: 1;
}

body.intro .animate-fade-up {
  animation-play-state: paused;
}

body.loaded .animate-fade-up {
  animation-play-state: running;
}

.hero__content {
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: min(90svw, 60rem);
  margin-inline: auto;
  position: relative;
  flex: 0 0 auto;
  transform: translateZ(0);
  /* Desktop footer font scales with container width */
  container-type: inline-size;
  container-name: hero;
}

.hero__content > .logo {
  margin-bottom: var(--hero-gap-logo-heading);
}

.hero__content > .heading {
  margin-bottom: var(--hero-gap-heading-footer);
}

/* Logo */

.logo {
  position: relative;
  z-index: 2;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  body > canvas {
    opacity: 0.25;
    animation: none;
  }

  .animate-slide-up,
  .animate-fade-up {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.logo svg {
  position: relative;
  z-index: 0;
  width: 100%;
  height: auto;
  fill: currentColor;
}

/* Heading */

.heading {
  position: relative;
  z-index: 1;
  text-align: justify;
  text-align-last: start;
  text-transform: uppercase;
  font-family: "Druk Wide", sans-serif;
  font-size: clamp(0.75rem, 2.8vw + 0.1rem, 1.5rem);
  font-weight: 700;
  line-height: 120%;
  letter-spacing: 0.02em;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

@supports (text-box-trim: trim-both) {
  .heading {
    text-box-trim: trim-both;
  }
}

@supports not (text-wrap: pretty) {
  .heading {
    text-wrap: wrap;
  }
}

.link {
  text-decoration: underline;
}

.link:hover {
  opacity: 1;
  color: var(--white);
}

.link--split {
  text-decoration: none;
}

.link--split .link__brand {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

/* Social */

.social {
  position: relative;
  z-index: 2;
  display: flex;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-weight: 400;
  line-height: 100%;
  text-transform: uppercase;
}

.social__title {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 25%;
}

.social__links {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 1rem;
}

.social__label {
  font-size: 0.75rem;
  font-weight: 400;
}

.social__divider {
  background-color: var(--white);
  flex: 1;
  height: 2px;
}

.social__divider--grow {
  min-width: 0.75rem;
}

/* Footer */

.footer {
  position: relative;
  z-index: 1;

  /* Typography tokens */
  --footer-font-mobile: clamp(1.3125rem, 1.0625vw + 2rem, 1.5rem);
  --footer-font-desktop-min: 0.62rem;
  --footer-font-desktop-max: 2rem;
  --footer-font-desktop-slope: 2.65;
  --footer-font-desktop-base: 0.42rem;
  --footer-font-copy-ratio: 0.35;
  --footer-font-size: var(--footer-font-mobile);

  --footer-gap: 12.5px;
  --footer-globe-em: 1.75;
  --footer-x-h-mobile: 0.6em;

  font-family: "Tall Dark", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: var(--footer-font-size);
}

.footer__row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--footer-gap);
  width: 100%;
  flex-shrink: 0;
}

.footer__name {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  display: block;
  line-height: 1;
  white-space: nowrap;
}

/* X: fluid spacer between name and roles */
.footer__x-wrap {
  flex: 1 1 0;
  min-width: clamp(0.5rem, 3vw, 1.25rem);
  width: 0;
  align-self: center;
  height: var(--footer-x-h-mobile);
  max-height: var(--footer-x-h-mobile);
  min-height: 0;
}

.footer__x {
  display: block;
  width: 100%;
  height: 100%;
  color: var(--white);
  vertical-align: top;
  overflow: visible;
}

.footer__roles {
  display: block;
  line-height: 1;
  width: auto;
  flex: 0 1 auto;
  min-width: 0;
  letter-spacing: inherit;
  white-space: nowrap;
}

.footer__available {
  flex: 1;
  min-width: 0;
}

.footer__globe {
  display: block;
  width: calc(var(--footer-globe-em) * 1em);
  max-width: calc(var(--footer-globe-em) * 1em);
  height: auto;
  flex: 0 0 auto;
}

.footer__worldwide {
  flex: 1;
  min-width: 0;
  text-align: right;
}

/* Mobile: center globe with equal-width columns */
.footer__row--globe {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--footer-gap);
}

.footer__row--globe .footer__available,
.footer__row--globe .footer__worldwide {
  justify-self: center;
  text-align: center;
}

.footer__row--globe .footer__globe {
  justify-self: center;
  /* Nudge for off-center SVG (cx 15.53 vs viewBox mid 16) */
  transform: translateX(calc((16 - 15.53) / 32 * var(--footer-globe-em) * 1em));
}

/* Hidden on mobile, shown inline on desktop */
.footer__avail-full {
  display: none;
}

.footer__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 0;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: calc(var(--footer-font-size) * var(--footer-font-copy-ratio));
  line-height: normal;
  text-transform: none;
}

.footer__copy-line {
  display: block;
  text-align: center;
  letter-spacing: 0.05em;
  margin-inline-end: -0.05em;
  text-wrap: balance;
}

.footer__copy-spacer {
  white-space: pre;
}

/* Desktop */

@media (min-width: 768px) {
  .hero > .social {
    max-width: min(90svw, 60rem);
    margin-inline: auto;
    width: 100%;
  }

  .footer {
    --footer-font-size: clamp(
      var(--footer-font-desktop-min),
      calc(var(--footer-font-desktop-slope) * 0.9vw + var(--footer-font-desktop-base)),
      var(--footer-font-desktop-max)
    );
    --footer-gap: 20px;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--footer-gap);
  }

  .footer__name,
  .footer__roles,
  .footer__globe,
  .footer__avail-full {
    flex-shrink: 0;
  }

  .footer__row,
  .footer__row--globe {
    display: contents;
  }

  .footer__row--globe .footer__available,
  .footer__row--globe .footer__worldwide {
    justify-self: unset;
  }

  .footer__name {
    order: 1;
  }

  .footer__x-wrap {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    /* Cap-height of Tall Dark — slightly under 1em so X isn't taller than type */
    height: 0.52em;
    max-height: 0.52em;
    align-self: center;
  }

  .footer__roles {
    order: 3;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    margin-inline-start: auto;
  }

  .footer__globe {
    order: 4;
    margin: 0;
  }

  .footer__avail-full {
    order: 5;
    display: inline;
    white-space: nowrap;
  }

  .footer__available,
  .footer__worldwide {
    display: none;
  }

  .footer__copy {
    display: none;
  }

  .footer__name,
  .footer__roles {
    font-size: inherit;
    letter-spacing: 0.1em;
  }
}

/* Container-query font sizing (progressive enhancement over vw fallback) */
@supports (font-size: 1cqw) {
  @media (min-width: 768px) {
    .footer {
      --footer-font-size: clamp(
        var(--footer-font-desktop-min),
        calc(var(--footer-font-desktop-slope) * 1cqw + var(--footer-font-desktop-base)),
        var(--footer-font-desktop-max)
      );
    }
  }
}

/* Animations */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  opacity: 0;
  animation: slide-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-up {
  opacity: 0;
  animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
  animation-delay: 0.1s;
}
.delay-2 {
  animation-delay: 0.2s;
}
.delay-3 {
  animation-delay: 0.3s;
}
.delay-4 {
  animation-delay: 0.4s;
}
.delay-5 {
  animation-delay: 0.5s;
}
.delay-6 {
  animation-delay: 0.6s;
}
.delay-7 {
  animation-delay: 0.7s;
}
.delay-8 {
  animation-delay: 0.8s;
}

/* Responsive */

@media (max-width: 991px) {
  .hero__content {
    width: 100%;
  }

  .social__divider {
    height: 1px;
  }
}

@media (max-width: 767px) {
  .hero__content {
    padding-bottom: calc(
      var(--hero-social-bar-reserve) + var(--hero-gap-footer-social) + env(safe-area-inset-bottom)
    );
  }

  /* Fixed bottom bar — must be outside .hero__content (transform breaks fixed) */
  .social {
    position: fixed;
    z-index: 25;
    left: 0;
    right: 0;
    bottom: 0;
    padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-top: 0.75rem;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: stretch;
    gap: 0.75rem;
    width: 100%;
    max-width: none;
    margin-inline: 0;
    background: var(--black);
  }

  .social__title {
    display: none;
  }

  .social__links {
    display: flex;
    flex: 1;
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
  }

  .social__divider:not(.social__divider--grow) {
    display: none;
  }

  .social__divider--grow {
    height: 1px;
  }

  .footer__copy-spacer {
    display: none;
  }

  .footer__row--name {
    padding-inline: 0.5rem;
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .footer__row--globe {
    padding-inline: 1rem;
    margin-top: 0.5rem;
  }

  .footer__copy {
    padding-top: 0.5rem;
    align-items: center;
  }
}

@media (max-width: 479px) {
  .social__divider {
    margin: 0;
  }
}
