:root {
  --bg: #140c08;
  --bg-soft: #24130d;
  --surface: rgba(39, 21, 15, 0.82);
  --surface-strong: rgba(54, 28, 20, 0.92);
  --surface-soft: rgba(255, 243, 233, 0.08);
  --ink: #fff3e6;
  --muted: #d9bfad;
  --line: rgba(255, 224, 198, 0.11);
  --accent: #ff6a2b;
  --accent-strong: #ff8b3d;
  --accent-deep: #ff3d1f;
  --gold: #ffc362;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-strong: 0 18px 44px rgba(255, 92, 33, 0.22);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Syne", sans-serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 116, 43, 0.22), transparent 22%),
    radial-gradient(circle at 78% 12%, rgba(255, 195, 98, 0.18), transparent 16%),
    radial-gradient(circle at 50% 78%, rgba(255, 61, 31, 0.16), transparent 22%),
    linear-gradient(180deg, #0d0806 0%, var(--bg) 52%, #1f100a 100%);
}

body,
button,
input,
a {
  -webkit-font-smoothing: antialiased;
}

button,
input,
.eyebrow,
.section-kicker,
.brand,
.nav a,
.status-pill,
.button,
.card-label,
.repo-meta,
.repo-link,
#projectCount,
#projectStatus {
  font-family: "IBM Plex Mono", monospace;
}

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

img {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.site-glow {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.28;
  z-index: 0;
}

.site-glow-one {
  top: -10rem;
  right: -8rem;
  background: rgba(255, 106, 43, 0.46);
}

.site-glow-two {
  left: -10rem;
  bottom: 2rem;
  background: rgba(255, 195, 98, 0.28);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.panel,
.section-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel {
  background: linear-gradient(180deg, rgba(51, 26, 19, 0.88), rgba(24, 13, 10, 0.94));
}

.section-block {
  margin-top: 22px;
  padding: 32px;
  background: linear-gradient(180deg, rgba(34, 18, 13, 0.82), rgba(22, 12, 9, 0.92));
}

.hero {
  padding: 30px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.brand {
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.nav a {
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

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

.hero-grid,
.projects-header,
.about-grid,
.spotlight-grid,
.lottery-layout,
.tone-layout,
.dual-controls,
.tone-stat-grid {
  display: grid;
  gap: 20px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: start;
}

.eyebrow,
.section-kicker,
.card-label {
  margin: 0 0 14px;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p,
dl {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 18px;
  font-size: clamp(3.2rem, 8vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
  line-height: 1.15;
}

.lede,
.section-intro p,
.info-card p,
.spotlight-card p,
.repo-card p,
.about-card p {
  color: var(--muted);
  line-height: 1.7;
}

.lede {
  max-width: 62ch;
  margin-bottom: 0;
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.projects-nav-actions,
.projects-footer-actions {
  margin-top: 0;
}

.projects-footer-actions {
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff5ec;
  box-shadow: var(--shadow-strong);
}

.button.ghost {
  background: rgba(255, 243, 233, 0.08);
  border: 1px solid var(--line);
  color: var(--ink);
}

.button.compact {
  min-height: 44px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 0;
}

.stat-card,
.info-card,
.spotlight-card,
.repo-card,
.about-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.stat-card {
  padding: 18px;
}

.stat-card dt {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.hero-panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 195, 98, 0.22);
  background: rgba(255, 195, 98, 0.08);
  color: var(--gold);
  font-size: 0.78rem;
}

.status-stack {
  display: grid;
  gap: 14px;
}

.info-card,
.spotlight-card,
.about-card {
  padding: 22px;
}

.accent-card {
  background:
    radial-gradient(circle at top right, rgba(255, 195, 98, 0.12), transparent 34%),
    linear-gradient(160deg, rgba(255, 106, 43, 0.18), rgba(255, 61, 31, 0.08));
}

.section-intro {
  max-width: 70ch;
}

.spotlight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.lottery-layout,
.tone-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.projects-header {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: end;
}

.projects-tools {
  display: grid;
  gap: 12px;
}

.search-shell input {
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 243, 233, 0.08);
  color: var(--ink);
}

.search-shell input::placeholder {
  color: rgba(255, 243, 230, 0.54);
}

.project-summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 18px;
}

#projectCount,
#projectStatus {
  margin-bottom: 0;
  color: var(--gold);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.repo-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.repo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
  border-color: rgba(255, 106, 43, 0.34);
}

.repo-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.repo-name {
  margin-bottom: 8px;
  font-size: 1.18rem;
}

.repo-meta {
  color: var(--gold);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.repo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.repo-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 243, 233, 0.06);
  color: var(--muted);
  font-size: 0.76rem;
}

.repo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
}

.repo-link.primary-link {
  background: linear-gradient(135deg, rgba(255, 106, 43, 0.24), rgba(255, 61, 31, 0.16));
  color: var(--ink);
}

.repo-link.secondary-link {
  border: 1px solid var(--line);
  background: rgba(255, 243, 233, 0.05);
  color: var(--muted);
}

.repo-card.is-empty,
.repo-card.is-loading {
  grid-column: 1 / -1;
  text-align: center;
  justify-items: center;
  padding: 36px 24px;
}

.pages-section .repo-card {
  min-height: 100%;
}

.lottery-panel,
.tone-panel,
.lottery-highlight,
.draw-card,
.meaning-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.lottery-panel,
.tone-panel {
  padding: 22px;
}

.lottery-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 320px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 243, 233, 0.05);
}

