/* Montserrat, self-hosted (Latin, variable 400–800) and preloaded in index.html so it
   arrives with the page instead of after a Google Fonts round trip */
@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/montserrat-latin.woff2") format("woff2");
}

/* Stop phones from enlarging some text and not the links beside it. iOS needs the prefix. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #151113;
}

/* Grain + vignette, fixed so content scrolls over it (matches tej.as approach) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url%28%23n%29' opacity='0.55'/%3E%3C/svg%3E")
    repeat;
  background-size: 160px 160px;
  mix-blend-mode: screen;
  opacity: 0.15;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(145% 115% at 50% 35%, rgb(0 0 0 / 0%) 58%, #151113 100%);
  opacity: 0.55;
}

h1,
p {
  margin: 0;
}

a {
  color: #f2efe9;
  text-decoration: none;
}

a:hover {
  color: #fff;
}

/* Signature underline */
.ul {
  position: relative;
  display: inline-block;
}

.ul::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  transform: translateX(-50%);
  height: 1px;
  width: 0;
  background: #ef3340;
  transition:
    width 0.25s ease-out,
    height 0.2s ease-out;
}

.ul:hover::after,
.ul:focus-visible::after {
  width: 100%;
  height: 2px;
}

.ul:focus-visible {
  outline: none;
}

@media (hover: none) {
  .ul::after {
    width: 100%;
    opacity: 0.35;
  }
}

/* dvh is the height actually visible on phones; vh is the fallback and counts the browser toolbar */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  padding: 32px 32px 28px;
  background: #151113;
  font-family: Montserrat, sans-serif;
  display: flex;
  flex-direction: column;
}

/* Fills everything above the footer */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 44px;
  text-align: center;
}

.brand {
  position: relative;
  display: inline-block;
}

.wordmark {
  font-size: clamp(min(10.75vw, 48px), 9vw, 112px);
  font-weight: 800;
  line-height: 1.05;
  color: #f2efe9;
  letter-spacing: -0.02em;
}

.wordmark-dot {
  color: #ef3340;
}

/* Red line that grows out from the center on load */
.draw {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: #ef3340;
  animation: draw 0.9s 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes draw {
  to {
    width: 100%;
  }
}

/* Text fades up on load: wordmark, then the line, links and footer */
.wordmark,
.site-nav,
.footer {
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .draw {
    animation: none;
    width: 100%;
  }

  .wordmark,
  .site-nav,
  .footer {
    animation: none;
  }
}

.site-nav {
  animation-delay: 0.7s;
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 17px;
  font-weight: 600;
}

.footer {
  animation-delay: 0.9s;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a39b98;
}

/* Backup for iOS if it still links the footer text (see format-detection in index.html) */
.footer a[x-apple-data-detectors] {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
}

/* Paused until the page script marks the font as ready (see index.html). Without JS it just plays. */
.anim .wordmark,
.anim .draw,
.anim .site-nav,
.anim .footer {
  animation-play-state: paused;
}

.anim.ready .wordmark,
.anim.ready .draw,
.anim.ready .site-nav,
.anim.ready .footer {
  animation-play-state: running;
}
