:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --bg-elevated: #131820;
  --ink: #f3f0e8;
  --muted: #8a92a1;
  --line: rgba(243, 240, 232, 0.08);
  --off: #2a313c;
  --blue: #6aa8ff;
  --green: #3dd68c;
  --yellow: #efc15a;
  --red: #ff6b6b;
  --purple: #c084fc;
  --ring: var(--blue);
  --accent-wash: rgba(106, 168, 255, 0.12);
  --font-display: "Syne", "Avenir Next", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: color-mix(in srgb, var(--ring) 35%, transparent);
  color: var(--ink);
}

body[data-status="PASS"] {
  --ring: var(--green);
  --accent-wash: rgba(61, 214, 140, 0.11);
}

body[data-status="FAIL"] {
  --ring: var(--red);
  --accent-wash: rgba(255, 107, 107, 0.12);
}

body[data-status="UNKNOWN"],
body[data-status="RUNNING"],
body[data-status="WAITING"],
body[data-status="APPROVAL"] {
  --ring: var(--yellow);
  --accent-wash: rgba(239, 193, 90, 0.11);
}

body[data-status="CONNECTION_ERROR"] {
  --ring: var(--purple);
  --accent-wash: rgba(192, 132, 252, 0.11);
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 40% at 50% -5%, var(--accent-wash), transparent 70%),
    linear-gradient(180deg, #10151c 0%, var(--bg) 42%, #07090c 100%);
  transition: background 0.6s var(--ease-out);
}

main {
  position: relative;
  z-index: 1;
  width: min(38rem, 92vw);
  margin: 0 auto;
  flex: 1;
  padding: clamp(2rem, 6vh, 3.25rem) 0 clamp(2.5rem, 7vh, 4rem);
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 1.75rem;
  animation: rise 0.7s var(--ease-out) both;
}

.masthead {
  text-align: center;
  display: grid;
  gap: 0.55rem;
  justify-items: center;
}

.brand-mark {
  width: clamp(3.25rem, 8vw, 4rem);
  height: auto;
  border-radius: 1rem;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent),
    0 12px 40px rgba(0, 0, 0, 0.35);
  animation: brand-in 0.8s var(--ease-out) both;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.tagline {
  margin: 0.15rem 0 0;
  max-width: 26rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
  font-weight: 500;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  padding-bottom: 0.12rem;
  transition:
    color 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out);
}

.repo-link:hover,
.repo-link:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ring) 55%, transparent);
  outline: none;
}

.repo-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(0.4rem) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.connection {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.connection::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.connection[data-state="live"] {
  color: var(--green);
}

.connection[data-state="live"]::before {
  animation: live-pulse 1.8s ease-out infinite;
}

.connection[data-state="offline"] {
  color: var(--red);
}

.last-checked {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.push-controls {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  margin-top: 0.15rem;
}

.push-toggle {
  appearance: none;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: 0.35rem;
  background: transparent;
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out);
}

.push-toggle:hover,
.push-toggle:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ring) 55%, transparent);
  outline: none;
}

.push-toggle:disabled {
  opacity: 0.55;
  cursor: default;
}

.push-toggle[data-state="on"] {
  border-color: color-mix(in srgb, var(--green) 45%, transparent);
  color: color-mix(in srgb, var(--green) 85%, var(--ink));
}

.push-hint {
  margin: 0;
  max-width: 22rem;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
  text-align: center;
}

.site-credit {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding: 0 1rem 1.75rem;
  text-align: center;
}

.site-credit p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.site-credit a {
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--ring) 35%, transparent);
  margin-left: 0.35em;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.site-credit a:hover,
.site-credit a:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ring) 70%, transparent);
  outline: none;
}

.privacy-page {
  position: relative;
  z-index: 1;
  width: min(40rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 2rem;
}

.privacy-page article {
  text-align: left;
}

.privacy-page h1,
.privacy-page h2 {
  font-family: var(--font-display);
}

.privacy-page p,
.privacy-page li {
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
  line-height: 1.55;
}

.privacy-page a {
  color: var(--blue);
}

.hero {
  display: grid;
  justify-items: center;
  width: 100%;
}

.status-dial {
  position: relative;
  width: min(17.5rem, 68vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.status-dial-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ring) 12%, transparent));
}

.status-dial-track,
.status-dial-progress {
  fill: none;
  stroke-width: 1.4;
}

.status-dial-track {
  stroke: rgba(243, 240, 232, 0.05);
}

