.not-found-page .site-header,
.not-found-page .site-header.is-scrolled,
.not-found-page .site-header.is-menu-open {
  color: var(--color-primary);
  border-color: rgba(18, 57, 88, 0.08);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 24px rgba(18, 57, 88, 0.055);
  backdrop-filter: blur(14px);
}

.not-found-page .eyebrow > span:first-child {
  flex: 0 0 28px;
  width: 28px;
  height: 2px;
}

.error-hero {
  display: grid;
  min-height: 600px;
  align-items: center;
  padding: calc(var(--header-height) + 42px) 0 76px;
  background:
    radial-gradient(ellipse at 76% 48%, rgba(19, 145, 80, 0.09), transparent 33%),
    linear-gradient(90deg, #ffffff 0%, #fbfdff 58%, #f1f7fc 100%);
}

.error-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  align-items: center;
  gap: clamp(42px, 7vw, 100px);
}

.error-hero__content {
  max-width: 660px;
}

.error-code {
  margin: 0 0 5px -7px;
  color: rgba(18, 57, 88, 0.075);
  font-family: var(--font-display);
  font-size: clamp(118px, 14.5vw, 184px);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.72;
}

.error-hero__content .eyebrow {
  margin: 29px 0 13px;
  color: var(--color-action);
}

.error-hero h1 {
  max-width: 620px;
  margin: 0;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: clamp(51px, 6vw, 75px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.96;
  text-transform: uppercase;
}

.error-hero__description {
  max-width: 600px;
  margin: 20px 0 0;
  color: #58696f;
  font-size: var(--text-lead);
  line-height: 1.75;
}

.error-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px 25px;
  margin-top: 27px;
}

.error-hero__secondary,
.error-help__secondary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  font-size: var(--text-body);
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease;
}

.error-hero__secondary:hover {
  color: var(--color-action);
}

.error-flow {
  position: relative;
  width: 100%;
  max-width: 505px;
  justify-self: end;
  padding: 21px 22px 18px;
  border: 1px solid #dce8f0;
  background-color: rgba(255, 255, 255, 0.78);
  background-image: linear-gradient(rgba(18, 57, 88, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(18, 57, 88, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: 0 22px 55px rgba(18, 57, 88, 0.075);
}

.error-flow::before,
.error-flow::after {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--color-accent);
  border-style: solid;
  content: "";
}

.error-flow::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.error-flow::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
}

.error-flow__topline,
.error-flow__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-action);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.error-flow__topline b {
  margin-left: 5px;
  color: #a16e39;
  font-size: inherit;
}

.error-flow__diagram {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) 34px minmax(80px, 1.06fr) 34px minmax(72px, 1fr);
  align-items: center;
  min-height: 255px;
  padding: 18px 0 8px;
}

.error-flow__stage {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 9px;
  border: 1px solid #dce8f0;
  background: rgba(255, 255, 255, 0.86);
}

.error-flow__stage--fault {
  min-height: 178px;
  justify-content: center;
  align-items: center;
  border-color: #cfad78;
  background: #fffaf1;
  text-align: center;
}

.error-flow__stage-index {
  color: var(--color-action);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 0.11em;
  white-space: nowrap;
}

.error-flow__stage-label {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.error-flow__stage-mark {
  width: 100%;
  height: 20px;
  border-bottom: 2px solid var(--color-accent);
  background: linear-gradient(135deg, transparent 44%, rgba(19, 145, 80, 0.16) 45%, rgba(19, 145, 80, 0.16) 53%, transparent 54%);
}

.error-flow__stage-mark--end {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, transparent 44%, rgba(18, 57, 88, 0.08) 45%, rgba(18, 57, 88, 0.08) 53%, transparent 54%);
}

.error-flow__fault-code {
  margin: 5px 0 2px;
  color: #967345;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.2vw, 52px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.error-flow__connector {
  position: relative;
  height: 2px;
  background: #75ad84;
}

.error-flow__connector::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 6px;
  height: 6px;
  border-top: 2px solid #75ad84;
  border-right: 2px solid #75ad84;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.error-flow__connector--broken {
  height: 1px;
  background: repeating-linear-gradient(90deg, #bd9871 0 5px, transparent 5px 9px);
}

.error-flow__connector--broken::after {
  border-color: #bd9871;
}

.error-flow__caption {
  justify-content: flex-start;
  gap: 10px;
  padding-top: 13px;
  border-top: 1px solid #e1eaf2;
  color: #6c7b73;
  font-size: var(--text-caption);
  letter-spacing: 0.02em;
}

.error-flow__caption span:first-child {
  color: var(--color-action);
  font-family: var(--font-display);
  font-size: var(--text-lead);
  font-weight: 700;
}

.error-recovery {
  padding: clamp(58px, 6vw, 78px) 0 clamp(62px, 6.5vw, 84px);
  background: #f5f8f6;
}

.error-section-heading {
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: center;
}

.error-section-heading .eyebrow {
  justify-content: center;
  margin-bottom: 13px;
  color: var(--color-action);
}

.error-section-heading h2 {
  margin: 0;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-transform: uppercase;
}

.error-recovery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #dbe7ef;
  border-left: 1px solid #dbe7ef;
}

