:root {
  color-scheme: dark;
  --ink: #fafaf7;
  --muted: #c8c1b2;
  --canvas: #070606;
  --panel: rgba(18, 12, 11, 0.84);
  --line: rgba(179, 153, 93, 0.25);
  --accent: #aa0000;
  --accent-bright: #d4b46a;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 9%, rgba(170, 0, 0, 0.3), transparent 31rem),
    radial-gradient(circle at 18% 86%, rgba(179, 153, 93, 0.1), transparent 26rem),
    linear-gradient(145deg, #130807 0%, var(--canvas) 55%, #120d08 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.12;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.site-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

header, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
}

header { border-bottom: 1px solid var(--line); }
footer { border-top: 1px solid var(--line); }

.brand, .status, footer p {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand { color: var(--ink); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 16px rgba(212, 180, 106, 0.8);
  content: "";
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
  padding: clamp(64px, 11vh, 132px) 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
  color: var(--accent-bright);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 36px;
  height: 2px;
  background: currentColor;
  content: "";
}

.brand-title {
  max-width: 760px;
  margin: 0;
}

.hero-logo {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 1px 1px rgba(212, 180, 106, 0.4));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.message {
  position: relative;
  align-self: end;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.message::before {
  position: absolute;
  inset: -1px -1px auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0 62%, var(--accent-bright) 62% 100%);
  content: "";
}

.message .index {
  margin: 0 0 52px;
  color: var(--muted);
  font: 700 0.76rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
}

h2 {
  margin: 0 0 20px;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.message p:last-child {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.contact-button,
.submit-button,
.close-button {
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.contact-button {
  margin-top: 30px;
  padding: 15px 20px;
  background: linear-gradient(110deg, var(--accent) 0 74%, var(--accent-bright) 74% 100%);
  color: white;
  box-shadow: 0 14px 34px rgba(170, 0, 0, 0.3);
}

.contact-button:hover,
.contact-button:focus-visible { filter: brightness(1.12); }

dialog {
  width: min(calc(100% - 32px), 560px);
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(212, 180, 106, 0.45);
  background: #100b0a;
  color: var(--ink);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.75);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.contact-panel { padding: clamp(26px, 5vw, 42px); }

.contact-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.contact-heading h2 { margin: 0; }

.close-button {
  padding: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
}

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

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--accent-bright);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 14px;
  background: #080706;
  color: var(--ink);
  font: 500 1rem/1.45 inherit;
}

.contact-form textarea { min-height: 150px; resize: vertical; }

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.form-trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

.submit-button {
  justify-self: start;
  min-width: 160px;
  padding: 14px 20px;
  background: var(--accent);
  color: white;
}

.submit-button:disabled { cursor: wait; opacity: 0.65; }

.form-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.form-status[data-state="success"] { color: #d4b46a; }
.form-status[data-state="error"] { color: #ff8c8c; }

footer p { color: var(--muted); letter-spacing: 0.08em; }
footer p:last-child { color: var(--ink); }

.reveal {
  animation: rise 700ms cubic-bezier(.22, .8, .3, 1) both;
}

.message.reveal { animation-delay: 120ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  .site-shell { width: min(calc(100% - 28px), var(--max)); }
  header, footer { min-height: 76px; }
  main {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 56px;
    padding: 70px 0;
  }
  .brand-title { width: min(100%, 680px); }
  .message { width: min(100%, 560px); margin-left: auto; }
}

@media (max-width: 520px) {
  header { align-items: flex-start; padding: 22px 0; }
  .brand { max-width: 18ch; line-height: 1.45; }
  .status { padding-top: 2px; }
  .status span { display: none; }
  main { gap: 44px; padding: 56px 0 64px; }
  .brand-title { width: 100%; }
  .message .index { margin-bottom: 40px; }
  footer { align-items: flex-end; gap: 24px; padding: 22px 0; }
  footer p { max-width: 18ch; font-size: 0.68rem; line-height: 1.5; }
  footer p:last-child { text-align: right; }
}

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