:root {
  color-scheme: dark;
  --bg: #0b0f0d;
  --bg-2: #101713;
  --panel: rgba(18, 27, 23, 0.78);
  --panel-solid: #121b17;
  --panel-soft: #17231e;
  --ink: #eef7ef;
  --muted: #93a69b;
  --line: rgba(126, 246, 209, 0.16);
  --line-strong: rgba(126, 246, 209, 0.34);
  --green: #7ef6d1;
  --cyan: #52d7ff;
  --amber: #ffbd6b;
  --danger: #ff7d6b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 8%, rgba(126, 246, 209, 0.12), transparent 28%),
    radial-gradient(circle at 84% 16%, rgba(255, 189, 107, 0.12), transparent 24%),
    linear-gradient(180deg, #0a0f0d 0, #101713 44%, #0b0f0d 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  background:
    linear-gradient(rgba(126, 246, 209, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 246, 209, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
}

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

button,
a.button {
  appearance: none;
}

.button {
  align-items: center;
  background: rgba(126, 246, 209, 0.08);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-height: 42px;
  padding: 0 14px;
  text-align: center;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
  white-space: nowrap;
}

.button:hover,
.button:focus-visible {
  border-color: var(--green);
  outline: none;
  transform: translateY(-1px);
}

.button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.78rem;
}

.button.primary {
  background: linear-gradient(135deg, var(--green), #caffef);
  border-color: rgba(126, 246, 209, 0.78);
  color: #07100d;
}

.button.ghost {
  background: rgba(126, 246, 209, 0.08);
  border-color: var(--line);
  color: var(--ink);
}

.button.buy {
  background: rgba(255, 189, 107, 0.12);
  border-color: rgba(255, 189, 107, 0.36);
  color: var(--amber);
}

.button.disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.hero-actions,
.dialog-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.site-header,
main {
  margin: 0 auto;
  max-width: 1320px;
  position: relative;
  width: min(100% - 40px, 1320px);
  z-index: 1;
}

.site-header {
  padding: 18px 0 0;
}

.nav {
  align-items: center;
  background: rgba(18, 27, 23, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.brand {
  align-items: center;
  color: var(--green);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 900;
  gap: 10px;
  letter-spacing: 0;
}

.brand::before {
  background: linear-gradient(135deg, var(--green), var(--amber));
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(126, 246, 209, 0.28);
  content: "";
  height: 13px;
  width: 13px;
}

.nav-actions {
  display: flex;
  gap: 8px;
}

.nav-actions a {
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 10px;
}

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

main { padding: 18px 0 80px; }

.section { padding: 18px 0 0; }

.section-kicker {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.toolbar {
  align-items: end;
  background: rgba(18, 27, 23, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 22px;
  justify-content: space-between;
  padding: 22px;
}

h2 {
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  line-height: 1;
  margin: 0;
}

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

label {
  color: var(--muted);
  display: grid;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  gap: 6px;
}

input,
select {
  background: #0e1512;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  min-height: 40px;
  min-width: 220px;
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--green);
  outline: none;
}

.projects-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 54px;
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: 250px 1fr;
  min-height: 520px;
  overflow: hidden;
}

.project-card.featured {
  border-color: rgba(126, 246, 209, 0.32);
}

.project-cover {
  background: #080d0b;
  border-bottom: 1px solid var(--line);
  min-height: 250px;
  overflow: hidden;
  position: relative;
}

.project-cover::after {
  background:
    linear-gradient(180deg, transparent 40%, rgba(8, 13, 11, 0.74)),
    repeating-linear-gradient(0deg, rgba(126, 246, 209, 0.06) 0 1px, transparent 1px 4px);
  content: "";
  inset: 0;
  position: absolute;
}

.project-cover img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.project-cover.fallback {
  align-items: center;
  background:
    radial-gradient(circle at 22% 25%, rgba(82, 215, 255, 0.18), transparent 28%),
    radial-gradient(circle at 78% 40%, rgba(255, 189, 107, 0.16), transparent 24%),
    #0e1512;
  display: flex;
  justify-content: center;
}

.project-cover.fallback span {
  color: rgba(126, 246, 209, 0.42);
  font-family: var(--mono);
  font-size: 6rem;
  font-weight: 950;
}

.project-card-body {
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.card-topline {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.type-pill,
.status,
.tags span {
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
  padding: 5px 8px;
}

.type-pill {
  background: rgba(126, 246, 209, 0.12);
  color: var(--green);
}

.status { color: var(--amber); }

.project-card h3 {
  font-size: 1.7rem;
  line-height: 1.05;
  margin: 20px 0 10px;
}

.project-card p {
  color: var(--muted);
  margin: 0;
}

.commerce-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.commerce-meta span {
  background: rgba(255, 189, 107, 0.1);
  border: 1px solid rgba(255, 189, 107, 0.2);
  border-radius: 999px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 5px 8px;
}

.dialog-commerce {
  margin-top: 18px;
}

.addons-panel {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}

.addons-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.addon-item {
  background: rgba(126, 246, 209, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.addon-item strong {
  color: var(--ink);
  line-height: 1.15;
}

.addon-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.addon-item b {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.86rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.tags span {
  background: rgba(255, 255, 255, 0.05);
  color: #b5c5bd;
}

.card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}

.card-actions .button {
  min-width: 104px;
}

.empty-state {
  color: var(--muted);
  font-size: 1rem;
}

code {
  background: rgba(126, 246, 209, 0.1);
  border-radius: 5px;
  color: var(--green);
  padding: 2px 6px;
}

dialog {
  background: transparent;
  border: 0;
  max-height: min(92vh, 1100px);
  max-width: min(1280px, calc(100vw - 32px));
  padding: 0;
  width: 1280px;
}

dialog::backdrop {
  background: rgba(4, 7, 6, 0.78);
  backdrop-filter: blur(6px);
}

.dialog-content {
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: min(92vh, 1100px);
  overflow: auto;
  padding: 28px;
  position: relative;
}

.icon-button {
  background: rgba(126, 246, 209, 0.12);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  float: right;
  font: inherit;
  font-family: var(--mono);
  font-weight: 900;
  height: 36px;
  position: sticky;
  top: 0;
  width: 36px;
  z-index: 2;
}

.dialog-hero {
  align-items: stretch;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.8fr);
}

.dialog-summary {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 720px;
}

.dialog-cover {
  background: #050807;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 360px;
  overflow: hidden;
}

.dialog-cover img {
  display: block;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  width: 100%;
}

.readme {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 24px;
}

.readme h2,
.readme h3,
.readme h4 {
  font-size: 1.55rem;
  line-height: 1.12;
  margin: 28px 0 10px;
}

.readme p,
.readme li {
  color: var(--muted);
  font-size: 1rem;
}

.readme a {
  color: var(--green);
  font-weight: 900;
}

.readme img {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: block;
  height: auto;
  margin: 18px 0 28px;
  max-width: 100%;
}

.checkout-shell {
  display: grid;
  gap: 20px;
}

.admin-shell {
  padding-top: 18px;
}

.admin-hero,
.checkout-box {
  background: rgba(18, 27, 23, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.admin-hero h1 {
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.96;
  margin: 0;
}

.admin-ip-line,
.admin-section-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 18px;
}

.admin-ip-line span,
.admin-section-heading p {
  color: var(--muted);
  margin: 0;
}

.notice {
  background: rgba(126, 246, 209, 0.1);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 900;
  margin-top: 18px;
  padding: 12px 14px;
}

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

.metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  background: rgba(126, 246, 209, 0.07);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 900;
}

.metric-card strong {
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  max-width: 620px;
}

.auth-form input,
.auth-form select {
  width: 100%;
}

.checkout-list {
  color: var(--muted);
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.checkout-list a {
  color: var(--green);
  overflow-wrap: anywhere;
}

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

.analytics-list li {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.analytics-list span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.analytics-list strong {
  color: var(--amber);
  font-family: var(--mono);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

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

  .toolbar {
    align-items: stretch;
    display: grid;
  }

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

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

  .metrics-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .dialog-cover,
  .dialog-cover img {
    max-height: 320px;
  }
}

@media (max-width: 640px) {
  .site-header,
  main {
    width: min(100% - 24px, 1320px);
  }

  .nav,
  .nav-actions,
  .controls,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions .button {
    width: 100%;
  }

  input,
  select {
    min-width: 100%;
  }

  .project-card {
    grid-template-rows: 210px 1fr;
    min-height: 500px;
  }

  .dialog-content {
    padding: 18px 14px;
  }

  .dialog-cover,
  .dialog-cover img {
    max-height: 240px;
    min-width: 0;
  }
}