.status-dial-progress {
  stroke: color-mix(in srgb, var(--ring) 42%, transparent);
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  opacity: 0.65;
  transition:
    stroke 0.45s var(--ease-out),
    opacity 0.35s var(--ease-out);
}

.status-dial[data-fetching="true"] .status-dial-progress {
  stroke: color-mix(in srgb, var(--ring) 28%, transparent);
  stroke-dasharray: 0.06 0.94;
  opacity: 0.45;
  animation: dial-spin 2.8s linear infinite;
}

.status-dial-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.45rem;
  width: 72%;
  aspect-ratio: 1;
  padding: 0.7rem 0.85rem;
  border-radius: 50%;
  overflow: hidden;
  container-type: inline-size;
  background: radial-gradient(
    circle at 50% 40%,
    color-mix(in srgb, var(--ring) 12%, #151b24),
    #0e131a 70%
  );
  border: 1px solid rgba(243, 240, 232, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-align: center;
}

.status-word {
  margin: 0;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 22cqi, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ring);
  white-space: nowrap;
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

body[data-status="RUNNING"] .status-word,
body[data-status="WAITING"] .status-word,
body[data-status="APPROVAL"] .status-word {
  text-shadow: 0 0 1.25rem color-mix(in srgb, var(--yellow) 55%, transparent);
}

body[data-status="RUNNING"] .status-dial-core,
body[data-status="WAITING"] .status-dial-core,
body[data-status="APPROVAL"] .status-dial-core {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 2.5rem color-mix(in srgb, var(--yellow) 22%, transparent);
}

.summary {
  margin: 0;
  max-width: 9.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  text-wrap: balance;
}

.lights {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.25rem;
  width: min(28rem, 100%);
  padding: 0.85rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
}

.light {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  opacity: 0.45;
  transition: opacity 0.25s ease;
}

.light.on,
.light.pulse {
  opacity: 1;
}

.bulb {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--off);
  border: 1px solid rgba(243, 240, 232, 0.05);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.light.on .bulb,
.light.pulse .bulb {
  transform: scale(1.1);
}

.light[data-light="blue"].on .bulb {
  background: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent),
    0 0 14px color-mix(in srgb, var(--blue) 45%, transparent);
}

.light[data-light="green"].on .bulb {
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent),
    0 0 14px color-mix(in srgb, var(--green) 45%, transparent);
}

.light[data-light="yellow"].on .bulb,
.light[data-light="yellow"].pulse .bulb {
  background: var(--yellow);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow) 14%, transparent),
    0 0 14px color-mix(in srgb, var(--yellow) 45%, transparent);
}

.light[data-light="yellow"].pulse .bulb {
  animation: pulse 1.2s ease-in-out infinite;
}

.light[data-light="red"].on .bulb {
  background: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 14%, transparent),
    0 0 14px color-mix(in srgb, var(--red) 45%, transparent);
}

.light[data-light="purple"].on .bulb {
  background: var(--purple);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 14%, transparent),
    0 0 14px color-mix(in srgb, var(--purple) 45%, transparent);
}

.label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.light.on .label,
.light.pulse .label {
  color: color-mix(in srgb, var(--ink) 80%, var(--muted));
}

.issues {
  width: min(34rem, 100%);
  margin-top: 0.25rem;
  text-align: left;
}

.repos {
  width: min(34rem, 100%);
  margin-top: 0.25rem;
  text-align: left;
}

.repos-head,
.issues-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding: 0 0.15rem 0.55rem;
  border-bottom: 1px solid var(--line);
}

.repos h2,
.issues h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.repo-count,
.issue-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.repos ul,
.issues ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.repo-item {
  animation: rise 0.5s var(--ease-out) both;
  animation-delay: var(--delay, 0ms);
}

.repo-row {
  --accent: var(--green);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--bg-elevated) 92%, white 5%);
  border-radius: 0 0.7rem 0.7rem 0;
  transition: border-color 0.2s ease;
}

.repo-fail {
  --accent: var(--red);
}

.repo-unknown,
.repo-waiting,
.repo-approval {
  --accent: var(--yellow);
}

.repo-connection_error {
  --accent: var(--purple);
}

.repo-running,
.repo-waiting,
.repo-approval,
.repo-row.is-running:not(.repo-fail):not(.repo-connection_error):not(.repo-unknown):not(.repo-approval) {
  --accent: var(--yellow);
}

.repo-none {
  --accent: var(--muted);
}

