/* Statuspage-style theme: cream page, serif masthead, single bordered card
   of service rows with 90 vertical day-bars. */

:root {
  --bg: #faf9f5;
  --ink: #1e1d1a;
  --muted: #6e6b64;
  --card-bg: #fdfdfb;
  --border: #dedcd4;
  --green: #7fa650;
  --green-text: #5d8a2d;
  --amber: #d99c3b;
  --amber-text: #b07714;
  --red: #c05b4d;
  --red-text: #c0392b;
  --nodata: #e4e2da;
  --banner-red: #b4533f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 44px 24px 60px;
}

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

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

@font-face {
  font-family: "Bauhaus";
  src: url("/assets/BauhausRegular.ttf") format("truetype");
  font-display: swap;
}

.logo-mark {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.logo-text {
  font-family: "Bauhaus", Georgia, "Times New Roman", serif;
  font-size: 42px;
  letter-spacing: -0.2px;
}

.subscribe-wrap {
  position: relative;
}

.subscribe-button {
  background: #171613;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
}

.subscribe-button:hover {
  background: #35332e;
}

.subscribe-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 14px;
  z-index: 20;
}

.subscribe-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.subscribe-row {
  display: flex;
  gap: 8px;
}

.subscribe-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
}

.subscribe-submit {
  background: #171613;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.subscribe-message {
  font-size: 12.5px;
  margin-top: 8px;
  color: var(--muted);
}

.subscribe-message.error {
  color: var(--red-text);
}

/* ---- Flash (confirm/unsubscribe redirects) --------------------------- */

.flash {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 24px;
}

/* ---- Incident banner -------------------------------------------------- */

.incident {
  border: 1px solid var(--banner-red);
  border-radius: 4px;
  margin-bottom: 28px;
  overflow: hidden;
}

.incident-header {
  background: var(--banner-red);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 24px;
  font-size: 18px;
  font-weight: 700;
}

.incident-subscribe {
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 400;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.incident-subscribe:hover {
  text-decoration: underline;
}

.incident-body {
  background: #ffffff;
  padding: 18px 24px;
}

.incident-update {
  padding: 9px 0;
}

.incident-update-line {
  font-size: 16px;
  line-height: 1.55;
}

.incident-update-line strong {
  font-weight: 700;
}

.incident-update-time {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---- Uptime caption ---------------------------------------------------- */

.uptime-caption {
  text-align: right;
  font-size: 13.5px;
  color: var(--muted);
  margin: 44px 0 10px;
}

.uptime-link {
  color: var(--ink);
  text-decoration: none;
}

.uptime-link:hover {
  text-decoration: underline;
}

/* ---- Services card ----------------------------------------------------- */

.services-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.loading {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.service-row {
  padding: 20px 22px 16px;
}

.service-row + .service-row {
  border-top: 1px solid var(--border);
}

.service-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.service-name {
  font-size: 15.5px;
  font-weight: 700;
}

.service-status {
  font-size: 13.5px;
  font-weight: 600;
}

.service-status.operational { color: var(--green-text); }
.service-status.degraded { color: var(--amber-text); }
.service-status.outage { color: var(--red-text); }

.bars {
  display: flex;
  gap: 3px;
  height: 34px;
}

.bar {
  flex: 1;
  border-radius: 1px;
  background: var(--nodata);
  cursor: default;
}

.bar.operational { background: var(--green); }
.bar.degraded { background: var(--amber); }
.bar.outage { background: var(--red); }

.bar:hover {
  opacity: 0.75;
}

.service-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.service-foot .rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Tooltip ----------------------------------------------------------- */

.bar-tooltip {
  position: fixed;
  z-index: 40;
  background: #26251f;
  color: #ffffff;
  border-radius: 4px;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.5;
  pointer-events: none;
  max-width: 240px;
}

/* ---- Past incidents ----------------------------------------------------- */

.history-title {
  font-size: 28px;
  font-weight: 700;
  margin: 68px 0 30px;
}

.history-day {
  margin-bottom: 46px;
}

.history-day-date {
  font-size: 19px;
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.history-none,
.history-unresolved {
  font-size: 15px;
  color: #9b9890;
}

.history-incident {
  margin-bottom: 32px;
}

.history-incident-title {
  font-size: 17.5px;
  font-weight: 700;
  color: #e0a03c;
  margin-bottom: 13px;
}

.history-update {
  margin-bottom: 14px;
}

.history-update-line {
  font-size: 15px;
  line-height: 1.5;
}

.history-update-time {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* ---- Historical uptime page ------------------------------------------- */

.history-nav {
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.history-tab {
  display: inline-block;
  padding: 10px 18px;
  margin-right: 6px;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}

.history-tab:hover {
  color: var(--ink);
}

.history-tab.current {
  border-color: var(--border);
  border-bottom-color: var(--bg);
  color: var(--ink);
  cursor: default;
}

.uptime-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.component-selector select {
  min-width: 220px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #ffffff;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}

.uptime-range {
  font-size: 14px;
  color: var(--muted);
}

.uptime-months {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.calendar-month {
  width: 260px;
  margin-bottom: 32px;
}

.month-header {
  display: flex;
  align-items: baseline;
  margin-bottom: 12px;
}

.month-name {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
}

.month-uptime {
  font-size: 13px;
  color: var(--muted);
}

.month-days {
  display: flex;
  flex-wrap: wrap;
  width: 260px;
}

.cal-day {
  width: 32px;
  height: 32px;
  margin-left: 6px;
  margin-top: 6px;
  border-radius: 2px;
}

.cal-day:nth-child(7n + 1) {
  margin-left: 0;
}

.cal-day:nth-child(-n + 7) {
  margin-top: 0;
}

.cal-day.operational { background: var(--green); }
.cal-day.degraded { background: var(--amber); }
.cal-day.outage { background: var(--red); }
.cal-day.nodata { background: var(--nodata); }

.cal-day.spacer,
.cal-day.future {
  background: transparent;
}

.cal-day.operational:hover,
.cal-day.degraded:hover,
.cal-day.outage:hover,
.cal-day.nodata:hover {
  opacity: 0.75;
}

/* ---- Uptime tooltip ----------------------------------------------------- */

.uptime-tooltip {
  position: fixed;
  z-index: 50;
  width: 300px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  padding: 15px;
  pointer-events: none;
}

.uptime-tooltip .tip-pointer {
  position: absolute;
  top: -7px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-left: 1px solid rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  transform: rotate(45deg);
}

.tip-date {
  font-size: 14px;
  font-weight: 600;
}

.tip-msg {
  font-size: 14px;
  margin-top: 8px;
}

.outage-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f4f5f7;
  border-radius: 2px;
  padding: 9px 14px;
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
}

.outage-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.outage-field .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.outage-field .dot.major { background: var(--red); }
.outage-field .dot.partial { background: var(--amber); }

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

.page-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

.page-footer.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.back-link {
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 36px;
  }

  .bars {
    height: 28px;
  }

  .uptime-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .uptime-months {
    justify-content: center;
    gap: 0 24px;
  }
}
