/*
 * PeptideClients status page styles.
 *
 * Mirrors the cream / ink / clay design system from
 * apps/marketing/DESIGN_SYSTEM.md and apps/docs/styles.css. We DON'T
 * import that file -- the status page is intentionally standalone (zero
 * cross-app dependencies) so an outage in one of the other deploys
 * cannot regress the status page's CSS.
 *
 * Status colors are added on top of the base palette:
 *   --green   operational
 *   --amber   degraded
 *   --orange  partial outage / maintenance
 *   --red     major outage
 *   --grey    unknown / loading
 */

@import url('/fonts/fonts.css');

:root {
  --paper:        #F2EAD9;
  --paper-2:      #ECE2CB;
  --paper-3:      #E4D8BC;
  --linen:        #FBF7EE;
  --ink:          #1B1714;
  --ink-2:        #2C251E;
  --muted:        #6E6051;
  --muted-2:      #8C7E6C;
  --rule:         rgb(27 23 20 / 0.10);
  --rule-strong:  rgb(27 23 20 / 0.15);
  --clay:         #A8451E;
  --clay-deep:    #8A3815;
  --sand:         #D9C49A;
  --olive:        #4D4A33;

  --green:        #4F7A4A;
  --green-soft:   #DFEAD7;
  --amber:        #B17A1F;
  --amber-soft:   #F1E1C2;
  --orange:       #B85D2C;
  --orange-soft:  #F0D9C8;
  --red:          #9C2D2D;
  --red-soft:     #ECCFCF;
  --grey:         #8C7E6C;
  --grey-soft:    #E4D8BC;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
a:hover { color: var(--clay); }
img { max-width: 100%; height: auto; }
code, pre, .tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.muted-thin { color: var(--muted); font-weight: 400; font-style: italic; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(242, 234, 217, 0.9);
  backdrop-filter: blur(8px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); font-weight: 500;
  letter-spacing: -0.005em;
}
.brand .mark {
  display: inline-block; width: 10px; height: 10px; background: var(--clay);
  border-radius: 1px;
}

/* Image wordmark variants. Mirrors apps/docs/styles.css so the cream-bg
   nav uses the logo as-is, and the ink-bg footer uses
   brightness(0) + invert(1) to render a clean white silhouette from the
   same PNG (no separate inverted asset to keep in sync). */
.nav-logo,
.footer-logo {
  display: inline-flex; align-items: center; gap: 10px;
  line-height: 0; text-decoration: none; color: var(--ink);
}
.nav-logo img {
  height: 34px; width: auto; display: block;
}
.footer-logo img {
  height: 36px; width: auto; display: block;
  filter: brightness(0) invert(1);
  opacity: 0.94;
}
/* "status" suffix pill: visually identifies this as the status site
   without overshadowing the wordmark itself. */
.nav-logo .status-pill,
.footer-logo .status-pill {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0;
  color: var(--muted);
  line-height: 1;
  padding-bottom: 2px; /* optical alignment with wordmark baseline */
}
.footer-logo .status-pill { color: rgba(251, 247, 238, 0.7); }
@media (max-width: 700px) {
  .nav-logo img { height: 28px; }
  .nav-logo .status-pill { font-size: 15px; }
  .footer-logo img { height: 30px; }
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px; color: var(--ink-2); text-decoration: none;
}
.nav-links a:hover { color: var(--ink); }

@media (max-width: 700px) {
  .nav-links { display: none; }
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 300; letter-spacing: -0.01em; color: var(--ink);
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--clay); font-weight: 300; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.05; }
h2 { font-size: clamp(1.375rem, 2.5vw, 1.75rem); line-height: 1.1; margin-top: 3em; margin-bottom: 0.75em; }
h3 { font-size: 1.125rem; line-height: 1.2; margin-top: 2em; margin-bottom: 0.5em; font-weight: 500; }
.small-caps {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}

/* main also carries .wrap (max-width + horizontal padding). .wrap uses the
   shorthand `padding: 0 24px`, which would zero out top/bottom padding if
   we targeted just `main` here -- shorthand on `.wrap` (specificity 0,1,0)
   beats `main` (0,0,1). The compound `main.wrap` selector (0,1,1) wins,
   keeping the breathing room below the sticky nav. */
main.wrap { padding-top: 88px; padding-bottom: 80px; }
main > section + section { margin-top: 24px; }