.repo-summary {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  grid-template-areas:
    "chevron name status external"
    "chevron meta prs external";
  gap: 0.2rem 0.7rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  list-style: none;
  cursor: pointer;
  color: inherit;
}

.repo-summary::-webkit-details-marker {
  display: none;
}

.repo-summary::marker {
  content: "";
}

.repo-summary:hover .repo-name {
  color: color-mix(in srgb, var(--ink) 88%, var(--accent));
}

.repo-summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 70%, white);
  outline-offset: 2px;
}

.repo-chevron {
  grid-area: chevron;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease;
  justify-self: center;
}

.repo-row[open] .repo-chevron {
  transform: rotate(45deg);
  border-color: var(--accent);
}

.repo-name {
  grid-area: name;
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: -0.015em;
}

.repo-meta {
  grid-area: meta;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
}

.repo-status {
  grid-area: status;
  justify-self: end;
  padding: 0.25rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 0.3rem;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.repo-external {
  grid-area: external;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.repo-external:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.repo-external:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 70%, white);
  outline-offset: 2px;
}

.repo-glances {
  grid-area: prs;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  justify-self: start;
}

.repo-prs,
.repo-security {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--accent);
  border-radius: 0.3rem;
  padding: 0.1rem 0.35rem;
}

.repo-prs:hover,
.repo-security:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.repo-prs:focus-visible,
.repo-security:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 70%, white);
  outline-offset: 2px;
}

.repo-workflows {
  list-style: none;
  margin: 0;
  padding: 0 0.7rem 0.7rem 1.85rem;
  display: grid;
  gap: 0.3rem;
  border-top: 1px solid var(--line);
}

.workflow-row {
  --wf-accent: var(--green);
}

.workflow-fail {
  --wf-accent: var(--red);
}

.workflow-unknown {
  --wf-accent: var(--yellow);
}

.workflow-connection_error {
  --wf-accent: var(--purple);
}

.workflow-running,
.workflow-waiting,
.workflow-approval {
  --wf-accent: var(--yellow);
}

.workflow-none {
  --wf-accent: var(--muted);
}

.workflow-row a,
.workflow-row:not(:has(a)) {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.55rem 0.55rem 0.65rem;
  border-left: 2px solid color-mix(in srgb, var(--wf-accent) 55%, transparent);
  border-radius: 0 0.4rem 0.4rem 0;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.workflow-row a:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.workflow-row a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 70%, white);
  outline-offset: 2px;
}

.workflow-name {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.workflow-status {
  justify-self: end;
  padding: 0.18rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--wf-accent) 32%, transparent);
  border-radius: 0.3rem;
  background: color-mix(in srgb, var(--wf-accent) 9%, transparent);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wf-accent);
}

.issue {
  --accent: var(--red);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--bg-elevated) 92%, white 5%);
  border-radius: 0 0.7rem 0.7rem 0;
  animation: rise 0.5s var(--ease-out) both;
  animation-delay: var(--delay, 0ms);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.issue-unknown,
.issue-approval {
  --accent: var(--yellow);
}

.issue-connection_error {
  --accent: var(--purple);
}

.issue a,
.issue:not(:has(a)) {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "repo status"
    "workflow status";
  gap: 0.2rem 1rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  color: inherit;
  text-decoration: none;
}

.issue a:hover {
  transform: translateX(2px);
}

.issue a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 70%, white);
  outline-offset: 2px;
}

.issue-repo {
  grid-area: repo;
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: -0.015em;
}

.issue-org {
  color: var(--muted);
  font-weight: 500;
}

.issue-name {
  color: var(--ink);
}

.issue-workflow {
  grid-area: workflow;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.issue-status {
  grid-area: status;
  justify-self: end;
  padding: 0.25rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 0.3rem;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes dial-spin {
  to {
    stroke-dashoffset: -1;
  }
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(61, 214, 140, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 214, 140, 0);
  }
}

@media (max-width: 560px) {
  .status-dial {
    width: min(15rem, 72vw);
  }

  .lights {
    padding: 0.75rem 0.35rem;
  }

  .bulb {
    width: 1.2rem;
    height: 1.2rem;
  }

  .issue a,
  .issue:not(:has(a)) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "repo"
      "workflow"
      "status";
    gap: 0.3rem;
  }

  .repo-summary {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "chevron name external"
      "chevron meta external"
      "chevron prs external"
      "chevron status external";
    gap: 0.3rem 0.65rem;
  }

  .repo-status,
  .workflow-status {
    justify-self: start;
  }

  .repo-workflows {
    padding-left: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
