:root {
  --bg: #090b12;
  --panel: rgba(8, 10, 18, 0.52);
  --panel-hover: rgba(16, 20, 32, 0.82);
  --ink: #f7fafc;
  --muted: #b6c3d8;
  --line: rgba(255, 255, 255, 0.16);
  --link: #ffd166;
  --accent: #71e4ff;
  --glow: rgba(113, 228, 255, 0.22);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --art-height: min(100vh, 940px);
  --art-width: calc(var(--art-height) * 1164 / 1754);
  --column-gap: 22px;
  --column-right-pad: 32px;
  --column-width: min(680px, calc(100vw - var(--art-width) - var(--column-gap) - var(--column-right-pad)));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    linear-gradient(90deg, rgba(9, 11, 18, 0.82) 0%, rgba(9, 11, 18, 0.46) 42%, rgba(9, 11, 18, 0.18) 100%),
    linear-gradient(180deg, rgba(9, 11, 18, 0.04) 0%, rgba(9, 11, 18, 0.42) 58%, rgba(9, 11, 18, 0.88) 100%),
    url("background.png");
  background-attachment: fixed;
  background-position: left top;
  background-repeat: no-repeat;
  background-size: auto var(--art-height);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 66%);
}

main {
  width: 100%;
  margin: 0;
  padding: 24px var(--column-right-pad) 80px 0;
  position: relative;
}

header {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  position: relative;
  width: var(--column-width);
  margin-left: calc(var(--art-width) + var(--column-gap));
  padding-top: 12px;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  max-width: 760px;
}

.logo-container {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), 0 0 34px var(--glow);
  backdrop-filter: blur(16px);
}

.logo-container img {
  width: 42px;
  height: 42px;
}

h1 {
  margin: 0 0 12px;
  max-width: 520px;
  font-size: clamp(42px, 4.4vw, 58px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0;
  background: linear-gradient(135deg, #ffffff 0%, #d7efff 54%, #ffd166 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

p.description {
  margin: 0;
  color: #d6e0ef;
  font-size: 17px;
  max-width: 480px;
  line-height: 1.6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.72);
}

.meta {
  background: rgba(8, 10, 18, 0.72);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--link);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  backdrop-filter: blur(16px);
  margin-top: 10px;
}

section {
  width: var(--column-width);
  margin-left: calc(var(--art-width) + var(--column-gap));
  margin-top: 20px;
}

h2 {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}

h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  padding: 0;
  margin: 0;
  list-style: none;
}

section:first-of-type .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-left: 0;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  min-height: 122px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.26);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(113, 228, 255, 0.16) 0%, transparent 52%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(113, 228, 255, 0.42);
  background: var(--panel-hover);
  box-shadow: 0 20px 42px -18px rgba(0, 0, 0, 0.72);
}

.card:focus-visible,
.card.is-selected {
  outline: 2px solid rgba(255, 209, 102, 0.78);
  outline-offset: 3px;
  border-color: rgba(255, 209, 102, 0.58);
  background: rgba(20, 25, 38, 0.88);
}

.card:hover::before {
  opacity: 1;
}

.card > a {
  display: block;
  position: relative;
  z-index: 1;
}

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

.name {
  display: block;
  grid-column: 2;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-icon {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.18)),
    linear-gradient(135deg, var(--icon-a), var(--icon-b));
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.26), 0 0 22px color-mix(in srgb, var(--icon-a) 34%, transparent);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.app-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: inherit;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.app-description {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.card[data-tone="cyan"] {
  --icon-a: #71e4ff;
  --icon-b: #8ff0c5;
}

.card[data-tone="gold"] {
  --icon-a: #ffd166;
  --icon-b: #ff8f70;
}

.card[data-tone="rose"] {
  --icon-a: #ff7aa8;
  --icon-b: #b58cff;
}

.card[data-tone="green"] {
  --icon-a: #8ff0c5;
  --icon-b: #d6f06b;
}

.card[data-tone="blue"] {
  --icon-a: #8fb8ff;
  --icon-b: #71e4ff;
}

.card[data-tone="silver"] {
  --icon-a: #d6e0ef;
  --icon-b: #91a7c4;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-column: 2;
  margin-top: 10px;
  position: relative;
  z-index: 2;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--link);
  opacity: 0.9;
  transition: opacity 0.2s;
  width: max-content;
}

.link:hover {
  opacity: 1;
  text-decoration: underline;
}

.link-disabled {
  color: var(--muted);
  opacity: 0.5;
  cursor: default;
}

.link-disabled:hover {
  text-decoration: none;
}

.project-panel {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100vw - 48px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 10, 18, 0.88);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(18px);
  overflow: auto;
  z-index: 10;
}

.panel-empty h2,
.panel-header h2 {
  margin: 4px 0 6px;
  font-size: 24px;
  line-height: 1.05;
}

.panel-empty p,
.panel-header p,
.panel-section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.panel-kicker {
  color: var(--link);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-header {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.panel-header img {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.panel-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.panel-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.panel-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-section code {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #f7fafc;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
}

.backstage-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.backstage-list div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
}

.backstage-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.backstage-list dd {
  margin: 0;
  color: #ffffff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.test-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.test-pass {
  color: #08130d;
  background: #8ff0c5;
}

.test-fail {
  color: #18090c;
  background: #ff7aa8;
}

.test-unknown,
.test-stale {
  color: #091018;
  background: #d6e0ef;
}

.next-list,
.commit-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.next-list li {
  display: grid;
  gap: 3px;
}

.next-list span,
.commit-list span {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.35;
}

.next-list small,
.commit-list time {
  color: var(--muted);
  font-size: 11px;
}

.commit-list li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 2px;
}

.commit-list code {
  grid-row: 1 / span 2;
  margin: 0;
  text-align: center;
}

.empty-row {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  main {
    width: min(100% - 40px, 1200px);
    margin: 0 auto;
    padding: 40px 0;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    width: auto;
    margin-left: 0;
  }

  section {
    width: auto;
    margin-left: 0;
  }

  .grid,
  section:first-of-type .grid {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .header-decor {
    display: none;
  }

  h1 {
    font-size: 46px;
  }

  body {
    background-position: center top;
    background-size: contain;
  }

  .project-panel {
    position: static;
    width: auto;
    max-height: none;
    margin: 0 0 28px;
  }
}

.header-decor {
  position: absolute;
  left: 6px;
  right: auto;
  top: auto;
  bottom: 44px;
  filter: drop-shadow(0 0 10px var(--glow));
  animation: float 6s ease-in-out infinite;
  opacity: 0.58;
}

.header-decor img {
  width: 54px !important;
  height: 54px !important;
  opacity: 0.62 !important;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

footer {
  margin-top: 100px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  animation: pulse-grey 1.5s ease-in-out infinite;
  flex: 0 0 auto;
}

.dot-disabled {
  background: #555;
  animation: none;
  opacity: 0.5;
}

.status-dot.up {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  animation: none;
}

.status-dot.down {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
  animation: none;
}

@keyframes pulse-grey {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
