:root {
  --bg: #150a28;
  --bg-deep: #0c0418;
  --text: #eee8f6;
  --text-muted: #9a8ab8;
  --text-faint: #4a3870;
  --accent: #14b8a6;
  --accent-soft: rgba(20, 184, 166, 0.15);
  --accent-glow: rgba(20, 184, 166, 0.4);
  --violet: #8b5cf6;
  --violet-soft: rgba(139, 92, 246, 0.06);
  --grain-opacity: 0.035;
  --logo-glow: rgba(139, 92, 246, 0.3);
  --em-color: #2dd4bf;
  --grad-teal: rgba(20, 184, 166, 0.08);
  --grad-violet: rgba(139, 92, 246, 0.12);
  --grad-mid: rgba(40, 20, 70, 0.5);
  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3eff8;
    --bg-deep: #e8e2f0;
    --text: #1a0a2e;
    --text-muted: #534068;
    --text-faint: #9a8ab8;
    --accent: #0f766e;
    --accent-soft: rgba(15, 118, 110, 0.12);
    --accent-glow: rgba(15, 118, 110, 0.2);
    --violet: #7c3aed;
    --violet-soft: rgba(124, 58, 237, 0.06);
    --grain-opacity: 0.03;
    --logo-glow: rgba(139, 92, 246, 0.2);
    --em-color: #0f766e;
    --grad-teal: rgba(15, 118, 110, 0.08);
    --grad-violet: rgba(124, 58, 237, 0.1);
    --grad-mid: rgba(220, 210, 235, 0.5);
  }
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gradient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 15%, var(--grad-teal), transparent),
    radial-gradient(ellipse 60% 60% at 85% 75%, var(--grad-violet), transparent),
    radial-gradient(ellipse 80% 70% at 50% 50%, var(--grad-mid), transparent),
    linear-gradient(155deg, var(--bg-deep) 0%, var(--bg) 35%, var(--bg-deep) 100%);
}

.grain {
  position: fixed;
  inset: 0;
  overflow: clip;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain-opacity);
}

.grain::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  background-repeat: repeat;
  animation: grain-drift 0.5s steps(1) infinite;
}

@keyframes grain-drift {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-12px, -25px); }
  30% { transform: translate(8px, -38px); }
  50% { transform: translate(30px, 23px); }
  70% { transform: translate(23px, 10px); }
  90% { transform: translate(-3px, 18px); }
}

.orbit-ring {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(90vw, 800px);
  height: min(90vw, 800px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: orbit-appear 2s ease-out 1.8s forwards;
}

.orbit-ring svg {
  width: 100%;
  height: 100%;
  animation: orbit-rotate 60s linear infinite;
}

@keyframes orbit-appear {
  to { opacity: 1; }
}

@keyframes orbit-rotate {
  to { transform: rotate(360deg); }
}

main {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 820px;
  width: 100%;
  padding: 2rem;
  overflow-x: clip;
}

.logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 3.5rem;
  opacity: 0;
  animation: emerge 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.logo {
  display: block;
  width: min(300px, 80vw);
  height: auto;
  position: relative;
  z-index: 1;
}

.logo-glow {
  position: absolute;
  inset: 0;
  transform: scale(2);
  background:
    radial-gradient(circle at 40% 50%, var(--logo-glow), transparent 60%),
    radial-gradient(circle at 60% 50%, rgba(20, 184, 166, 0.12), transparent 60%);
  filter: blur(35px);
  z-index: 0;
  animation: breathe 6s ease-in-out infinite;
}

@keyframes emerge {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(2); }
  50% { opacity: 1; transform: scale(2.24); }
}

.headline {
  margin-bottom: 2.5rem;
}

.h-line {
  display: block;
  margin-bottom: 0.8em;
}

.h-line:last-child {
  margin-bottom: 0;
}

.mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: baseline;
}

.word {
  display: inline-block;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  letter-spacing: -0.03em;
  vertical-align: baseline;
  animation: word-reveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.w0 { animation-delay: 0.7s; }
.w2 { animation-delay: 0.94s; }
.w3 { animation-delay: 1.3s; }
.w5 { animation-delay: 1.54s; }

@keyframes word-reveal {
  from { transform: translateY(115%); }
  to { transform: translateY(0); }
}

.word--em {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--em-color);
}

.rule {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--violet), var(--accent), transparent);
  margin: 0 auto 2rem;
  animation: draw 1s cubic-bezier(0.16, 1, 0.3, 1) 2s forwards;
}

@keyframes draw {
  to { width: 120px; }
}

.teaser {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fade-up 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) 2.3s forwards;
}

.status {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 3rem;
  opacity: 0;
  animation: fade-up 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) 2.5s forwards;
}

.status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { opacity: 0.6; box-shadow: 0 0 12px 4px var(--accent-glow); }
}

.typewriter {
  contain: strict;
  height: 4em;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fade-in 0.6s ease 2.8s forwards;
}

.typewriter-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  letter-spacing: 0.01em;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.typewriter-cursor {
  display: inline-block;
  width: 1px;
  height: 1.2em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}

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

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  opacity: 0;
  animation: fade-up 0.5s cubic-bezier(0.215, 0.61, 0.355, 1) 3.1s forwards;
}

.email {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.25s ease;
}

.email:hover {
  color: var(--accent);
}

.dot {
  width: 3px;
  height: 3px;
  background: var(--text-faint);
  border-radius: 50%;
}

@keyframes fade-in {
  to { opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-color-scheme: light) {
  .rule {
    height: 1px;
    background: linear-gradient(90deg, transparent, #a78bfa, #2dd4bf, transparent);
    box-shadow: 0 0 12px 1px rgba(139, 92, 246, 0.15), 0 0 12px 1px rgba(45, 212, 191, 0.15);
  }
}

@media (max-width: 640px) {
  .logo-wrap { margin-bottom: 2.5rem; }
  .headline { margin-bottom: 2rem; }
  .orbit-ring { width: 120vw; height: 120vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .word { animation: none; }
  .rule { width: 120px; }
  .grain::after { animation: none; }
  .typewriter-cursor { animation: none; }
  .orbit-ring svg { animation: none; }
  .orbit-ring { opacity: 1; }
}
