/* Digital Umuganda status page.
   Brand: the DCP theme (green brand scale, cool ink greys, amber and red for
   trouble), Manrope for headings and Inter for text, both self-hosted (no
   external requests). The banner's zigzag edge follows the imigongo relief
   patterns; everything else stays quiet so the status reads first.
   Colour values are the DCP theme tokens (src/styles/index.css) in hex. */

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('fonts/manrope-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fafbfc; /* ink-50 */
  --surface: #ffffff;
  --sunken: #f1f5f8; /* ink-100 */
  --ink: #0f1b21; /* ink-900 */
  --muted: #5f717b; /* ink-500 */
  --rule: #dfe7eb; /* ink-200 */
  --brand: #007a52; /* brand-600 */
  --brand-strong: #006442; /* brand-700 */
  --brand-soft: #e5fbef; /* brand-50 */
  --ok: #007a52; /* brand-600 */
  --minor: #986600; /* amber-700 */
  --partial: #b04406;
  --major: #bb1519; /* red-600 */
  --maint: #34596b; /* the logo's slate wordmark */
  --nodata: #cbd5db; /* ink-300 */
  --bar-ok: #009263; /* brand-500 */
  --bar-minor: #d38f00; /* amber-500 */
  --bar-major: #cc342f; /* red-500 */
  --band-ok: #006442; /* brand-700 */
  --band-minor: #986600; /* amber-700 */
  --band-partial: #b04406;
  --band-major: #bb1519; /* red-600 */
  --band-maint: #34596b;
  --band-ink: #ffffff;
  --focus: #009263;
  --font: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --display: 'Manrope', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono:
    ui-monospace, 'SF Mono', 'Cascadia Mono', 'DejaVu Sans Mono', monospace;
  --measure: 50rem;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #061015; /* ink-950 */
    --surface: #0f1b21; /* ink-900 */
    --sunken: #1d2a31; /* ink-800 */
    --ink: #f1f5f8; /* ink-100 */
    --muted: #93a3ac; /* ink-400 */
    --rule: #1d2a31; /* ink-800 */
    --brand: #3ab381; /* brand-400 */
    --brand-strong: #007a52; /* brand-600 */
    --brand-soft: #002a1a; /* brand-950 */
    --ok: #3ab381; /* brand-400 */
    --minor: #e4a339; /* amber-400 */
    --partial: #f19156;
    --major: #e3655a; /* red-400 */
    --maint: #8fb4c6;
    --nodata: #34434b; /* ink-700 */
    --bar-ok: #3ab381; /* brand-400 */
    --bar-minor: #e4a339; /* amber-400 */
    --bar-major: #e3655a; /* red-400 */
    /* Deep bands so white text holds AA on every one. */
    --band-ok: #005235; /* brand-800 */
    --band-minor: #7b5100; /* amber-800 */
    --band-partial: #8a3305;
    --band-major: #9e000c; /* red-700 */
    --band-maint: #2b4a59;
    --focus: #72d2a5; /* brand-300 */
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 var(--font);
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 16px;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 10;
  background: var(--surface);
  padding: 0.4rem 0.8rem;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.quiet,
.meta {
  color: var(--muted);
}

.meta {
  font-size: 0.875rem;
}

.small {
  font-size: 0.875rem;
}

/* Masthead ---------------------------------------------------------------- */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}

.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
  /* Room above and below when the subscribe link wraps on a phone. */
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo {
  display: block;
  height: 2.1rem;
  width: auto;
}

.wordmark-tag {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
  padding-left: 0.75rem;
  border-left: 1px solid var(--rule);
}

.subscribe-link {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1.05rem;
  background: var(--brand);
  color: #ffffff;
  border-radius: 999px;
  text-decoration: none;
}

.subscribe-link:hover {
  background: var(--brand-strong);
}

@media (prefers-color-scheme: dark) {
  .subscribe-link {
    color: var(--paper);
  }

  .subscribe-link:hover {
    background: var(--ok);
    filter: brightness(1.1);
  }
}

/* Banner: the page's single bold element -------------------------------------- */

.banner {
  --band: var(--band-ok);
  position: relative;
  background:
    radial-gradient(
      120% 160% at 100% 0%,
      color-mix(in srgb, #ffffff 14%, transparent),
      transparent 60%
    ),
    var(--band);
  color: var(--band-ink);
  margin-bottom: 2.75rem;
}

.banner::after {
  /* Imigongo-style zigzag edge: two rows of triangles in the band colour. */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 10px;
  background:
    linear-gradient(135deg, var(--band) 50%, transparent 50%) 0 0 / 20px 10px
      repeat-x,
    linear-gradient(225deg, var(--band) 50%, transparent 50%) 0 0 / 20px 10px
      repeat-x;
}

.ind-minor {
  --band: var(--band-minor);
}

.ind-major {
  --band: var(--band-partial);
}

.ind-critical {
  --band: var(--band-major);
}

.ind-maintenance {
  --band: var(--band-maint);
}

.banner-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 2.25rem;
  padding-bottom: 2.25rem;
}

