/* ===== JellyClaw shared styles ===== */

:root {
  --bg: #17111f;
  --bg-soft: #201829;
  --pink: #ff4fa3;
  --pink-bright: #ff6db5;
  --pink-deep: #e03d8f;
  --text: #f2eef6;
  --text-dim: #a99cb8;
  --card: #241b30;
  --card-border: #372a47;
}

[data-theme="light"] {
  --bg: #faf7fc;
  --bg-soft: #f1eaf7;
  --text: #2a1f35;
  --text-dim: #6f6180;
  --card: #ffffff;
  --card-border: #e6dbef;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
a { color: var(--pink-bright); }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.gradient-text {
  background: linear-gradient(135deg, var(--pink-bright), var(--pink), var(--pink-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.dim { color: var(--text-dim); }

/* ===== Nav ===== */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.brand img { display: block; }

.nav-links { display: flex; gap: 8px; margin-left: auto; min-width: 0; overflow-x: auto; }

.nav-links a {
  position: relative;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); background: var(--bg-soft); }

.nav-links a.active { color: var(--text); }

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--pink);
}

@media (max-width: 480px) {
  .nav { gap: 8px; padding: 12px 14px; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 6px 7px; }
  .brand span { display: none; } /* mascot logo carries the brand on tiny screens */
}

.theme-toggle, .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: none;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.theme-toggle:hover, .nav-icon:hover { border-color: var(--pink); }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  color: var(--text);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink-bright), var(--pink-deep));
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 79, 163, 0.35);
  transition: box-shadow 0.3s ease;
}

.btn-primary:hover { box-shadow: 0 6px 34px rgba(255, 79, 163, 0.55); }

.btn-ghost { background: transparent; border: 1px solid var(--card-border); }
.btn-ghost:hover { border-color: var(--pink); }

.btn:hover { animation: btnJelly 0.45s ease; }
.btn:active { transform: scale(1.08, 0.85); }

@keyframes btnJelly {
  0% { transform: scale(1, 1); }
  30% { transform: scale(1.08, 0.9); }
  60% { transform: scale(0.96, 0.96); }
  80% { transform: scale(1.05, 1.05); }
  100% { transform: scale(1, 1); }
}

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ===== Cards ===== */

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 28px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: var(--pink);
  box-shadow: 0 12px 36px rgba(255, 79, 163, 0.16);
  animation: cardWobble 0.5s ease forwards;
}

@keyframes cardWobble {
  0% { transform: translateY(0) scale(1, 1); }
  45% { transform: translateY(-8px) scale(1.015, 0.985); }
  70% { transform: translateY(-5px) scale(0.995, 1.005); }
  100% { transform: translateY(-6px) scale(1, 1); }
}

.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }

.grid-3 { display: grid; gap: 20px; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ===== Sections ===== */

section { padding: 72px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.section-head p { color: var(--text-dim); }
.section-soft { background: var(--bg-soft); }

/* ===== Hero + starfield ===== */

.hero { position: relative; overflow: hidden; text-align: center; padding: 72px 20px 80px; }

.hero::before, .hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 3px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    8vw 12vh 0 rgba(255, 109, 181, 0.45), 22vw 34vh 0 rgba(255, 79, 163, 0.3),
    36vw 8vh 0 rgba(242, 238, 246, 0.35), 55vw 26vh 0 rgba(255, 109, 181, 0.4),
    70vw 10vh 0 rgba(242, 238, 246, 0.3), 84vw 30vh 0 rgba(255, 79, 163, 0.35),
    93vw 15vh 0 rgba(255, 109, 181, 0.3), 14vw 44vh 0 rgba(242, 238, 246, 0.25);
  animation: twinkle 5s ease-in-out infinite;
}

.hero::after {
  width: 2px; height: 2px;
  box-shadow:
    5vw 28vh 0 rgba(242, 238, 246, 0.3), 30vw 18vh 0 rgba(255, 109, 181, 0.35),
    47vw 40vh 0 rgba(255, 79, 163, 0.25), 63vw 36vh 0 rgba(242, 238, 246, 0.3),
    78vw 20vh 0 rgba(255, 109, 181, 0.3), 90vw 42vh 0 rgba(242, 238, 246, 0.25);
  animation-delay: 2.5s;
}

@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.wordmark { font-size: clamp(2.8rem, 8vw, 4.6rem); font-weight: 900; letter-spacing: -0.02em; margin: 18px 0 10px; }

.tagline {
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-weight: 700;
  font-size: clamp(0.72rem, 2vw, 0.92rem);
  margin: 0 0 18px;
}

.pitch { max-width: 600px; margin: 0 auto 32px; color: var(--text-dim); font-size: 1.08rem; }

/* ===== Mascot (approved) ===== */

.mascot-wrap {
  display: inline-block;
  cursor: pointer;
  animation: floaty 4.5s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(255, 79, 163, 0.25));
  transition: filter 0.35s ease;
}
.mascot-wrap:hover { filter: drop-shadow(0 0 48px rgba(255, 79, 163, 0.65)); }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }
.jelly-svg .dome-group { transform-origin: 50% 42%; animation: jellySquish 4.5s ease-in-out infinite; }
@keyframes jellySquish { 0%,100%{transform:scale(1,1)} 35%{transform:scale(1.04,.95)} 65%{transform:scale(.97,1.04)} }
.jelly-svg .tentacle { transform-origin: top center; animation: sway 4.5s ease-in-out infinite; }
.jelly-svg .tentacle.t1{animation-delay:0s} .jelly-svg .tentacle.t2{animation-delay:.35s} .jelly-svg .tentacle.t3{animation-delay:.7s}
@keyframes sway { 0%,100%{transform:rotate(0)} 50%{transform:rotate(4deg)} }
.jelly-svg .eye { transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%,92%,100%{transform:scaleY(1)} 95%{transform:scaleY(.08)} }
.mascot-wrap:hover .jelly-svg { animation: hoverJelly .6s ease; }
@keyframes hoverJelly { 0%{transform:scale(1,1)} 30%{transform:scale(1.12,.88)} 55%{transform:scale(.94,1.08)} 75%{transform:scale(1.04,.97)} 100%{transform:scale(1,1)} }

