:root {
  --appforge-font-family:
    "OpenAI Sans",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;

  --bg: #050b18;
  --panel: rgba(7, 17, 34, .76);
  --panel2: rgba(255, 255, 255, .045);
  --line: rgba(116, 192, 255, .20);
  --text: #edf6ff;
  --muted: #9fb4cf;
  --soft: #c7d7eb;
  --cyan: #5cc8ff;
  --green: #58f0a7;
  --violet: #a78bfa;
  --amber: #ffd166;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(92,200,255,.14), transparent 30%),
    radial-gradient(circle at 88% 0%, rgba(167,139,250,.12), transparent 30%),
    linear-gradient(135deg, #030712, #07152b 48%, #050b18);
  color: var(--text);
  font-family: var(--appforge-font-family);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
}

.public-shell {
  min-height: 100vh;
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 22px;
  border-bottom: 1px solid rgba(116,192,255,.14);
  background: rgba(4, 10, 24, .88);
  backdrop-filter: blur(18px);
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  text-decoration: none;
}

.public-logo {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.9), transparent 22%),
    linear-gradient(135deg, var(--cyan), var(--green) 55%, var(--violet));
  box-shadow: 0 0 28px rgba(92,200,255,.24);
}

.public-brand b {
  display: block;
  color: #f5fbff;
  font-size: .98rem;
  letter-spacing: -.02em;
}

.public-brand span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  margin-top: 1px;
}

.public-menu-toggle {
  display: none;
  margin-left: auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.public-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.public-links a,
.public-links button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #dceeff;
  background: transparent;
  text-decoration: none;
  font-size: .76rem;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.public-links a:hover,
.public-links a.active {
  border-color: rgba(92,200,255,.28);
  background: rgba(92,200,255,.08);
  color: #ffffff;
}

.public-login {
  color: #04101f !important;
  border: 0 !important;
  background: linear-gradient(135deg, var(--cyan), var(--green)) !important;
  font-weight: 950 !important;
}

.public-main {
  width: min(1240px, calc(100vw - 36px));
  margin: 0 auto;
}

.page-hero {
  padding: clamp(52px, 8vw, 96px) 0 clamp(32px, 5vw, 58px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(88,240,167,.28);
  border-radius: 999px;
  background: rgba(88,240,167,.08);
  color: #bfffe2;
  font-size: .74rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(88,240,167,.8);
}

h1 {
  max-width: 920px;
  margin: 18px 0 0;
  font-size: clamp(2.25rem, 6vw, 5.7rem);
  line-height: .98;
  letter-spacing: -.075em;
  font-weight: 920;
}

h1 span,
.gradient-text {
  background: linear-gradient(90deg, #eaf6ff 0%, #8be4ff 34%, #a7f3d0 65%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 840px;
  margin: 20px 0 0;
  color: var(--soft);
  font-size: clamp(.98rem, 1.35vw, 1.18rem);
  line-height: 1.72;
}

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

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(116,192,255,.24);
  background: rgba(255,255,255,.055);
  color: var(--text);
  font-size: .84rem;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary {
  border: 0;
  color: #04101f;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 14px 44px rgba(92,200,255,.22);
}

.section {
  padding: clamp(28px, 4vw, 50px) 0;
}

.section-head {
  max-width: 820px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.7vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: -.045em;
  background: linear-gradient(90deg, #eaf6ff 0%, #8be4ff 40%, #a7f3d0 76%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-head p {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.62;
  font-size: .96rem;
}

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

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

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(92,200,255,.075), rgba(88,240,167,.045)),
    var(--panel2);
  padding: 18px;
  min-height: 160px;
  box-shadow: 0 16px 52px rgba(0,0,0,.18);
}

.card h3 {
  margin: 0 0 9px;
  color: #eaf6ff;
  font-size: 1.02rem;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.card p,
.card li {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.56;
}

.card ul {
  margin: 0;
  padding-left: 18px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.pills span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(88,240,167,.23);
  border-radius: 999px;
  background: rgba(88,240,167,.07);
  color: #bfffe2;
  font-size: .70rem;
  font-weight: 850;
}

.big-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 20%, rgba(92,200,255,.13), transparent 34%),
    radial-gradient(circle at 86% 34%, rgba(88,240,167,.10), transparent 34%),
    var(--panel);
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 0 24px 86px rgba(0,0,0,.25);
}

.flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}

.flow-step {
  min-height: 88px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  border: 1px solid rgba(116,192,255,.26);
  border-radius: 18px;
  background: rgba(255,255,255,.05);
  color: #edf6ff;
  font-weight: 900;
  font-size: .78rem;
}

.flow-step b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #04101f;
}

/* Intelligence animation */
.intelligence-stage {
  min-height: 420px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 16px;
  align-items: center;
}

.intel-side,
.intel-engine {
  min-height: 300px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(116,192,255,.20);
  border-radius: 26px;
  background: rgba(4,12,27,.58);
  padding: 18px;
}

