:root {
  --paper: #f4f1ea;
  --ink: #15140f;
  --muted: #6d675b;
  --line: rgba(21, 20, 15, 0.14);
  --accent: #b8451f;
  --accent-soft: rgba(184, 69, 31, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(21, 20, 15, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21, 20, 15, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 18%, rgba(184, 69, 31, 0.10), transparent 32%),
    radial-gradient(circle at 12% 72%, rgba(21, 20, 15, 0.05), transparent 36%);
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1360px;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: clamp(20px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 940px;
  padding: clamp(64px, 10vw, 140px) 0;
}

.eyebrow {
  margin-bottom: clamp(20px, 3vw, 32px);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(3.2rem, 9vw, 7.6rem);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.92;
  overflow-wrap: anywhere;
}

h1 .accent {
  color: var(--accent);
}

.lead {
  max-width: 640px;
  margin: clamp(28px, 4vw, 44px) 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.rule {
  position: relative;
  width: min(220px, 36vw);
  height: 2px;
  margin: clamp(36px, 5vw, 56px) 0 clamp(20px, 3vw, 28px);
  overflow: hidden;
  background: var(--ink);
}

.rule::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: var(--accent);
  animation: slide 2.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.8;
}

.note a,
.text-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 180ms ease, color 180ms ease;
}

.note a:hover,
.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.error-code {
  margin: 0 0 clamp(16px, 2vw, 24px);
  color: var(--accent);
  font-size: clamp(4rem, 14vw, 12rem);
  font-weight: 600;
  letter-spacing: -0.08em;
  line-height: 0.8;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(32px, 4vw, 44px);
  color: var(--ink);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.back-link span {
  display: inline-block;
  transition: transform 180ms ease;
}

.back-link:hover span {
  transform: translateX(4px);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: clamp(20px, 3vw, 28px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer a {
  color: inherit;
  text-decoration: none;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-link {
  border-bottom: 1px solid var(--line);
  transition: color 180ms ease, border-color 180ms ease;
}

.footer-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.icp {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: none;
}

.icp a {
  border-bottom: 1px solid var(--line);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px var(--accent-soft);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 7px rgba(184, 69, 31, 0.05);
    opacity: 0.7;
  }
}

@keyframes slide {
  0% {
    left: -40%;
  }
  60%,
  100% {
    left: 100%;
  }
}

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
  }

  .brand-name {
    display: none;
  }

  .status {
    padding-top: 4px;
    font-size: 9px;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 3.6rem);
  }

  .lead br {
    display: none;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
