/* status.55th.trading. The shell (portrait, link wall, article column, mobile header) is copied from
   benklosky.com's globals.css so this page sits exactly where the site's article pages do. */

:root {
  --background: #f8f7f4;
  --foreground: #1b1a18;
  --text: #3a3834;
  --muted: #5c5954;
  --link: #2f2c28;
  --underline: #1e3a8a;
  --underline-thickness: 2px;
  --ok: #6f8f5a;
  --degraded: #b8862f;
  --down: #b5402a;
  --none: #e3e0d8;
}

body {
  background: var(--background);
  color: var(--foreground);
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

.site-shell {
  --sidebar-top: 5.5rem;
  --portrait-size: 5rem;
  --sidebar-gap: 1.5rem;
  box-sizing: border-box;
  display: flex;
  min-height: 100svh;
  align-items: flex-start;
  justify-content: center;
  padding: var(--sidebar-top) 2rem 4rem;
}

.composition {
  display: flex;
  width: min(40rem, 100%);
  gap: 4.5rem;
  margin-right: 10vw;
}

.composition--article {
  /* Keep the sidebar at the same horizontal position as on the home page. */
  margin-left: max(0px, calc((100% - 40rem - 10vw) / 2));
  width: calc(100% - max(0px, (100% - 40rem - 10vw) / 2));
  gap: clamp(1rem, 3vw, 4rem);
  margin-right: 0;
}

.page-content {
  flex: 1;
  min-width: 0;
}

.mobile-header {
  display: none;
}

.link-column {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-self: stretch;
  gap: var(--sidebar-gap);
  width: max-content;
}

.portrait-link {
  align-self: flex-start;
  position: sticky;
  top: var(--sidebar-top);
  z-index: 1;
  display: block;
  width: var(--portrait-size);
  height: var(--portrait-size);
  border-radius: 50%;
  line-height: 0;
}

.portrait-link:focus-visible,
.link-wall a:focus-visible,
.status-page a:focus-visible,
.mobile-header a:focus-visible {
  outline: 2px solid #c96f45;
  outline-offset: 3px;
}

.portrait {
  width: var(--portrait-size);
  height: var(--portrait-size);
  border-radius: 50%;
  object-fit: cover;
}

.link-wall {
  position: sticky;
  top: calc(var(--sidebar-top) + var(--portrait-size) + var(--sidebar-gap));
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
  gap: 0.85rem;
  padding-top: 0.15rem;
  color: #fff;
  mix-blend-mode: difference;
}

.link-wall a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  font-size: 0.8125rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 140ms ease;
}

.link-wall a:hover,
.link-wall a:focus-visible {
  opacity: 0.58;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-wall svg {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ the page (matches the article pages) */

.status-page {
  color: var(--foreground);
  padding-top: 1.75rem;
  max-width: 34rem;
}

.status-page h1 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.status-page h2 {
  margin: 2rem 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.status-page p {
  margin: 0 0 1.1rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
}

.status-page a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: 0.15em;
}

.status-page .status-summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--foreground);
}

.status-dot {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--none);
}

.status-dot.is-ok { background: var(--ok); }
.status-dot.is-degraded { background: var(--degraded); }
.status-dot.is-down { background: var(--down); }

.checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.check + .check {
  margin-top: 1rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--text);
}

.check-name {
  flex: 1;
  min-width: 0;
  color: var(--foreground);
}

.check-detail,
.check-uptime {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.check-uptime {
  min-width: 3.4rem;
  text-align: right;
}

.check.is-down .check-detail {
  color: var(--down);
}

.bars {
  display: flex;
  gap: 2px;
  height: 0.85rem;
  margin: 0.4rem 0 0 1.15rem;
}

.bar {
  flex: 1;
  border-radius: 1px;
  background: var(--none);
}

.bar.is-ok { background: var(--ok); }
.bar.is-degraded { background: var(--degraded); }
.bar.is-down { background: var(--down); }

.bars-axis {
  display: flex;
  justify-content: space-between;
  margin: 0.35rem 0 0 1.15rem;
  font-size: 0.6875rem;
  color: var(--muted);
}

.status-page .status-caption {
  margin-top: 2.25rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-shell {
    --sidebar-top: 2.5rem;
    --mobile-header: 3.75rem;
    padding: var(--mobile-header) 1.5rem 3rem;
  }

  .mobile-header {
    display: flex;
    position: fixed;
    z-index: 20;
    top: 0;
    right: 0;
    left: 0;
    height: var(--mobile-header, 3.75rem);
    align-items: flex-start;
    padding: 0.95rem 1.5rem 0 calc(0.95rem + (0.95rem - 0.8125rem) / 2);
    background: linear-gradient(to bottom, var(--background) 0%, var(--background) 42%, transparent 100%);
    pointer-events: none;
  }

  .mobile-header a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--foreground);
    font-size: 0.8125rem;
    line-height: 1;
    text-decoration: none;
    pointer-events: auto;
  }

  .mobile-header a span {
    text-decoration: underline;
    text-decoration-color: var(--underline);
    text-decoration-thickness: var(--underline-thickness);
    text-underline-offset: 0.15em;
  }

  .mobile-header svg {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
  }

  .composition--article {
    flex-direction: column;
    margin-left: 0;
    width: 100%;
    gap: 1.25rem;
  }

  .link-column {
    display: none;
  }

  .status-page {
    max-width: none;
  }
}
