:root {
  --home-display: "Aptos Display", "Segoe UI Variable Display", "Helvetica Neue", Arial, sans-serif;
  --home-body: "Segoe UI Variable Text", "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background:
    radial-gradient(circle at 76% 8%, rgba(67, 97, 238, 0.14), transparent 32rem),
    radial-gradient(circle at 12% 22%, rgba(32, 215, 186, 0.1), transparent 28rem),
    #040a10;
  font-family: var(--home-body);
}

body::after {
  position: fixed;
  z-index: 40;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.045;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(128, 216, 255, 0.34) 4px);
  animation: demo-scanlines 10s linear infinite;
}

.screen .shell {
  width: min(100% - 32px, 1160px);
  min-width: 0;
  margin-inline: auto;
  justify-self: center;
}

.screen .mast {
  min-height: 56px;
  margin-bottom: 18px;
  padding-bottom: 12px;
}

.mast-actions .status-line {
  padding: 7px 10px;
  border: 1px solid rgba(32, 215, 186, 0.18);
  border-radius: 999px;
  background: rgba(32, 215, 186, 0.05);
  white-space: nowrap;
}

.mast-actions .status-line span {
  animation: demo-status-pulse 1.8s ease-out infinite;
}

.demo-ticker {
  overflow: hidden;
  margin-bottom: 14px;
  border-block: 1px solid rgba(128, 255, 91, 0.2);
  color: #80ff5b;
  background: rgba(4, 10, 16, 0.68);
  font: 800 0.62rem/30px var(--font-mono);
  letter-spacing: 0.17em;
  white-space: nowrap;
}

.demo-ticker-track {
  display: flex;
  width: max-content;
  animation: demo-ticker 30s linear infinite;
}

.demo-ticker-track span {
  padding-right: 5rem;
}

.kofi-button {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 999px;
  box-shadow: none;
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(28px, 6vw, 90px);
  margin-bottom: 18px;
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  border: 1px solid rgba(128, 216, 255, 0.22);
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(32, 215, 186, 0.1), transparent 48%),
    linear-gradient(300deg, rgba(67, 97, 238, 0.13), transparent 52%),
    rgba(8, 16, 25, 0.78);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  isolation: isolate;
  animation: demo-panel-in 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.home-hero::before {
  position: absolute;
  z-index: -1;
  inset: -50% auto -50% -18%;
  width: 34%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(32, 215, 186, 0.2), transparent);
  filter: blur(8px);
  transform: skewX(-18deg);
  animation: demo-beam 7s ease-in-out infinite;
}

