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

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-hover: #161616;
  --border: #1f1f1f;
  --border-hover: #2a2a2a;
  --accent: #f59e0b;
  --accent-dim: rgba(245, 158, 11, 0.12);
  --text: #efefef;
  --text-muted: #909090;
  --text-faint: #3a3a3a;
  --online: #22c55e;
  --online-glow: rgba(34, 197, 94, 0.4);
  --offline: #ef4444;
  --offline-glow: rgba(239, 68, 68, 0.3);
  --pending: #3a3a3a;
  --font: 'JetBrains Mono', monospace;
  --radius: 6px;
  --max-width: 960px;
}

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */

header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.logo-prompt {
  color: var(--accent);
}

.logo-name {
  color: var(--text);
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.status-summary {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.last-updated {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Main ── */

main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

/* ── Section ── */

.section-title {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.subsection {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.subsection + .subsection {
  margin-top: 1.5rem;
}

.subsection-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-left: 0.1rem;
  margin-bottom: 0.4rem;
}

.subsection-label::before {
  content: '## ';
  color: var(--accent);
  letter-spacing: 0;
}

.section-prefix {
  color: var(--accent);
  margin-right: 0.35rem;
}

/* ── Public site cards ── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card {
  background: var(--surface);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  position: relative;
}

.card:hover {
  background: var(--surface-hover);
}

.card:hover .card-name {
  color: var(--accent);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.card-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  transition: color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favicon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  opacity: 0.85;
}

/* ── Status dot ── */

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--pending);
  transition: background 0.4s, box-shadow 0.4s;
}

.dot.online {
  background: var(--online);
  box-shadow: 0 0 7px var(--online-glow);
  animation: pulse 2.5s ease-in-out infinite;
}

.dot.offline {
  background: var(--offline);
  box-shadow: 0 0 5px var(--offline-glow);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ── Links section ── */

.link-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.link-item:last-child {
  border-bottom: none;
}

.link-item:hover {
  background: var(--surface-hover);
}

.link-item:hover .link-name {
  color: var(--accent);
}

.link-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
  transition: color 0.15s;
  flex: 1;
}

.link-arrow {
  color: var(--text-faint);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: color 0.15s;
}

.link-item:hover .link-arrow {
  color: var(--accent);
}

/* ── Internal services ── */

.service-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.service-item:last-child {
  border-bottom: none;
}

.service-name {
  font-size: 0.875rem;
  color: var(--text);
  flex: 1;
}

/* ── Footer ── */

footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ── Loading skeleton ── */

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 3px;
  display: inline-block;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ── */

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

  main {
    padding: 2rem 1.25rem;
    gap: 2.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .header-meta {
    align-items: flex-end;
  }
}
