/* ===========================================================================
   Pillow Client — the pages that are not the start page.

   The start page carries landing.css. This file carries the two pages that run
   on the shared shell (src/layouts/base.html): the status page and the 404, plus
   the two chrome pieces they share with the start page — the header partial and
   the footer partial. The footer lives here on purpose: src/partials/footer.html
   is used by BOTH layouts, so its rules have to be in a file that both layouts
   load (base.html loads this file; landing.html loads it after landing.css).

   Rules of this file:
   - No gradient, no glow, no icon card. Surfaces are one flat fill plus a 1px
     line; the accent is used for links and focus only.
   - Everything is a token from tokens.css. No hardcoded colour, size or gap.
   - Mobile first in behaviour, not in ordering: 320px must not scroll sideways,
     so every grid below collapses to one column before it can overflow.
   - Selectors are prefixed with .status, .notfound, .footer or .nav. The start
     page shares .footer and .nav, so nothing here may restyle .hero, .section,
     .btn or .brand outside those two blocks.
   =========================================================================== */

/* ===========================================================================
   1. Header on the base layout (status, 404)

   The landing layout has its own header markup; these pages get the shared
   nav partial. The bar is plain and static: a bar that follows you is chrome,
   and these two pages are read top to bottom once.
   =========================================================================== */
.nav,
.nav.is-stuck {
  position: static;
  z-index: 10;
  background: var(--bg);
  backdrop-filter: none;
  border-bottom: 1px solid var(--line);
}

.nav__cta { margin-left: 6px; }

/* the current page, marked by the builder's nav token (data-active). The token
   is "true" on the status page and "false" elsewhere, which is also what makes
   aria-current="true"/"false" in the partial valid ARIA. */
.nav__link[data-active='true'],
.nav__link[data-active='status'],
.nav__link[data-active='page'],
.nav__link[data-active='1'] {
  color: var(--text);
  background: var(--surface-2);
}

@media (max-width: 900px) {
  /* Two links and a button do not need a hamburger, and a menu that can only
     be opened by a component this partial does not ship would be a dead end. */
  .nav__inner { height: 58px; gap: 12px; }
  .nav .nav__menu {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    backdrop-filter: none;
    border: 0;
  }
  .nav .nav__list { flex-direction: row; gap: 2px; }
  .nav .nav__link { padding: 8px 9px; font-size: var(--fs-sm); }
  .nav .brand__tag { display: none; }
  .nav__cta { display: none; }
}

@media (max-width: 360px) {
  .nav .nav__link { padding: 6px 7px; font-size: var(--fs-xs); }
}

/* ===========================================================================
   2. STATUS PAGE

   One claim, one state line, two blocks. The page exists because the status API
   is being built, so it says that and then prints the only numbers that are real
   today: the build's own facts. Nothing here is estimated or placeheld.
   =========================================================================== */
.status__inner {
  width: 100%;
  max-width: var(--wrap-narrow);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(48px, 7.5vw, 92px) clamp(44px, 6vw, 76px);
}

.status__title {
  max-width: 22ch;
  font-size: var(--fs-h2);
}

.status__lead {
  margin-top: 18px;
  max-width: 56ch;
  font-size: var(--fs-lead);
  line-height: 1.65;
  color: var(--text-2);
}

.status__state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-2);
}

.status__dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-dim);
}

.status__block {
  border-top: 1px solid var(--line);
  padding-block: clamp(26px, 3.6vw, 40px);
}

.status__h2 { font-size: var(--fs-h3); }

.status__list {
  display: grid;
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--line);
}

.status__list li {
  display: grid;
  gap: 3px;
  padding: 15px 17px;
  background: var(--bg-1);
}

@media (min-width: 700px) {
  .status__list li {
    grid-template-columns: 16ch minmax(0, 1fr);
    gap: 18px;
    align-items: baseline;
  }
}

.status__list b {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
}

.status__list span {
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text-2);
}

.status__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--line);
}

.status__fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg-1);
}

.status__fact dt {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-3);
}

.status__fact dd {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text);
  text-align: right;
}

/* one column before a long loader string can push a value out of its cell */
@media (max-width: 560px) {
  .status__facts { grid-template-columns: minmax(0, 1fr); }
}

.status__note {
  margin-top: 20px;
  max-width: 62ch;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-2);
}

.status__note a {
  color: var(--violet-soft);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.status__note a:hover { color: var(--text); }

/* ===========================================================================
   3. 404

   Served for every unmatched path. It has one job: say the page is gone and
   point home. The 404 code sits under the button, not above the headline, so the
   first thing read is a sentence rather than a label.
   =========================================================================== */
.page--notfound {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.page--notfound #main {
  flex: 1 0 auto;
  display: grid;
  align-content: center;
  padding-block: clamp(40px, 8vw, 90px);
}

.notfound__inner {
  width: 100%;
  max-width: var(--wrap-narrow);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.notfound__title {
  max-width: 18ch;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
}

.notfound__lede {
  margin-top: 16px;
  max-width: 44ch;
  font-size: var(--fs-lead);
  color: var(--text-2);
}

.notfound__cta { margin-top: 26px; }

.notfound__code {
  margin-top: clamp(32px, 6vw, 56px);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-3);
}

/* ===========================================================================
   4. FOOTER (shared with the start page)

   src/partials/footer.html is inserted into both layouts, so every rule here
   has to be layout independent: no .section parent, no scroll container, no
   assumption about what sits above it. Flat black surface, one hairline on top,
   three short columns on the right, the brand and the one action on the left.
   =========================================================================== */
.footer {
  margin-top: 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}

.footer__inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(36px, 5vw, 60px) var(--gutter) clamp(28px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(28px, 5vw, 64px);
}

/* The footer wordmark is the same on both layouts. landing.css styles .brand
   for the landing header, so the footer gets its own scoped rules: the header
   may change without dragging the footer with it. */
.footer .brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  flex: none;
}

.footer .brand__mark { display: flex; align-self: center; }

.footer .brand__word {
  font-size: 1.06rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.footer .brand__tag {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-3);
}

.footer__line {
  margin-top: 16px;
  max-width: 34ch;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-2);
}

.footer__cta { margin-top: 22px; }

.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 34px);
}

.footer__heading {
  margin-bottom: 14px;
  font-size: var(--fs-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-3);
}

.footer__col ul {
  display: grid;
  gap: 9px;
}

.footer__col a {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.footer__col a:hover { color: var(--violet-soft); }

.footer__meta {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-3);
}

.footer__base {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 22px var(--gutter) 30px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.footer__legal {
  max-width: 92ch;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--text-3);
}

/* dim used to be a hand-picked grey below 4.5:1 on black; the token is the
   darker of the two legible greys, so the second line stays AA instead of
   fading out. */
.footer__legal--dim { color: var(--text-3); }

@media (max-width: 900px) {
  .footer__inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .footer__cols { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .footer__cta,
  .status__note a { transition: none; }
}