.banner h1 {
  font-size: clamp(1.6rem, 5.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.banner p {
  margin-top: 0.35rem;
  opacity: 0.92;
}

.banner .glyph {
  width: clamp(2.2rem, 7vw, 3rem);
  height: clamp(2.2rem, 7vw, 3rem);
  flex: none;
  fill: var(--band-ink);
  stroke: var(--band);
}

.banner .glyph .g-mark {
  stroke: var(--band);
}

/* Status labels and glyphs -------------------------------------------------- */

.glyph {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: currentColor;
}

.glyph .g-mark {
  fill: none;
  stroke: var(--surface);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.s-operational {
  color: var(--ok);
}

.s-degraded_performance {
  color: var(--minor);
}

.s-partial_outage {
  color: var(--partial);
}

.s-major_outage {
  color: var(--major);
}

.s-under_maintenance {
  color: var(--maint);
}

/* Sections ---------------------------------------------------------------- */

main {
  padding-bottom: 3rem;
}

main > section,
main > article {
  margin-bottom: 2.5rem;
}

main h2 {
  font-size: 1.2rem;
  font-weight: 650;
  margin-bottom: 0.9rem;
}

.page-title {
  font-size: clamp(1.6rem, 4.6vw, 2.1rem);
  font-weight: 650;
  margin: 2rem 0 1rem;
}

.crumb {
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

/* Under a banner the crumb tucks into the banner's bottom margin. */
.banner + main .crumb {
  margin-top: -1rem;
}

.lede {
  color: var(--muted);
  margin: -0.4rem 0 1rem;
}

/* Products: one card, a row per product (Vercel-style accordion) ----------- */

.products,
.product-page .product {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(15 27 33 / 4%);
}

.products {
  margin-bottom: 2.5rem;
}

.products > .product {
  padding: 1.15rem 1.25rem 1.1rem;
}

.products > .product + .product {
  border-top: 1px solid var(--rule);
}

.product-page .product {
  padding: 1.15rem 1.25rem 0.4rem;
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.disclosure {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 0;
  margin: -0.3rem 0 -0.3rem -0.4rem;
  padding: 0.3rem 0.55rem 0.3rem 0.4rem;
  background: none;
  border: 0;
  border-radius: 8px;
  color: inherit;
  font: inherit;
  text-align: left;
}

.disclosure:hover {
  background: var(--sunken);
}

.chev {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.disclosure[aria-expanded='true'] .chev {
  transform: rotate(90deg);
}

.count {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--sunken);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* Without JavaScript the button does nothing: no chevron, every panel open. */
html:not(.js) .chev {
  display: none;
}

.js .panel.collapsed {
  display: none;
}

.panel {
  margin: 1.1rem 0 0 0.45rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--brand-soft);
}

.panel-foot {
  font-size: 0.875rem;
  padding: 0.25rem 0 0.15rem;
}

.panel-foot a {
  color: var(--brand);
  font-weight: 600;
}

.product-head {
  padding-bottom: 0.9rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--rule);
}

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

.component {
  padding: 0.95rem 0 1rem;
}

.component + .component {
  border-top: 1px solid var(--rule);
}

.panel .component:first-child {
  padding-top: 0.2rem;
}

.component-name h3 {
  font-family: var(--font);
  font-size: 0.975rem;
  font-weight: 600;
}

.component-name p {
  font-size: 0.85rem;
  color: var(--muted);
}

/* 90-day bars ------------------------------------------------------------- */

.bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 3px;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 3px;
}

.bars:focus-visible {
  outline-offset: 4px;
}

.bar {
  position: relative;
  border-radius: 2px;
  background: var(--nodata);
}

.bar.lv-ok {
  background: var(--bar-ok);
}

.bar.lv-minor {
  background: var(--bar-minor);
}

.bar.lv-major {
  background: var(--bar-major);
}

.bar:hover,
.bar.is-active {
  filter: brightness(0.82);
}

/* Tooltip text is always in the DOM for screen readers and clipped visually
   until the day is hovered, focused through the arrow keys, or tapped. */
.tip {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bar:hover > .tip,
.bar.is-active > .tip {
  clip-path: none;
  width: max-content;
  max-width: min(17rem, calc(100vw - 32px));
  height: auto;
  overflow: visible;
  white-space: normal;
  z-index: 5;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  font-size: 0.8125rem;
  line-height: 1.35;
  box-shadow: 0 6px 20px rgb(0 0 0 / 18%);
}

/* Keep tooltips of edge days inside the card. */
.bar:nth-child(-n + 20):hover > .tip,
.bar:nth-child(-n + 20).is-active > .tip {
  left: 0;
  transform: none;
}

.bar:nth-last-child(-n + 20):hover > .tip,
.bar:nth-last-child(-n + 20).is-active > .tip {
  left: auto;
  right: 0;
  transform: none;
}

.tip a {
  color: inherit;
  font-weight: 600;
}

.bars-axis {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.axis-uptime {
  color: var(--ink);
  font-weight: 600;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  list-style: none;
  padding: 0;
  margin: -1.6rem 0 2.75rem;
  padding: 0 0.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.prose .legend {
  margin: 0 0 1rem;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-link {
  margin-left: auto;
}

.legend-link a {
  color: var(--brand);
  font-weight: 600;
}

.sw {
  width: 0.55rem;
  height: 1rem;
  border-radius: 1.5px;
  background: var(--nodata);
}

.sw.lv-ok {
  background: var(--bar-ok);
}

.sw.lv-minor {
  background: var(--bar-minor);
}

.sw.lv-major {
  background: var(--bar-major);
}

/* Incidents ----------------------------------------------------------------- */

.incident {
  --imp: var(--minor);
  border-left: 4px solid var(--imp);
  background: var(--surface);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 0 8px 8px 0;
}

.imp-none {
  --imp: var(--muted);
}

.imp-major {
  --imp: var(--partial);
}

.imp-critical {
  --imp: var(--major);
}

.imp-maintenance {
  --imp: var(--maint);
}

.incident h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.update-line {
  margin-bottom: 0.3rem;
}

.update-line strong {
  margin-right: 0.3rem;
}

.past-day {
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}

.past-day h3 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

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

.past-items li {
  --imp: var(--minor);
  border-left: 3px solid var(--imp);
  padding: 0.1rem 0 0.1rem 0.75rem;
  margin: 0.5rem 0 0.9rem;
}

.past-items a {
  font-weight: 600;
}

.month {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

.pager {
  display: flex;
  justify-content: space-between;
}

/* Incident page ----------------------------------------------------------- */

.incident-page .kind {
  margin-top: 0.5rem;
  color: var(--muted);
  font-weight: 600;
}

.incident-page h1 {
  font-size: clamp(1.6rem, 4.6vw, 2.1rem);
  margin: 0.2rem 0 0.4rem;
}

.affected {
  margin: 1.5rem 0;
}

.affected ul {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.affected li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
}

.affected li + li {
  border-top: 1px solid var(--rule);
}

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

.timeline li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}

.tl-status {
  font-weight: 650;
}

.tl-body p + p {
  margin-top: 0.3rem;
}

@media (max-width: 30rem) {
  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

/* Uptime explainer -------------------------------------------------------- */

.prose h2 {
  margin: 1.75rem 0 0.6rem;
}

.prose p,
.prose ul {
  margin: 0 0 0.9rem;
  max-width: 38rem;
}

.formula code {
  display: block;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.9rem;
  overflow-x: auto;
}

/* Forms ------------------------------------------------------------------- */

.narrow {
  max-width: 30rem;
}

.narrow > p {
  margin-bottom: 1rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.stack > button,
.actions {
  margin-top: 0.75rem;
}

label,
.label {
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

input[type='email'],
input[type='password'],
input[type='datetime-local'],
input:not([type]),
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border: 1.5px solid var(--muted);
  border-radius: 6px;
}

button {
  min-height: 2.75rem;
  padding: 0.5rem 1.2rem;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--ink);
}

button.link {
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  text-decoration: underline;
}

.form-error {
  color: var(--major);
  font-weight: 600;
  margin: 1rem 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Admin --------------------------------------------------------------------- */

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline select {
  width: auto;
  min-height: 2.25rem;
}

.small-btn {
  min-height: 2.25rem;
  padding: 0.25rem 0.9rem;
}

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.picker {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.6rem 0.9rem 0.8rem;
  margin: 0 0 0.6rem;
}

.picker legend {
  font-weight: 650;
  padding: 0 0.3rem;
}

.picker-row {
  display: grid;
  grid-template-columns: 1fr minmax(10rem, 14rem);
  gap: 0.5rem;
  align-items: center;
  padding: 0.25rem 0;
}

.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 400;
  min-height: 2.25rem;
}

.check input {
  width: 1.15rem;
  height: 1.15rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

.plain {
  padding-left: 1.1rem;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

thead th {
  color: var(--muted);
  font-weight: 600;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.footer-row a {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 30rem) {
  .bars {
    height: 1.9rem;
    gap: 1px;
  }

  .products > .product,
  .product-page .product {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .panel {
    margin-left: 0.2rem;
    padding-left: 0.75rem;
  }

  .count {
    display: none;
  }

  .logo {
    height: 1.75rem;
  }

  .legend-link {
    margin-left: 0;
  }

  .picker-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (forced-colors: active) {
  .bar {
    border: 1px solid CanvasText;
  }

  .bar.lv-minor,
  .bar.lv-major {
    background: CanvasText;
  }
}
