/* The NeuroCards palette and type, as on neurocards.net. */

:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-2: rgba(34, 34, 34, 0.06);
  --surface-active: rgba(34, 34, 34, 0.11);
  --ink: #222222;
  --ink-2: #4a4a4a;
  --ink-3: #6c6c6c;
  --hairline: #ebebeb;
  --chip-face: rgba(34, 34, 34, 0.059);
  --chip-face-hover: rgba(34, 34, 34, 0.1);
  --skeleton-sheen: rgba(255, 255, 255, 0.6);
  --menu-shadow: 0 3px 6px rgba(0, 0, 0, 0.05), 0 18px 40px rgba(0, 0, 0, 0.18);
  --chart-fill: rgba(34, 34, 34, 0.06);

  --accent-green: #10b981;
  --accent-orange: #d97706;
  --accent-red: #dc2626;
  --accent-blue: #007dff;
  --day-up: color-mix(in srgb, var(--accent-green) 75%, transparent);
  --day-none: rgba(34, 34, 34, 0.08);
}

[data-theme="dark"] {
  --bg: #141414;
  --surface: #1a1a1a;
  --surface-2: #2c2c2c;
  --surface-active: rgba(218, 218, 218, 0.08);
  --ink: #fafafa;
  --ink-2: #ababab;
  --ink-3: #868686;
  --hairline: #252525;
  --chip-face: rgba(218, 218, 218, 0.07);
  --chip-face-hover: rgba(218, 218, 218, 0.12);
  --skeleton-sheen: rgba(218, 218, 218, 0.05);
  --menu-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), 0 18px 40px rgba(0, 0, 0, 0.45);
  --chart-fill: rgba(250, 250, 250, 0.06);

  --accent-green: #34d399;
  --accent-orange: #ffb86c;
  --accent-red: #f87171;
  --accent-blue: #93c5fd;
  --day-up: color-mix(in srgb, var(--accent-green) 75%, transparent);
  --day-none: rgba(218, 218, 218, 0.08);
}

@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-Italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/DMSans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

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

body {
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-variation-settings: "opsz" 14;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(760px, 100% - 32px);
  margin: 0 auto;
}

/* Header */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

/* The wordmark's lighter half, and the site's name after it. */
.brand em {
  font-style: normal;
  font-weight: 500;
}

.brand-mark {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

.topbar-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 8px 4px;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.topbar-link:hover {
  color: var(--ink);
}

/* The link's word for the app on a phone, in place of its name. */
.topbar-link-narrow {
  display: none;
}

/* Headline */

.hero {
  padding: 72px 0 40px;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eyebrow {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
}

.hero-title {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-variation-settings:
    "opsz" 72,
    "SOFT" 100,
    "wght" 400;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero-title em {
  font-style: italic;
  color: var(--ink-2);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 15px;
  color: var(--ink-2);
}

/* A status light. Working and slow pulse gently, down holds steady. */
.state-dot {
  --tone: var(--ink-3);
  position: relative;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tone);
}

.state-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--tone);
  opacity: 0;
}

.state-dot[data-state="up"] {
  --tone: var(--accent-green);
}
.state-dot[data-state="slow"] {
  --tone: var(--accent-orange);
}
.state-dot[data-state="down"] {
  --tone: var(--accent-red);
}

.state-dot[data-state="up"]::after,
.state-dot[data-state="slow"]::after {
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.45;
  }
  70%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Sections */

.block {
  margin-bottom: 44px;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.block-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.block-caption {
  font-size: 13px;
  color: var(--ink-3);
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
}

/* Notices */

.notices {
  display: grid;
  gap: 12px;
  margin-bottom: 44px;
}

.notice {
  padding: 18px 20px;
}

.notice-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--ink-3);
}

.notice-type {
  --tone: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  color: var(--tone);
  font-weight: 600;
  font-size: 12px;
}

.notice-type::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.notice-type[data-type="outage"] {
  --tone: var(--accent-red);
}
.notice-type[data-type="warning"] {
  --tone: var(--accent-orange);
}
.notice-type[data-type="information"] {
  --tone: var(--accent-blue);
}
.notice-type[data-type="operational"] {
  --tone: var(--accent-green);
}

.notice-message {
  font-size: 15px;
  color: var(--ink);
}

/* Services */

.service {
  padding: 20px 22px 18px;
}

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

.services-empty {
  padding: 22px;
  font-size: 14px;
  color: var(--ink-3);
}

