/* Shared by the React recovery screens and the standalone HTTP 404. */
.atlas-recovery-document {
  color-scheme: light dark;
  --foreground: #171b1e;
  --background: #f0f3f4;
  --card: #fff;
  --muted-foreground: #3a4247;
  --border: #bfc7cc;
  --ring: #246e97;
  --primary: #173440;
  --primary-foreground: #fff;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 1rem/1.55 'IBM Plex Sans', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  .atlas-recovery-document {
    --foreground: #f0f3f4;
    --background: #171b1e;
    --card: #20272b;
    --muted-foreground: #d6dcdf;
    --border: #515a60;
    --ring: #a3bfda;
    --primary: #f0f3f4;
    --primary-foreground: #0a1628;
  }
}

.atlas-recovery-document *,
.atlas-recovery-document *::before,
.atlas-recovery-document *::after {
  box-sizing: border-box;
}

.atlas-recovery-masthead {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.atlas-recovery-masthead > div {
  display: flex;
  min-height: 4rem;
  max-width: 78rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.atlas-recovery-masthead img {
  display: block;
  width: auto;
  height: clamp(1.35rem, 5vw, 1.85rem);
}

.atlas-recovery {
  --recovery-atlas: var(--atlas-deep, #12354a);
  --recovery-atlas-raised: var(--atlas-deep-raised, #1c4358);
  --recovery-mark: var(--atlas-change, #b64b32);
  min-width: 0;
  color: var(--foreground);
}

.atlas-recovery--page {
  width: 100%;
  max-width: 78rem;
  margin-inline: auto;
  padding: clamp(1.75rem, 6vw, 5.5rem) clamp(1rem, 4vw, 2rem);
}

.atlas-recovery-sheet {
  position: relative;
  display: grid;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--card);
}

.atlas-recovery--page .atlas-recovery-sheet {
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  overflow: hidden;
  box-shadow: 0 18px 42px -34px var(--recovery-atlas);
}

.atlas-recovery-copy {
  min-width: 0;
  padding: clamp(1.45rem, 4vw, 3.4rem);
}

.atlas-recovery--page .atlas-recovery-copy {
  align-self: center;
}

.atlas-recovery-mark {
  display: flex;
  min-height: 1.85rem;
  align-items: center;
  gap: 0.62rem;
  color: var(--recovery-mark);
}

.atlas-recovery-open-mark {
  position: relative;
  display: grid;
  width: 1.875rem;
  height: 1.875rem;
  place-items: center;
  background:
    linear-gradient(currentColor, currentColor) left center / 7px 1px no-repeat,
    linear-gradient(currentColor, currentColor) right center / 7px 1px no-repeat,
    linear-gradient(currentColor, currentColor) center top / 1px 7px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 1px 7px no-repeat;
}

.atlas-recovery-open-mark::after {
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: '';
}

.atlas-recovery-code {
  border-left: 1px solid var(--border);
  padding-left: 0.65rem;
  color: var(--muted-foreground);
  font: 500 0.75rem/1 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: 0.09em;
}

.atlas-recovery--page .atlas-recovery-content {
  margin-top: 1rem;
}

.atlas-recovery-title {
  margin: 0;
  max-width: 19ch;
  font: 500 clamp(2.45rem, 4.1vw, 3.95rem) / 1.045 'IBM Plex Serif', Georgia, serif;
  letter-spacing: -0.045em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.atlas-recovery-description {
  max-width: 37ch;
  margin: 0.85rem 0 0;
  color: var(--muted-foreground);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.55;
}

.atlas-recovery-controls,
.atlas-recovery-actions {
  margin-top: 1.45rem;
}

.atlas-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.atlas-recovery .atlas-recovery-actions > * {
  max-width: 100%;
  white-space: normal;
}

.atlas-recovery-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.45rem;
  color: var(--foreground);
  font-size: 0.9rem;
  font-weight: 550;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.23em;
}

.atlas-recovery-link:hover {
  color: var(--muted-foreground);
  text-decoration-thickness: 2px;
}

.atlas-recovery-report {
  margin-top: 0.55rem;
  color: var(--muted-foreground);
}

.atlas-recovery-controls + .atlas-recovery-report {
  margin-top: 0.12rem;
}

.atlas-recovery-search label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--foreground);
  font-size: 0.9rem;
  font-weight: 650;
}

.atlas-recovery-search-fields {
  display: flex;
  max-width: 29rem;
  gap: 0.4rem;
}

.atlas-recovery-search input,
.atlas-recovery-search button {
  min-height: 3rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.65rem 0.8rem;
  font: inherit;
}

.atlas-recovery-search input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  background: var(--background);
  color: var(--foreground);
  font-size: 1rem;
}

.atlas-recovery-search input::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}

