:root {
  --bg: #05030a;
  --panel: rgba(8, 5, 18, 0.92);
  --panel-2: rgba(13, 10, 28, 0.96);
  --text: #d8ffd9;
  --muted: #9fcca8;
  --lime: #79ff4d;
  --cyan: #53f7ff;
  --pink: #ff4fd8;
  --yellow: #ffe45c;
  --red: #ff6b6b;
  --border: #b300ff;
  --shadow: 0 0 0 2px #000, 0 0 18px rgba(255, 79, 216, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.crt {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'MS PGothic', 'MS Gothic', 'Courier New', monospace;
  line-height: 1.5;
  background-color: #05030a;
  background-image:
    radial-gradient(circle at top, rgba(83, 247, 255, 0.12), transparent 35%),
    radial-gradient(circle at bottom, rgba(255, 79, 216, 0.12), transparent 30%),
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    url('../images/bg_tile.gif');
  background-size: auto, auto, 4px 4px, 4px 4px, auto;
}

@media (min-width: 761px) {
  body.crt {
    cursor: none;
  }

  a,
  button,
  input,
  textarea,
  select {
    cursor: none;
  }
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0.02), rgba(0,0,0,0.14));
  mix-blend-mode: screen;
  opacity: 0.22;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.08;
  z-index: 1;
}

.petals-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6;
}

.petal {
  position: absolute;
  top: -12vh;
  width: 16px;
  height: 11px;
  background: linear-gradient(135deg, #ffdff2, #ff9fd4);
  border-radius: 14px 14px 14px 3px;
  opacity: 0.85;
  box-shadow: 0 0 12px rgba(255, 173, 218, 0.28);
  animation: petal-fall 14s linear infinite;
  will-change: transform;
}

.petal::after {
  content: '';
  position: absolute;
  inset: 2px 3px auto auto;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
}

@keyframes petal-fall {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(var(--drift, 48px), 115vh, 0) rotate(360deg);
  }
}

.p1 { left: 4%;  animation-duration: 13s; animation-delay: -2s;  --drift: 36px; }
.p2 { left: 12%; animation-duration: 17s; animation-delay: -8s;  --drift: -42px; }
.p3 { left: 21%; animation-duration: 15s; animation-delay: -5s;  --drift: 58px; }
.p4 { left: 32%; animation-duration: 19s; animation-delay: -11s; --drift: -34px; }
.p5 { left: 43%; animation-duration: 14s; animation-delay: -4s;  --drift: 41px; }
.p6 { left: 51%; animation-duration: 18s; animation-delay: -9s;  --drift: -56px; }
.p7 { left: 61%; animation-duration: 16s; animation-delay: -6s;  --drift: 33px; }
.p8 { left: 70%; animation-duration: 20s; animation-delay: -12s; --drift: -47px; }
.p9 { left: 78%; animation-duration: 15s; animation-delay: -3s;  --drift: 54px; }
.p10 { left: 85%; animation-duration: 17s; animation-delay: -10s; --drift: -31px; }
.p11 { left: 91%; animation-duration: 14s; animation-delay: -7s;  --drift: 38px; }
.p12 { left: 96%; animation-duration: 18s; animation-delay: -13s; --drift: -28px; }

img {
  max-width: 100%;
}

.container {
  position: relative;
  z-index: 2;
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.panel {
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.hit-counter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #000;
  border: 2px solid var(--pink);
  padding: 10px 12px;
  color: var(--yellow);
  font-weight: bold;
}

.counter-label {
  color: var(--yellow);
  text-transform: lowercase;
}

.counter {
  letter-spacing: 0.2em;
}

.status-lights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  border: 1px solid currentColor;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.45);
}

.status-pill.online { color: var(--lime); }
.status-pill.sync { color: var(--cyan); }
.status-pill.build { color: var(--yellow); }

.hero {
  padding: 26px 18px 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--yellow);
  text-shadow: 2px 2px 0 #000, 0 0 8px rgba(255, 228, 92, 0.22);
}

.hero-copy {
  max-width: 720px;
  margin: 14px 0 16px;
  color: var(--text);
}

.news-ticker {
  display: block;
  margin: 16px 0;
  padding: 8px 10px;
  background: #001aff;
  color: #fff47a;
  border: 2px dashed var(--cyan);
  font-weight: bold;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pixel-button {
  display: inline-block;
  text-decoration: none;
  color: #000;
  background: var(--lime);
  border: 2px solid #000;
  padding: 10px 14px;
  box-shadow: 3px 3px 0 var(--pink);
  font-weight: bold;
}

.pixel-button:hover,
.pixel-button:focus {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--pink);
}

.pixel-button.alt {
  background: var(--cyan);
}

.pixel-button.small {
  padding: 8px 10px;
  font-size: 0.85rem;
}

