:root {
  --void: #000000;
  --ink: #f4f0ff;
  --violet: #5e17eb;   /* brand violet, sampled from the logo */
  --lilac: #c9b6ff;
  --dust: #9d8fc0;
  --rule: #2a1757;
  --danger: #ff6b8b;

  --gutter: clamp(16px, 3vw, 40px);
  --edge: 3px;
  --shadow: 8px;

  color-scheme: dark;
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--void);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 100%;
}

#galaxy {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- top bar ---------- */

.bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: calc(var(--gutter) + env(safe-area-inset-top, 0px)) var(--gutter) 0;
  pointer-events: none;
}

.bar > * { pointer-events: auto; }

.mark {
  display: block;
  width: 52px;
  height: 48px;
}

.mark svg { width: 100%; height: 100%; display: block; }

.cta {
  margin-left: auto;
  font: inherit;
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--void);
  background: var(--ink);
  border: var(--edge) solid var(--ink);
  padding: 13px 20px;
  min-height: 48px;
  cursor: pointer;
  box-shadow: var(--shadow) var(--shadow) 0 var(--violet);
  transition: transform 90ms steps(2), box-shadow 90ms steps(2);
}

.cta:hover {
  background: var(--violet);
  border-color: var(--violet);
  color: var(--ink);
  box-shadow: var(--shadow) var(--shadow) 0 var(--ink);
}

.cta:active {
  transform: translate(var(--shadow), var(--shadow));
  box-shadow: 0 0 0 var(--violet);
}

:focus-visible {
  outline: 3px solid var(--lilac);
  outline-offset: 4px;
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  pointer-events: none;
}

.wordmark {
  margin: 0;
  padding: 0 var(--gutter) calc(env(safe-area-inset-bottom, 0px));
  font-variation-settings: "wdth" 125;
  font-weight: 900;
  font-size: 15vw; /* refined in main.js to fit the width exactly */
  line-height: .74;
  letter-spacing: -0.045em;
  white-space: nowrap;
  overflow: visible;
  min-width: 0;
  color: var(--ink);
  mix-blend-mode: difference;
  user-select: none;
  /* trims the descender space so the letters sit on the viewport floor */
  transform: translateY(0.035em);
}

/* ---------- contact dialog ---------- */

.contact {
  width: min(560px, calc(100vw - 2 * 16px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: var(--void);
  border: var(--edge) solid var(--ink);
  border-radius: 0;
  box-shadow: 12px 12px 0 var(--violet);
  overflow: auto;
}

.contact::backdrop {
  background: rgb(0 0 0 / .72);
  backdrop-filter: blur(3px) saturate(.6);
}

.contact[open] { animation: slam 160ms cubic-bezier(.2, .9, .3, 1.2); }

@keyframes slam {
  from { transform: translate(12px, 12px); box-shadow: 0 0 0 var(--violet); }
}

.contact-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.contact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: var(--edge) solid var(--rule);
  padding-bottom: 16px;
}

.contact-head h2 {
  margin: 0;
  font-variation-settings: "wdth" 125;
  font-weight: 900;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.close {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: none;
  color: var(--ink);
  border: var(--edge) solid var(--ink);
  cursor: pointer;
  flex: none;
}

.close svg { width: 20px; height: 20px; }
.close:hover { background: var(--violet); border-color: var(--violet); }

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  font-weight: 600;
  font-size: 15px;
  color: var(--lilac);
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #000;
  border: var(--edge) solid var(--rule);
  border-radius: 0;
  padding: 12px 14px;
  resize: vertical;
}

.field textarea { min-height: 130px; }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--violet);
  box-shadow: 4px 4px 0 var(--violet);
}

.field [aria-invalid="true"] { border-color: var(--danger); }

.error {
  font-style: normal;
  font-size: 14px;
  color: var(--danger);
  min-height: 0;
}

.error:empty { display: none; }

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.status {
  margin: 0;
  font-size: 15px;
  color: var(--dust);
  flex: 1 1 180px;
}

.status[data-state="ok"] { color: var(--lilac); }
.status[data-state="error"] { color: var(--danger); }

.send {
  font: inherit;
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  background: var(--violet);
  border: var(--edge) solid var(--violet);
  padding: 13px 22px;
  min-height: 48px;
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--ink);
}

.send:hover { background: var(--ink); color: var(--void); border-color: var(--ink); box-shadow: 6px 6px 0 var(--violet); }
.send:active { transform: translate(6px, 6px); box-shadow: none; }
.send[disabled] { opacity: .6; cursor: progress; }

/* ---------- small screens ---------- */

@media (max-width: 600px) {
  .mark { width: 44px; height: 41px; }
  @media (prefers-reduced-motion: reduce) {
  .contact[open] { animation: none; }
  .cta, .send { transition: none; }
}
