@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-500.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-600.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/Fraunces-600.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

/* Dashboard dark theme tokens */
:root {
  color-scheme: dark;
  --background: oklch(0.13 0 0);
  --foreground: oklch(0.95 0 0);
  --card: oklch(0.17 0 0);
  --popover: oklch(0.17 0 0);
  --muted: oklch(0.22 0 0);
  --muted-foreground: oklch(0.65 0 0);
  --border: oklch(0.25 0 0);
  --primary: oklch(0.70 0.16 35);
  --success: oklch(0.70 0.15 162);
  --warning: oklch(0.77 0.16 70);
  --error: oklch(0.64 0.21 25);
  --info: oklch(0.68 0.15 237);
  --tone: var(--muted-foreground);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Same diagonal grid with traveling light streaks as the connic.co heroes */
.backdrop {
  position: absolute;
  inset: 0 0 auto;
  height: 560px;
  overflow: hidden;
  pointer-events: none;
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--background), transparent 35%),
    radial-gradient(ellipse at center, transparent 0%, var(--background) 75%);
}

/* 3072px is 48 grid steps, so a grid line runs through the center of the rotation. */
.grid-layer {
  position: absolute;
  top: calc(280px - 1536px);
  left: -100vw;
  width: 300vw;
  height: 3072px;
  background: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 64px);
  opacity: 0.6;
}

.grid-forward {
  transform: rotate(45deg);
}

.grid-backward {
  transform: rotate(-45deg);
}

.stream {
  position: absolute;
  left: 0;
  width: 40vw;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
  animation: shoot 12s linear infinite;
}

.stream:nth-child(1) {
  top: 1152px;
  animation-duration: 11s;
  animation-delay: -3s;
}

.stream:nth-child(2) {
  top: 1344px;
  animation-duration: 14s;
  animation-delay: -9s;
}

.stream:nth-child(3) {
  top: 1664px;
  animation-duration: 12s;
  animation-delay: -6s;
}

.stream:nth-child(4) {
  top: 1856px;
  animation-duration: 15s;
  animation-delay: -1s;
}

.grid-backward .stream:nth-child(1) {
  top: 1280px;
  animation-delay: -7s;
}

.grid-backward .stream:nth-child(3) {
  top: 1728px;
  animation-delay: -11s;
}

@keyframes shoot {
  from {
    transform: translateX(-40vw);
  }
  to {
    transform: translateX(300vw);
  }
}

a {
  color: inherit;
}

h1,
h2,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

.container {
  position: relative;
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 16px;
}

.muted {
  color: var(--muted-foreground);
}

.small {
  font-size: 13px;
}

.prose {
  overflow-wrap: anywhere;
}

.prose > * + * {
  margin-top: 10px;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-size: 15px;
  font-weight: 600;
}

.prose * + h1,
.prose * + h2,
.prose * + h3,
.prose * + h4 {
  margin-top: 18px;
}

.prose ul,
.prose ol {
  padding-left: 20px;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 4px;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose code {
  font-size: 0.9em;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--muted);
}

.prose pre {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--muted);
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
}

.prose blockquote {
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  color: var(--muted-foreground);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.prose th,
.prose td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-weight: 500;
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--muted) 50%, transparent);
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Status tones */

.tone-operational {
  --tone: var(--success);
}

.tone-maintenance {
  --tone: var(--info);
}

.tone-degraded,
.tone-partial_outage {
  --tone: var(--warning);
}

.tone-major_outage {
  --tone: var(--error);
}

.tone-text {
  color: var(--tone);
}

.dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--tone);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  color: var(--tone);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}

.chip-neutral {
  --tone: var(--muted-foreground);
  background: var(--muted);
}

.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--tone) 12%, var(--card));
  color: var(--tone);
}

.tile-lg {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.tile-lg .icon {
  width: 22px;
  height: 22px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}

.card-title {
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.button:hover {
  background: var(--muted);
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Header and footer */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 24px;
  width: auto;
}

.brand-label {
  padding-left: 12px;
  border-left: 1px solid var(--border);
  color: var(--muted-foreground);
  font-weight: 500;
}

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: blur(8px);
}

.tabs a {
  padding: 5px 14px;
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.tabs a:hover {
  color: var(--foreground);
}

.tabs a[aria-current="page"] {
  background: var(--muted);
  color: var(--foreground);
}

main.container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 72px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  padding-bottom: 32px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 13px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--foreground);
}

.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.with-icon .icon {
  width: 14px;
  height: 14px;
}

/* Overview hero */

.hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 40px 0 24px;
}

.orb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--tone) 90%, white), var(--tone));
  color: var(--background);
  box-shadow: 0 0 40px color-mix(in srgb, var(--tone) 45%, transparent);
}

.orb::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  border: 2px solid var(--tone);
  animation: ripple 2.4s ease-out infinite;
}