/* ===== Code blocks & tabs (dark in both themes) ===== */

.code-block {
  background: #1c1526;
  border: 1px solid #372a47;
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  max-width: 640px;
  margin: 0 auto;
}

.code-block pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #ff9dcb;
}

.code-block .comment { color: #8a7a9b; }
.code-note { padding: 20px; color: #a99cb8; font-size: 0.95rem; margin: 0; }

.tabs-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #372a47;
}

.tab {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: none;
  color: #a99cb8;
  cursor: pointer;
}

.tab:hover { color: #f2eef6; }
.tab.active { color: #ff6db5; background: rgba(255, 79, 163, 0.12); border-color: rgba(255, 79, 163, 0.35); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== How it works ===== */

.steps { display: grid; gap: 20px; margin-bottom: 44px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-bright), var(--pink-deep));
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.diagram { display: block; max-width: 560px; width: 100%; margin: 0 auto 44px; }

/* ===== Status badge ===== */

.status {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 79, 163, 0.4);
  background: rgba(255, 79, 163, 0.1);
  color: var(--pink-bright);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ===== Sub-page head, integrations, blog ===== */

.page-head { text-align: center; padding: 56px 20px 0; }
.page-head h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
.page-head p { max-width: 620px; margin: 0 auto; color: var(--text-dim); font-size: 1.05rem; }

.glyph { display: block; width: 44px; height: 44px; color: var(--pink-bright); margin-bottom: 14px; }

.card .status { margin-top: 16px; }

.post-card { display: block; text-decoration: none; color: inherit; max-width: 680px; margin: 0 auto; }
.post-meta { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 8px; }

.article { max-width: 700px; margin: 0 auto; padding: 48px 20px 72px; }
.article h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 6px; }
.article h2 { font-size: 1.3rem; margin-top: 2em; }
.article p, .article li { font-size: 1.02rem; line-height: 1.75; }
.article .code-block { margin: 20px 0; }

/* ===== Footer ===== */

.footer {
  border-top: 1px solid var(--card-border);
  padding: 36px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer nav { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.footer a { color: var(--text-dim); text-decoration: none; font-weight: 600; }
.footer a:hover { color: var(--text); }

/* ===== Docs layout ===== */

.docs-layout { display: grid; gap: 36px; padding: 36px 0 80px; align-items: start; }
.docs-layout > * { min-width: 0; } /* keep long code lines from widening the grid */

@media (min-width: 860px) {
  .docs-layout { grid-template-columns: 230px 1fr; }
  .docs-sidebar { position: sticky; top: 84px; }
}

.docs-sidebar h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 18px 0 8px;
}

.docs-sidebar h4:first-child { margin-top: 0; }
.docs-sidebar ul { list-style: none; margin: 0; padding: 0; }

.docs-sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.docs-sidebar a:hover { color: var(--text); background: var(--bg-soft); }
.docs-sidebar a.active { color: var(--pink-bright); background: var(--bg-soft); font-weight: 700; }
.docs-sidebar a.roadmap-link { opacity: 0.55; }

.roadmap-badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--text-dim);
}

.docs-content h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.docs-content h2 { font-size: 1.35rem; margin-top: 2em; scroll-margin-top: 84px; }
.docs-content p, .docs-content li { color: var(--text); }
.docs-content .code-block { margin: 20px 0; }
.docs-content ul, .docs-content ol { padding-left: 1.3rem; }
.docs-content li { margin-bottom: 6px; }

.callout {
  border: 1px solid rgba(255, 79, 163, 0.4);
  background: rgba(255, 79, 163, 0.08);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 20px 0;
}

.callout p { margin: 0; }

/* ===== Reduced motion: kill everything ===== */

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