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

:root {
  --bg: #0d0d0d;
  --text: #f0ecf8;
  --text-dim: #91869f;
  --accent: #a66dff;
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow: hidden;
}

/* ── Canvas ── */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  will-change: transform;
}

/* ── Radial vignette for legibility ── */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 65% at 50% 50%,
    transparent 0%,
    rgba(13, 13, 13, 0.55) 60%,
    rgba(13, 13, 13, 0.92) 100%
  );
  z-index: 5;
}

/* ── Main layout ── */
.overlay {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 2rem 3rem;
}

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--text-dim);
  text-transform: uppercase;
  transition: color 0.2s ease;
}

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

/* ── Hero ── */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.75rem;
  max-width: 680px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
  font-weight: 500;
}

.hero-sub {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 380px;
}

.hero-actions {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* ── Buttons ── */
.btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 2px;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--accent);
  color: #0d0d0d;
  font-weight: 500;
}

.btn-primary:hover {
  background: #c49bff;
}

.btn-ghost {
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ── Footer ── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.footer-hint {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: rgba(145, 134, 159, 0.5);
  text-transform: uppercase;
  animation: pulse 3s ease-in-out infinite;
}

.footer-coords {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(145, 134, 159, 0.4);
}

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

/* ── Responsive ── */
@media (max-width: 640px) {
  .overlay {
    padding: 1.5rem 1.5rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-coords {
    display: none;
  }
}

/* The maintenance page's only active forms and legal content. */
.site-dialog {
  position: fixed;
  z-index: 30;
  width: min(620px, calc(100vw - 2rem));
  max-height: min(90vh, 900px);
  margin: auto;
  padding: clamp(1.25rem, 3vw, 2rem);
  overflow: auto;
  border: 1px solid rgba(166, 109, 255, .38);
  border-radius: 12px;
  background: #171222;
  box-shadow: 0 24px 100px rgba(0, 0, 0, .7);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
.site-dialog::backdrop { background: rgba(7, 5, 13, .78); backdrop-filter: blur(8px); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.dialog-heading h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; }
.dialog-close { flex: none; background: transparent; border: 0; color: var(--text); cursor: pointer; font-size: 2rem; line-height: 1; }
.dialog-intro { color: var(--text-dim); margin: .6rem 0 1.5rem; line-height: 1.5; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-grid label { display: flex; flex-direction: column; gap: .4rem; font-size: .82rem; }
.contact-grid .wide { grid-column: 1 / -1; }
.contact-grid input, .contact-grid textarea {
  width: 100%; padding: .8rem; border: 1px solid rgba(166, 109, 255, .32);
  border-radius: 4px; outline: none; background: #0f0d17; color: var(--text);
  font: inherit;
}
.contact-grid input:focus, .contact-grid textarea:focus { border-color: var(--accent); }
.consent { display: flex; align-items: start; gap: .65rem; margin: 1rem 0; color: var(--text-dim); font-size: .78rem; line-height: 1.5; }
.consent input { accent-color: var(--accent); margin-top: .2rem; }
.site-dialog a { color: #caa9ff; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; }
#contact-status { min-height: 1.4em; margin: 1rem 0; font-size: .85rem; }
#contact-status[data-state="error"] { color: #ffc2c2; }
#contact-status[data-state="success"] { color: #c4ffd8; }
#contact-submit { border: 0; cursor: pointer; }
#contact-submit:disabled { cursor: wait; opacity: .7; }
.legal-dialog { width: min(800px, calc(100vw - 2rem)); }
.legal-shade { position: fixed; z-index: 18; inset: 0; background: rgba(7, 5, 13, .78); backdrop-filter: blur(8px); }
.legal-dialog[open] { z-index: 19; top: 5vh; left: 0; right: 0; bottom: auto; margin: auto; }
.legal-body { margin-top: 1.5rem; color: #e2dbea; line-height: 1.65; font-size: .94rem; }
.legal-body h3 { font-size: 1.1rem; margin: 1.7rem 0 .5rem; color: var(--text); }
.legal-body p, .legal-body ul { margin: 0 0 1rem; }
.legal-body ul { padding-left: 1.4rem; }
.legal-body a { overflow-wrap: anywhere; }
.legal-body dl { display: grid; grid-template-columns: minmax(9rem, 1fr) 2fr; gap: .8rem 1.2rem; }
.legal-body dt { color: var(--text-dim); }
.legal-body dd { margin: 0; }
@media (max-width: 640px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-grid .wide { grid-column: auto; }
  .legal-body dl { grid-template-columns: 1fr; gap: .15rem; }
  .legal-body dd { margin-bottom: .8rem; }
}