.intel-orb {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 210px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 32%, rgba(255,255,255,.90), rgba(92,200,255,.50) 17%, transparent 34%),
    radial-gradient(circle at 64% 62%, rgba(167,139,250,.55), transparent 38%),
    radial-gradient(circle at center, rgba(92,200,255,.34), rgba(10,24,54,.28) 62%, transparent 72%);
  border: 1px solid rgba(139,228,255,.52);
  box-shadow: 0 0 48px rgba(92,200,255,.42);
  animation: pulseOrb 3.8s ease-in-out infinite;
}

.intel-orb::before,
.intel-orb::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 999px;
  border: 1px dashed rgba(191,255,226,.42);
  animation: spin 16s linear infinite;
}

.intel-orb::after {
  inset: 19%;
  border-color: rgba(167,139,250,.46);
  animation-direction: reverse;
  animation-duration: 10s;
}

.intel-orb span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f8fbff;
  font-size: 3.2rem;
  font-weight: 950;
}

.intel-chain {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.intel-chain::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 3px;
  background: linear-gradient(90deg, rgba(92,200,255,.25), rgba(88,240,167,.85), rgba(167,139,250,.40));
  box-shadow: 0 0 22px rgba(92,200,255,.35);
}

.intel-chain .flow-step {
  position: relative;
  z-index: 2;
  animation: nodePulse 5.6s ease-in-out infinite;
}

.intel-chain .flow-step:nth-child(2) { animation-delay: .5s; }
.intel-chain .flow-step:nth-child(3) { animation-delay: 1s; }
.intel-chain .flow-step:nth-child(4) { animation-delay: 1.5s; }
.intel-chain .flow-step:nth-child(5) { animation-delay: 2s; }
.intel-chain .flow-step:nth-child(6) { animation-delay: 2.5s; }

.engine-layer {
  margin: 10px 0;
  border: 1px solid rgba(88,240,167,.24);
  border-radius: 18px;
  padding: 12px;
  background: rgba(88,240,167,.06);
  animation: enginePulse 4.2s ease-in-out infinite;
}

.engine-layer b {
  color: #bfffe2;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* AppCloud marketplace */
.market-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
}

.market-search {
  min-height: 44px;
  width: 100%;
  border: 1px solid rgba(116,192,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  padding: 10px 15px;
  outline: none;
}

.market-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.market-filter {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid rgba(116,192,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-size: .76rem;
  font-weight: 900;
  cursor: pointer;
}

.market-filter.active {
  border: 0;
  color: #04101f;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.market-card {
  position: relative;
  overflow: hidden;
  min-height: 250px;
}

.market-card::before {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -84px;
  top: -84px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(92,200,255,.18), transparent 68%);
}

.market-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.badge {
  min-height: 24px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 950;
  text-transform: uppercase;
  color: #04101f;
  background: var(--green);
}

.badge.new { background: var(--cyan); }
.badge.trending { background: var(--amber); }
.badge.featured { background: var(--violet); color: #fff; }

.hidden {
  display: none !important;
}

.public-footer {
  margin-top: 40px;
  padding: 28px 0 42px;
  border-top: 1px solid rgba(116,192,255,.14);
  color: var(--muted);
  font-size: .82rem;
}

@keyframes pulseOrb {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes nodePulse {
  0%, 100% { border-color: rgba(116,192,255,.23); }
  50% { border-color: rgba(88,240,167,.58); box-shadow: 0 0 28px rgba(88,240,167,.18); }
}

@keyframes enginePulse {
  0%, 100% { border-color: rgba(88,240,167,.22); }
  50% { border-color: rgba(92,200,255,.52); }
}

@media (max-width: 1120px) {
  .public-menu-toggle {
    display: inline-flex;
  }

  .public-links {
    position: absolute;
    top: calc(100% + 10px);
    right: 18px;
    display: none;
    width: min(360px, calc(100vw - 36px));
    padding: 12px;
    border: 1px solid rgba(116,192,255,.22);
    border-radius: 22px;
    background: rgba(5,13,30,.96);
    box-shadow: 0 24px 80px rgba(0,0,0,.42);
    backdrop-filter: blur(18px);
  }

  .public-links.open {
    display: grid;
    grid-template-columns: 1fr;
  }

  .public-links a,
  .public-links button {
    width: 100%;
    min-height: 40px;
  }

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

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

  .intelligence-stage {
    grid-template-columns: 1fr;
  }

  .intel-chain {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .public-main {
    width: min(100%, calc(100vw - 26px));
  }

  .public-nav {
    padding: 12px 14px;
  }

  .public-brand {
    min-width: 0;
  }

  .public-brand span {
    display: none;
  }

  .grid,
  .grid.four,
  .flow,
  .intel-chain {
    grid-template-columns: 1fr;
  }

  .market-toolbar {
    grid-template-columns: 1fr;
  }

  .market-filters {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* APPFORGE_PUBLIC_COMPACT_TYPOGRAPHY_RULES_START */
@import url("./appforge-public-typography-rules.css");
/* APPFORGE_PUBLIC_COMPACT_TYPOGRAPHY_RULES_END */
