/* === Theme tokens === */
:root{
  --bg:#0e1117;
  --nav-bg:rgba(14,17,23,.6);
  --nav-border:rgba(255,255,255,.06);
}
[data-theme="light"]{
  --bg:#e8eaef;
  --nav-bg:rgba(255,255,255,.45);
  --nav-border:rgba(255,255,255,.5);
}

/* === Base === */
body{background:var(--bg);color:#fff;transition:background .5s,color .5s}
[data-theme="light"] body{color:#1d1d1f}
[data-theme="light"] .pill-btn{color:#1d1d1f}
[data-theme="light"] .lg-btn{color:#1d1d1f}
a{color:inherit;text-decoration:none}
button{font:inherit;cursor:pointer;border:0;background:0 0}

/* === Ambient orbs === */
.scene{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.orb{position:absolute;border-radius:50%;filter:blur(60px);will-change:transform;animation:drift 22s ease-in-out infinite alternate}
.orb-a{width:800px;height:800px;top:-12%;left:-10%;background:radial-gradient(circle,rgba(14,165,233,.3),transparent 70%)}
.orb-b{width:600px;height:600px;top:28%;right:-10%;background:radial-gradient(circle,rgba(244,114,182,.25),transparent 70%);animation-delay:-7s}
.orb-c{width:550px;height:550px;bottom:-5%;left:12%;background:radial-gradient(circle,rgba(45,212,191,.22),transparent 70%);animation-delay:-14s}
[data-theme="light"] .orb-a{background:radial-gradient(circle,rgba(14,165,233,.32),transparent 70%)}
[data-theme="light"] .orb-b{background:radial-gradient(circle,rgba(244,114,182,.26),transparent 70%)}
[data-theme="light"] .orb-c{background:radial-gradient(circle,rgba(45,212,191,.24),transparent 70%)}
@keyframes drift{to{transform:translate(60px,-40px) scale(1.08)}}

/* === Nav === */
.glass-nav{
  position:fixed;inset:0 0 auto;z-index:100;height:56px;
  background:var(--nav-bg);
  backdrop-filter:blur(24px) saturate(1.7);-webkit-backdrop-filter:blur(24px) saturate(1.7);
  border-bottom:1px solid var(--nav-border);
  transition:background .5s,border-color .5s;
}
.nav-mobile{display:none;flex-direction:column;gap:5px;padding:6px}
.nav-mobile span{display:block;width:16px;height:1.5px;background:currentColor;border-radius:1px;opacity:.7}

/* === Pill buttons === */
.pill-btn{
  padding:5px 14px;border-radius:9999px;font-size:.76rem;font-weight:600;
  opacity:.4;border:1px solid rgba(255,255,255,.08);transition:all .25s;
}
[data-theme="light"] .pill-btn{border-color:rgba(255,255,255,.4)}
.pill-btn:hover{opacity:.7}
.pill-btn.active{
  opacity:1;
  background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
}
[data-theme="light"] .pill-btn.active{
  background:rgba(255,255,255,.45);
  border-color:rgba(255,255,255,.6);
  box-shadow:0 2px 8px rgba(0,0,0,.06),inset 0 .5px 0 rgba(255,255,255,.7);
}

/* === Hero h1 gradient text === */
.hero-h1{
  background:linear-gradient(180deg,#fff 30%,rgba(255,255,255,.45));
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;
}
[data-theme="light"] .hero-h1{
  background:linear-gradient(180deg,#1d1d1f 30%,rgba(29,29,31,.45));
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;
}

/* === Buttons === */
.lg-btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:12px 28px;border-radius:14px;
  font-size:.88rem;font-weight:600;
  background:rgba(255,255,255,.08);
  backdrop-filter:blur(12px) saturate(1.4);-webkit-backdrop-filter:blur(12px) saturate(1.4);
  border:1px solid rgba(255,255,255,.15);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12);
  transition:all .25s;
}
.lg-btn:hover{transform:translateY(-2px);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 8px 24px rgba(0,0,0,.15)}
.lg-btn--ghost{background:transparent;border-color:rgba(255,255,255,.08);box-shadow:none}
.lg-btn--ghost:hover{background:rgba(255,255,255,.05)}
[data-theme="light"] .lg-btn{
  background:rgba(255,255,255,.45);
  border-color:rgba(255,255,255,.65);
  color:#1d1d1f;
  box-shadow:0 2px 12px rgba(0,0,0,.06),inset 0 1px 0 rgba(255,255,255,.7);
}
[data-theme="light"] .lg-btn--ghost{background:rgba(255,255,255,.15);border-color:rgba(255,255,255,.4)}

/* === Liquid glass card — 4-layer system === */
.glass-card,.glass-stat{
  position:relative;
  border-radius:24px;
  overflow:hidden;
  box-shadow:0 4px 16px rgba(0,0,0,.15),0 0 0 .5px rgba(255,255,255,.2),0 0 15px rgba(255,255,255,.04);
  transition:transform .4s cubic-bezier(.2,.8,.2,1),box-shadow .4s;
}
.glass-stat{border-radius:16px}
[data-theme="light"] .glass-card,[data-theme="light"] .glass-stat{
  box-shadow:
    0 4px 24px rgba(0,0,0,.07),
    0 0 0 .5px rgba(255,255,255,.7),
    inset 0 .5px 0 rgba(255,255,255,.6),
    0 0 24px rgba(255,255,255,.25);
}

.glass-card{cursor:pointer}

/* Layer 0: Distortion */
.glass-fx{
  position:absolute;inset:0;z-index:0;
  border-radius:inherit;
  backdrop-filter:blur(3px) saturate(180%) brightness(1.1);
  -webkit-backdrop-filter:blur(3px) saturate(180%) brightness(1.1);
}
[data-theme="light"] .glass-fx{
  backdrop-filter:blur(16px) saturate(200%) brightness(1.08);
  -webkit-backdrop-filter:blur(16px) saturate(200%) brightness(1.08);
}

/* Layer 1: Tint */
.glass-tint{
  position:absolute;inset:0;z-index:1;
  border-radius:inherit;
  background:rgba(255,255,255,.04);
}
[data-theme="light"] .glass-tint{background:rgba(255,255,255,.35)}

/* Layer 2: Shine */
.glass-shine{
  position:absolute;inset:0;z-index:2;
  border-radius:inherit;pointer-events:none;
  box-shadow:
    inset 0 1px 12px rgba(255,255,255,.06),
    inset 0 -1px 8px rgba(255,255,255,.02),
    inset 0 0 24px rgba(255,255,255,.02);
  background:linear-gradient(170deg,rgba(255,255,255,.06) 0%,transparent 35%,transparent 85%,rgba(255,255,255,.015) 100%);
}
[data-theme="light"] .glass-shine{
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.8),
    inset 0 -1px 1px rgba(255,255,255,.3),
    inset 0 0 32px rgba(255,255,255,.12);
  background:linear-gradient(170deg,rgba(255,255,255,.4) 0%,rgba(255,255,255,.08) 25%,transparent 45%,transparent 80%,rgba(255,255,255,.12) 100%);
}

/* Layer 3: Content */
.glass-content{
  position:relative;z-index:3;
  display:flex;flex-direction:column;
  padding:28px;
}

/* Light sweep on hover */
.glass-card::before{
  content:'';position:absolute;inset:0;z-index:4;
  border-radius:inherit;pointer-events:none;
  background:linear-gradient(
    115deg,
    transparent 0%,transparent 20%,
    rgba(255,255,255,.01) 28%,rgba(255,255,255,.04) 38%,
    rgba(255,255,255,.06) 50%,rgba(255,255,255,.04) 62%,
    rgba(255,255,255,.01) 72%,transparent 80%,transparent 100%
  );
  opacity:0;transform:translateX(-140%);transition:none;
}
.glass-card:hover::before{
  opacity:1;transform:translateX(140%);
  transition:transform 8s cubic-bezier(.08,.6,0,1),opacity .6s;
}

/* Hover lift */
.glass-card:hover{
  transform:translateY(-4px);
  box-shadow:0 16px 40px rgba(0,0,0,.25),0 0 1px rgba(255,255,255,.25);
}
[data-theme="light"] .glass-card:hover{
  box-shadow:
    0 20px 48px rgba(0,0,0,.1),
    0 0 0 .5px rgba(255,255,255,.8),
    inset 0 .5px 0 rgba(255,255,255,.7),
    0 0 32px rgba(255,255,255,.3);
}

/* Module icons */
.mod-icon{display:block;width:36px;height:36px;margin-bottom:12px;line-height:0}
.mod-icon svg{width:36px;height:36px}
.mod-icon--lg{width:48px;height:48px;margin-bottom:16px}
.mod-icon--lg svg{width:48px;height:48px}

/* Card inner elements */
.card-badge{font-size:.65rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:rgba(56,189,248,.8);margin-bottom:8px;display:block}
.card-title{font-size:1rem;font-weight:700;letter-spacing:-.02em;margin-bottom:4px}
.card-desc{font-size:.86rem;opacity:.4;line-height:1.6;flex:1}
.card-tags{display:block;margin-top:16px;padding-top:12px;border-top:1px solid rgba(255,255,255,.06);font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.7rem;opacity:.25}
[data-theme="light"] .card-badge{color:rgba(14,120,200,.9)}
[data-theme="light"] .card-desc{opacity:.55}
[data-theme="light"] .card-tags{border-color:rgba(255,255,255,.4);opacity:.35}
.glass-card.hidden{display:none}

/* === Section label === */
.section-label{
  font-size:.75rem;font-weight:700;text-transform:uppercase;
  letter-spacing:.1em;
  color:rgba(56,189,248,.7);
}
[data-theme="light"] .section-label{color:rgba(14,120,200,.8)}

/* === Step number === */
.step-num{
  display:inline-flex;align-items:center;justify-content:center;
  width:56px;height:56px;border-radius:50%;
  font-size:1.3rem;font-weight:700;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.1);
  color:rgba(56,189,248,.8);
}
[data-theme="light"] .step-num{
  background:rgba(255,255,255,.4);
  border-color:rgba(255,255,255,.6);
  color:rgba(14,120,200,.8);
  box-shadow:0 2px 8px rgba(0,0,0,.05),inset 0 .5px 0 rgba(255,255,255,.7);
}

/* === Config code === */
.config-code{color:rgba(255,255,255,.6)}
.c-key{color:rgba(165,214,255,.9)}
.c-str{color:rgba(165,214,255,.7)}
[data-theme="light"] .config-code{color:rgba(0,0,0,.55)}
[data-theme="light"] .c-key{color:rgba(14,120,200,.9)}
[data-theme="light"] .c-str{color:rgba(14,120,200,.7)}

/* === Workflow tags === */
.wf-tag{
  font-size:.68rem;font-weight:600;
  padding:3px 10px;border-radius:9999px;
  background:rgba(56,189,248,.1);
  color:rgba(56,189,248,.8);
  border:1px solid rgba(56,189,248,.15);
}
[data-theme="light"] .wf-tag{
  background:rgba(14,120,200,.08);
  color:rgba(14,120,200,.8);
  border-color:rgba(14,120,200,.15);
}

/* === Modal === */
.modal-overlay{
  position:fixed;inset:0;z-index:200;
  display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.6);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  opacity:0;pointer-events:none;transition:opacity .3s;
}
.modal-overlay.open{opacity:1;pointer-events:auto}
.modal-glass{
  position:relative;max-width:520px;width:calc(100% - 40px);
  border-radius:24px;overflow:hidden;
  background:rgba(22,27,34,.92);
  box-shadow:0 32px 80px -16px rgba(0,0,0,.5),0 0 1px rgba(255,255,255,.15);
  transform:translateY(20px) scale(.96);
  transition:transform .35s cubic-bezier(.2,.8,.2,1);
}
[data-theme="light"] .modal-glass{
  background:rgba(255,255,255,.88);
  box-shadow:0 32px 80px -16px rgba(0,0,0,.15),0 0 0 .5px rgba(255,255,255,.7);
}
.modal-overlay.open .modal-glass{transform:none}
.modal-glass .glass-content{padding:36px}
.modal-glass--expanded{max-width:640px}
.modal-scroll{max-height:80vh;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.12) transparent}
.modal-scroll::-webkit-scrollbar{width:6px}
.modal-scroll::-webkit-scrollbar-thumb{background:rgba(255,255,255,.15);border-radius:3px}
[data-theme="light"] .modal-scroll::-webkit-scrollbar-thumb{background:rgba(0,0,0,.15)}

/* Modal example prompt */
.modal-example{margin-bottom:20px}
.modal-prompt{
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);
  border-radius:12px;padding:14px 18px;font-size:.9rem;font-style:italic;opacity:.8;line-height:1.6;
}
[data-theme="light"] .modal-prompt{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.08)}

