@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #151617;
  --text: #F1F2F4;
  --muted: #8d8f93;
  --line: #242628;
  --line-strong: #313336;
  --btn: #f3f6fb;
  --btn-ink: #070a10;
  --mono: "JetBrains Mono", monospace;
  --font-main: "Open Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
a,
a:visited {
  color: #F1F2F4;
}

a:hover,
a:active {
  color: #ffffff;
}

a.btn-primary,
a.btn-primary:visited,
a.btn-primary:hover,
a.btn-primary:active {
  color: var(--btn-ink);
}

a.btn-secondary,
a.btn-secondary:visited,
a.btn-secondary:hover,
a.btn-secondary:active {
  color: #F1F2F4;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

.noise {
  position: fixed;
  inset: 0;
  background: transparent;
  opacity: 1;
  mix-blend-mode: normal;
  filter: none;
  pointer-events: none;
  z-index: -1;
}

.flow-background {
  width: 100%;
  height: 100%;
  display: block;
}

.shell { width: min(1140px, 92vw); margin: 0 auto; }

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "brand nav actions";
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  width: calc(100vw - 48px);
  max-width: none;
  margin-left: calc(50% - 50vw + 24px);
  margin-right: calc(50% - 50vw + 24px);
}

.site-header > .brand {
  grid-area: brand;
  justify-self: start;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  position: relative;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.16),
    0 0 18px rgba(255, 255, 255, 0.08);
}

.brand::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.14) 38%, rgba(255, 255, 255, 0.06) 58%, rgba(255, 255, 255, 0) 76%);
  filter: blur(3px);
  pointer-events: none;
  z-index: 0;
}

.brand-mark {
  width: 29px;
  height: 29px;
  object-fit: contain;
  display: inline-block;
  position: relative;
  z-index: 1;
  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.34))
    drop-shadow(0 0 9px rgba(255, 255, 255, 0.2))
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.12));
}

nav {
  grid-area: nav;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.575rem calc(0.575rem - 6px);
  border-radius: 21px;
  border: 1px solid #242628;
  background: #151517;
  overflow: visible;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(255, 255, 255, 0.02);
}

nav a {
  text-decoration: none;
  color: #F1F2F4;
  font-size: 0.915rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  padding: 1.058rem 1.35rem;
  border-radius: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0;
}

nav a.flash-link {
  color: #F1F2F4;
  isolation: isolate;
  z-index: 3;
}

nav a.flash-link::before {
  content: "";
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 1px;
  right: 1px;
  border-radius: 16px;
  background: transparent;
  border: 0;
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.18),
    0 0 28px rgba(255, 255, 255, 0.1),
    0 0 42px rgba(255, 255, 255, 0.06);
  z-index: -1;
}

nav a.flash-link::after {
  content: "";
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 1px;
  right: 1px;
  border-radius: 16px;
  background: transparent;
  box-shadow:
    0 0 24px rgba(255, 255, 255, 0.08),
    0 0 52px rgba(255, 255, 255, 0.04);
  opacity: 1;
  animation: skillGlowPulse 3.4s ease-in-out infinite;
  z-index: -2;
}

nav a:hover {
  color: #ffffff;
  background: transparent;
}

nav a.flash-link:hover {
  color: #ffffff;
}

nav a.flash-link:hover::before {
  background: #151617;
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.34),
    0 0 38px rgba(255, 255, 255, 0.22),
    0 0 58px rgba(255, 255, 255, 0.14);
}

nav a.flash-link:hover::after {
  top: -5px;
  bottom: -5px;
  left: 1px;
  right: 1px;
  border-radius: 16px;
  background: transparent;
  box-shadow:
    0 0 34px rgba(255, 255, 255, 0.18),
    0 0 72px rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.site-header nav a.flash-link.is-active::before {
  background: transparent;
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.18),
    0 0 28px rgba(255, 255, 255, 0.1),
    0 0 42px rgba(255, 255, 255, 0.06);
  z-index: -1;
}

.site-header nav a.flash-link.is-active::after {
  z-index: -2;
}

.site-header nav a.flash-link.is-active {
  color: #F1F2F4;
}

nav a:not(.flash-link):hover::after {
  content: "";
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 1px;
  right: 1px;
  border-radius: 16px;
  background: #27282A;
  z-index: -1;
}

.site-header nav a.is-active {
  position: relative;
  background: transparent;
  color: #F1F2F4;
}

.site-header nav a.is-active::before {
  content: "";
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 1px;
  right: 1px;
  border-radius: 16px;
  background: #1c1d1e;
  z-index: -1;
}