.atlas-recovery-search button {
  flex: 0 0 auto;
  border-color: var(--primary);
  padding-inline: clamp(0.75rem, 2vw, 1.4rem);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.94rem;
  font-weight: 650;
  cursor: pointer;
}

.atlas-recovery-search button:hover {
  filter: brightness(0.9);
}

.atlas-recovery :focus-visible,
.atlas-recovery-masthead :focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

.atlas-recovery-map {
  position: relative;
  min-height: 25rem;
  overflow: hidden;
  background:
    linear-gradient(140deg, #12354a00 62%, #0a162866),
    url('/atlas-recovery.webp') center / cover,
    linear-gradient(140deg, var(--recovery-atlas-raised), var(--recovery-atlas));
}

.atlas-recovery-map::before {
  position: absolute;
  inset: clamp(0.7rem, 1.65vw, 1.4rem);
  border: 1px solid #bfd0d945;
  content: '';
}

.atlas-recovery-reticle {
  position: absolute;
  top: 62%;
  left: 38%;
  display: grid;
  width: clamp(2.4rem, 6vw, 5rem);
  aspect-ratio: 1;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid #bfd0d977;
  color: #e38a72;
  background:
    linear-gradient(currentColor, currentColor) left center / 26% 1px no-repeat,
    linear-gradient(currentColor, currentColor) right center / 26% 1px no-repeat,
    linear-gradient(currentColor, currentColor) center top / 1px 26% no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 1px 26% no-repeat;
}

.atlas-recovery-reticle::after {
  width: 24%;
  aspect-ratio: 1;
  transform: rotate(45deg);
  border: 2px solid currentColor;
  content: '';
}

.atlas-recovery[data-kind='access'] .atlas-recovery-reticle,
.atlas-recovery[data-kind='empty'] .atlas-recovery-reticle {
  color: #bfd0d9;
}

.atlas-recovery[data-kind='offline'] .atlas-recovery-map {
  filter: saturate(0.66);
}

.atlas-recovery--inline .atlas-recovery-sheet {
  border-inline-start: 2px solid var(--recovery-mark);
}

.atlas-recovery--inline:is([data-kind='empty'], [data-kind='access']) .atlas-recovery-sheet {
  border-inline-start-color: var(--border);
}

.atlas-recovery--inline .atlas-recovery-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  padding: clamp(1rem, 2.6vw, 1.65rem);
}

.atlas-recovery--inline .atlas-recovery-mark {
  align-self: start;
}

