:root {
  color-scheme: dark;
  --bg: #120807;
  --red: #9f160e;
  --red-bright: #f04432;
  --text: #fff4f1;
  --muted: #e0b8b1;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(circle at 50% 38%, rgba(159, 22, 14, 0.32), transparent 34rem),
    linear-gradient(145deg, #080403 0%, var(--bg) 48%, #210b08 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 38%, rgba(240, 68, 50, 0.32), transparent 22rem),
    rgba(8, 4, 3, 0.72);
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 860ms ease, transform 1100ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.is-loading body::before {
  opacity: 1;
}

.is-ready body::before {
  opacity: 0;
  transform: scale(1);
}

main {
  width: min(100%, 760px);
  display: grid;
  justify-items: center;
  gap: 24px;
}

img {
  width: min(58vw, 280px);
  height: auto;
  filter: drop-shadow(0 22px 42px rgba(0, 0, 0, 0.48));
  transform-origin: 50% 48%;
}

h1 {
  margin: 0;
  color: var(--red-bright);
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(240, 68, 50, 0.34);
}

p {
  margin: 0;
  max-width: 65ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.7;
}

strong {
  color: var(--text);
  font-weight: 700;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid rgba(255, 118, 91, 0.58);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 94, 67, 0.96) 0%, rgba(157, 18, 13, 0.98) 46%, rgba(58, 9, 8, 0.98) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent);
  color: var(--text);
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
  font-family: inherit;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 32px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(240, 68, 50, 0.18);
  transition:
    background-position 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.contact-link:hover {
  border-color: rgba(255, 188, 174, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 18px 38px rgba(0, 0, 0, 0.42),
    0 0 30px rgba(240, 68, 50, 0.32);
  transform: translateY(-2px);
}

.contact-link:focus-visible {
  outline: 3px solid rgba(255, 244, 241, 0.86);
  outline-offset: 4px;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 2, 2, 0.62);
  backdrop-filter: blur(6px);
}

.contact-modal[hidden] {
  display: none;
}

.contact-modal__panel {
  width: min(100%, 380px);
  padding: 22px;
  border: 1px solid rgba(255, 118, 91, 0.35);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(42, 9, 8, 0.96), rgba(15, 5, 4, 0.98)),
    var(--bg);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.54),
    0 0 34px rgba(240, 68, 50, 0.16);
  text-align: left;
}

.contact-modal h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.15rem;
  letter-spacing: 0;
}

.contact-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.challenge-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.challenge-form label {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.challenge-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 118, 91, 0.36);
  border-radius: 9px;
  background: rgba(255, 244, 241, 0.08);
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.challenge-form input:focus-visible {
  border-color: rgba(255, 188, 174, 0.88);
  outline: 3px solid rgba(240, 68, 50, 0.3);
  outline-offset: 2px;
}

.challenge-trap {
  position: absolute;
  left: -9999px;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
}

.challenge-status {
  min-height: 1.4em;
}

.contact-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.modal-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 118, 91, 0.58);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(240, 68, 50, 0.94), rgba(116, 14, 10, 0.96));
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.modal-button--ghost {
  border-color: rgba(255, 244, 241, 0.2);
  background: rgba(255, 244, 241, 0.07);
  color: var(--muted);
}

.modal-button:focus-visible {
  outline: 3px solid rgba(255, 244, 241, 0.86);
  outline-offset: 3px;
}

.is-loading img,
.is-loading h1,
.is-loading p,
.is-loading .contact-link {
  opacity: 0;
}

.is-loading img {
  transform: scale(0.88) rotate(-5deg);
}

.is-loading h1,
.is-loading p,
.is-loading .contact-link {
  transform: translateY(18px);
}

.is-ready img {
  animation: logo-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.is-ready h1 {
  animation: fade-up 720ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms both;
}

.is-ready p {
  animation: fade-up 720ms cubic-bezier(0.2, 0.8, 0.2, 1) 240ms both;
}

.is-ready .contact-link {
  animation: fade-up 720ms cubic-bezier(0.2, 0.8, 0.2, 1) 360ms both;
}

@keyframes logo-in {
  from {
    opacity: 0;
    transform: scale(0.88) rotate(-5deg);
  }

  70% {
    opacity: 1;
    transform: scale(1.025) rotate(1deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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