* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #07070b;
  color: #f4f5f8;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: #2BB3E5; text-decoration: none; }
::selection { background: #ED0F7A; color: #fff; }

.stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 5vh, 64px);
  padding: clamp(28px, 6vh, 64px) 5vw;
  overflow: hidden;
}

/* ---------- Halftone dot fields ---------- */
.dot-layer {
  position: absolute;
  inset: -12%;
  pointer-events: none;
}
.dot-layer--cyan {
  transform: translate3d(calc(var(--px, 0px) * 0.09), calc(var(--py, 0px) * 0.09), 0);
  transition: transform .9s cubic-bezier(.16,1,.3,1);
  background-image: radial-gradient(circle at center, rgba(43,179,229,.45) 1px, transparent 1.1px);
  background-size: 12px 12px;
  mask-image: radial-gradient(55% 55% at 50% 45%, #000, transparent 74%);
  -webkit-mask-image: radial-gradient(55% 55% at 50% 45%, #000, transparent 74%);
}
.dot-layer--magenta {
  transform: translate3d(calc(var(--px, 0px) * -0.055), calc(var(--py, 0px) * -0.055), 0);
  transition: transform 1.1s cubic-bezier(.16,1,.3,1);
  background-image: radial-gradient(circle at center, rgba(237,15,122,.4) 1.6px, transparent 1.7px);
  background-size: 19px 19px;
  mask-image: radial-gradient(45% 45% at 14% 86%, #000, transparent 76%);
  -webkit-mask-image: radial-gradient(45% 45% at 14% 86%, #000, transparent 76%);
}

.sweep {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,224,0,.45), transparent);
  animation: sweep 8s linear infinite;
  pointer-events: none;
}

.halo {
  position: absolute;
  top: 50%; left: 50%;
  width: min(70vw, 60vh, 620px);
  aspect-ratio: 1;
  transform: translate3d(calc(-50% + var(--px, 0px) * 0.05), calc(-50% + var(--py, 0px) * 0.05), 0);
  transition: transform .8s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}
.halo-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at center, #FFE000 1.9px, transparent 2px);
  background-size: 15px 15px;
  mask-image: radial-gradient(circle, #000 18%, transparent 64%);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 64%);
  animation: pulse 7s ease-in-out infinite;
}

/* ---------- Glitch logo ---------- */
.logo-wrap {
  position: relative;
  width: min(74vw, 520px, calc(52vh * 1.26));
  max-height: 52vh;
  aspect-ratio: 614 / 487;
  transform: translate3d(calc(var(--px, 0px) * -0.07), calc(var(--py, 0px) * -0.07), 0);
  transition: transform .7s cubic-bezier(.16,1,.3,1);
}
.logo-flicker {
  position: absolute;
  inset: 0;
  animation: flick 6s steps(1) infinite;
}
.logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo-img--ghost-a {
  filter: hue-rotate(150deg) saturate(2.2);
  mix-blend-mode: screen;
  animation: gA 6s steps(1) infinite;
}
.logo-img--ghost-b {
  filter: hue-rotate(-70deg) saturate(2.4);
  mix-blend-mode: screen;
  animation: gB 6s steps(1) infinite;
}
.logo-img--main {
  filter: drop-shadow(0 0 46px rgba(43,179,229,.34));
}
.logo-halftone {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at center, rgba(7,7,11,.85) 1.5px, transparent 1.6px);
  background-size: 6px 6px;
  mix-blend-mode: multiply;
  opacity: .5;
  pointer-events: none;
}
.logo-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(7,7,11,.34) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

/* ---------- Email link ---------- */
.contact-row {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.email-link {
  font-size: clamp(13px, 2.1vw, 20px);
  letter-spacing: .22em;
  text-transform: lowercase;
  color: #f4f5f8;
  border-bottom: 1px solid rgba(244,245,248,.28);
  padding-bottom: 7px;
  transition: color .2s ease, border-color .2s ease;
}
.email-link:hover,
.email-link:focus-visible {
  color: #FFE000;
  border-color: #FFE000;
}

.contact-btn {
  font-family: inherit;
  font-size: clamp(10.5px, 1.6vw, 13px);
  letter-spacing: .22em;
  text-transform: lowercase;
  color: #4f5665;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color .2s ease;
}
.contact-btn:hover,
.contact-btn:focus-visible {
  color: #2BB3E5;
}

/* ---------- Contact dialog ---------- */
.contact-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92vw, 440px);
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid rgba(244,245,248,.16);
  background: #0c0c13;
  color: #f4f5f8;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 0 0 0 1px rgba(43,179,229,.08), 0 30px 80px rgba(0,0,0,.6);
}
.contact-dialog::backdrop {
  background: rgba(4,4,7,.78);
  backdrop-filter: blur(2px);
}
.contact-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-title {
  margin: 0 0 6px;
  font-size: 15px;
  letter-spacing: .18em;
  text-transform: lowercase;
  font-weight: 500;
  color: #FFE000;
}
.contact-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #4f5665;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s ease;
}
.contact-close:hover,
.contact-close:focus-visible {
  color: #ED0F7A;
}
.contact-label {
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #4f5665;
}
.contact-input {
  font-family: inherit;
  font-size: 14px;
  color: #f4f5f8;
  background: #07070b;
  border: 1px solid rgba(244,245,248,.18);
  padding: 9px 10px;
  outline: none;
  transition: border-color .2s ease;
  resize: vertical;
}
.contact-input:focus-visible {
  border-color: #2BB3E5;
}
.contact-textarea {
  min-height: 90px;
}
.contact-submit {
  margin-top: 6px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: lowercase;
  color: #07070b;
  background: #FFE000;
  border: none;
  padding: 11px;
  cursor: pointer;
  transition: opacity .2s ease;
}
.contact-submit:hover,
.contact-submit:focus-visible {
  opacity: .85;
}
.contact-submit:disabled {
  opacity: .5;
  cursor: default;
}
.contact-status {
  margin: 0;
  min-height: 14px;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: #4f5665;
}
.contact-status[data-state="ok"] { color: #2BB3E5; }
.contact-status[data-state="error"] { color: #ED0F7A; }

/* ---------- Footer ---------- */
.footer-bar {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #4f5665;
}
.footer-dot {
  width: 6px;
  height: 6px;
  background: #FFE000;
  animation: blink 1.3s steps(1) infinite;
}

/* ---------- Keyframes ---------- */
@keyframes gA {
  0%, 80%, 100% { transform: translate(0); clip-path: inset(0 0 0 0); opacity: .85; }
  82% { transform: translate(-9px, 3px); clip-path: inset(14% 0 62% 0); opacity: 1; }
  86% { transform: translate(7px, -4px); clip-path: inset(58% 0 20% 0); }
  90% { transform: translate(-4px, 2px); clip-path: inset(76% 0 6% 0); }
  94% { transform: translate(3px, 0); clip-path: inset(34% 0 46% 0); }
}
@keyframes gB {
  0%, 78%, 100% { transform: translate(0); clip-path: inset(0 0 0 0); opacity: .8; }
  81% { transform: translate(10px, -3px); clip-path: inset(52% 0 24% 0); opacity: 1; }
  85% { transform: translate(-7px, 4px); clip-path: inset(6% 0 72% 0); }
  89% { transform: translate(6px, -2px); clip-path: inset(80% 0 4% 0); }
  93% { transform: translate(-3px, 1px); clip-path: inset(40% 0 38% 0); }
}
@keyframes flick {
  0%, 100% { opacity: 1; }
  78% { opacity: 1; }
  79% { opacity: .62; }
  81% { opacity: 1; }
  87% { opacity: .78; }
  88% { opacity: 1; }
}
@keyframes sweep {
  0% { transform: translateY(-20vh); }
  100% { transform: translateY(120vh); }
}
@keyframes pulse {
  0%, 100% { opacity: .26; transform: scale(1); }
  50% { opacity: .46; transform: scale(1.05); }
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- Reduced motion & small viewports ---------- */
@media (prefers-reduced-motion: reduce) {
  .sweep, .halo-dots, .logo-flicker, .logo-img--ghost-a, .logo-img--ghost-b, .footer-dot {
    animation: none !important;
  }
  .dot-layer--cyan, .dot-layer--magenta, .halo, .logo-wrap {
    transition: none !important;
    transform: none !important;
  }
}

@media (max-height: 480px) {
  body { overflow-y: auto; }
  .stage { height: auto; min-height: 100dvh; }
}
