:root {
  --palette-grey-0: #FFFFFF;
  --palette-grey-10: #F8F9FC;
  --palette-grey-15: #F0F1F5;
  --palette-grey-20: #EFF2F7;
  --palette-grey-50: #E6EAF0;
  --palette-grey-200: #CDD4DC;
  --palette-grey-800: #45474D;
  --palette-grey-900: #2F3034;
  --palette-grey-1200: #121317;

  --surface: var(--palette-grey-0);
  --on-surface: var(--palette-grey-1200);
  --on-surface-variant: var(--palette-grey-800);
  --surface-container: var(--palette-grey-10);
  --surface-container-high: var(--palette-grey-20);
  --surface-container-higher: var(--palette-grey-50);
  --outline: rgba(33, 34, 38, 0.12);
  --outline-variant: rgba(33, 34, 38, 0.06);

  --accent-blue: #3186FF;
  --accent-green: #10B981;
  --page-header: 72px;
  --radius-pill: 999px;
  --radius-card: 28px;
  --radius-lg: 36px;
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scroll-padding-top: var(--page-header);
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: clip; background: var(--surface); }
a { color: inherit; text-decoration: none; }
main > section, #jungle-downloads { scroll-snap-align: start; }
#jungle-im { scroll-snap-align: none; }
body > footer { scroll-snap-align: end; }