/* Modal tool grid */
.modal-tool-grid{display:grid;grid-template-columns:1fr;gap:6px}
.modal-tool-item{
  display:flex;align-items:center;gap:10px;padding:10px 14px;
  border-radius:10px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.06);
  transition:background .2s;
}
.modal-tool-item:hover{background:rgba(255,255,255,.1)}
[data-theme="light"] .modal-tool-item{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.06)}
[data-theme="light"] .modal-tool-item:hover{background:rgba(0,0,0,.08)}
.modal-tool-name{font-family:'JetBrains Mono',monospace;font-size:.82rem;opacity:.9;white-space:nowrap}
.modal-tool-desc{font-size:.8rem;opacity:.6;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.modal-tool-badge{
  font-size:.68rem;padding:3px 8px;border-radius:6px;font-weight:600;white-space:nowrap;
}
.modal-tool-badge--read{background:rgba(45,212,191,.2);color:rgb(45,212,191)}
.modal-tool-badge--write{background:rgba(251,191,36,.2);color:rgb(251,191,36)}
.modal-tool-badge--destructive{background:rgba(239,68,68,.2);color:rgb(239,68,68)}

/* === Reveal === */
.reveal{opacity:0;transform:translateY(20px);transition:opacity .8s cubic-bezier(.2,.8,.2,1),transform .8s cubic-bezier(.2,.8,.2,1)}
.reveal.visible{opacity:1;transform:none}

/* === Language dropdown === */
.lang-select{position:relative}
.lang-dropdown{
  position:absolute;top:calc(100% + 8px);right:0;
  min-width:140px;
  background:var(--nav-bg);
  backdrop-filter:blur(24px) saturate(1.7);-webkit-backdrop-filter:blur(24px) saturate(1.7);
  border:1px solid var(--nav-border);
  border-radius:12px;
  padding:4px;
  opacity:0;pointer-events:none;
  transform:translateY(-4px);
  transition:opacity .2s,transform .2s;
  z-index:110;
  max-height:320px;overflow-y:auto;
}
.lang-dropdown.open{opacity:1;pointer-events:auto;transform:none}
.lang-dropdown button{
  display:block;width:100%;text-align:left;
  padding:7px 12px;border-radius:8px;
  font-size:.8rem;font-weight:500;
  opacity:.5;transition:all .15s;
}
.lang-dropdown button:hover{opacity:.9;background:rgba(255,255,255,.06)}
.lang-dropdown button.active{opacity:1;color:rgba(56,189,248,.9)}
[data-theme="light"] .lang-dropdown button:hover{background:rgba(0,0,0,.04)}
[data-theme="light"] .lang-dropdown button.active{color:rgba(14,120,200,.9)}

/* === Mobile === */
@media(max-width:640px){
  #navLinks{display:none}
  #navLinks.open{
    display:flex;flex-direction:column;
    position:absolute;top:56px;left:0;right:0;
    background:var(--nav-bg);backdrop-filter:blur(24px);
    padding:20px;gap:14px;border-bottom:1px solid var(--nav-border);
  }
  .nav-mobile{display:flex}
  .lang-dropdown{position:fixed;top:auto;bottom:20px;right:20px;left:20px;min-width:auto}
}