.home-kicker {
  margin: 0 0 10px;
  color: #20d7ba;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--home-display);
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.home-hero h1 em {
  color: #80ff5b;
  font-style: normal;
  text-shadow: 0 0 22px rgba(128, 255, 91, 0.24);
  animation: demo-title-fader 4.8s ease-in-out infinite alternate;
}

.home-hero-copy > p:not(.home-kicker) {
  max-width: 670px;
  margin: 18px 0 0;
  color: #b5c4d4;
  font-size: 1rem;
  line-height: 1.5;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.home-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid rgba(128, 216, 255, 0.3);
  border-radius: 10px;
  color: #edf4ff;
  background: rgba(128, 216, 255, 0.06);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.home-button:hover,
.home-button:focus-visible {
  border-color: rgba(128, 216, 255, 0.7);
  background: rgba(128, 216, 255, 0.12);
  outline: none;
  transform: translateY(-2px);
}

.home-button.primary {
  border-color: #80ff5b;
  color: #07100b;
  background: #80ff5b;
}

.home-stats {
  display: grid;
  min-width: 180px;
  margin: 0;
  border: 1px solid rgba(128, 216, 255, 0.18);
  border-radius: 14px;
  background: rgba(4, 10, 16, 0.5);
  animation: demo-panel-in 720ms 160ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.home-stats div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
}

.home-stats div + div {
  border-top: 1px solid rgba(128, 216, 255, 0.14);
}

.home-stats dt {
  color: #80ff5b;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 900;
}

.home-stats dd {
  margin: 0;
  color: #9fb1c6;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.screen .project-directory {
  padding: 20px;
  border: 1px solid rgba(126, 157, 191, 0.2);
  border-radius: 20px;
  background: rgba(8, 16, 25, 0.58);
  animation: demo-panel-in 720ms 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.screen .directory-head {
  align-items: center;
  margin-bottom: 14px;
}

.screen .directory-head h2 {
  margin: 0;
  font-family: var(--home-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.screen .directory-head .eyebrow {
  margin-bottom: 3px;
  color: #80ff5b;
}

.screen .signal-card {
  min-width: 118px;
  padding: 8px 10px;
  box-shadow: none;
}

.screen .project-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.screen .project {
  position: relative;
  grid-column: span 3;
  min-height: 104px;
  padding: 13px;
  border-radius: 14px;
  box-shadow: none;
  animation: demo-card-decode 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.screen .project:nth-child(2) { animation-delay: 70ms; }
.screen .project:nth-child(3) { animation-delay: 140ms; }
.screen .project:nth-child(4) { animation-delay: 210ms; }
.screen .project:nth-child(5) { animation-delay: 280ms; }
.screen .project:nth-child(6) { animation-delay: 350ms; }
.screen .project:nth-child(7) { animation-delay: 420ms; }

.screen .project:nth-child(n + 3) {
  grid-column: span 3;
}

.screen .project::after {
  position: absolute;
  right: 12px;
  bottom: 11px;
  color: rgba(237, 244, 255, 0.5);
  content: "↗";
  font-size: 0.8rem;
}

.screen .project.featured {
  border-color: rgba(128, 255, 91, 0.5);
  background:
    linear-gradient(135deg, rgba(128, 255, 91, 0.12), rgba(32, 215, 186, 0.1)),
    rgba(8, 16, 25, 0.82);
}

.screen .project.git-directory {
  grid-column: 1 / -1;
  border-color: rgba(32, 215, 186, 0.42);
  background:
    linear-gradient(100deg, rgba(32, 215, 186, 0.11), rgba(67, 97, 238, 0.12)),
    rgba(8, 16, 25, 0.82);
}

.screen .git-avatar {
  border-color: rgba(128, 255, 91, 0.54);
  color: #80ff5b;
  background: #06110e;
  font: 900 0.72rem var(--font-mono);
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 22px rgba(128, 255, 91, 0.08), 0 0 18px rgba(128, 255, 91, 0.08);
}

@keyframes demo-ticker { to { transform: translateX(-50%); } }
@keyframes demo-scanlines { to { background-position: 0 120px; } }
@keyframes demo-beam { 0%, 12% { transform: translateX(-60%) skewX(-18deg); opacity: 0; } 35%, 58% { opacity: 1; } 88%, 100% { transform: translateX(480%) skewX(-18deg); opacity: 0; } }
@keyframes demo-title-fader { 60% { text-shadow: 2px 0 #20d7ba, -2px 0 #435fee, 0 0 34px rgba(128, 255, 91, 0.58); } }
@keyframes demo-panel-in { from { opacity: 0; transform: translateY(18px); filter: saturate(0); } }
@keyframes demo-card-decode { from { opacity: 0; transform: translateY(14px); clip-path: inset(0 0 100% 0); filter: saturate(0); } to { opacity: 1; transform: none; clip-path: inset(0); filter: none; } }
@keyframes demo-status-pulse { 70%, 100% { box-shadow: 0 0 0 9px rgba(32, 215, 186, 0), 0 0 12px #20d7ba; } }

.screen .logo-avatar,
.screen .logo-avatar.meshtastic {
  width: 62px;
  height: 62px;
}

.screen .project-copy strong {
  font-family: var(--home-display);
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.screen .project-copy small {
  max-width: 34ch;
  margin-top: 4px;
  font-size: 0.78rem;
}

.screen .state {
  min-height: 20px;
  padding: 2px 7px;
  font-size: 0.62rem;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 4px 0;
  color: #8295aa;
  font-size: 0.72rem;
}

.home-footer p {
  margin: 0;
}

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

.home-footer a {
  color: #9fb1c6;
  text-decoration: none;
}

.home-footer a:hover {
  color: #20d7ba;
}

@media (max-width: 820px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .home-stats div {
    display: block;
  }

  .home-stats div + div {
    border-top: 0;
    border-left: 1px solid rgba(128, 216, 255, 0.14);
  }

  .screen .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen .project,
  .screen .project:nth-child(n + 3) {
    grid-column: span 1;
  }

  .screen .project.git-directory {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .screen .mast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .mast-actions {
    width: auto;
  }

  .mast-actions .status-line {
    display: none;
  }

  .kofi-button {
    width: auto;
    min-height: 36px;
    padding-inline: 12px;
  }

  .home-hero {
    gap: 22px;
    padding: 24px 20px;
    border-radius: 18px;
  }

  .home-hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.1rem);
  }

  .home-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-button {
    padding-inline: 10px;
    font-size: 0.75rem;
  }

  .home-stats {
    min-width: 0;
  }

  .home-stats div {
    padding: 10px;
  }

  .home-stats dd {
    font-size: 0.55rem;
  }

  .screen .project-directory {
    padding: 14px;
  }

  .screen .directory-head {
    flex-direction: row;
  }

  .screen .signal-card {
    width: auto;
    text-align: right;
  }

  .screen .project-grid {
    grid-template-columns: 1fr;
  }

  .screen .project {
    min-height: 96px;
  }

  .home-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after,
  .demo-ticker-track,
  .home-hero,
  .home-hero::before,
  .home-hero h1 em,
  .home-stats,
  .screen .project-directory,
  .home-button,
  .screen .project {
    animation: none;
    transition: none;
  }
}