.atlas-recovery--inline .atlas-recovery-title {
  max-width: 100%;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.atlas-recovery--inline .atlas-recovery-description {
  max-width: 60ch;
  margin-top: 0.4rem;
  font-size: 0.94rem;
}

.atlas-recovery--inline .atlas-recovery-actions {
  margin-top: 0.8rem;
}

.atlas-recovery-followup {
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  padding: clamp(1rem, 2vw, 1.5rem);
  background: var(--card);
}

@media (max-width: 720px) {
  .atlas-recovery--page .atlas-recovery-sheet {
    grid-template-columns: minmax(0, 1fr);
  }

  .atlas-recovery-map {
    min-height: clamp(5.75rem, 21vw, 8.75rem);
    background-position: center, 50% 42%, center;
  }

  .atlas-recovery-map::before {
    inset: 0.55rem;
  }

  .atlas-recovery-reticle {
    top: 50%;
  }

  .atlas-recovery-title {
    text-wrap: pretty;
  }
}

@media (max-width: 350px) {
  .atlas-recovery--page .atlas-recovery-copy {
    padding: 1.15rem;
  }

  .atlas-recovery-map {
    display: none;
  }
}

/* The 404 opens onto a real port scene and leaves the atlas search in view. */
.atlas-recovery[data-artwork='port'] {
  --recovery-scene: #0b2732;
  --recovery-scene-ink: #f4f8fa;
  --recovery-scene-muted: #bfd0d9;
  max-width: none;
  padding: 0;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-sheet {
  --ring: #a3bfda;
  position: relative;
  display: block;
  min-height: clamp(32rem, 66vh, 42rem);
  overflow: hidden;
  isolation: isolate;
  border: 0;
  background: var(--recovery-scene);
  color: var(--recovery-scene-ink);
  box-shadow: none;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 78rem;
  margin-inline: auto;
  padding: clamp(3.5rem, 7.2vh, 5.75rem) clamp(1rem, 4vw, 2rem) 4.25rem;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-content {
  max-width: 34rem;
  margin-top: 1.1rem;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-mark,
.atlas-recovery[data-artwork='port'] .atlas-recovery-mark svg {
  color: #e38a72;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-code {
  border-color: #bfd0d966;
  color: var(--recovery-scene-muted);
  letter-spacing: 0.14em;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-title {
  max-width: none;
  font-size: clamp(3.45rem, 6.3vw, 5.9rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-description {
  margin-top: 1.05rem;
  color: var(--recovery-scene-muted);
  font-size: clamp(1.05rem, 1.5vw, 1.26rem);
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-controls {
  margin-top: 2.1rem;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-search label {
  margin-bottom: 0.5rem;
  color: var(--recovery-scene-ink);
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-search-fields {
  width: 100%;
  max-width: 31rem;
  gap: 0;
  border: 1px solid #f4f8fa;
  background: #f4f8fa;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-search input,
.atlas-recovery[data-artwork='port'] .atlas-recovery-search button {
  min-height: 3.4rem;
  border: 0;
  border-radius: 0;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-search input {
  background: #f4f8fa;
  color: #171b1e;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-search input::placeholder {
  color: #4a5960;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-search input:focus-visible {
  outline-color: #246e97;
  outline-offset: -3px;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-search button {
  min-width: 6.6rem;
  background: #a5442e;
  color: #fff;
  font-weight: 650;
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-sheet .atlas-recovery-link {
  color: var(--recovery-scene-muted);
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-sheet .atlas-recovery-link:hover {
  color: var(--recovery-scene-ink);
}

.atlas-recovery[data-artwork='port'] .atlas-recovery-report {
  margin-top: 0.9rem;
}

.atlas-recovery-aerial {
  position: absolute;
  inset: 0 0 0 23%;
  margin: 0;
}

.atlas-recovery-aerial-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.atlas-recovery-aerial-frame img {
  position: absolute;
  inset: -15% 0 auto;
  width: 100%;
  height: 115%;
  object-fit: cover;
  object-position: 65% 56%;
}

.atlas-recovery-aerial-frame::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--recovery-scene),
    #0b2732ed 14%,
    #0b2732a8 31%,
    #0b273226 54%,
    transparent 72%
  );
  content: '';
}

.atlas-recovery-attribution {
  position: absolute;
  right: clamp(1rem, 4vw, 2rem);
  bottom: 1.35rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.08rem 0.8rem;
  margin: 0;
  border-inline-start: 2px solid #e38a72;
  padding: 0.55rem 0.8rem;
  background: #0a2029e8;
  color: #f4f8fa;
  font-size: 0.75rem;
  line-height: 1.35;
}

.atlas-recovery-attribution span:last-child {
  color: #bfd0d9;
}

.atlas-recovery-directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 78rem;
  margin-inline: auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.atlas-recovery-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 7.1rem;
  align-items: center;
  column-gap: clamp(0.65rem, 2vw, 1.2rem);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem clamp(0.7rem, 2.5vw, 1.6rem);
  color: var(--foreground);
  text-decoration: none;
}

.atlas-recovery-entry + .atlas-recovery-entry {
  border-inline-start: 1px solid var(--border);
}

.atlas-recovery-entry:hover {
  background: var(--card);
}

.atlas-recovery-entry-icon {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.atlas-recovery-entry-mark {
  width: 0.58rem;
  height: 0.58rem;
  transform: rotate(45deg);
  border: 1px solid currentColor;
  color: var(--recovery-mark);
}

.atlas-recovery-entry strong {
  display: block;
  font: 500 clamp(1.05rem, 2.1vw, 1.55rem) / 1.15 'IBM Plex Serif', Georgia, serif;
  letter-spacing: -0.018em;
  overflow-wrap: anywhere;
}

.atlas-recovery-entry small {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted-foreground);
  font-size: 0.84rem;
  line-height: 1.3;
}

.atlas-recovery-entry-arrow {
  color: var(--muted-foreground);
  font-size: 1.15rem;
}

@media (min-width: 761px) and (max-width: 1050px) {
  .atlas-recovery[data-artwork='port'] .atlas-recovery-content {
    max-width: 29rem;
  }
}

@media (max-width: 760px) {
  .atlas-recovery[data-artwork='port'] .atlas-recovery-sheet {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .atlas-recovery[data-artwork='port'] .atlas-recovery-copy {
    padding: 1.65rem clamp(1rem, 5vw, 1.6rem) 0.85rem;
  }

  .atlas-recovery[data-artwork='port'] .atlas-recovery-title {
    font-size: clamp(2.65rem, 10vw, 4.4rem);
    letter-spacing: -0.045em;
    text-wrap: initial;
  }

  .atlas-recovery[data-artwork='port'] .atlas-recovery-description {
    margin-top: 0.7rem;
  }

  .atlas-recovery[data-artwork='port'] .atlas-recovery-controls {
    margin-top: 1.35rem;
  }

  .atlas-recovery[data-artwork='port'] .atlas-recovery-search input,
  .atlas-recovery[data-artwork='port'] .atlas-recovery-search button {
    min-height: 3rem;
  }

  .atlas-recovery[data-artwork='port'] .atlas-recovery-search button {
    min-width: 4.4rem;
  }

  .atlas-recovery[data-artwork='port'] .atlas-recovery-report {
    margin-top: 0.35rem;
  }

  .atlas-recovery-aerial {
    position: relative;
    inset: auto;
    min-height: clamp(8.25rem, 40vw, 12.75rem);
  }

  .atlas-recovery-aerial-frame img {
    object-position: 50% 56%;
  }

  .atlas-recovery-aerial-frame::after {
    background: linear-gradient(180deg, var(--recovery-scene), transparent 50%);
  }

  .atlas-recovery-attribution {
    right: 1rem;
    bottom: 0.65rem;
    font-size: 0.68rem;
  }

  .atlas-recovery-directory {
    padding-inline: 0;
  }

  .atlas-recovery-entry {
    min-height: 4.55rem;
  }
}

@media (max-width: 540px) {
  .atlas-recovery-entry {
    column-gap: 0.45rem;
    padding-inline: 0.75rem;
  }

  .atlas-recovery-entry-icon {
    width: 1.25rem;
    height: 1.5rem;
    border: 0;
  }

  .atlas-recovery-entry strong {
    font-size: 1rem;
  }

  .atlas-recovery-entry small {
    display: none;
  }
}

@media (max-width: 360px) {
  .atlas-recovery-entry {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .atlas-recovery-entry-icon {
    display: none;
  }
}
