:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --bg-2: #ffffff;
  --ink: #24292f;
  --muted: #57606a;
  --card: #ffffff;
  --border: #d0d7de;
  --accent: #0969da;
  --operational: #2da44e;
  --minor: #d97706;
  --major: #cf222e;
  --maintenance: #1f6feb;
  --shadow: 0 20px 40px -30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --mono: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--mono);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 55%, #f6f8fa 100%);
  color: var(--ink);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 0;
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 24px 32px;
  gap: 24px;
  max-width: 850px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #11121a;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.brand-mark span {
  position: absolute;
  width: 42px;
  height: 4px;
  background: linear-gradient(90deg, #8fd18a, #f1a23a, #e0564a);
  border-radius: 999px;
  opacity: 0.9;
}

.brand-mark span:nth-child(1) {
  transform: rotate(20deg);
}

.brand-mark span:nth-child(2) {
  transform: rotate(-20deg);
}

.brand-mark span:nth-child(3) {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  mix-blend-mode: screen;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
}

.ghost-button {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -15px rgba(0, 0, 0, 0.3);
}

main {
  position: relative;
  z-index: 1;
  padding: 0 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 850px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.hero-status {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  border: 1px solid #f0eee8;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  background: #eaf6ec;
  color: var(--operational);
}

.status-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(46, 164, 79, 0.2);
}

.status-pill.minor {
  background: rgba(241, 162, 58, 0.18);
  color: var(--minor);
}

.status-pill.major {
  background: rgba(224, 86, 74, 0.18);
  color: var(--major);
}

.status-pill.maintenance {
  background: rgba(60, 120, 216, 0.18);
  color: var(--maintenance);
}

.status-pill.none {
  background: #e9f7ed;
  color: var(--operational);
}

.hero-status h2 {
  margin: 16px 0 8px;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.hero-status p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-meta {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-panel .status-meta {
  margin-top: 0;
}

.divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.hero-panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
  z-index: 0;
}

.hero-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.hero-panel h3 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 1.35rem;
}

.uptime-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uptime-label {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.05rem;
}

.uptime-percent {
  color: var(--muted);
  font-weight: 600;
}

.uptime-bars {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 3px;
  align-items: center;
}

.uptime-bars span {
  height: 26px;
  border-radius: 6px;
  background: #dfe4ea;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.uptime-bars span:hover,
.uptime-bars span:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.uptime-tooltip {
  position: absolute;
  min-width: 220px;
  max-width: 320px;
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 38px -28px rgba(28, 28, 28, 0.5);
  padding: 14px 16px 16px;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 999;
}

.uptime-tooltip.active {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.uptime-tooltip::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fffdf9;
  border: 1px solid var(--border);
  left: var(--arrow-left, 50%);
  transform: translateX(-50%) rotate(45deg);
}

.uptime-tooltip[data-arrow="top"]::before {
  top: -7px;
}

.tooltip-date {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
}

.tooltip-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(207, 201, 190, 0.2);
  color: var(--ink);
  font-weight: 600;
}

.tooltip-duration {
  margin-left: auto;
  color: var(--muted);
  font-weight: 600;
}

.tooltip-related {
  margin-top: 12px;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.tooltip-dot.operational,
.tooltip-dot.none {
  background: var(--operational);
}

.tooltip-dot.minor {
  background: var(--minor);
}

.tooltip-dot.major {
  background: var(--major);
}

.tooltip-dot.maintenance {
  background: var(--maintenance);
}

.tooltip-incidents {
  margin: 6px 0 0;
  padding-left: 0;
  list-style: none;
  color: var(--muted);
}

.tooltip-incidents li {
  margin-bottom: 4px;
}

.tooltip-incidents a {
  color: inherit;
}

.uptime-bars span.operational {
  background: rgba(45, 164, 78, 0.85);
}

.uptime-bars span.minor {
  background: rgba(217, 119, 6, 0.85);
}

.uptime-bars span.major {
  background: rgba(207, 34, 46, 0.85);
}

.uptime-bars span.maintenance {
  background: rgba(31, 111, 235, 0.85);
}

.uptime-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.operational {
  background: var(--operational);
}

.dot.minor {
  background: var(--minor);
}

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

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

.about-prompt {
  text-align: center;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--muted);
}