/* ---------- Overall banner ---------- */
.overall {
  border: 1px solid var(--rule);
  background: var(--linen);
  padding: 28px 28px 24px;
  border-left: 4px solid var(--grey);
}
.overall-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.overall-title {
  font-family: 'Fraunces', Georgia, serif; font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.1;
}
.overall-meta {
  margin-top: 12px; font-size: 13px; color: var(--muted);
}
.overall--operational     { border-left-color: var(--green);  background: var(--green-soft); }
.overall--degraded        { border-left-color: var(--amber);  background: var(--amber-soft); }
.overall--partial_outage  { border-left-color: var(--orange); background: var(--orange-soft); }
.overall--major_outage    { border-left-color: var(--red);    background: var(--red-soft); }
.overall--maintenance     { border-left-color: var(--clay);   background: var(--paper-2); }

/* ---------- Status dots ---------- */
.dot {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 999px; flex: 0 0 auto;
  background: var(--grey);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}
.dot-operational    { background: var(--green); }
.dot-degraded       { background: var(--amber); }
.dot-partial_outage { background: var(--orange); }
.dot-major_outage   { background: var(--red); }
.dot-maintenance    { background: var(--clay); }
.dot-loading        {
  background: var(--grey);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  50%  { transform: scale(1.2); opacity: 1.0; }
  100% { transform: scale(1);   opacity: 0.7; }
}