.orb-icon {
  width: 32px;
  height: 32px;
  stroke-width: 2.5;
}

@keyframes ripple {
  from {
    opacity: 0.7;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 50px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
}

.stat-label {
  color: var(--muted-foreground);
  font-size: 13px;
}

.stat-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-text {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  padding-top: 6px;
}

/* Incident, notice and maintenance cards */

.event {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  background:
    radial-gradient(ellipse 50% 120% at 0% 0%, color-mix(in srgb, var(--tone) 9%, transparent), transparent),
    var(--card);
}

.event-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.event-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.event h2 {
  font-size: 16px;
  font-weight: 600;
}

.event h2 a {
  text-decoration: none;
}

.event h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Components */

.systems-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.systems-head h2 {
  font-size: 15px;
  font-weight: 600;
}

.system {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px auto;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
}

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

.system-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 16%, transparent);
  color: var(--tone);
}

.badge-icon {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

.system-name {
  font-weight: 500;
}

.system-uptime {
  text-align: right;
}

.uptime-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 90-day calendar with popover tooltips */

.calendar {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  grid-auto-flow: column;
  grid-auto-columns: 10px;
  gap: 3px;
}

.day {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2.5px;
  background: var(--muted);
}

.day-blank {
  visibility: hidden;
}

.day-operational {
  background: color-mix(in srgb, var(--success) 70%, var(--card));
}

.day-maintenance {
  background: var(--info);
}

.day-degraded,
.day-partial_outage {
  background: var(--warning);
}

.day-major_outage {
  background: var(--error);
}

.calendar .day:hover {
  z-index: 10;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 3px var(--foreground);
}

.tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--popover) 95%, transparent);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.35), 0 4px 6px -4px rgb(0 0 0 / 0.35);
  backdrop-filter: blur(4px);
  color: var(--foreground);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) scale(0.95);
  transform-origin: bottom center;
  transition: opacity 120ms ease-out, transform 120ms ease-out;
}

.tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: var(--popover);
  transform: translateX(-50%) rotate(45deg);
}

.day:hover .tip {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.tip-start .tip {
  left: -8px;
  transform: translate(0, 4px) scale(0.95);
  transform-origin: bottom left;
}

.tip-start .tip::after {
  left: 13px;
}

.tip-start:hover .tip {
  transform: translate(0, 0) scale(1);
}

.tip-end .tip {
  right: -8px;
  left: auto;
  transform: translate(0, 4px) scale(0.95);
  transform-origin: bottom right;
}

.tip-end .tip::after {
  right: 9px;
  left: auto;
  transform: rotate(45deg);
}

.tip-end:hover .tip {
  transform: translate(0, 0) scale(1);
}

.tip-date {
  color: var(--muted-foreground);
}

.tip-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* History lists */

.page-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 32px 0 12px;
}

.page-heading h1 {
  font-size: clamp(30px, 5vw, 42px);
}

.month-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.month-head h2 {
  font-size: 15px;
  font-weight: 600;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  text-decoration: none;
}

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

.row:hover {
  background: color-mix(in srgb, var(--muted) 45%, transparent);
}

.month li:last-child .row {
  border-radius: 0 0 12px 12px;
}

.row-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.row-title {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  color: var(--muted-foreground);
}

.row-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.row-empty.tone-operational .icon {
  color: var(--tone);
}

.pager {
  display: flex;
  justify-content: space-between;
}

/* Incident and maintenance detail */

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 24px;
  color: var(--muted-foreground);
  font-size: 14px;
  text-decoration: none;
}

.back:hover {
  color: var(--foreground);
}

.detail {
  display: flex;
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(ellipse 45% 100% at 0% 0%, color-mix(in srgb, var(--tone) 10%, transparent), transparent),
    var(--card);
}

.detail-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

.detail h1 {
  font-size: clamp(26px, 4vw, 34px);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
}

.facts dt {
  color: var(--muted-foreground);
  font-size: 12px;
}

.facts dd {
  font-size: 14px;
}

.panel {
  padding: 20px 24px;
}

.timeline > li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 0 22px 26px;
}

.timeline > li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--tone);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 18%, transparent);
}

.timeline > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 2px;
  left: 4.5px;
  width: 1px;
  background: var(--border);
}

.timeline > li:last-child {
  padding-bottom: 0;
}

.state-investigating,
.state-identified {
  --tone: var(--warning);
}

.state-monitoring {
  --tone: var(--info);
}

.state-resolved {
  --tone: var(--success);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.timeline-state {
  font-weight: 600;
}

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

  .system {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 16px;
  }

  .calendar {
    grid-column: 1 / -1;
  }

  .hero {
    align-items: flex-start;
  }

  .orb {
    width: 56px;
    height: 56px;
  }

  .orb-icon {
    width: 26px;
    height: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb::after,
  .stream {
    animation: none;
  }

  .tip {
    transition: none;
  }
}
