:root {
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

/* Theme palettes scoped cleanly by [data-state] so both the live shell and transition underlay render independently */
html[data-state="off"],
[data-theme="off"] {
  --bg: #f7f6f2;
  --fg: #141619;
  --muted: #636973;
  --surface: #ffffff;
  --border: #e4e2da;
  --border-strong: #141619;
  --dot: #ff2414;
  --dot-core: #ff8a7a;
  --dot-glow: rgba(255, 36, 20, 0.88);
  --dot-halo: rgba(255, 36, 20, 0.52);
  --selection-bg: rgba(255, 36, 20, 0.16);
}

html[data-state="on"],
[data-theme="on"] {
  --bg: #0f1114;
  --fg: #f7f6f2;
  --muted: #9ba1aa;
  --surface: #181b20;
  --border: #282d35;
  --border-strong: #f7f6f2;
  --dot: #00ff6a;
  --dot-core: #c4ffe0;
  --dot-glow: rgba(0, 255, 106, 0.92);
  --dot-halo: rgba(0, 255, 106, 0.56);
  --selection-bg: rgba(0, 255, 106, 0.22);
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

::selection {
  background-color: var(--selection-bg);
  color: var(--fg);
}

.page-underlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: none;
}

.page-underlay.is-active {
  display: block;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100svh;
  background-color: var(--bg);
  color: var(--fg);
}

.page-underlay .page-shell {
  z-index: 1;
}

.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

.top-bar {
  position: fixed;
  top: clamp(1rem, 3vw, 1.75rem);
  right: clamp(1rem, 3vw, 1.75rem);
  z-index: 10;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--fg);
  text-decoration: none;
  transition:
    border-color 180ms ease,
    transform 160ms ease;
}

.social-link:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.social-link:active {
  transform: translateY(0) scale(0.96);
}

.social-link:focus-visible {
  outline: 2px solid var(--dot);
  outline-offset: 3px;
}

.social-icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* Stage pins the blinking dot to the exact (50%, 50%) geometric center of the viewport */
.stage {
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.wordmark {
  margin: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: clamp(0.9rem, 2.8vw, 1.9rem);
  font-size: clamp(3.25rem, 11.5vw, 7.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  -webkit-user-select: none;
  user-select: none;
}

.wordmark-prefix,
.wordmark-state {
  display: inline-block;
  /* Shift the text slightly upward relative to the centered dot so the dot sits dead-center in the x-height while staying at 50vh */
  transform: translateY(-0.1em);
  cursor: default;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.wordmark-prefix {
  justify-self: end;
}

.wordmark-state {
  justify-self: start;
}

.status-dot {
  position: relative;
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  display: inline-block;
  justify-self: center;
  align-self: center;
  width: clamp(16px, 2.4vw, 28px);
  height: clamp(16px, 2.4vw, 28px);
  border-radius: 9999px;
  background-color: var(--dot);
  background-image: radial-gradient(
    circle at 36% 34%,
    var(--dot-core) 0%,
    var(--dot) 54%
  );
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
  animation: led-blink 1.4s ease-in-out infinite;
}

/* Invisible expanded click/tap target around the dot for effortless interaction */
.status-dot::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 9999px;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: led-pulse-ring 1.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  pointer-events: none;
}

@media (hover: hover) {
  .status-dot:hover {
    transform: scale(1.14);
  }
}

.status-dot:active {
  transform: scale(0.92);
}

.status-dot:focus-visible {
  outline: 2px solid var(--dot);
  outline-offset: 6px;
}

@keyframes led-blink {
  0%,
  100% {
    opacity: 1;
    box-shadow:
      0 0 16px var(--dot-glow),
      0 0 36px var(--dot-halo);
  }
  45%,
  55% {
    opacity: 0.22;
    box-shadow: 0 0 3px transparent;
  }
  80% {
    opacity: 1;
    box-shadow:
      0 0 20px var(--dot-glow),
      0 0 42px var(--dot-halo);
  }
}

@keyframes led-pulse-ring {
  0% {
    box-shadow: 0 0 0 0 var(--dot-glow);
    opacity: 0.95;
  }
  65% {
    box-shadow: 0 0 0 20px transparent;
    opacity: 0;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    opacity: 0;
  }
}

/* Positioned lower on the page independently so the dot stays mathematically centered */
.subtitle {
  position: absolute;
  left: 50%;
  top: calc(50% + clamp(8.5rem, 23vh, 13.5rem));
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.35vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  white-space: nowrap;
  color: var(--muted);
}

@keyframes wordmark-ignite {
  0% {
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
  }
  18% {
    filter: drop-shadow(0 0 26px rgba(255, 255, 255, 0.98))
      drop-shadow(0 0 58px rgba(0, 255, 106, 0.9));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(0, 255, 106, 0));
  }
}

.wordmark.is-igniting {
  animation: wordmark-ignite 740ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .status-dot,
  .status-dot::after,
  .wordmark.is-igniting {
    animation: none;
  }

  .status-dot {
    box-shadow:
      0 0 16px var(--dot-glow),
      0 0 32px var(--dot-halo);
  }
}