/* ---------- Component groups ---------- */
.component-groups { display: grid; gap: 36px; margin-top: 24px; }
.component-group {
  background: var(--linen);
  border: 1px solid var(--rule);
}
.component-group-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule);
}
.component-group-head h3 {
  margin: 0; font-family: 'Fraunces', Georgia, serif;
  font-weight: 300; font-size: 1.125rem;
}
.component-group-status {
  font-size: 13px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.component-list { list-style: none; }
.component-row {
  display: grid;
  grid-template-columns: 18px 1fr auto 220px;
  gap: 16px;
  align-items: center;
  padding: 14px 24px;
  border-top: 1px solid var(--rule);
}
.component-row:first-child { border-top: 0; }
.component-row .name {
  font-weight: 500; color: var(--ink);
  display: flex; flex-direction: column; gap: 2px;
}
.component-row .name a { text-decoration: none; }
.component-row .desc {
  font-size: 12px; color: var(--muted); font-weight: 400;
}
.component-row .status-text {
  font-size: 13px; color: var(--muted);
  text-transform: capitalize;
}
.component-row .status-text--operational    { color: var(--green); }
.component-row .status-text--degraded       { color: var(--amber); }
.component-row .status-text--partial_outage { color: var(--orange); }
.component-row .status-text--major_outage   { color: var(--red); }
.component-row .status-text--maintenance    { color: var(--clay); }

/* Sparkline -- 90 day uptime, 90 cells, one per day. Empty cells render
   as muted dots so it's obvious we have no data yet for that day. */
.spark {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 1px;
  height: 26px;
  align-items: stretch;
}
.spark-cell {
  background: var(--rule);
  border-radius: 1px;
}
.spark-cell--operational    { background: var(--green); }
.spark-cell--degraded       { background: var(--amber); }
.spark-cell--partial_outage { background: var(--orange); }
.spark-cell--major_outage   { background: var(--red); }
.spark-cell--maintenance    { background: var(--clay); }

@media (max-width: 800px) {
  .component-row { grid-template-columns: 18px 1fr auto; }
  .component-row .spark-wrap { display: none; }
}
@media (max-width: 540px) {
  .component-group-head { padding: 14px 16px; }
  .component-row        { padding: 12px 16px; gap: 12px; }
}

/* ---------- Skeleton (initial paint) ---------- */
.component-skeleton {
  border: 1px solid var(--rule);
  background: var(--linen);
  padding: 24px;
  display: grid;
  gap: 12px;
}
.skeleton-bar {
  height: 14px;
  background: linear-gradient(
    90deg, var(--paper-2), var(--paper-3), var(--paper-2)
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: 2px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Incidents + scheduled maintenance ---------- */
.card-stack { padding: 24px; border: 1px solid var(--rule-strong); background: var(--linen); }
.card-stack h2 { margin-top: 0; }
.incidents { display: grid; gap: 18px; margin-top: 16px; }
.incident {
  border-left: 4px solid var(--grey);
  padding: 16px 18px;
  background: var(--paper);
}
.incident--investigating { border-left-color: var(--red); }
.incident--identified    { border-left-color: var(--orange); }
.incident--monitoring    { border-left-color: var(--amber); }
.incident--resolved      { border-left-color: var(--green); }
.incident--scheduled     { border-left-color: var(--clay); }
.incident--in_progress   { border-left-color: var(--orange); }
.incident-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.incident-head h3 { margin: 0; font-size: 1.125rem; }
.incident-meta {
  font-size: 12px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.incident-affects {
  font-size: 12px; color: var(--muted); margin-top: 6px;
}
.incident-update {
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  margin-top: 10px;
}
.incident-update .small-caps {
  display: inline-flex; align-items: center; gap: 6px;
}
.incident-update p { margin-top: 4px; font-size: 14px; }

/* ---------- Subscribe ---------- */
.subscribe {
  background: var(--linen);
  border: 1px solid var(--rule);
  padding: 28px;
}
/* Mirrors .card-stack h2 -- the global `h2 { margin-top: 3em }` would
   otherwise stack on top of the card's 28px padding and leave ~76px of
   dead space above the card title. */
.subscribe h2 { margin-top: 0; }
.subscribe-form {
  display: grid;
  gap: 14px;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  margin-top: 16px;
}
.subscribe-form .channel {
  border: 0;
  display: inline-flex; gap: 18px; align-items: center;
}
.subscribe-form .channel legend { display: block; margin-bottom: 6px; }
.subscribe-form .channel .radio {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--ink-2);
}
.subscribe-form .field {
  display: flex; flex-direction: column; gap: 6px;
}
.subscribe-form .field input {
  font-family: inherit; font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
}
.subscribe-form .field input:focus {
  outline: 2px solid var(--ink); outline-offset: 0;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; font-weight: 500;
  text-decoration: none; transition: all 150ms ease; cursor: pointer;
  border: 1px solid transparent; font-size: 14px;
}
.btn-dark {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.btn-dark:hover { background: var(--ink-2); color: var(--paper); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.form-status {
  grid-column: 1 / -1;
  font-size: 13px; color: var(--muted); margin: 0; min-height: 1.4em;
}
.form-status.is-error { color: var(--red); }
.form-status.is-ok    { color: var(--green); }

@media (max-width: 700px) {
  .subscribe-form { grid-template-columns: 1fr; }
}

/* ---------- Recent history ---------- */
.history { display: grid; gap: 14px; margin-top: 16px; }
.history-day {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--rule);
}
.history-day .date {
  font-size: 13px; color: var(--muted);
  display: flex; flex-direction: column; gap: 2px;
}
.history-day .body p { font-size: 14px; }
.history-day .body p + p { margin-top: 6px; }
.history-empty {
  color: var(--muted); font-style: italic; padding: 16px 0;
}
@media (max-width: 600px) {
  .history-day { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
}

/* ---------- Footer ----------
   Ink background to match the marketing site footer (apps/marketing/index.html
   line 661: `footer { background: var(--ink); color: var(--paper); }`). The
   ink bg is what makes the brightness(0) + invert(1) trick on .footer-logo
   img render the wordmark as a clean white silhouette. */
footer {
  background: var(--ink);
  color: var(--paper);
  padding: 56px 0 40px; margin-top: 80px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
}
.foot-brand .foot-tag {
  margin-top: 12px; color: rgba(251, 247, 238, 0.7); font-size: 13px; max-width: 32ch;
}
.foot-brand .foot-tag em { color: var(--sand); font-style: italic; }
.foot-col h5 {
  font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(251, 247, 238, 0.55); font-weight: 500;
  margin-bottom: 14px;
}
.foot-col a {
  display: block; font-size: 14px;
  color: rgba(251, 247, 238, 0.82); text-decoration: none;
  padding: 4px 0;
}
.foot-col a:hover { color: var(--paper); }
.foot-fine {
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid rgba(251, 247, 238, 0.12);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: 12px; color: rgba(251, 247, 238, 0.55);
}
.foot-fine a { color: rgba(251, 247, 238, 0.82); text-decoration: none; }
.foot-fine a:hover { color: var(--paper); }
@media (max-width: 800px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-fine { flex-direction: column; align-items: flex-start; gap: 6px; }
}