.service-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.service-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.service-caption {
  font-size: 13px;
  color: var(--ink-3);
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.service-state .state-dot {
  width: 8px;
  height: 8px;
}

.service-ms {
  color: var(--ink-3);
  font-weight: 400;
}

/* One thin bar a day, as many as fit (see barCount in app.js). */
.bars {
  display: flex;
  gap: 2px;
  height: 32px;
  border-radius: 3px;
  outline: none;
}

.bars:focus-visible {
  outline: 1px solid var(--ink-3);
  outline-offset: 3px;
}

.bars-row {
  display: contents;
}

.bar {
  flex: 1;
  min-width: 0;
  border-radius: 2px;
  background: var(--day-none);
  transition:
    transform 0.15s ease-out,
    opacity 0.15s ease-out;
  transform-origin: bottom;
}

.bar[data-day="up"] {
  background: var(--day-up);
}
.bar[data-day="partial"] {
  background: var(--accent-orange);
}
.bar[data-day="down"] {
  background: var(--accent-red);
}

.bars[data-hovering] .bar {
  opacity: 0.35;
}

.bars .bar.is-active {
  opacity: 1;
  transform: scaleY(1.08);
}

.bars-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

.bars-rule {
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.bars-uptime {
  color: var(--ink-2);
  font-weight: 500;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-3);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--day-none);
}

.legend-swatch[data-day="up"],
.tip-dot[data-day="up"] {
  background: var(--day-up);
}
.legend-swatch[data-day="partial"],
.tip-dot[data-day="partial"] {
  background: var(--accent-orange);
}
.legend-swatch[data-day="down"],
.tip-dot[data-day="down"] {
  background: var(--accent-red);
}

/* Floating day details, shared by every bar. */
.day-tip,
.chart-tip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--menu-shadow);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.day-tip:not([hidden]),
.chart-tip:not([hidden]) {
  animation: tip-in 0.14s ease-out;
}

.day-tip.is-gliding {
  transition:
    left 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tip-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

.tip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.tip-title {
  font-weight: 600;
}

.tip-uptime {
  font-size: 12px;
  color: var(--ink-3);
}

.tip-detail {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
}

.tip-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--day-none);
}

/* Loading */

.skeleton {
  border-radius: 6px;
  background: var(--surface-2);
  background-image: linear-gradient(
    90deg,
    transparent,
    var(--skeleton-sheen),
    transparent
  );
  background-size: 200% 100%;
  animation: sheen 1.4s ease-in-out infinite;
}

.skeleton--line {
  width: 40%;
  height: 16px;
  margin-bottom: 16px;
}

.skeleton--bars {
  height: 32px;
}

@keyframes sheen {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

/* Response time */

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--chip-face);
}

.segmented button {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-checked="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .segmented button[aria-checked="true"] {
  background: var(--surface-2);
}

.chart-card {
  padding: 18px 22px 20px;
}

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

.chips button {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--chip-face);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.chips button:hover {
  background: var(--chip-face-hover);
  color: var(--ink);
}

.chips button[aria-checked="true"] {
  background: var(--ink);
  color: var(--surface);
}

.chart-stats {
  margin: 16px 0 10px;
  font-size: 13px;
  color: var(--ink-3);
}

.chart-stats strong {
  font-family: "Fraunces", serif;
  font-variation-settings:
    "opsz" 48,
    "SOFT" 100;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-right: 6px;
}

.chart {
  position: relative;
  height: 160px;
  touch-action: pan-y;
}

.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-area {
  fill: var(--chart-fill);
}

.chart-grid {
  stroke: var(--hairline);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--ink-3);
  font-size: 11px;
}

.chart-dot {
  fill: var(--ink);
}

.chart-cursor {
  stroke: var(--ink-3);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart-point {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
}

.chart-empty {
  fill: var(--ink-3);
  font-size: 13px;
}

/* Past notices */

.past .notice + .notice {
  border-top: 1px solid var(--hairline);
}

/* Footer */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 16px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-3);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

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

@media (max-width: 560px) {
  .brand {
    font-size: 19px;
  }

  .topbar-link-wide {
    display: none;
  }

  .topbar-link-narrow {
    display: inline;
  }

  .hero {
    padding: 52px 0 32px;
  }

  .service,
  .chart-card {
    padding-left: 16px;
    padding-right: 16px;
  }

  .service-head {
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
