:root {
  color-scheme: dark;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  background: #000;
  color: #f8fbff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #000;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
}

.landing {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 3rem 1.25rem 7rem;
  text-align: center;
}

.hero {
  display: grid;
  justify-items: center;
  gap: clamp(1.35rem, 4vw, 2rem);
  width: min(100%, 28rem);
}

h1,
.error-code {
  margin: 0;
  font-size: clamp(2.5rem, 10vw, 7rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: lowercase;
  color: #ffffff;
  text-shadow:
    0 0 0.35rem rgba(255, 255, 255, 0.95),
    0 0 1rem rgba(142, 207, 255, 0.7),
    0 0 2.25rem rgba(86, 174, 255, 0.45);
  animation: pulse-glow 8s ease-in-out infinite;
}

.message-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0 1.05rem;
  border: 1px solid rgba(142, 207, 255, 0.24);
  border-radius: 999px;
  color: rgba(248, 251, 255, 0.86);
  background: rgba(255, 255, 255, 0.035);
  box-shadow:
    0 0 1rem rgba(255, 255, 255, 0.04),
    0 0 1.8rem rgba(86, 174, 255, 0.18);
  font-size: 0.86rem;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 0 0.75rem rgba(142, 207, 255, 0.38);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.message-link:hover,
.message-link:focus-visible {
  color: #ffffff;
  border-color: rgba(142, 207, 255, 0.72);
  background: rgba(142, 207, 255, 0.09);
  box-shadow:
    0 0 1rem rgba(255, 255, 255, 0.08),
    0 0 2.4rem rgba(86, 174, 255, 0.32);
  outline: none;
}

.form-page {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1.25rem;
}

.message-panel {
  position: relative;
  display: grid;
  gap: 1rem;
  width: min(100%, 24rem);
  padding: 1.25rem;
  border: 1px solid rgba(142, 207, 255, 0.22);
  border-radius: 1.25rem;
  background:
    linear-gradient(180deg, rgba(142, 207, 255, 0.055), rgba(255, 255, 255, 0.018)),
    #000;
  box-shadow:
    0 0 0.9rem rgba(255, 255, 255, 0.035),
    0 0 2.8rem rgba(86, 174, 255, 0.15),
    inset 0 0 2rem rgba(142, 207, 255, 0.04);
  text-align: left;
}

.form-title {
  margin: 0;
  color: rgba(248, 251, 255, 0.9);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    0 0 0.45rem rgba(255, 255, 255, 0.35),
    0 0 1.2rem rgba(142, 207, 255, 0.32);
}

.back-link {
  justify-self: start;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.75rem;
  text-decoration: none;
  transition:
    color 180ms ease,
    text-shadow 180ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 0.8rem rgba(142, 207, 255, 0.5);
  outline: none;
}

.message-form {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.field-row {
  display: grid;
  gap: 0.35rem;
}

label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.62);
}

input,
textarea,
button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.85rem;
  font: inherit;
}

input,
textarea {
  color: #f8fbff;
  background: rgba(0, 0, 0, 0.72);
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

input {
  height: 2.25rem;
  padding: 0 0.65rem;
}

textarea {
  min-height: 5.75rem;
  max-height: 12rem;
  padding: 0.6rem 0.65rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

input:focus,
textarea:focus {
  border-color: rgba(142, 207, 255, 0.72);
  box-shadow: 0 0 0.9rem rgba(142, 207, 255, 0.18);
}

button {
  height: 2.35rem;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    text-shadow 180ms ease;
}

button:hover,
button:focus-visible {
  color: #ffffff;
  border-color: rgba(142, 207, 255, 0.72);
  background: rgba(142, 207, 255, 0.12);
  text-shadow: 0 0 0.7rem rgba(142, 207, 255, 0.65);
  outline: none;
}

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

.status-message {
  min-height: 1.1rem;
  margin: 0;
  color: rgba(235, 247, 255, 0.68);
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 0 0.7rem rgba(142, 207, 255, 0.25);
}

.status-message[hidden] {
  display: block;
  visibility: hidden;
}

.projects {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: min(100% - 2rem, 24rem);
  transform: translateX(-50%);
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.projects a,
.home-link {
  color: rgba(235, 247, 255, 0.82);
  text-decoration: underline;
  text-decoration-color: rgba(142, 207, 255, 0.35);
  text-underline-offset: 0.25em;
  transition:
    color 180ms ease,
    text-decoration-color 180ms ease,
    text-shadow 180ms ease;
}

.projects a:hover,
.projects a:focus-visible,
.home-link:hover,
.home-link:focus-visible {
  color: #ffffff;
  text-decoration-color: rgba(142, 207, 255, 0.95);
  text-shadow: 0 0 0.8rem rgba(142, 207, 255, 0.7);
}

.projects a:focus-visible,
.home-link:focus-visible {
  outline: 1px solid rgba(142, 207, 255, 0.8);
  outline-offset: 0.35rem;
}

.error-page {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem;
  text-align: center;
}

.error-content {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
}

.error-subtitle,
.error-small {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
}

.error-subtitle {
  font-size: clamp(1rem, 4vw, 1.35rem);
}

.error-small,
.home-link {
  font-size: 0.82rem;
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.92;
    text-shadow:
      0 0 0.35rem rgba(255, 255, 255, 0.9),
      0 0 1rem rgba(142, 207, 255, 0.62),
      0 0 2.25rem rgba(86, 174, 255, 0.4);
  }

  50% {
    opacity: 1;
    text-shadow:
      0 0 0.5rem rgba(255, 255, 255, 1),
      0 0 1.35rem rgba(170, 222, 255, 0.78),
      0 0 3rem rgba(86, 174, 255, 0.56);
  }
}

@media (prefers-reduced-motion: reduce) {
  h1,
  .error-code {
    animation: none;
  }
}

@media (max-width: 38rem) {
  .landing {
    align-items: start;
    padding-top: 2.25rem;
  }

  .projects {
    font-size: 0.74rem;
  }
}
