:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;

  --font-body: system-ui, sans-serif;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root,
[data-theme='light'] {
  --color-bg: #f4f2ed;
  --color-surface: #ece8df;
  --color-surface-soft: #fbfaf7;
  --color-text: #171614;
  --color-text-muted: #68645c;
  --color-text-faint: #9b968d;
  --color-border: color-mix(in oklab, var(--color-text), transparent 86%);
  --color-accent: #1b1a17;
  --color-stage: #fffcf6;
  --color-code: #171614;
  --shadow-stage:
    0 1px 2px oklch(0.2 0.01 80 / 0.06),
    0 20px 60px oklch(0.2 0.01 80 / 0.08);
}

[data-theme='dark'] {
  --color-bg: #111110;
  --color-surface: #1d1c1a;
  --color-surface-soft: #22211f;
  --color-text: #fffefa;
  --color-text-muted: #9c9991;
  --color-text-faint: #64625d;
  --color-border: color-mix(in oklab, var(--color-text), transparent 86%);
  --color-accent: #fffefa;
  --color-stage: #111110;
  --color-code: #ffffff;
  --shadow-stage:
    0 1px 2px oklch(0 0 0 / 0.28),
    0 24px 90px oklch(0 0 0 / 0.44);
}

.landing {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--color-bg);
}

.hero {
  display: grid;
  min-height: 100dvh;
  grid-template-rows: 1fr auto auto auto 1fr;
  align-items: center;
  justify-items: center;
  row-gap: 1rem;
  padding: clamp(var(--space-8), 5vw, var(--space-16)) var(--space-5);
}

.logo-stage {
  position: relative;
  grid-row: 2;
  width: 150px;
  max-width: 78vw;
  aspect-ratio: 88 / 145;
  overflow: visible;
  color: var(--color-code);
  transform: translateZ(0);
  animation: stage-enter 900ms var(--ease-out) both;
}

.masked-logo {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.dot-field circle {
  fill: var(--color-code);
  transform-box: fill-box;
  transform-origin: center;
}

.status-indicator {
  grid-row: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.62);
  font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  line-height: 1;
  animation: stage-enter 900ms var(--ease-out) 90ms both;
}

.status-light {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  animation: status-pulse 1.5s ease-in-out infinite;
}

.social-links {
  grid-row: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  animation: stage-enter 900ms var(--ease-out) 120ms both;
}

.social-links a {
  display: grid;
  width: 1.95rem;
  height: 1.95rem;
  place-items: center;
  color: rgba(255, 255, 255, 0.52);
  text-decoration: none;
}

.social-links svg {
  width: 1.08rem;
  height: 1.08rem;
  fill: currentColor;
}

.social-links a:hover,
.social-links a:focus-visible {
  color: rgba(255, 255, 255, 0.9);
}

.logo-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  filter: invert(1);
}

@keyframes stage-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.88);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.38);
  }

  50% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0.32rem rgba(74, 222, 128, 0);
  }
}

@media (width <= 640px) {
  .hero {
    grid-template-rows: 1fr auto auto auto 1fr;
    padding-inline: var(--space-4);
  }

  .logo-stage {
    width: min(150px, 78vw);
  }

}

@media (prefers-reduced-motion: reduce) {
  .dot-field {
    opacity: 0;
  }

  .logo-fallback {
    opacity: 1;
  }

  .status-light {
    animation: none;
  }
}
