.legal-page,
.error-page {
  background: var(--mist);
}

.legal-page .site-header,
.error-page .site-header {
  color: var(--blue-deep);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 28px rgba(11, 46, 89, .08);
  backdrop-filter: blur(16px);
}

.legal-main {
  padding-top: 132px;
  padding-bottom: 120px;
}

.legal-hero {
  max-width: 880px;
  margin-bottom: 46px;
}

.legal-hero h1 {
  margin: 0 0 18px;
  color: var(--blue-deep);
  font-size: clamp(44px, 5.8vw, 78px);
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: 1.08;
}

.legal-hero h1 .heading-accent {
  color: var(--blue);
}

.legal-hero > p:not(.section-kicker) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.legal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  margin-bottom: 46px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.legal-breadcrumb a {
  color: var(--blue);
  font-weight: 700;
}

.legal-breadcrumb a:hover {
  color: var(--orange);
}

.legal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: clamp(40px, 7vw, 112px);
}

.legal-index {
  position: sticky;
  top: 112px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-left: 18px;
  border-left: 2px solid var(--line-strong);
}

.legal-index a {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  transition: color .25s ease;
}

.legal-index a:hover,
.legal-index a:focus-visible {
  color: var(--blue);
}

.legal-content {
  max-width: 820px;
  padding: clamp(30px, 4vw, 54px);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.legal-content section + section {
  margin-top: 42px;
  padding-top: 37px;
  border-top: 1px solid var(--line);
}

.legal-content h2 {
  margin-bottom: 14px;
  color: var(--blue-deep);
  font-size: clamp(24px, 2.4vw, 33px);
  letter-spacing: -.045em;
  line-height: 1.2;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
}

.legal-content p {
  margin-bottom: 13px;
}

.legal-content ul {
  margin: 13px 0 0;
  padding-left: 20px;
}

.legal-content li + li {
  margin-top: 6px;
}

.legal-note {
  margin-top: 20px;
  padding: 15px 17px;
  border-left: 3px solid var(--orange);
  color: var(--blue-deep) !important;
  background: rgba(233, 104, 50, .07);
  font-size: 12px !important;
  line-height: 1.75 !important;
}

.legal-contact-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 26px;
  margin-top: 19px;
  padding: 18px;
  background: var(--mist);
}

.legal-contact-box span,
.legal-contact-box a {
  color: var(--blue-deep);
  font-size: 13px;
  line-height: 1.6;
}

.legal-contact-box a:hover {
  color: var(--orange);
}

.error-main {
  display: flex;
  align-items: center;
  min-height: min(760px, calc(100vh - 220px));
  padding-top: 132px;
  padding-bottom: 104px;
}

.error-layout {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(350px, 1.18fr);
  align-items: center;
  gap: clamp(50px, 9vw, 150px);
}

.error-copy {
  max-width: 530px;
}

.error-code {
  display: block;
  margin-bottom: 12px;
  color: var(--orange);
  font-family: var(--font-sans);
  font-size: clamp(76px, 12vw, 166px);
  font-weight: 900;
  letter-spacing: -.12em;
  line-height: .86;
}

.error-copy h1 {
  margin: 0 0 18px;
  color: var(--blue-deep);
  font-size: clamp(34px, 4.2vw, 59px);
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1.1;
}

.error-copy > p:not(.section-kicker) {
  max-width: 460px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.error-visual {
  position: relative;
  min-height: 385px;
  padding: 24px;
  border: 1px solid #cbdceb;
  background: var(--mist-blue);
  overflow: hidden;
}

.error-visual::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-top: 2px solid var(--orange);
  border-left: 2px solid var(--orange);
  content: "";
}

.error-visual-meta {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  color: #8da5bd;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
}

.error-route {
  position: absolute;
  inset: 58px 24px 54px;
  width: calc(100% - 48px);
  height: calc(100% - 112px);
}

.error-route-grid {
  fill: none;
  stroke: #b8d0e9;
  stroke-width: 1;
  stroke-dasharray: 2 8;
  opacity: .6;
}

.error-route-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 5 10;
  animation: route-dash 18s linear infinite;
}

.error-route-line-broken {
  fill: none;
  stroke: var(--orange);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 2 11;
}

.error-route-node {
  fill: var(--orange);
  stroke: var(--paper);
  stroke-width: 4;
}

.error-route-node-muted {
  fill: var(--blue);
}

.error-route-label {
  fill: var(--blue-deep);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
}

.error-route-caption {
  position: absolute;
  right: 24px;
  bottom: 21px;
  left: 24px;
  padding-top: 12px;
  border-top: 1px solid #cbdceb;
  color: #8da5bd;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: .08em;
}

@media (max-width: 900px) {
  .legal-main {
    padding-top: 110px;
  }

  .legal-layout,
  .error-layout {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .legal-index {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
    border-top: 2px solid var(--line-strong);
    border-left: 0;
    padding-top: 17px;
  }

  .error-main {
    min-height: 0;
    padding-top: 110px;
  }

  .error-visual {
    max-width: 700px;
  }
}

@media (max-width: 680px) {
  .legal-main {
    padding-top: 97px;
    padding-bottom: 72px;
  }

  .legal-hero {
    margin-bottom: 32px;
  }

  .legal-hero h1 {
    font-size: clamp(40px, 12vw, 54px);
  }

  .legal-hero > p:not(.section-kicker) {
    font-size: 14px;
  }

  .legal-breadcrumb {
    min-height: 49px;
    margin-bottom: 32px;
    font-size: 10px;
  }

  .legal-index {
    gap: 9px 16px;
    font-size: 10px;
  }

  .legal-index a {
    font-size: 10px;
  }

  .legal-content {
    padding: 24px 19px;
  }

  .legal-content section + section {
    margin-top: 32px;
    padding-top: 28px;
  }

  .legal-content h2 {
    font-size: 24px;
  }

  .legal-content p,
  .legal-content li {
    font-size: 13px;
    line-height: 1.85;
  }

  .legal-contact-box {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 14px;
  }

  .error-main {
    padding-top: 97px;
    padding-bottom: 72px;
  }

  .error-code {
    font-size: 100px;
  }

  .error-copy h1 {
    font-size: 37px;
  }

  .error-copy > p:not(.section-kicker) {
    font-size: 14px;
  }

  .error-actions .button {
    min-height: 45px;
    padding-inline: 15px;
    font-size: 12px;
  }

  .error-visual {
    min-height: 285px;
    padding: 17px;
  }

  .error-visual-meta {
    font-size: 7px;
  }

  .error-route {
    inset: 48px 17px 45px;
    width: calc(100% - 34px);
    height: calc(100% - 93px);
  }

  .error-route-label {
    font-size: 10px;
  }

  .error-route-caption {
    right: 17px;
    bottom: 15px;
    left: 17px;
    padding-top: 9px;
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-route-line {
    animation: none;
  }
}
