@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 {
  /* ~12.5% larger rem/em base without transform: scale (browser default × 1.125) */
  font-size: 125%;
  height: -webkit-fill-available;
  height: fill-available;
}

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

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: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
}

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%;
  height: 100svh;
  position: relative;
  overflow: hidden;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}

.hero {
  z-index: 1;
  isolation: isolate;
}

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

body.intro .hero__content {
  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: 1.5rem;
  width: 100%;
  max-width: min(90svw, 60rem);
  margin-inline: auto;
  position: relative;
  transform: translateZ(0);
}

/* Logo */

.logo {
  position: relative;
  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;
  /* one fluid size (replaces per-breakpoint .heading font-size) */
  font-size: clamp(0.75rem, 2.8vw + 0.1rem, 1.5rem);
  font-weight: 700;
  line-height: 120%;
  letter-spacing: 0.02em;
  hyphens: auto;
  text-box-trim: trim-both;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  /* pretty line breaks for justified copy; balance + justify causes huge word gaps */
  text-wrap: pretty;
}

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

.link {
  text-decoration: underline;
}

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

/* @ plain; Surfer underlined; hover unchanged */
.link--split {
  text-decoration: none;
}

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

/* Social */

.social {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
  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: 1rem;
  font-weight: 700;
}

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

/* Footer — tokens from Figma Website file (frames 423:186 desktop row, 421:273 mobile) */

.footer {
  --footer-primary: 26.66px;
  --footer-roles-desktop: 11.309px;
  --footer-copy: 0.35em;
  --footer-gap: 10px;
  --footer-stack-gap: 0px;
  --footer-globe-w: 40px;
  /* X height = Design/Engineer block: mobile one line, desktop two stacked lines */
  --footer-x-h-mobile: 0.6em;
  --footer-x-h-desktop: 0.6em;
  font-family: "Tall Dark", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--footer-stack-gap);
  font-size: var(--footer-primary);
}

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

/* X: width from flex, height locked to DE label (no aspect-ratio blow-up) */
.footer__x-wrap {
  flex: 1 1 0;
  min-width: 1rem;
  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);
  overflow: visible;
  vertical-align: top;
}

/* Mobile: one row — Design ——— Engineer; desktop: stacked column (see 768px) */
.footer__roles {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--footer-gap);
  line-height: 1;
  width: 100%;
  letter-spacing: inherit;
}

.footer__roles-line {
  flex: 1;
  height: 1px;
  align-self: center;
  margin: 0;
  min-width: 0.35rem;
  background: var(--white);
}

.footer__design,
.footer__engineer {
  flex-shrink: 0;
  display: block;
  line-height: 1;
  font-family: inherit;
  font-weight: inherit;
  font-style: inherit;
  /* mobile frame: same 26.66px as other footer lines */
  font-size: inherit;
}
.footer__available {
  flex: 1;
}
.footer__globe {
  width: var(--footer-globe-w);
  height: auto;
  flex-shrink: 0;
}
.footer__worldwide {
  flex: 1;
  text-align: right;
}

/* Desktop-only "Available Worldwide" (hidden on mobile; explicit for Safari) */
.footer__avail-full {
  display: none !important;
}

.footer__copy {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: var(--footer-copy);
  letter-spacing: 0.05em;
  line-height: normal;
  text-align: center;
  margin-top: 0;
}

/* Desktop: flatten rows into single line */
@media (min-width: 768px) {
  .footer {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--footer-gap);
    font-size: var(--footer-primary);
  }

  .footer__row {
    display: contents;
  }

  .footer__roles {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: auto;
    flex-shrink: 0;
    gap: 0;
  }

  .footer__roles-line {
    display: none;
  }

  .footer__x-wrap {
    min-width: 2rem;
    height: var(--footer-x-h-desktop);
    max-height: var(--footer-x-h-desktop);
  }

  /* desktop frame: stacked label, smaller type */
  .footer__design,
  .footer__engineer {
    font-size: var(--footer-roles-desktop);
    letter-spacing: 0.1em;
  }

  /* Hide mobile-only elements, show desktop "Available Worldwide" */
  .footer__available {
    display: none;
  }
  .footer__worldwide {
    display: none;
  }
  .footer__avail-full {
    display: inline !important;
  }

  .footer__globe {
    width: var(--footer-globe-w);
    margin: 0;
  }

  .footer__copy {
    margin: 0 0 0 auto;
    text-align: right;
  }
}

/* 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) {
  .footer__x-wrap {
    flex: 0 0 auto;
    width: min(28vw, 5.25rem);
    aspect-ratio: 1;
    height: auto;
    max-height: none;
  }

  .hero {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .social {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .social__title {
    width: auto;
  }

  .social__links {
    flex-wrap: wrap;
  }

  .footer__copy {
    /* no mobile overrides needed — handled in footer base */
  }
}

@media (max-width: 479px) {
  .hero__content {
    gap: 0.5rem;
  }

  .social {
    gap: 0;
    margin-top: 1em;
    margin-bottom: 1em;
  }

  .social__divider {
    margin: 0;
  }

  .social__label {
    font-size: 0.8rem;
  }
}