.about-prompt a {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.about-prompt a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -15px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.about-prompt a .status-operational {
  color: var(--operational);
}

.about-prompt a .status-minor {
  color: var(--minor);
}

.about-prompt a .status-major {
  color: var(--major);
}

.about-prompt a .status-maintenance {
  color: var(--maintenance);
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 0;
  overflow: visible;
}


.panel-raise {
  z-index: 10;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header h3 {
  margin: 0;
  font-family: var(--display);
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.timeline-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.about-panel {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.about-body {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.about-nerd {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(9, 105, 218, 0.06);
  border: 1px solid rgba(9, 105, 218, 0.16);
}

.about-links {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.about-links a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.about-links a:hover {
  color: var(--accent);
  background: rgba(9, 105, 218, 0.1);
  box-shadow: inset 0 -6px 0 rgba(9, 105, 218, 0.18);
  text-decoration: none;
}

.about-body a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.about-body a:hover {
  color: var(--accent);
  background: rgba(9, 105, 218, 0.1);
  box-shadow: inset 0 -6px 0 rgba(9, 105, 218, 0.18);
  text-decoration: none;
}

.history-header {
  align-items: center;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.month-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: #ffffff;
  position: relative;
  z-index: 0;
  overflow: visible;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
}

.month-header span {
  color: var(--muted);
  font-size: 0.85rem;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.month-day,
.month-empty {
  width: 100%;
  height: 12px;
  border-radius: 4px;
  background: #dfe4ea;
}

.month-day {
  cursor: pointer;
}

.month-day.operational {
  background: rgba(45, 164, 78, 0.8);
}

.month-day.minor {
  background: rgba(217, 119, 6, 0.85);
}

.month-day.major {
  background: rgba(207, 34, 46, 0.85);
}

.month-day.maintenance {
  background: rgba(31, 111, 235, 0.85);
}

.month-day.future {
  background: #e9edf1;
  cursor: default;
  pointer-events: none;
}

.month-empty {
  background: transparent;
  pointer-events: none;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 16px;
  position: relative;
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  position: relative;
  z-index: 0;
  overflow: visible;
}

.service-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.service-row-header span {
  color: var(--muted);
}

.service-bars {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 2px;
  align-items: center;
}

.service-bars span {
  height: 12px;
  border-radius: 4px;
  background: #dfe4ea;
  cursor: pointer;
}

.service-bars span.operational {
  background: rgba(45, 164, 78, 0.8);
}

.service-bars span.minor {
  background: rgba(217, 119, 6, 0.85);
}

.service-bars span.major {
  background: rgba(207, 34, 46, 0.85);
}

.service-bars span.maintenance {
  background: rgba(31, 111, 235, 0.85);
}

.empty {
  padding: 20px;
  border-radius: var(--radius-sm);
  background: #f6f8fa;
  color: var(--muted);
  margin-top: 16px;
}

.incident-group {
  margin-top: 18px;
}

.incident-group h4 {
  margin: 0 0 8px;
  font-family: var(--display);
}

.incident-card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #ffffff;
}

.incident-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.incident-title h5 {
  margin: 0;
  font-size: 1rem;
}

.incident-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge.minor {
  background: rgba(217, 119, 6, 0.16);
  color: #8a4b00;
}

.badge.major {
  background: rgba(207, 34, 46, 0.16);
  color: #8a1f24;
}

.badge.maintenance {
  background: rgba(31, 111, 235, 0.16);
  color: #1f4d8f;
}

.badge.none,
.badge.operational {
  background: rgba(45, 164, 78, 0.16);
  color: #1b5f33;
}

.timeline {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
}

.timeline span {
  padding: 4px 8px;
  background: #f0ede7;
  border-radius: 999px;
}

.components {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.components span {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f6f8fa;
  border: 1px solid var(--border);
}

details {
  margin-top: 10px;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

details ul {
  padding-left: 16px;
  color: var(--muted);
}

.site-footer {
  padding: 32px 24px 48px;
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 850px;
  margin: 0 auto;
}

[data-animate] {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.8s ease forwards;
}

[data-animate]:nth-of-type(1) {
  animation-delay: 0.1s;
}

[data-animate]:nth-of-type(2) {
  animation-delay: 0.2s;
}

[data-animate]:nth-of-type(3) {
  animation-delay: 0.3s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .uptime-bars {
    grid-template-columns: repeat(30, 1fr);
    grid-auto-rows: 10px;
    gap: 4px;
  }

  .uptime-bars span {
    height: 14px;
  }

  .hero-panel h3 {
    font-size: 1.2rem;
  }

  .service-bars {
    grid-template-columns: repeat(30, 1fr);
  }

  .status-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.hero-panel.tooltip-open,
.hero.tooltip-open,
.panel.tooltip-open,
.month-card.tooltip-open,
.service-row.tooltip-open {
  z-index: 50;
}

.hero.tooltip-open {
  position: relative;
}
