/*
 * zerohub — pure monochrome design system.
 * Theme is driven by the OS: light tokens on :root, dark tokens under
 * @media (prefers-color-scheme: dark). No JS toggle required.
 */

:root {
  --radius: 0.75rem;
  color-scheme: light;
  --background: oklch(0.99 0 0);
  --foreground: oklch(0.16 0 0);
  --card: oklch(1 0 0);
  --primary: oklch(0.16 0 0);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.955 0 0);
  --secondary-foreground: oklch(0.16 0 0);
  --muted-foreground: oklch(0.5 0 0);
  --accent: oklch(0.94 0 0);
  --border: oklch(0.9 0 0);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: oklch(0.13 0 0);
    --foreground: oklch(0.96 0 0);
    --card: oklch(0.17 0 0);
    --primary: oklch(0.96 0 0);
    --primary-foreground: oklch(0.13 0 0);
    --secondary: oklch(0.22 0 0);
    --secondary-foreground: oklch(0.96 0 0);
    --muted-foreground: oklch(0.65 0 0);
    --accent: oklch(0.24 0 0);
    --border: oklch(0.27 0 0);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
  /* hidden scrollbar, scrolling still works */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

::-webkit-scrollbar {
  display: none;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: "JetBrains Mono", "JetBrainsMono Nerd Font", "Symbols Nerd Font",
    ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--foreground);
  color: var(--background);
}

.container {
  width: 100%;
  max-width: 48rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

main.container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.icon {
  width: 1rem;
  height: 1rem;
}

.icon-sm {
  width: 0.875rem;
  height: 0.875rem;
}

/* ------- liquid background ------- */

.liquid {
  position: fixed;
  inset: 0;
  z-index: -10;
  overflow: hidden;
  pointer-events: none;
}

.liquid-blob {
  position: absolute;
  filter: blur(90px);
  will-change: transform, border-radius;
  animation: liquid-morph 16s ease-in-out infinite;
}

.liquid-blob--1 {
  top: -12rem;
  left: -12rem;
  width: 38rem;
  height: 38rem;
  background: color-mix(in srgb, var(--foreground) 6%, transparent);
}

.liquid-blob--2 {
  top: 33%;
  right: -14rem;
  width: 32rem;
  height: 32rem;
  background: color-mix(in srgb, var(--foreground) 4.5%, transparent);
}

.liquid-blob--3 {
  bottom: -14rem;
  left: 25%;
  width: 30rem;
  height: 30rem;
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
}

.liquid-blob--slow {
  animation-duration: 24s;
  animation-delay: -8s;
}

.liquid-blob--rev {
  animation-duration: 19s;
  animation-direction: reverse;
  animation-delay: -4s;
}

@keyframes liquid-morph {
  0%,
  100% {
    border-radius: 58% 42% 60% 40% / 45% 55% 45% 55%;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  33% {
    border-radius: 40% 60% 45% 55% / 60% 40% 60% 40%;
    transform: translate3d(4vw, 3vh, 0) rotate(45deg) scale(1.1);
  }
  66% {
    border-radius: 55% 45% 38% 62% / 42% 58% 42% 58%;
    transform: translate3d(-3vw, -2vh, 0) rotate(-30deg) scale(0.94);
  }
}

/* ------- header ------- */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  background: color-mix(in srgb, var(--background) 70%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-decoration: none;
}

.brand .nf {
  font-size: 1rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.75rem;
}

.nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.3s;
}

.nav a:hover {
  color: var(--foreground);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.status-dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--foreground);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

/* ------- hero ------- */

.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 4rem;
}

.hero-kicker {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.hero-title {
  margin-top: 1.5rem;
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.caret {
  font-weight: 300;
  animation: caret-blink 1.1s step-end infinite;
}

@keyframes caret-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.hero-sub {
  margin-top: 1.5rem;
  max-width: 28rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--muted-foreground);
}

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition:
    transform 0.3s,
    background-color 0.3s;
}

.btn .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.5rem 1rem;
}

.btn-primary:hover {
  transform: scale(1.03);
}

.btn-primary:active {
  transform: scale(0.95);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 0.3s;
}

.link:hover {
  color: var(--foreground);
  text-decoration: underline;
}

.hero-arrow {
  margin-top: 6rem;
  color: var(--muted-foreground);
}

.bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: none;
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* ------- sections ------- */

.section {
  padding-block: 4rem;
  scroll-margin-top: 6rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-sub {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ------- code card ------- */

.code-card {
  margin-top: 1.5rem;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 20px 60px -30px var(--foreground);
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 1rem;
}

.code-dots {
  display: flex;
  gap: 0.375rem;
}

.code-dots span {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--foreground) 20%, transparent);
}

.code-label {
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.code-card pre {
  overflow-x: auto;
  padding: 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.7;
}

.code-card .comment {
  color: var(--muted-foreground);
}

/* ------- copy button ------- */

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.375rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition:
    background-color 0.3s,
    box-shadow 0.3s,
    transform 0.15s;
}

.copy-btn:hover {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-btn .icon-check {
  display: none;
}

.copy-btn.copied .icon-copy {
  display: none;
}

.copy-btn.copied .icon-check {
  display: block;
}

/* ------- features ------- */

.features-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.feature {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 60%, transparent);
  backdrop-filter: blur(8px);
  padding: 1.25rem;
  transition:
    transform 0.5s,
    background-color 0.5s,
    box-shadow 0.5s;
}

.feature:hover {
  transform: translateY(-0.25rem);
  background: var(--card);
  box-shadow: 0 16px 40px -24px var(--foreground);
}

.feature-icon {
  font-size: 1.25rem;
  display: inline-block;
  transition: transform 0.5s;
}

.feature:hover .feature-icon {
  transform: scale(1.1);
}

.feature-title {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.feature-desc {
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  line-height: 1.7;
  color: var(--muted-foreground);
}

/* ------- discord ------- */

.discord-card {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .discord-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.discord-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.discord-icon {
  font-size: 1.5rem;
}

.discord-name {
  font-size: 0.875rem;
  font-weight: 700;
}

.discord-label {
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.discord-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
}

/* ------- footer ------- */

.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  font-size: 0.625rem;
  color: var(--muted-foreground);
}

.footer-dim {
  opacity: 0.7;
}

/* ------- entrance animations ------- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rise {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rise-1 {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.rise-2 {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.rise-3 {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

/* ------- scroll reveal ------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .liquid-blob,
  .caret,
  .status-dot,
  .rise,
  .rise-1,
  .rise-2,
  .rise-3,
  .bounce {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