.error-nav-card {
  display: flex;
  min-height: 192px;
  flex-direction: column;
  align-items: flex-start;
  padding: 21px 22px 18px;
  border-right: 1px solid #dbe7ef;
  border-bottom: 1px solid #dbe7ef;
  color: inherit;
  background: rgba(255, 255, 255, 0.58);
  text-decoration: none;
  transition: background-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.error-nav-card:hover {
  z-index: 1;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(18, 57, 88, 0.075);
  transform: translateY(-2px);
}

.error-nav-card__label {
  color: #708078;
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 0.13em;
}

.error-nav-card__label i {
  margin: 0 4px;
  color: var(--color-action);
  font-style: normal;
}

.error-nav-card h3 {
  margin: 16px 0 7px;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.error-nav-card p {
  max-width: 335px;
  margin: 0;
  color: #64736c;
  font-size: var(--text-body);
  line-height: 1.6;
}

.error-nav-card__link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 15px;
  color: var(--color-action);
  font-size: var(--text-caption);
  font-weight: 700;
}

.error-nav-card__link i {
  font-size: var(--text-body);
  font-style: normal;
  transition: transform 170ms ease;
}

.error-nav-card:hover .error-nav-card__link i {
  transform: translate(2px, -2px);
}

.error-help {
  padding: clamp(42px, 4.5vw, 54px) 0;
  color: #fff;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(19, 145, 80, 0.17), transparent 42%),
    var(--color-primary);
}

.error-help__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 42px;
}

.error-help__copy {
  max-width: 810px;
}

.error-help .eyebrow {
  margin: 0 0 12px;
  color: var(--color-blue-soft);
}

.error-help h2 {
  max-width: 790px;
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(37px, 4.5vw, 55px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-transform: uppercase;
}

.error-help__copy > p:last-child {
  max-width: 700px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--text-body);
  line-height: 1.7;
}

.error-help__actions {
  display: flex;
  min-width: 205px;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.error-help__secondary {
  color: #fff;
}

.error-help__secondary:hover {
  color: var(--color-blue-soft);
}

.error-hero a:focus-visible,
.error-nav-card:focus-visible,
.error-help a:focus-visible {
  outline: 3px solid #9ed9ad;
  outline-offset: 4px;
}

@media (max-width: 1000px) {
  .error-hero {
    min-height: 0;
    padding: calc(var(--header-height) + 45px) 0 65px;
  }

  .error-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.86fr);
    gap: 35px;
  }

  .error-flow {
    padding-inline: 16px;
  }

  .error-flow__diagram {
    grid-template-columns: minmax(60px, 1fr) 22px minmax(72px, 1.06fr) 22px minmax(60px, 1fr);
  }

  .error-flow__stage {
    padding-inline: 7px;
  }

  .error-nav-card {
    padding-inline: 18px;
  }

  .error-help__inner {
    grid-template-columns: minmax(0, 1fr) 205px;
    gap: 28px;
  }
}

@media (max-width: 767px) {
  .error-hero {
    padding: calc(var(--header-height) + 28px) 0 46px;
    background:
      radial-gradient(ellipse at 74% 45%, rgba(19, 145, 80, 0.08), transparent 38%),
      #fff;
  }

  .error-hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .error-code {
    margin-left: -4px;
    font-size: clamp(105px, 26vw, 142px);
  }

  .error-hero__content .eyebrow {
    margin-top: 25px;
  }

  .error-hero h1 {
    max-width: 520px;
    font-size: clamp(47px, 10vw, 64px);
  }

  .error-hero__description {
    font-size: var(--text-body);
  }

  .error-flow {
    max-width: none;
    justify-self: stretch;
  }

  .error-flow__diagram {
    min-height: 220px;
  }

  .error-recovery {
    padding-block: 63px 69px;
  }

  .error-section-heading {
    margin-bottom: 26px;
  }

  .error-recovery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .error-nav-card {
    min-height: 213px;
    padding: 19px 16px 17px;
  }

  .error-nav-card h3 {
    font-size: 25px;
  }

  .error-help__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .error-help__actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
  }
}

@media (max-width: 520px) {
  .error-hero__actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .error-flow {
    padding: 17px 12px 14px;
  }

  .error-flow__diagram {
    grid-template-columns: minmax(58px, 1fr) 15px minmax(68px, 1.06fr) 15px minmax(58px, 1fr);
    min-height: 204px;
    padding-block: 13px 7px;
  }

  .error-flow__stage {
    min-height: 132px;
    padding: 10px 6px;
  }

  .error-flow__stage--fault {
    min-height: 157px;
  }

  .error-flow__stage-index {
    font-size: var(--text-caption);
    letter-spacing: 0.06em;
  }

  .error-flow__stage-label {
    font-size: var(--text-lead);
  }

  .error-flow__fault-code {
    font-size: 39px;
  }

  .error-flow__topline {
    font-size: var(--text-caption);
  }

  .error-flow__caption {
    align-items: flex-start;
    font-size: var(--text-caption);
  }

  .error-recovery__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .error-nav-card {
    min-height: 185px;
    padding: 18px 19px 17px;
  }

  .error-nav-card h3 {
    margin-top: 13px;
  }

  .error-nav-card__link {
    padding-top: 12px;
  }

  .error-help {
    padding-block: 44px;
  }

  .error-help__actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-hero__secondary,
  .error-help__secondary,
  .error-nav-card,
  .error-nav-card__link i {
    transition: none;
  }

  .error-nav-card:hover {
    transform: none;
  }
}
