:root {
  color-scheme: dark;
  --ink: #ffffff;
  --muted: #aeb6bb;
  --surface: #15191c;
  --surface-muted: #000000;
  --line: rgb(0 255 0 / 48%);
  --primary: #00ff00;
  --primary-dark: #00ff00;
  --success: #00ff00;
  --warning: #ffd166;
  --maintenance: #ffb000;
  --maintenance-surface: #342408;
  --danger: #ff6969;
  --danger-surface: #3a1515;
  --unknown-surface: #30270e;
  font-family: "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #000000;
  color: var(--ink);
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--ink);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  box-shadow: 0 0 1rem rgb(0 255 0 / 35%);
}

.site-header,
.site-main {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  padding: 3rem 0 2rem;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

.site-header p {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.return-home {
  display: inline-flex;
  margin-top: 1.25rem;
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  background: transparent;
  box-shadow: inset 0 0 0.5rem rgb(0 255 0 / 12%), 0 0 0.75rem rgb(0 255 0 / 12%);
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.return-home:hover {
  background: var(--primary);
  box-shadow: 0 0 1rem rgb(0 255 0 / 45%);
  color: #000000;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.language-switcher {
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  padding: 1rem 1.25rem;
  box-shadow:
    0.75rem 0.75rem 1.25rem rgb(0 0 0 / 78%),
    -0.35rem -0.35rem 0.9rem rgb(42 51 56 / 48%),
    inset 0 0 0.6rem rgb(0 255 0 / 5%);
}

.filter-label {
  margin: 0 0 0.65rem;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.language-switcher-list {
  min-height: 2rem;
}

.language-switcher-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.language-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: transparent;
  color: var(--primary);
  font-size: 0.9rem;
  text-decoration: none;
}

.language-link:hover {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0.8rem rgb(0 255 0 / 35%);
  color: #000000;
}

.language-link-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.filter-button {
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
}

.filter-button:hover,
.filter-button.is-active {
  background: var(--primary);
  box-shadow: 0 0 0.8rem rgb(0 255 0 / 35%);
  color: #000000;
}

.status-message {
  margin: 1rem 0;
  color: var(--muted);
}

.status-message.is-error {
  color: var(--danger);
}

.journal-grid,
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.journal-card,
.status-card,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  padding: 1.25rem;
  box-shadow:
    0.75rem 0.75rem 1.25rem rgb(0 0 0 / 78%),
    -0.35rem -0.35rem 0.9rem rgb(42 51 56 / 48%),
    inset 0 0 0.65rem rgb(0 255 0 / 4%);
}

.journal-card {
  display: flex;
  flex-direction: column;
  min-height: 13rem;
}

.journal-card h2,
.status-card h2 {
  margin: 0.45rem 0;
  font-size: 1.25rem;
}

.journal-card p {
  margin: 0.5rem 0 1rem;
  color: var(--muted);
}

.journal-card .article-locales {
  margin-top: 0;
  font-size: 0.9rem;
}

.article-locales a {
  color: var(--primary);
}

.journal-card footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 0.75rem;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.overall {
  display: inline-flex;
  margin: 0 0 1.5rem;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-weight: 700;
}

.overall.operational {
  border: 1px solid var(--success);
  background: #092a17;
  color: var(--success);
}

.overall.degraded {
  border: 1px solid var(--danger);
  background: var(--danger-surface);
  color: var(--danger);
}

.overall.maintenance {
  border: 1px solid var(--maintenance);
  background: var(--maintenance-surface);
  color: var(--maintenance);
}

.overall.unknown {
  border: 1px solid var(--warning);
  background: var(--unknown-surface);
  color: var(--warning);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-card strong {
  display: block;
  font-size: 1.8rem;
}

.summary-card span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.history-panel {
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  padding: 1.25rem;
  box-shadow:
    0.75rem 0.75rem 1.25rem rgb(0 0 0 / 78%),
    -0.35rem -0.35rem 0.9rem rgb(42 51 56 / 48%),
    inset 0 0 0.65rem rgb(0 255 0 / 4%);
}

.history-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.history-panel-header h2 {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
}

.history-panel-header p:last-child {
  margin: 0;
  max-width: 24rem;
  color: var(--muted);
  text-align: right;
}

.history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

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

.history-key {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.2rem;
  background: var(--line);
}

.history-key.healthy,
.history-point.healthy {
  background: var(--success);
}

.history-key.maintenance,
.history-point.maintenance {
  background: var(--maintenance);
}

.history-key.unhealthy,
.history-point.unhealthy {
  background: var(--danger);
}

.history-key.unknown,
.history-point.unknown {
  background: #b6c0c8;
}

.status-card {
  padding: 0;
  overflow: hidden;
}

.status-card-summary {
  display: block;
  padding: 1.25rem;
  cursor: pointer;
  list-style: none;
}

.status-card-summary::-webkit-details-marker {
  display: none;
}

.status-card-summary:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.host-card-heading,
.host-card-body-heading,
.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.host-card-heading h2,
.host-card-body-heading h3 {
  margin: 0.35rem 0 0;
  color: var(--ink);
}

.host-card-heading h2 {
  font-size: 1.35rem;
}

.host-card-body-heading h3 {
  font-size: 1.15rem;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: #101416;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill.healthy {
  border-color: var(--success);
  background: #092a17;
  color: var(--success);
}

.status-pill.maintenance {
  border-color: var(--maintenance);
  background: var(--maintenance-surface);
  color: var(--maintenance);
}

.status-pill.unhealthy {
  border-color: var(--danger);
  background: var(--danger-surface);
  color: var(--danger);
}

.host-card-url,
.host-card-detail {
  margin: 0.35rem 0;
  color: var(--muted);
}

.host-card-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-card-detail {
  min-height: 1.5rem;
}

.history-heading {
  align-items: baseline;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.history-heading strong {
  color: var(--ink);
}

.history-strip {
  display: grid;
  grid-template-columns: repeat(168, minmax(1px, 1fr));
  gap: 1px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #000000;
  padding: 0.25rem;
  box-shadow: inset 0 0.2rem 0.5rem rgb(0 0 0 / 75%);
}

.compact-history {
  height: 2.25rem;
  margin-top: 0.5rem;
}

.year-history {
  grid-auto-rows: 0.35rem;
  max-height: 14rem;
  margin-top: 1rem;
  overflow: auto;
}

.history-point {
  min-width: 0;
  border-radius: 0.1rem;
  background: var(--line);
}

.history-summary {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.history-note {
  margin: 0.6rem 0 0;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.host-card-body {
  border-top: 1px solid var(--line);
  padding: 1.25rem;
}

.host-card-body-heading a {
  color: var(--primary);
  font-weight: 700;
}

.status-card[open] .status-card-summary {
  background: #1b2125;
}

.site-footer {
  width: min(72rem, calc(100% - 2rem));
  margin: 3rem auto;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 42rem) {
  .history-panel-header,
  .host-card-heading,
  .host-card-body-heading {
    display: block;
  }

  .history-panel-header p:last-child {
    margin-top: 0.75rem;
    text-align: left;
  }

  .status-pill {
    display: inline-flex;
    margin-top: 0.75rem;
  }
}