main {
  display: block;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.intro-grid.single-column {
  grid-template-columns: 1fr;
}

.terminal-box {
  background: var(--panel-2);
  border: 2px solid var(--cyan);
  padding: 14px;
  min-height: 100%;
}

.window-title {
  margin: -14px -14px 12px;
  padding: 8px 12px;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  color: #120617;
  font-weight: bold;
}

.prompt {
  color: var(--lime);
}

.status-list {
  margin: 0;
  padding-left: 18px;
}

.section-block {
  padding: 16px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  color: var(--yellow);
  margin-bottom: 6px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.repo-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.repo-card,
.loading-card,
.error-card,
.empty-card {
  position: relative;
  background: linear-gradient(180deg, rgba(14, 8, 27, 0.96), rgba(5, 2, 12, 0.96));
  border: 2px solid var(--pink);
  padding: 14px;
  min-height: 190px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.repo-card::before {
  display: none;
}

.card-kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 8px;
  background: var(--red);
  color: #fff9b0;
  font-size: 0.7rem;
  font-weight: bold;
  transform: rotate(2deg);
}

.repo-card h3 {
  margin-bottom: 10px;
  color: var(--cyan);
}

.project-label {
  color: var(--yellow) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.live-card.accent-lime {
  border-color: var(--lime);
}

.live-card.accent-cyan {
  border-color: var(--cyan);
}

.live-card.accent-pink {
  border-color: var(--pink);
}

.live-card.accent-yellow {
  border-color: var(--yellow);
}

.live-card.accent-red {
  border-color: var(--red);
}

.repo-card p {
  margin: 0 0 12px;
  color: var(--text);
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

.repo-tag {
  padding: 3px 6px;
  border: 1px solid currentColor;
  background: rgba(0, 0, 0, 0.35);
}

.repo-tag.lang { color: var(--lime); }
.repo-tag.stars { color: var(--yellow); }
.repo-tag.updated { color: var(--pink); }

.repo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.repo-link {
  color: #000;
  background: var(--yellow);
  border: 2px solid #000;
  text-decoration: none;
  padding: 8px 10px;
  font-weight: bold;
}

.repo-link.secondary {
  background: var(--cyan);
}

.archive-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.archive-toolbar input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 12px;
  background: #090512;
  color: var(--text);
  border: 2px solid var(--cyan);
  font: inherit;
}

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

.link-card {
  display: block;
  text-decoration: none;
  padding: 14px;
  background: var(--panel-2);
  border: 2px solid var(--cyan);
  color: var(--text);
}

.link-card:hover,
.link-card:focus {
  border-color: var(--yellow);
  transform: translateY(-2px);
}

.link-label {
  display: block;
  color: var(--yellow);
  font-weight: bold;
  margin-bottom: 6px;
}

.link-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.webring-panel {
  padding: 16px;
}

.webring {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.webring a {
  color: var(--yellow);
  text-decoration: none;
  font-weight: bold;
}

.footer-panel {
  padding: 14px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.cursor-trail {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan), transparent 70%);
  pointer-events: none;
  opacity: 0.5;
  z-index: 7;
}

.cursor-kitty {
  position: fixed;
  width: 26px;
  height: 26px;
  pointer-events: none;
  z-index: 8;
  transform: translate(-4px, -4px);
}

.cursor-kitty::before,
.cursor-kitty::after {
  content: '';
  position: absolute;
  background: #ffd8ef;
}

.cursor-kitty::before {
  inset: 6px 4px 2px;
  border-radius: 50% 50% 45% 45%;
  box-shadow: 0 0 0 2px #1b0f21;
}

.cursor-kitty::after {
  width: 8px;
  height: 8px;
  left: 9px;
  top: 11px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff7dbf 0 35%, #1b0f21 36% 100%);
}

.cursor-kitty span,
.cursor-kitty i {
  position: absolute;
  display: block;
}

.cursor-kitty span {
  width: 8px;
  height: 10px;
  top: 1px;
  background: #ffd8ef;
  box-shadow: 0 0 0 2px #1b0f21;
}

.cursor-kitty .ear-left {
  left: 3px;
  transform: rotate(-24deg);
  border-radius: 90% 10% 20% 10%;
}

.cursor-kitty .ear-right {
  right: 3px;
  transform: rotate(24deg);
  border-radius: 10% 90% 10% 20%;
}

.cursor-kitty i {
  width: 4px;
  height: 4px;
  top: 13px;
  border-radius: 50%;
  background: #1b0f21;
}

.cursor-kitty .eye-left {
  left: 7px;
}

.cursor-kitty .eye-right {
  right: 7px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .cursor-kitty,
  .cursor-trail {
    display: none !important;
  }

  .container {
    width: min(100% - 16px, 1100px);
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 20px 14px 16px;
  }

  .section-block,
  .webring-panel,
  .footer-panel {
    padding: 14px;
  }

  .petal {
    width: 13px;
    height: 9px;
    opacity: 0.7;
  }

  .repo-grid,
  .repo-grid.compact,
  .link-grid {
    grid-template-columns: 1fr;
  }
}
