/**
 * error.css — 404 error page styles
 * Oversized copper "404", lang switcher, secondary contact link.
 * Depends on: tokens.css, base.css, components/switcher.css
 */

/* ============================================================
 * 404 PAGE
 * ============================================================ */

.page-404 {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-9) var(--container-pad);
  text-align: center;
  background:
    radial-gradient(ellipse at 70% 25%, rgba(184, 115, 51, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 75%, rgba(91, 107, 124, 0.10) 0%, transparent 50%),
    linear-gradient(180deg, var(--c-navy-deep) 0%, var(--c-navy) 60%, var(--c-navy-mid) 100%);
  color: var(--c-white);
  position: relative;
  overflow: hidden;
}

/* Grain texture */
.page-404::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

/* Lang switcher — top-right, mirrors brand mark positioning */
.page-404__lang {
  position: absolute;
  top: var(--sp-5);
  right: var(--sp-5);
  z-index: 2;
}

/* Brand mark at top */
.page-404__brand {
  position: absolute;
  top: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-serif);
  font-size: var(--fs-nav);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: rgba(247, 248, 250, 0.7);
  text-decoration: none;
  white-space: nowrap;
}

/* Oversized copper 404 numeral */
.page-404__code {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 1;
  margin: 0;
  background: linear-gradient(135deg, var(--c-copper-bright) 0%, var(--c-copper) 50%, var(--c-copper-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: var(--tracking-tight);
  filter: drop-shadow(0 20px 60px rgba(184, 115, 51, 0.3));
  position: relative;
  z-index: 1;
  /* spacing-bump: illustration removed; --sp-5 (32px) preserves vertical rhythm */
  margin-bottom: var(--sp-5);
}

/* Decorative broken-gear icon — sits below 404 numeral, above title */
.page-404__visual {
  display: block;
  margin: 0 auto var(--sp-5);
  max-width: 400px;
  opacity: 0.82;
  position: relative;
  z-index: 1;
}

.page-404__visual img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 640px) {
  .page-404__visual {
    max-width: 260px;
  }
}

/* Title */
.page-404__title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 300;
  font-style: italic;
  color: var(--c-fog);
  margin: 0 0 var(--sp-3);
  line-height: var(--leading-snug);
  position: relative;
  z-index: 1;
}

/* Lead text */
.page-404__lead {
  max-width: 46ch;
  margin: 0 auto var(--sp-6);
  font-size: var(--fs-body);
  line-height: var(--leading-relaxed);
  color: rgba(247, 248, 250, 0.65);
  position: relative;
  z-index: 1;
}

/* CTA */
.page-404__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.9rem 2rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--c-copper-bright), var(--c-copper));
  color: var(--c-navy-deep);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--fs-nav);
  text-decoration: none;
  box-shadow: 0 12px 36px rgba(184, 115, 51, 0.35);
  transition: transform var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
}

/* Copper underline animation on hover */
.page-404__cta::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--c-copper);
  transition: width var(--dur-medium) var(--ease-out);
  border-radius: var(--radius-pill);
}

.page-404__cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(184, 115, 51, 0.45);
}

.page-404__cta:hover::after { width: 60%; }

.page-404__cta svg {
  transition: transform var(--dur-short) var(--ease-out);
}

.page-404__cta:hover svg { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  .page-404__cta,
  .page-404__cta::after,
  .page-404__cta svg { transition: none; }
  .page-404__cta:hover { transform: none; }
}

/* Secondary contact link — muted, beneath primary CTA */
/* Note: --fs-body-sm not defined; using --fs-small (0.875rem / 14px) */
.page-404__secondary {
  margin-top: var(--sp-4);
  font-size: var(--fs-small);
  color: rgba(247, 248, 250, 0.55);
  position: relative;
  z-index: 1;
}

.page-404__secondary a {
  color: var(--c-copper-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-404__secondary a:hover {
  color: var(--c-copper);
}
