:root {
  --turf: #15412b;
  --turf-2: #1c5438;
  --ok: #1e7a46;
  --ok-soft: #e8f5ec;
  --gold: #e6a400;
  --gold-ink: #3a2c00;
  --caution: #b26a00;
  --caution-soft: #fff4e0;
  --partial: #d97706;
  --flag: #c23b22;
  --flag-soft: #fdecea;
  --maint: #2a5a86;
  --maint-soft: #e8f0f8;
  --paper: #fbfcfa;
  --chalk: #f4f7f2;
  --card: #ffffff;
  --ink: #0e1a13;
  --slate: #33454e;
  --muted: #5d6b60;
  --line: #d5ddd5;
  --line-soft: #e8eee8;
  --shadow: 0 1px 2px rgba(14, 26, 19, 0.05), 0 4px 16px rgba(14, 26, 19, 0.04);
  --radius: 8px;
  --max: 820px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: var(--chalk);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--turf);
}

a:hover {
  color: var(--turf-2);
}

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.wordmark {
  display: block;
  height: 44px;
  width: auto;
  max-width: min(220px, 52vw);
  object-fit: contain;
  object-position: left center;
  border-radius: 6px;
  background: #000;
}

.brand-name {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--turf);
}

.subscribe-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.subscribe-btn:hover,
.subscribe-btn:focus-visible {
  border-color: var(--turf);
  color: var(--turf);
  outline: none;
}

/* Banner */
.banner {
  margin: 28px 0 20px;
  padding: 16px 20px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow);
}

.banner.operational {
  background: var(--ok);
}

.banner.degraded,
.banner.partial {
  background: var(--caution);
}

.banner.major {
  background: var(--flag);
}

.banner.maintenance {
  background: var(--maint);
}

.updated {
  margin: -8px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

/* Components */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.component {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-top: 1px solid var(--line-soft);
}

.component:first-child {
  border-top: 0;
}

.component-name {
  font-size: 15px;
  font-weight: 500;
}

.component-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
}

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

.component-status.operational .dot {
  background: #2fcc66;
}

.component-status.degraded {
  color: var(--caution);
}

.component-status.degraded .dot {
  background: var(--gold);
}

.component-status.partial {
  color: var(--partial);
}

.component-status.partial .dot {
  background: var(--partial);
}

.component-status.major {
  color: var(--flag);
}

.component-status.major .dot {
  background: var(--flag);
}

.component-status.maintenance {
  color: var(--maint);
}

.component-status.maintenance .dot {
  background: var(--maint);
}

/* History */
.history {
  margin: 40px 0 24px;
}

.history h2 {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.day {
  padding: 18px 0 6px;
  border-top: 1px solid var(--line);
}

.day:first-of-type {
  border-top: 0;
}

.day-date {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.quiet {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 10px;
}

.incident {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 8px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}

.incident-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 650;
}

.update {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 14px;
  padding: 0 0 14px;
}

.update-status {
  font-size: 13px;
  font-weight: 750;
  text-transform: capitalize;
}

.update-status.investigating,
.update-status.identified {
  color: var(--caution);
}

.update-status.update,
.update-status.monitoring {
  color: var(--maint);
}

.update-status.resolved {
  color: var(--ok);
}

.update-body {
  margin: 0;
  font-size: 14px;
  color: var(--slate);
}

.update-time {
  grid-column: 2;
  margin: -8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Subscribe modal */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 26, 19, 0.4);
}

.modal-card {
  position: relative;
  width: min(440px, calc(100% - 32px));
  margin: 12vh auto 0;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(14, 26, 19, 0.18);
  padding: 22px 22px 20px;
}

.modal-card h2 {
  margin: 0 40px 8px 0;
  font-size: 18px;
}

.modal-lead {
  margin: 0 0 16px;
  color: var(--slate);
  font-size: 14px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.field input:focus {
  outline: 2px solid var(--turf);
  outline-offset: 1px;
  border-color: var(--turf);
}

.form-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.form-row button {
  appearance: none;
  border: 0;
  background: var(--turf);
  color: #fff;
  font: inherit;
  font-weight: 650;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.form-row button:hover {
  background: var(--turf-2);
}

.form-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.form-msg {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.form-msg.ok {
  color: var(--ok);
}

.form-msg.err {
  color: var(--flag);
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 20px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer .name {
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 560px) {
  .wrap {
    width: calc(100% - 24px);
  }

  .header-inner {
    flex-wrap: wrap;
    align-items: center;
  }

  .brand {
    flex: 1 1 180px;
  }

  .wordmark {
    height: 34px;
    max-width: min(168px, 48vw);
  }

  .brand-name {
    font-size: 15px;
  }

  .banner {
    font-size: 16px;
    margin-top: 20px;
  }

  .update {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .update-time {
    grid-column: 1;
    margin-top: 0;
  }

  .form-row {
    flex-direction: column;
  }
}
