/* --- Self-hosted fonts (latin subset) — no third-party requests --- */
/* Space Grotesk latin is a single variable file covering weights 400–700 */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/space-mono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/space-mono-700-latin.woff2") format("woff2");
}

:root {
  --ink: #f4f4f4;       /* near-white foreground */
  --void: #000000;      /* black background */
  --dim: #8a8a8a;       /* muted text */
  --edge: rgba(244, 244, 244, 0.18);
  --pad: clamp(1.25rem, 4vw, 4rem);
  --about-w: 46ch;      /* About box width — logo is derived from this */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--void);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

/* --- Dithered background canvas --- */
#dither {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  image-rendering: pixelated;
  opacity: 0.55;
}

/* Subtle CRT scanline overlay to sell the 1-bit vibe */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.35) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

/* --- Foreground layout --- */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 4vh, 3rem);
  padding: var(--pad);
  text-align: center;
}

.brand__logo {
  /* always ~2/3 the width of the About box (never overflow narrow screens) */
  width: min(calc(var(--about-w) * 2 / 3), 90vw);
  height: auto;
  display: block;
  /* tight black tile — thin edge keeps it defined over dark dither,
     drop shadow lifts it off the flowing background */
  border: 1px solid var(--edge);
  filter: drop-shadow(0 10px 34px rgba(0, 0, 0, 0.7));
  animation: rise 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.tagline {
  margin: 0;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: clamp(0.85rem, 2.4vw, 1.35rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1.9;
  color: var(--ink);
  /* black outline keeps text legible where the dither flips to white */
  text-shadow:
    -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
    0 0 4px #000;
  animation: rise 1.1s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.tagline__line {
  display: block;
  position: relative;
}

.tagline__line::before,
.tagline__line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: clamp(12px, 4vw, 46px);
  height: 1px;
  background: var(--edge);
}
.tagline__line::before { right: calc(100% + 0.9em); }
.tagline__line::after  { left:  calc(100% + 0.9em); }

/* --- About --- */
.about {
  max-width: var(--about-w);
  margin-top: clamp(1rem, 4vh, 2.5rem);
  padding: clamp(1.1rem, 3vw, 1.75rem);
  text-align: left;
  border: 1px solid var(--edge);
  background: rgba(0, 0, 0, 0.92);
  /* solid halo keeps edges legible over the dither; offset shadow adds depth */
  box-shadow:
    0 0 0 6px rgba(0, 0, 0, 0.92),
    0 16px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  animation: rise 1.1s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.about__heading {
  margin: 0 0 0.75rem;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 0.5ch;
}

.about__prompt {
  color: var(--ink);
}

.cursor {
  width: 0.6ch;
  height: 1em;
  background: var(--ink);
  display: inline-block;
  animation: blink 1.1s steps(1) infinite;
}

.about__body {
  margin: 0;
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  line-height: 1.65;
  color: #d6d6d6;
  text-shadow:
    -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* --- Footer --- */
.foot {
  position: relative;
  margin-top: clamp(1.5rem, 5vh, 3rem);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #cfcfcf;
  text-shadow:
    -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
    0 0 4px #000;
  display: flex;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
  justify-content: center;
}

.foot__dot {
  width: 8px;
  height: 8px;
  background: var(--ink);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.foot__contact {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--edge);
  padding-bottom: 1px;
}
.foot__contact:hover {
  border-bottom-color: var(--ink);
}

/* --- Animations --- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  50% { opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.7); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
