:root {
  --bg: #f7f7f5;
  --fg: #16181d;
  --muted: #5d6270;
  --accent: #2f6fed;
  --accent-hi: #8fb4ff;
  --grid: rgba(47, 111, 237, 0.22);
  --glow: rgba(47, 111, 237, 0.20);
  --line: rgba(47, 111, 237, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #eef0f4;
    --muted: #9aa0ad;
    --accent: #6d9bff;
    --accent-hi: #d6e3ff;
    --grid: rgba(109, 155, 255, 0.26);
    --glow: rgba(109, 155, 255, 0.22);
    --line: rgba(109, 155, 255, 0.55);
  }
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: hidden;
}

/* ── Background: glowing orb, horizon line, moving grid floor ── */

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

.glow {
  position: absolute;
  top: 42%;
  left: 50%;
  width: min(90vw, 620px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
  filter: blur(24px);
  animation: pulse 7s ease-in-out infinite;
}

.horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 62%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  box-shadow: 0 0 24px 2px var(--glow);
}

.grid {
  position: absolute;
  left: -50%;
  right: -50%;
  top: 62%;
  height: 80%;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(320px) rotateX(62deg);
  transform-origin: center top;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%, #000 70%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 35%, #000 70%, transparent 100%);
  animation: grid-move 3.5s linear infinite;
}

/* ── Content ── */

main {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -12vh;
}

.logo {
  font-size: clamp(2.75rem, 13vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  animation: rise 0.9s cubic-bezier(.2, .7, .2, 1) both;
}

.logo span {
  color: var(--accent);
  background: linear-gradient(100deg, var(--accent) 35%, var(--accent-hi) 50%, var(--accent) 65%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4.5s ease-in-out infinite;
}

.tagline {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  animation: rise 0.9s 0.15s cubic-bezier(.2, .7, .2, 1) both;
}

.contact {
  margin-top: 1.5rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  font-size: clamp(0.95rem, 3.6vw, 1.05rem);
  letter-spacing: 0.02em;
  text-decoration: none;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
  animation: rise 0.9s 0.3s cubic-bezier(.2, .7, .2, 1) both;
}

.contact:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 28px var(--glow);
  transform: translateY(-1px);
}

.contact:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Animations ── */

@keyframes grid-move {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 56px, 0 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  60%, 100% { background-position: 0% 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