.top-actions {
  grid-area: actions;
  display: inline-flex;
  gap: 0.48rem;
  justify-self: end;
}
.top-actions .btn-small {
  font-size: 0.915rem;
  font-weight: 400;
  padding: 1.058rem 1.35rem;
  border-radius: 16px;
  line-height: 1;
}

.hero { padding: 2.8rem 0 2rem; }
.eyebrow {
  margin: 0;
  font-family: var(--mono);
  color: #8d8f93;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}
h1 {
  margin: 0.8rem 0 2rem;
  font-size: clamp(2.2rem, 6.6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.hero-copy { color: var(--muted); margin: 0; max-width: 67ch; font-size: 1rem; }
.hero-cta { margin-top: 1.45rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }

.section { padding: 2.2rem 0; }
.section-gap-top { margin-top: 2.7rem; }
.section-highlighted { padding-bottom: 0; }
.section-head h2 { margin: 0; font-size: clamp(1.45rem, 4vw, 2.3rem); letter-spacing: -0.02em; }
.section-head p { margin: 0.44rem 0 0; color: var(--muted); }
.section-head a { color: #F1F2F4; }
.highlighted-accent { color: #799C92; }
.mechanics-accent { color: #F1F2F4; }
.today-accent { color: #F1F2F4; }

.skill-mechanics-link {
  color: #F1F2F4;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 1px;
  padding: 0;
  display: inline;
  transition: color 160ms ease;
}

.skill-mechanics-link:hover {
  color: #ffffff;
}

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.85rem; }
.split-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.85rem; }

.panel, .api-console {
  background: #151517;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 1rem;
}

.panel h3 { margin-top: 0; }
.builders-accent { color: #6F839F; }
.agents-accent { color: #BD9F65; }
.panel p, .panel li, .muted, .tiny, .status { color: var(--muted); }
.panel ul a,
.panel ul a:visited {
  color: #F1F2F4;
}

.panel ul a:hover,
.panel ul a:active {
  color: #ffffff;
}

.skills-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.skill-card {
  background: #151517;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
}

.highlighted-skill {
  text-decoration: none;
  color: inherit;
  display: block;
}

.highlighted-skill .skill-card {
  transition: transform 140ms ease, border-color 140ms ease;
}

.highlighted-skill:hover .skill-card {
  transform: translateY(-2px);
  border-color: #3a3d41;
}

.skill-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; }
.skill-top h3 { margin: 0; font-size: 1rem; }
.skill-price {
  border: 1px solid #313336;
  border-radius: 8px;
  padding: 0.18rem 0.46rem;
  font-size: 0.79rem;
  font-family: var(--mono);
  color: #D7D8DA;
  background: #1b1d1f;
}
.skill-meta { margin: 0.45rem 0 0.2rem; font-size: 0.82rem; color: var(--muted); }
.skill-description { margin: 0.44rem 0 0.8rem; color: #C9CBCE; font-size: 0.92rem; }
.skill-card .skill-description {
  min-height: 3.9em;
  max-height: 3.9em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.stat-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.72rem; }
.chip {
  border: 1px solid #313336;
  background: #1b1d1f;
  color: #A9ACB0;
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  font-size: 0.72rem;
  font-family: var(--mono);
}

.revenue-chip {
  background: #202225;
  border-color: #3b3f44;
  color: #F1F2F4;
  font-size: 0.84rem;
  padding: 0.3rem 0.62rem;
}

.revenue-chip-gross {
  background: #262a2e;
  border-color: #555b62;
  color: #ffffff;
}

.revenue-chip-burn {
  background: #2b2522;
  border-color: #6a5949;
  color: #f0d7b2;
}

.revenue-chip-payout {
  background: #222a24;
  border-color: #4d6252;
  color: #cfe7d6;
}

.submit-form { display: grid; gap: 0.58rem; }
.submit-form label {
  font-size: 0.82rem;
  color: #B8BBBF;
  font-weight: 600;
}
.submit-form input, .submit-form textarea, .submit-form select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #111214;
  color: var(--text);
  font: inherit;
  padding: 0.62rem 0.7rem;
}
.submit-form textarea { min-height: 100px; resize: vertical; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 58.5px;
  border-radius: 16px;
  border: 1px solid transparent;
  padding: 1.058rem 1.35rem;
  font-family: inherit;
  font-size: 0.915rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.btn-small {
  min-height: 58.5px;
  padding: 1.058rem 1.35rem;
  font-size: 0.915rem;
  font-weight: 400;
  border-radius: 16px;
  line-height: 1;
}
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-secondary { background: #151517; border-color: var(--line-strong); color: #F1F2F4; }
.buy-btn { width: 100%; margin-top: auto; }
.preview-btn { width: 100%; margin-top: 0.6rem; }
.skill-card .preview-btn + .buy-btn { margin-top: 0.45rem; }
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wallet-menu {
  position: fixed;
  z-index: 1000;
  min-width: 170px;
  background: #151517;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0.3rem;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}

.wallet-menu-item {
  width: 100%;
  text-align: left;
  border: 0;
  min-height: 58.5px;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  padding: 1.058rem 1.35rem;
  font-family: inherit;
  font-size: 0.915rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.wallet-menu-item:hover {
  background: #27282A;
}

.wallet-menu-item.danger {
  color: #ffafb2;
}

.purchase-list { display: grid; gap: 0.6rem; }
.purchase-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1b1d1f;
  color: var(--text);
  text-decoration: none;
}
.purchase-item span { color: var(--muted); font-size: 0.86rem; }

.modal {
  width: min(520px, 92vw);
  max-width: 92vw;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #151517;
  color: var(--text);
}
.modal::backdrop { background: rgba(4, 8, 14, 0.74); }
.modal-card {
  padding: 1rem;
  max-width: 100%;
  overflow-x: hidden;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; }
#description-full {
  margin: 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.pay-actions { display: grid; gap: 0.62rem; }

.status.error { color: #ff8d8d; }
.status.ok { color: #8bd4aa; }

.docs pre {
  background: #111214;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  overflow: auto;
}
.docs code { font-family: var(--mono); color: #D5D7DA; font-size: 0.82rem; }

.terminal-window {
  border: 1px solid #313336;
  border-radius: 12px;
  background: #111214;
  overflow: hidden;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid #242628;
  background: #151517;
}

.terminal-head .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #5a5d61;
}

.terminal-title {
  margin-left: 0.45rem;
  color: #A9ACB0;
  font-size: 0.78rem;
  font-family: var(--mono);
}

.site-footer {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 1.4rem 0 2rem;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 0.65rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.footer-links a {
  color: #4D4E4F;
  text-decoration: none;
  font-weight: 400;
  font-size: 0.915rem;
  letter-spacing: 0.01em;
  padding: 0;
  line-height: 1.2;
}
.footer-links a + a::before {
  content: "|";
  color: #4D4E4F;
  margin-right: 0.65rem;
}
.footer-links a:hover {
  color: #ffffff;
}

.footer-version {
  color: #4D4E4F;
  font-size: 0.915rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

@media (max-width: 940px) {
  .site-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "actions"
      "nav";
    gap: 0.75rem;
    width: min(1140px, 92vw);
    margin-left: auto;
    margin-right: auto;
  }

  .site-header > .brand,
  .top-actions,
  nav {
    justify-self: stretch;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .btn-small {
    width: 100%;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow: visible;
    gap: 0.5rem;
    padding: 0.5rem;
  }
}

@media (max-width: 620px) {
  .site-header {
    gap: 0.65rem;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  nav a {
    width: 100%;
    min-width: 0;
    text-align: center;
    padding: 0.95rem 0.9rem;
  }

  .top-actions .btn {
    width: 100%;
  }
}


.hero-cta button[disabled] { opacity: 0.55; cursor: not-allowed; }
.tab-active {
  border-color: #313336 !important;
  background: #27282A !important;
  color: #F1F2F4 !important;
}


.skill-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 290px;
}

.skill-main { min-width: 0; overflow: hidden; }
.skill-side { min-width: 0; overflow: hidden; }
.skill-main .hero-cta + .skill-content-panel { margin-top: 0.65rem; }
.skill-ownership-section { margin-top: 0.75rem; }
.skill-content-panel {
  min-width: 0;
  overflow: hidden;
}

.skill-layout .section-head p,
.skill-layout .skill-description,
.skill-layout .muted,
.skill-layout .status,
.skill-layout .tiny,
.skill-layout .chip,
.skill-layout .purchase-item,
.skill-layout .purchase-item span,
.skill-layout .purchase-item strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.skill-overview-copy p {
  margin: 0;
  color: #C9CBCE;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.skill-md-pre {
  margin: 0;
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.skill-md-pre code {
  display: block;
  font-family: var(--mono);
  color: #D5D7DA;
  font-size: 0.82rem;
  line-height: 1.55;
}

.skill-side h3 {
  margin: 0.3rem 0 0.5rem;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

@media (max-width: 920px) {
  .skill-layout { grid-template-columns: 1fr; }
}
