/* status.duckert.design — on top of /styles.css */
.status-page {
  --ok: #60ed2e;
  --ok-text: #2f9e0c;
  --ok-soft: #effde9;
  --warn: #f0a92e;
  --warn-text: #a15c00;
  --warn-soft: #fff4dc;
  --bad: #d93025;
  --bad-soft: #fdecea;
  --info: #111111;
  --none: #e6e8e3;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}
html { overflow-x: clip; }

/* Header: logo left, log in right (on phones too) */
.status-page .site-header { grid-template-columns: 1fr auto; }
.status-account { justify-self: end; }
.status-account .btn { background: rgba(255, 255, 255, calc(0.4 + 0.5 * var(--glass))); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%); }
.status-account span { font-weight: 400; }
.btn-sm { padding: 10px 18px; font-size: 15px; gap: 8px; }
.status-page .site-header.is-hidden .status-account { transform: translateY(-120%); opacity: 0; }
.status-account { transition: transform 0.8s var(--ease-soft), opacity 0.6s var(--ease-soft); }

/* ---------- Hero ---------- */
.status-hero { padding: calc(var(--header-h) + 72px) 0 40px; max-width: 760px; }
.status-hero h1 { font-size: clamp(40px, 6.5vw, 72px); line-height: 1.02; font-weight: 700; margin: 20px 0 16px; }
.status-orb {
  position: relative; display: block; width: 22px; height: 22px; border-radius: 50%;
  background: var(--none); transition: background-color 0.4s var(--ease);
}
.status-orb::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit;
  animation: orb-pulse 2.4s var(--ease-soft) infinite; opacity: 0;
}
.orb-ok { background: var(--ok); }
.orb-warn { background: var(--warn); }
.orb-bad { background: var(--bad); }
.orb-info { background: var(--info); }
.orb-none::after { animation: none; }
/* While the status loads, the orb is the green spinner */
.orb-loading { background: none; border: 3px solid rgba(96, 237, 46, 0.2); border-top-color: var(--ok); animation: orb-spin 0.9s linear infinite; }
.orb-loading::after { display: none; }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}

/* ---------- Blocks ---------- */
.status-block, .status-mine { padding: 32px 0; }
.status-h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.1; margin-bottom: 20px; }
.status-h2-sm { font-size: clamp(22px, 2.6vw, 28px); }
.status-note { color: var(--muted); font-size: 14px; margin: 14px 4px 0; }
.empty-note { color: var(--muted); margin: 0; }
.empty-note a, .plain-list a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- Components ---------- */
.component-list, .site-list, .incident-list { display: grid; gap: 12px; }
.component, .site, .incident, .project {
  background: var(--surface); border-radius: var(--radius); padding: 22px 24px;
  min-width: 0;
}
.component-head, .site-head, .incident header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px;
}
.component h3, .site h3, .incident h3 { font-size: 19px; margin: 0 0 2px; }
.component-head p, .site-domain, .incident-meta { color: var(--muted); font-size: 15px; margin: 0; }
.component-foot { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.skeleton { height: 148px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, #eef0ec 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* State pills */
.state {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 700; white-space: nowrap; background: var(--white);
}
.state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.state-ok { color: var(--ok-text); background: var(--ok-soft); }
.state-ok i { background: var(--ok); }
.state-warn { color: var(--warn-text); background: var(--warn-soft); }
.state-bad { color: var(--bad); background: var(--bad-soft); }
.state-info { color: var(--ink); background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.state-none { color: var(--muted); background: var(--white); }

/* ---------- Uptime bars ---------- */
.bars {
  display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px;
  height: 36px; margin-top: 18px;
}
.bar { border-radius: 3px; background: var(--none); transition: transform 0.2s var(--ease), filter 0.2s var(--ease); transform-origin: bottom; cursor: default; }
.bar:hover { transform: scaleY(1.12); filter: brightness(0.94); }
.bar-ok { background: var(--ok); }
.bar-warn { background: var(--warn); }
.bar-bad { background: var(--bad); }
.bars-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.bars-legend span:nth-child(2) { color: var(--ink); font-weight: 700; }
@media (max-width: 720px) {
  /* 45 days fit a phone better than 90 */
  .bars { grid-template-columns: repeat(45, minmax(0, 1fr)); }
  .bar:nth-child(-n + 45) { display: none; }
  .bars-legend span:first-child { visibility: hidden; }
  .bars-legend span:first-child::before { content: "45 dage siden"; visibility: visible; }
}
.bar-tip {
  position: absolute; z-index: 60; max-width: min(320px, calc(100vw - 16px));
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--black); color: var(--white); font-size: 13px; line-height: 1.4;
  pointer-events: none; box-shadow: var(--shadow);
}

/* ---------- Incidents ---------- */
.incident { background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.incident-bad { box-shadow: inset 4px 0 0 var(--bad), inset 0 0 0 1px var(--line); }
.incident-warn { box-shadow: inset 4px 0 0 var(--warn), inset 0 0 0 1px var(--line); }
.incident-info { box-shadow: inset 4px 0 0 var(--ink), inset 0 0 0 1px var(--line); }
.updates { list-style: none; margin: 16px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.updates li { position: relative; }
.updates li::before { content: ""; position: absolute; left: -24px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--white); box-shadow: inset 0 0 0 2px var(--muted); }
.updates li:first-child::before { background: var(--green); box-shadow: none; }
.updates p { margin: 0; overflow-wrap: anywhere; }
.updates time { color: var(--muted); font-size: 13px; }
.incident > .incident-meta:last-child { margin-top: 12px; }
.month + .month { margin-top: 28px; }
.month-title { font-size: 15px; color: var(--muted); font-weight: 700; margin: 0 0 10px 4px; letter-spacing: 0; }
.month .incident + .incident { margin-top: 12px; }

/* ---------- Logged in ---------- */
.status-mine { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.mine-head { margin-bottom: 20px; }
.mine-head .lead { font-size: 17px; }
.mine-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.site { background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius-lg); padding: 28px; }
.site-link { display: inline-block; margin: 2px 0; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 4px; overflow-wrap: anywhere; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 22px 0 0; }
.facts-grid div { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; }
.facts-grid dt { color: var(--muted); font-size: 13px; }
.facts-grid dd { margin: 2px 0 0; font-weight: 700; }
@media (max-width: 720px) {
  .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-grid div:last-child:nth-child(odd) { grid-column: span 2; }
  .site { padding: 22px 20px; }
  .component, .incident, .project { padding: 20px; }
  .component-head, .site-head, .incident header { flex-direction: column; }
}
.site .incident-list { margin-top: 18px; }
.sub { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.sub h4, .project h4 { font-size: 16px; margin: 0 0 10px; color: var(--black); }
details.sub summary { cursor: pointer; font-weight: 700; }
details.sub .incident { margin-top: 12px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }

.work { margin-top: 36px; }
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.project .btn { margin-top: 16px; }
.steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.steps li { position: relative; display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; padding-bottom: 14px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.is-done::after { background: var(--green); }
.step-dot { grid-row: span 2; width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--white); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.18); }
.is-done .step-dot { background: var(--green); box-shadow: none; }
.is-now .step-dot { background: var(--black); box-shadow: 0 0 0 4px var(--ok-soft); }
.steps strong { font-size: 15px; }
.steps span:not(.step-dot) { color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .status-orb::after, .skeleton { animation: none; }
  .orb-loading { animation-duration: 2.4s; }
}
