:root {
  --bg-color: #fff;
  --text-color: #222;
  --link-color: #00e;
  --up-color: #0a0;
  --down-color: #d00;
  --maintenance-color: #fa0;
  --border-color: #ddd;
  --card-bg: #fafafa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --link-color: #6af;
    --up-color: #0f0;
    --down-color: #f44;
    --maintenance-color: #fc6;
    --border-color: #444;
    --card-bg: #1a1a1a;
 }
}

@view-transition {
  navigation: auto;
}

* {
  font-family: monospace !important;
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
}

header,
main,
footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4rem 1rem;
  margin-bottom: 1rem;

  nav {
    text-align: right;
  }

  @media (max-width: 600px) {
    padding: 2rem 1rem;
  }
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;

  a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
  }
}

.title {
  font-size: 2rem;

  a {
    color: inherit;
    text-decoration: none;
    
    &:hover {
      opacity: 0.8;
      text-decoration: none;
    }
  }

  img {
    display: inline-block;
    vertical-align: middle;
    max-height: 2rem;
  }
}

.overall-status-banner {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  text-align: center;

  .last-update {
    opacity: 0.6;
  }
}

.overall-status-banner.operational {
  background: rgba(0, 170, 0, 0.1);
}

.overall-status-banner.partial {
  background: rgba(255, 170, 0, 0.1);
}

.overall-status-banner.major {
  background: rgba(221, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  .overall-status-banner.partial {
    background: rgba(255, 170, 0, 0.15);
  }
}

a {
  color: var(--link-color);
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-card {
  background: var(--card-bg);
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  
  .label {
    opacity: 0.7;
    margin-bottom: .5rem;
  }

  .value {
    font-size: 1.2rem;
    font-weight: bold;
  }

  &.operational .value {
    color: var(--up-color);
  }

  &.issues .value {
    color: var(--down-color);
  }
}

.services-grid {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

.service-card {
  background: var(--card-bg);
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
}

.service-card:hover {
  border-color: var(--link-color);
  text-decoration: none;
}

.service-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.service-name-status {
  display: flex;
  align-items: center;
}

.service-metrics-inline {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.metric-item {
  white-space: nowrap;
}

.method-badge {
  display: inline-block;
  vertical-align: middle;
  padding: 0.2rem 0.5rem;
  font-weight: bold;
  border-radius: 3px;
  background: rgba(0, 100, 200, 0.15);
  font-size: 1rem;
  color: var(--link-color);
  border: 1px solid var(--link-color);
  white-space: nowrap;
  text-transform: uppercase;
}

.method-badge.post {
  background: rgba(255, 150, 0, 0.15);
  color: #ff9900;
  border-color: #ff9900;
}

.method-badge.tcp {
  background: rgba(150, 100, 255, 0.15);
  color: #9966ff;
  border-color: #9966ff;
}

.method-badge.dns {
  background: rgba(0, 180, 100, 0.15);
  color: #00b464;
  border-color: #00b464;
}

@media (prefers-color-scheme: dark) {
  .method-badge {
    background: rgba(100, 180, 255, 0.2);
  }
  
  .method-badge.post {
    background: rgba(255, 150, 0, 0.2);
  }
  
  .method-badge.tcp {
    background: rgba(150, 100, 255, 0.2);
  }
  
  .method-badge.dns {
    background: rgba(0, 180, 100, 0.2);
  }
}

.service-history {
  margin-top: 0.5rem;
}

.history-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 0.25rem;
}

.service-info .service-url {
  font-size: 0.85rem;
  opacity: 0.6;
}

.service-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  text-align: right;
  font-size: 0.9rem;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: bold;
}

.status-badge.up {
  color: var(--up-color);
}

.status-badge.down {
  color: var(--down-color);
}

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

.metric-row {
  font-size: 0.85rem;
  opacity: 0.8;
}

.up {
  color: var(--up-color);
}

.down {
  color: var(--down-color);
}

.maintenance {
  color: var(--maintenance-color);
}

table {
  width: 100%;
  border-collapse: collapse;

  th,
  td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
  }
}

details {
  summary {
    padding: 1rem 0;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
  }
}

.history {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin: 0.5rem 0;

  .history-day {
    flex: 1 0 auto;
    height: 30px;
    border-radius: 4px;
    background: var(--border-color);

    &.up {
      background: var(--up-color);
    }

    &.down {
      background: var(--down-color);
    }

    &.maintenance {
      background: var(--maintenance-color);
    }
  }
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0 0.5rem;
}

.history-filters {
  display: flex;

  .filter-btn {
    padding: 0.3rem 0.6rem;
    background: none;
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;

    &.active {
      background: var(--link-color);
      color: var(--bg-color);
    }
  }
}

.history-container {
  position: relative;
  min-height: 50px;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .service-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .service-metrics {
    align-items: flex-start;
    text-align: left;
  }
}

.service-header {
  margin-bottom: 2rem;
  overflow-x: auto;

  h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}

pre, code {
  font-size: 0.9rem;
}

pre {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  display: inline-block;
  margin: 0;
}

p .method-badge + pre {
  margin-left: 0.5rem;
  display: inline-block;
}

.landing-hero {
  text-align: center;
  padding: 4rem 2rem;
  margin-bottom: 3rem;
}

.landing-title {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.landing-subtitle {
  font-size: 1.3rem;
  opacity: 0.8;
  margin-bottom: 2rem;
}

.landing-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: opacity 0.2s;

  &:hover {
    opacity: 0.8;
  }
}

.btn-primary {
  background: var(--link-color);
  color: var(--bg-color);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-color);
  border: 2px solid var(--border-color);
}

.features {
  margin: 3rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.feature-card p {
  opacity: 0.8;
  line-height: 1.5;
}

.quick-start {
  margin: 3rem 0;
}

.quick-start ol {
  max-width: 600px;
  margin: 2rem auto;
}

.quick-start li {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.quick-start pre {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.api-endpoints {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.api-endpoint {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-bg);
  transition: border-color 0.2s;
}

.api-endpoint:hover {
  border-color: var(--link-color);
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border-color);
}

@media (prefers-color-scheme: dark) {
  .endpoint-header {
    background: rgba(255, 255, 255, 0.03);
  }
}

.endpoint-header .method-badge {
  flex-shrink: 0;
}

.endpoint-description {
  padding: 1rem;
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.5;
}

.copy-button {
  color: var(--border-color);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;

  svg {
    display: block;
  }

  &:hover {
    color: var(--link-color);
  }
}

.example-config {
  margin: 3rem 0;
}

.example-config pre {
  max-width: 600px;
  margin: 1rem auto;
}

.badge-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .badge-container {
    flex-direction: column;
  }
}

.badge-code-wrapper {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-bg);
}

.badge-code {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.75rem;
  word-break: break-all;
  color: var(--link-color);
  user-select: all;
}