/* HEADER & NAV */
.header-wrapper {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.header-wrapper.scrolled { border-bottom-color: var(--outline-variant); }
header {
  max-width: 1440px; margin: 0 auto; padding: 0.85rem 2.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em;
}
.brand-mark { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
nav { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
nav a {
  padding: 0.55rem 1.05rem; border-radius: var(--radius-pill);
  font-size: 0.92rem; color: var(--on-surface-variant); font-weight: 450; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
nav a:hover { color: var(--on-surface); background: rgba(183, 191, 217, 0.2); }
nav a[aria-current="page"] { background: #e7f0e9; color: #173b2e; font-weight: 650; }
nav a:focus-visible, .brand:focus-visible, .site-footer a:focus-visible {
  outline: 2px solid #1e704e; outline-offset: -2px;
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.68rem 1.45rem; border-radius: var(--radius-pill);
  font-size: 0.92rem; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; transition: all 0.18s ease-out; white-space: nowrap;
}
.btn-primary { background: var(--on-surface); color: var(--surface); }
.btn-primary:hover { background: var(--palette-grey-900); transform: translateY(-1px); }
.btn-secondary {
  background: rgba(183, 191, 217, 0.14); color: var(--on-surface);
  border-color: var(--outline-variant);
}
.btn-secondary:hover { background: var(--palette-grey-15); }
.btn-lg { padding: 0.92rem 1.9rem; font-size: 1.05rem; }

/* HERO */
#hero {
  position: relative; min-height: calc(100svh - var(--page-header));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: clamp(3.5rem, 8vh, 7rem) 1.25rem; overflow: hidden;
}
#particle-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.hero-content {
  position: relative; z-index: 1; max-width: 960px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  animation: heroReveal 0.8s var(--ease-out-expo) both;
}
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-title {
  font-size: clamp(2.75rem, 6vw, 5.1rem); font-weight: 500;
  line-height: 1.08; letter-spacing: -0.035em;
}
.hero-desc {
  max-width: 640px; font-size: 1.15rem; color: var(--on-surface-variant); line-height: 1.6;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 0.5rem; }

/* JUNGLEIM PRODUCT SHOWCASES */
.showcase-section {
  --demo-ink: #142e24;
  --demo-muted: #52665d;
  --demo-line: #dfe8e2;
  --demo-surface: #f2f6f3;
  --demo-green: #1e704e;
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  min-height: calc(100svh - var(--page-header));
  padding: clamp(2.5rem, 5.5vh, 5rem) clamp(1.25rem, 4vw, 2.5rem);
  display: grid;
  align-content: center;
  gap: clamp(1.25rem, 3.2vh, 2rem);
}
.showcase-section + .showcase-section { border-top: 1px solid var(--outline-variant); }
.showcase-heading {
  display: flex; justify-content: space-between; align-items: end;
  flex-wrap: wrap; gap: 0.6rem 1.5rem;
}
.showcase-heading .statement-heading { color: var(--demo-ink); }
.showcase-heading p { color: var(--demo-muted); font-size: 0.95rem; }
.stage-window {
  display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr);
  height: clamp(430px, 62svh, 540px);
  overflow: hidden; border: 1px solid var(--demo-line);
  border-radius: 16px; background: var(--surface); color: var(--demo-ink);
}
.demo-ai { grid-template-columns: minmax(0, 200px) minmax(0, 1fr) minmax(0, 220px); }
.demo-rail, .demo-workbench { background: var(--demo-surface); padding: 1.15rem; min-width: 0; }
.demo-rail { border-right: 1px solid var(--demo-line); }
.demo-ai .demo-rail { background: #173b2e; color: #f3faf5; border: 0; }
.demo-brand { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 1.3rem; }
.demo-options { display: grid; gap: 0.45rem; }
.demo-choice {
  display: flex; align-items: center; gap: 0.6rem; min-width: 0; min-height: 48px;
  border: 0; border-radius: 10px; padding: 0.6rem; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.demo-choice:hover { background: #e8f0eb; }
.demo-choice[aria-pressed="true"] { background: #dfede3; }
.demo-ai .demo-choice:hover { background: #204a39; }
.demo-ai .demo-choice[aria-pressed="true"] { background: #2b5544; }
.demo-choice > span:not(.demo-avatar) { min-width: 0; }
.demo-choice strong, .demo-choice small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.demo-choice strong { font-size: 0.88rem; font-weight: 600; }
.demo-choice small { color: var(--demo-muted); font-size: 0.74rem; margin-top: 0.12rem; }
.demo-ai .demo-choice { display: block; }
.demo-ai .demo-choice small { color: #cae0d3; }
.demo-choice:focus-visible, .demo-send:focus-visible, .demo-messages:focus-visible {
  outline: 2px solid var(--demo-green); outline-offset: -2px;
}
.demo-ai .demo-choice:focus-visible { outline-color: #bce6c9; }
.demo-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.demo-header {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1.3rem; border-bottom: 1px solid var(--demo-line);
}
.demo-header h2 { font-weight: 650; font-size: 1.05rem; }
.demo-header p, .demo-model { color: var(--demo-muted); font-size: 0.76rem; }
.demo-mode {
  background: #e3efe7; color: #255940; border-radius: var(--radius-pill);
  font-size: 0.76rem; padding: 0.22rem 0.65rem; white-space: nowrap;
}
.demo-workbench { border-left: 1px solid var(--demo-line); }
.demo-workbench h2 { font-size: 0.9rem; font-weight: 650; margin-bottom: 0.9rem; }
.demo-workbench ol { list-style-position: inside; color: var(--demo-muted); font-size: 0.82rem; }
.demo-workbench li { padding: 0.65rem 0; border-top: 1px solid var(--demo-line); }
.demo-messages {
  overflow: auto; scrollbar-color: #a8bfb0 transparent; padding: 1.15rem 1.3rem;
  display: flex; flex-direction: column; gap: 0.85rem;
}
.demo-date { text-align: center; color: var(--demo-muted); font-size: 0.74rem; }
.demo-message { display: flex; align-items: start; gap: 0.6rem; max-width: 90%; }
.demo-message.is-self { align-self: end; flex-direction: row-reverse; }
.demo-avatar {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: #e4efe7; color: #285940;
  font-size: 0.78rem; font-weight: 650;
}
.demo-ai .demo-message:not(.is-self) .demo-avatar { background: #173b2e; color: #fff; }
.demo-meta { color: var(--demo-muted); font-size: 0.75rem; margin-bottom: 0.22rem; }
.is-self .demo-meta { text-align: right; }
.demo-message-body { min-width: 0; }
.demo-bubble {
  background: var(--demo-surface); border-radius: 11px; padding: 0.58rem 0.8rem;
  font-size: 0.9rem; line-height: 1.55; overflow-wrap: anywhere;
}
.is-self .demo-bubble { background: #dfede3; }
.demo-answer { font-size: 0.9rem; line-height: 1.6; overflow-wrap: anywhere; }
.demo-answer ol { padding-left: 1.25rem; margin-top: 0.4rem; }
.demo-answer li + li { margin-top: 0.18rem; }
.demo-answer pre {
  overflow: auto; margin-top: 0.5rem; padding: 0.65rem 0.8rem; border-radius: 9px;
  background: var(--demo-surface); font: 0.8rem/1.55 'JetBrains Mono', monospace;
}
.demo-composer { border-top: 1px solid var(--demo-line); padding: 0.75rem 1.3rem; }
.demo-composer, .demo-input-row { display: flex; align-items: center; gap: 0.55rem; }
.demo-ai .demo-composer { display: block; }
.demo-composer input {
  flex: 1; width: 100%; min-width: 0; min-height: 42px;
  border: 1px solid var(--demo-line); border-radius: 10px; padding: 0.5rem 0.7rem;
  background: var(--demo-surface); color: var(--demo-ink); font: inherit; font-size: 0.86rem;
}
.demo-composer input::placeholder { color: var(--demo-muted); }
.demo-composer input:focus-visible { outline: 2px solid var(--demo-green); outline-offset: -2px; }
.demo-send {
  flex: none; min-height: 42px; padding: 0.45rem 0.9rem;
  border: 0; border-radius: 10px; background: var(--demo-green); color: #fff;
  font: inherit; font-size: 0.86rem; cursor: pointer;
}
.demo-send:hover { background: #185b40; }
.demo-model { text-align: right; margin-top: 0.35rem; }
@media (max-width: 960px) {
  .demo-ai { grid-template-columns: minmax(0, 185px) minmax(0, 1fr); }
  .demo-workbench { display: none; }
}
@media (max-width: 640px) {
  .showcase-section { padding-block: 1.7rem; }
  .stage-window, .demo-ai {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    height: clamp(430px, 66svh, 510px);
  }
  .demo-rail { padding: 0.6rem; border-right: 0; border-bottom: 1px solid var(--demo-line); }
  .demo-brand { margin: 0 0 0.35rem 0.35rem; font-size: 0.8rem; }
  .demo-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.25rem; }
  .demo-choice { justify-content: center; text-align: center; padding-inline: 0.2rem; min-height: 42px; }
  .demo-choice strong { font-size: 0.75rem; }
  .demo-choice small, .demo-choice .demo-avatar { display: none; }
  .demo-header, .demo-messages, .demo-composer { padding-inline: 0.75rem; }
  .demo-message { max-width: 95%; }
  .demo-message .demo-avatar { width: 27px; height: 27px; }
}

.mini-pill {
  font-size: 0.75rem; padding: 0.25rem 0.65rem; border-radius: var(--radius-pill);
  background: var(--surface-container); border: 1px solid var(--outline-variant);
  color: var(--on-surface-variant); font-family: 'JetBrains Mono', monospace;
}

/* STATEMENT & FLOATING ICONS */
.section-container { max-width: 1320px; margin: 0 auto; padding: 6rem 2.5rem; }
.statement-heading {
  font-size: clamp(2rem, 4vw, 3.35rem); font-weight: 450;
  line-height: 1.18; letter-spacing: -0.028em; max-width: 26ch;
}
.statement-heading .muted { color: var(--on-surface-variant); }
.typewriter-cursor {
  display: inline-block; width: 3px; height: 0.95em; vertical-align: -0.1em;
  margin-left: 4px; background: linear-gradient(180deg, #3186FF, #10B981);
  animation: cursorBlink 0.9s infinite alternate;
}
@keyframes cursorBlink { from { opacity: 1; } to { opacity: 0.15; } }
.icon-strip-wrapper {
  width: 100%; padding: 4.5rem 0;
  overflow: hidden; display: flex; gap: 0.85rem; align-items: center; justify-content: center;
}
.floating-icon {
  flex: 0 0 clamp(4.2rem, 7vw, 5.6rem); aspect-ratio: 1; border-radius: 50%;
  background: rgba(183, 191, 217, 0.12); border: 1px solid var(--outline-variant);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  animation: wobble 3.8s ease-in-out infinite alternate;
}
.floating-icon:nth-child(odd) { animation-delay: -1.9s; }
.floating-icon:nth-child(3n) { animation-delay: -0.9s; }
@keyframes wobble { from { transform: translateY(18px); } to { transform: translateY(-18px); } }

/* SPLIT FEATURES */
.split-features {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 4rem; align-items: start; margin-top: 2rem;
}
.feature-text-list { display: flex; flex-direction: column; }
.feature-step {
  padding: 4.5rem 0; border-top: 1px solid var(--outline-variant);
  opacity: 0.38; transition: opacity 0.35s ease; cursor: pointer;
}
.feature-step.active { opacity: 1; }
.feature-step-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
  color: var(--accent-blue); margin-bottom: 0.6rem; display: inline-block;
}
.feature-step h2 { font-size: 1.85rem; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 0.85rem; }
.feature-step p { font-size: 1.05rem; color: var(--on-surface-variant); line-height: 1.65; max-width: 46ch; }
.feature-visual-sticky {
  position: sticky; top: calc(var(--page-header) + 1.25rem); background: var(--surface-container);
  border: 1px solid var(--outline); border-radius: var(--radius-lg);
  padding: 2.25rem; min-height: 440px; display: flex; flex-direction: column; justify-content: space-between;
}
.visual-panel { display: none; flex-direction: column; gap: 1.25rem; animation: fadePanel 0.35s ease both; }
.visual-panel.active { display: flex; }
@keyframes fadePanel { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.code-window {
  background: var(--palette-grey-1200); color: var(--palette-grey-10);
  border-radius: 20px; padding: 1.5rem; font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem; line-height: 1.7; overflow-x: auto;
}
.code-comment { color: #7C8594; }
.code-kw { color: #749BFF; }
.code-str { color: #56D364; }
.code-fn { color: #D2A8FF; }

/* JUNGLEIM DOWNLOADS */
#jungle-im {
  border-top: 1px solid var(--outline-variant);
  padding: clamp(3.25rem, 6vw, 5.75rem) clamp(1.25rem, 3vw, 2.5rem);
}
.section-header-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 2rem; margin-bottom: 3.5rem; flex-wrap: wrap;
}
.section-header-row p { max-width: 42ch; color: var(--on-surface-variant); font-size: 1.08rem; line-height: 1.6; }
#jungle-downloads .section-header-row { gap: 0.75rem 2rem; margin-bottom: 2rem; }
.jungle-editions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.jungle-edition {
  background: var(--surface-container); border: 1px solid var(--outline-variant);
  border-radius: 16px; padding: clamp(1.15rem, 2.65vw, 2.1rem);
  display: flex; flex-direction: column; gap: 1.25rem;
}
.jungle-edition h2 { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 0.35rem; }
.jungle-edition p { color: var(--on-surface-variant); font-size: 0.94rem; line-height: 1.55; }
.jungle-platforms { list-style: none; margin-top: auto; border-top: 1px solid var(--outline); }
.jungle-platforms li + li { border-top: 1px solid var(--outline-variant); }
.jungle-platform {
  min-height: 4.3rem; padding: 0.65rem 0.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 0.6rem;
}
.jungle-platform:hover { background: var(--surface-container-high); }
.jungle-platform:focus-visible, .jungle-release-link:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.jungle-platform-label { min-width: 0; }
.jungle-platform-label strong { display: block; font-size: 1rem; font-weight: 600; }
.jungle-platform-label small {
  display: block; color: var(--on-surface-variant); font-size: 0.8rem;
  line-height: 1.45; overflow-wrap: anywhere;
}
.jungle-platform-file {
  flex: none; padding: 0.42rem 0.72rem; border-radius: var(--radius-pill);
  background: var(--on-surface); color: var(--surface); font-size: 0.8rem; font-weight: 500;
}
.jungle-release-link { margin-top: 1.25rem; }

/* CAROUSEL */
#solutions { border-top: 1px solid var(--outline-variant); }
.carousel-track {
  display: flex; gap: 1.75rem; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 1.5rem; scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.case-card {
  flex: 0 0 min(520px, 84vw); scroll-snap-align: start;
  background: var(--surface-container); border: 1px solid var(--outline-variant);
  border-radius: var(--radius-card); overflow: hidden; display: flex; flex-direction: column;
}
.case-visual {
  height: 220px; background: linear-gradient(135deg, #121317 0%, #212226 100%);
  color: var(--surface); padding: 2rem; display: flex; flex-direction: column;
  justify-content: space-between; position: relative; overflow: hidden;
}
.case-visual-title { font-size: 1.65rem; font-weight: 500; letter-spacing: -0.02em; z-index: 1; }
.case-body { padding: 2rem; display: flex; flex-direction: column; gap: 0.85rem; flex: 1; }
.case-body h3 { font-size: 1.25rem; font-weight: 500; }
.case-body p { color: var(--on-surface-variant); font-size: 0.96rem; line-height: 1.6; flex: 1; }
.case-link { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.92rem; font-weight: 500; margin-top: 0.5rem; }

/* CALLOUT & CTA */
.dual-callout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  text-align: center; padding: 4rem 0; border-top: 1px solid var(--outline-variant);
}
.callout-box {
  background: var(--surface-container); border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg); padding: 4.5rem 2rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem;
}
.callout-box h2 { font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 450; line-height: 1.2; }
.callout-box h2 span { display: block; color: var(--on-surface-variant); }
.dark-cta-card {
  background: var(--palette-grey-1200); color: var(--surface);
  border-radius: var(--radius-lg); padding: clamp(3rem, 6vw, 5.5rem);
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 2.5rem; margin-bottom: 4rem;
}
.dark-cta-card h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 450; line-height: 1.15; max-width: 22ch; }
.dark-cta-card .btn-light { background: var(--surface); color: var(--on-surface); }
.dark-cta-card .btn-outline-light {
  background: rgba(255, 255, 255, 0.1); color: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* FOOTER */

@media (max-width: 1024px) {
  :root { --page-header: 104px; }
  header { padding: 0.75rem 1.25rem; flex-wrap: wrap; gap: 0.55rem 0.75rem; }
  .split-features { grid-template-columns: minmax(0, 1fr); }
  .feature-visual-sticky { position: static; }
  .feature-step { padding: 2.5rem 0; opacity: 1; }
  .dual-callout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .jungle-editions { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .dark-cta-card { padding: 1.5rem; }
  .dark-cta-card .btn { display: block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  .hero-content, .floating-icon, .typewriter-cursor, .visual-panel { animation: none; }
}
@media (max-width: 360px) {
  .stage-window, .demo-ai { height: clamp(410px, 62svh, 480px); }
}
main { min-height: calc(100svh - var(--page-header) - 4.5rem); }
.hero-title { text-wrap: balance; }
.site-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  max-width: 1320px; margin: 0 auto; padding: 1.4rem clamp(1.25rem, 4vw, 2.5rem);
  gap: 0.65rem 1.5rem; border-top: 1px solid var(--outline-variant);
  color: var(--on-surface-variant); font-size: 0.88rem;
}
.site-footer a { text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 820px) {
  nav a { padding: 0.45rem 0.65rem; font-size: 0.87rem; }
}
@media (max-width: 560px) {
  header { align-items: start; }
  nav { flex: 1 0 100%; overflow-x: auto; padding-bottom: 2px; }
  nav a { padding-inline: 0.48rem; }
  .hero-cta .btn { padding-inline: 1.15rem; }
}