/* === Terminal Playground === */
.term-window{border-radius:12px;overflow:hidden;border:1px solid rgba(255,255,255,.08);background:rgba(0,0,0,.65);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
[data-theme="light"] .term-window{background:rgba(30,30,30,.92)}
.term-titlebar{display:flex;align-items:center;gap:6px;padding:10px 14px;background:rgba(255,255,255,.04);border-bottom:1px solid rgba(255,255,255,.06)}
.term-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}
.term-titlebar-text{font-family:'JetBrains Mono',monospace;font-size:11px;opacity:.35;margin-left:8px}
.term-body{padding:16px 18px;font-family:'JetBrains Mono',monospace;font-size:13px;line-height:1.7;min-height:220px;max-height:320px;overflow-y:auto;scroll-behavior:smooth}
.term-line{margin-bottom:2px;white-space:pre-wrap;word-break:break-word}
.term-prompt{color:#28c840;font-weight:600}
.term-user{color:#fff;opacity:.9}
.term-dim{opacity:.3}
.term-tool{color:#0ea5e9;font-weight:500}
.term-args{color:#f472b6;opacity:.7;margin-left:2px;font-size:12px}
.term-result{color:#a8b2c1;opacity:.7;padding-left:18px;display:inline-block}
.term-summary{color:#2dd4bf;padding-left:18px;display:inline-block;font-weight:500}
.term-fade-in{animation:termFade .3s ease-out}
@keyframes termFade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.term-prompt-card{display:flex;flex-direction:column;gap:6px;padding:12px 16px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:rgba(255,255,255,.03);text-align:left;transition:all .2s;cursor:pointer}
.term-prompt-card:hover{border-color:rgba(14,165,233,.3);background:rgba(14,165,233,.06);transform:translateY(-1px)}
[data-theme="light"] .term-prompt-card{background:rgba(0,0,0,.03);border-color:rgba(0,0,0,.08)}
[data-theme="light"] .term-prompt-card:hover{background:rgba(14,165,233,.08);border-color:rgba(14,165,233,.25)}
.term-prompt-text{font-size:13px;opacity:.55;font-style:italic;line-height:1.4}