.mode-chip {
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  padding: 12px 14px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.mode-chip:hover,
.preset-pill:hover,
.repo-link:hover {
  transform: translateY(-1px);
}

.mode-chip.is-active,
.preset-pill.is-active,
.selected-tone {
  box-shadow: var(--shadow-strong);
}

.mode-chip.is-active {
  background: linear-gradient(135deg, rgba(255, 106, 43, 0.24), rgba(255, 61, 31, 0.2));
  color: var(--ink);
}

.lottery-highlight {
  margin-top: 18px;
  padding: 22px;
}

.lottery-list {
  display: grid;
  gap: 12px;
}

.draw-card {
  padding: 18px;
}

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

.balls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 243, 233, 0.1);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
}

.bonus-ball {
  background: linear-gradient(135deg, var(--gold), var(--accent-strong));
  color: #29150d;
}

.lottery-note,
.tone-note,
.meaning-copy {
  color: var(--muted);
  line-height: 1.7;
}

.tone-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px;
}

.control-stack {
  display: grid;
  gap: 18px;
}

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

.control {
  display: grid;
  gap: 10px;
}

.control span {
  font-weight: 700;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 243, 233, 0.08);
  color: var(--ink);
  padding: 15px 16px;
}

input[type="range"] {
  height: 14px;
  margin: 0;
  appearance: none;
  background: linear-gradient(90deg, rgba(255, 106, 43, 0.25), rgba(255, 195, 98, 0.24));
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border: 2px solid rgba(255, 243, 233, 0.92);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  cursor: pointer;
}

.binaural-presets,
.tone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preset-pill,
.load-tone-button {
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 243, 233, 0.08);
  color: var(--ink);
  padding: 11px 15px;
  cursor: pointer;
}

.meaning-card {
  padding: 22px;
}

.meaning-frequency {
  color: var(--gold);
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.visualizer {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  height: 180px;
  margin: 18px 0;
  padding: 22px 16px 16px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 106, 43, 0.18), rgba(255, 195, 98, 0.08));
  overflow: hidden;
}

.bar {
  height: 18%;
  border-radius: 999px 999px 12px 12px;
  background: linear-gradient(180deg, rgba(255, 243, 233, 0.96), rgba(255, 106, 43, 0.68));
  transform-origin: bottom;
  animation: tonePulse 2.5s ease-in-out infinite;
  animation-play-state: paused;
}

.bar:nth-child(2n) {
  animation-duration: 2.1s;
}

.bar:nth-child(3n) {
  animation-duration: 2.9s;
}

.bar:nth-child(4n) {
  animation-duration: 1.9s;
}

.visualizer.playing .bar {
  animation-play-state: running;
}

.about-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.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: 980px) {
  .hero-grid,
  .projects-header,
  .spotlight-grid,
  .about-grid,
  .project-grid,
  .lottery-layout,
  .tone-layout,
  .dual-controls {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 12px;
  }

  .hero,
  .section-block {
    padding: 22px;
  }

  .topbar,
  .project-summary {
    align-items: start;
    flex-direction: column;
  }

  .nav {
    gap: 10px 14px;
  }

  h1 {
    font-size: clamp(2.6rem, 15vw, 4.2rem);
  }
}

@keyframes tonePulse {
  0%,
  100% {
    transform: scaleY(0.32);
    opacity: 0.58;
  }

  40% {
    transform: scaleY(0.98);
    opacity: 1;
  }

  70% {
    transform: scaleY(0.6);
    opacity: 0.82;
  }
}
