
/* ============ VARIABLES ============ */
:root{
  --bg:#050505;
  --surface:#0D0D10;
  --surface-2:#121216;
  --border:rgba(255,255,255,0.08);
  --border-strong:rgba(255,255,255,0.14);
  --accent:#7C3AED;
  --accent-2:#4F46E5;
  --accent-light:#A78BFA;
  --accent-soft:rgba(124,58,237,0.15);
  --green:#22C55E;
  --white:#FFFFFF;
  --gray:#A1A1AA;
  --gray-dim:#6B6B76;
  --header-h:72px;
  --font-head:'Space Grotesk', sans-serif;
  --font-body:'Inter', sans-serif;
  --font-mono:'JetBrains Mono', monospace;
  --font-serif:'Instrument Serif', serif;
}

*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg);
  color:var(--white);
  font-family:var(--font-body);
  overflow-x:hidden;
  position:relative;
  width:100%;
  padding-bottom:120px; /* clearance for the fixed sticky banner */
}
::selection{background:rgba(124,58,237,.4); color:#fff;}
a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer;}
img,svg{display:block;}
ul{list-style:none;}

/* ============ BACKGROUND LAYERS ============ */
.bg-grid{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size:64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}
.orb{
  position:fixed; border-radius:50%; filter:blur(90px); pointer-events:none; z-index:0;
  opacity:.5; will-change:transform;
}
.orb-1{ width:650px; height:650px; top:-200px; left:-150px; background:radial-gradient(circle, #7C3AED 0%, transparent 70%);}
.orb-2{ width:600px; height:600px; top:20%; right:-200px; background:radial-gradient(circle, #4F46E5 0%, transparent 70%);}
.orb-3{ width:500px; height:500px; bottom:-150px; left:30%; background:radial-gradient(circle, #7C3AED 0%, transparent 70%); opacity:.3;}

/* ============ CONTAINER ============ */
.wrap{max-width:1240px; margin:0 auto; padding:0 24px; position:relative; z-index:1;}
section{position:relative; z-index:1;}

/* ============ HEADER ============ */
header{
  position:fixed; top:0; left:0; right:0; z-index:100; height:var(--header-h);
  background:rgba(5,5,5,.55);
  backdrop-filter:blur(18px) saturate(140%);
  -webkit-backdrop-filter:blur(18px) saturate(140%);
  border-bottom:1px solid var(--border);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  height:100%;
}
.logo{display:flex; align-items:center; gap:10px; height:36px;}
.logo-mark{
  width:36px; height:36px; flex:0 0 36px;
  display:flex; align-items:center; justify-content:center;
}
.logo-mark svg{width:100%; height:100%; filter: drop-shadow(0 0 10px rgba(124,58,237,.65));}
.logo-text{
  font-family:var(--font-head); font-weight:700; font-size:18px; letter-spacing:-0.02em;
  line-height:1;
}
.logo-text span{color:var(--accent-light);}

nav.main-nav{display:flex; align-items:center; gap:36px; height:100%;}
.nav-link{
  font-size:14.5px; color:var(--gray); font-weight:500; transition:color .25s ease; position:relative;
  display:inline-flex; align-items:center; height:100%;
}
.nav-link::after{
  content:""; position:absolute; left:0; bottom:24px; width:0; height:1px; background:var(--accent-light);
  transition:width .3s ease;
}
.nav-link:hover{color:#fff;}
.nav-link:hover::after{width:100%;}

.header-right{display:flex; align-items:center; gap:14px; flex:0 0 auto;}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-weight:600; font-size:14.5px; border-radius:12px; border:none;
  padding:12px 22px; transition:transform .25s cubic-bezier(.2,.9,.3,1.3), box-shadow .3s ease, background .3s ease, border-color .3s ease;
  white-space:nowrap; line-height:1.2;
}
.btn i{width:16px; height:16px; flex:0 0 16px;}
.btn-primary{
  background:linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color:#fff;
  box-shadow:0 0 0 1px rgba(124,58,237,.25), 0 6px 20px rgba(124,58,237,.25);
}
.btn-primary:hover{
  transform:scale(1.05) translateY(-1px);
  box-shadow:0 0 0 1px rgba(124,58,237,.5), 0 0 28px rgba(124,58,237,.55), 0 10px 30px rgba(124,58,237,.35);
}
.btn-glass{
  background:rgba(255,255,255,.04);
  border:1px solid var(--border-strong);
  color:#fff;
  backdrop-filter:blur(10px);
}
.btn-glass:hover{
  transform:scale(1.04);
  border-color:var(--accent-light);
  background:rgba(124,58,237,.08);
  box-shadow:0 0 20px rgba(124,58,237,.25);
}
.btn-sm{padding:9px 16px; font-size:13.5px; border-radius:10px;}
.btn-giant{padding:22px 48px; font-size:18px; border-radius:16px;}

.burger{
  display:none; width:38px; height:38px; flex:0 0 38px; border-radius:10px; border:1px solid var(--border-strong);
  background:rgba(255,255,255,.03); align-items:center; justify-content:center; flex-direction:column; gap:4px;
}
.burger span{width:16px; height:1.4px; background:#fff; transition:all .3s ease; display:block;}

.mobile-nav{
  display:none; position:fixed; top:var(--header-h); left:0; right:0; z-index:99;
  background:rgba(8,8,10,.97); backdrop-filter:blur(20px);
  border-bottom:1px solid var(--border);
  padding:24px; flex-direction:column; gap:20px;
  transform:translateY(-10px); opacity:0; pointer-events:none;
  transition:all .3s ease;
}
.mobile-nav.open{transform:translateY(0); opacity:1; pointer-events:all;}

/* ============ BADGE ============ */
.badge{
  display:inline-flex; align-items:center; gap:9px;
  padding:7px 16px 7px 12px; border-radius:100px;
  border:1px solid var(--border-strong); background:rgba(255,255,255,.03);
  font-size:12.5px; letter-spacing:.08em; font-weight:600; color:var(--gray);
  backdrop-filter:blur(6px); height:32px;
}
.dot-green{
  width:7px; height:7px; flex:0 0 7px; border-radius:50%; background:var(--green);
  box-shadow:0 0 8px 2px rgba(34,197,94,.7);
  animation:pulse-green 1.8s infinite;
}
@keyframes pulse-green{0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.5; transform:scale(.8);}}

/* ============ HERO ============ */
.hero{
  padding:calc(var(--header-h) + 100px) 0 100px;
  display:grid; gap:60px; grid-template-columns:minmax(0,1fr);
  min-height:100vh;
  align-content:center;
}
.hero-top{text-align:center; max-width:800px; margin:0 auto; min-width:0; overflow-wrap:break-word;}
.hero-badge-wrap{display:flex; justify-content:center; margin-bottom:28px;}
.hero h1{
  font-family:var(--font-head); font-weight:700;
  font-size:clamp(1.9rem, 6vw, 4.6rem);
  line-height:1.05; letter-spacing:-0.04em; margin-bottom:26px;
  overflow-wrap:break-word; word-break:break-word; hyphens:auto;
}
.hero h1 em{
  font-family:var(--font-serif); font-style:italic; font-weight:400;
  background:linear-gradient(120deg, #c9b3ff 0%, var(--accent-light) 40%, var(--accent) 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  display:block;
  font-size:1.12em;
}
.hero p.sub{
  font-size:clamp(1rem, 1.6vw, 1.2rem); color:var(--gray); line-height:1.6; max-width:620px; margin:0 auto 38px;
}
.hero-actions{display:flex; align-items:center; justify-content:center; gap:16px; flex-wrap:wrap;}
.hero-actions .btn{padding:15px 28px; font-size:15px;}

/* ============ TERMINAL ============ */
.terminal-wrap{max-width:780px; margin:0 auto; width:100%; min-width:0;}
.terminal{
  border-radius:16px; overflow:hidden; min-width:0; max-width:100%;
  border:1px solid var(--border-strong);
  background:rgba(13,13,16,.65);
  backdrop-filter:blur(20px) saturate(150%);
  box-shadow:0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(124,58,237,.08), inset 0 1px 0 rgba(255,255,255,.04);
}
.terminal-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding:13px 18px; border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.02); height:48px;
}
.terminal-dots{display:flex; gap:7px; flex:0 0 auto;}
.terminal-dots span{width:11px; height:11px; border-radius:50%; display:block;}
.terminal-dots span:nth-child(1){background:#FF5F56;}
.terminal-dots span:nth-child(2){background:#FFBD2E;}
.terminal-dots span:nth-child(3){background:#27C93F;}
.terminal-title{font-size:12.5px; color:var(--gray-dim); font-family:var(--font-mono);}
.terminal-copy{
  display:flex; align-items:center; gap:6px; background:rgba(255,255,255,.05);
  border:1px solid var(--border); color:var(--gray); font-size:12px; padding:6px 11px; border-radius:8px;
  transition:all .2s ease; height:28px;
}
.terminal-copy i{width:12px; height:12px; flex:0 0 12px;}
.terminal-copy:hover{color:#fff; border-color:var(--accent-light); background:rgba(124,58,237,.12);}
.terminal-copy.copied{background:rgba(34,197,94,.15); border-color:var(--green); color:var(--green);}
.terminal-body{
  padding:22px 24px; font-family:var(--font-mono); font-size:13.5px; line-height:1.85;
  height:360px; overflow-y:auto; text-align:left; min-width:0;
}
.terminal-body pre{margin:0; white-space:pre-wrap; word-break:break-word; max-width:100%;}
.terminal-body code{font-family:var(--font-mono); background:none !important; white-space:pre-wrap; word-break:break-word;}
.typed-cursor{
  display:inline-block; width:7px; height:16px; background:var(--accent-light); margin-left:2px;
  animation:blink 1s step-end infinite; vertical-align:text-bottom;
}
@keyframes blink{0%,100%{opacity:1;} 50%{opacity:0;}}

/* ============ SECTION HEADS ============ */
.eyebrow{
  font-family:var(--font-mono); font-size:12.5px; letter-spacing:.2em; color:var(--accent-light);
  text-align:center; margin-bottom:16px; font-weight:600;
}
.section-title{
  font-family:var(--font-head); font-weight:700; letter-spacing:-0.035em;
  font-size:clamp(2rem, 4vw, 3rem); text-align:center; margin-bottom:16px;
}
.section-sub{
  text-align:center; color:var(--gray); max-width:580px; margin:0 auto 64px; font-size:16px; line-height:1.6;
}
section.pad{padding:120px 0;}

/* ============ ARCHITECTURE ============ */
.arch-diagram{
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:30px;
}
.arch-col{display:flex; flex-direction:column; gap:16px;}
.arch-card{
  border:1px solid var(--border); background:var(--surface);
  border-radius:14px; padding:16px 18px; display:flex; align-items:center; gap:12px;
  font-size:14px; font-weight:500; transition:transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  min-height:66px;
}
.arch-card:hover{border-color:var(--accent-light); box-shadow:0 0 24px rgba(124,58,237,.2); transform:translateX(4px);}
.arch-col:last-child .arch-card:hover{transform:translateX(-4px);}
.arch-card .ic{
  width:34px; height:34px; flex:0 0 34px; border-radius:9px; background:var(--surface-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; color:var(--accent-light);
}
.arch-card .ic i{width:16px; height:16px;}
.arch-card.tier-free .ic{color:#4ADE80;}
.arch-card.tier-smart .ic{color:var(--accent-light);}
.arch-card.tier-premium .ic{color:#FBBF24;}
.arch-card small{display:block; color:var(--gray-dim); font-size:11.5px; font-weight:400; margin-top:2px;}

.arch-center{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px;
  width:160px;
}
.gateway-node{
  width:130px; height:130px; flex:0 0 130px; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, rgba(167,139,250,.13), rgba(124,58,237,.07) 60%, transparent);
  border:1px solid rgba(124,58,237,.5);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  box-shadow:0 0 50px rgba(124,58,237,.35), inset 0 0 30px rgba(124,58,237,.15);
  animation:float-node 4s ease-in-out infinite;
  position:relative;
}
.gateway-node::before{
  content:""; position:absolute; inset:-14px; border-radius:50%; border:1px dashed rgba(124,58,237,.3);
  animation:spin-slow 14s linear infinite;
}
@keyframes spin-slow{from{transform:rotate(0);} to{transform:rotate(360deg);}}
@keyframes float-node{0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);}}
.gateway-node i{width:28px; height:28px; color:var(--accent-light); filter:drop-shadow(0 0 8px rgba(124,58,237,.8));}
.gateway-node .label{font-family:var(--font-mono); font-size:11.5px; font-weight:600; letter-spacing:.02em; text-align:center; line-height:1.3;}

@media (max-width: 860px){
  .arch-diagram{grid-template-columns:1fr;}
  .arch-center{order:-1; padding-bottom:10px; margin:0 auto 10px;}
}

/* ============ FLEXIBLE DEAL (CTA) ============ */
.deal-card{
  max-width:820px; margin:0 auto; text-align:center;
  border:1px solid var(--border-strong); background:linear-gradient(180deg, rgba(124,58,237,.08), var(--surface) 55%);
  border-radius:28px; padding:72px 48px;
  box-shadow:0 0 0 1px rgba(124,58,237,.15), 0 40px 100px rgba(124,58,237,.12);
}
.deal-icon{
  width:64px; height:64px; flex:0 0 64px; border-radius:18px; margin:0 auto 28px;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 36px rgba(124,58,237,.45);
}
.deal-icon i{width:30px; height:30px; color:#fff;}
.deal-card h2{
  font-family:var(--font-head); font-weight:700; letter-spacing:-0.035em;
  font-size:clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom:20px;
}
.deal-card p{color:var(--gray); font-size:16.5px; line-height:1.7; max-width:600px; margin:0 auto 40px;}
.deal-card .funpay-range{
  color:var(--accent-light); font-family:var(--font-mono); font-weight:600;
}
.deal-note{margin-top:22px; font-size:13.5px; color:var(--gray-dim); display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap;}
.deal-note i{width:14px; height:14px; color:var(--green); flex:0 0 14px;}

/* ============ BENTO MODELS ============ */
.bento-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));
  gap:24px;
  width:100%;
  align-items:stretch;
}
.bento-item{
  border:1px solid var(--border); background:var(--surface);
  border-radius:18px; padding:24px; position:relative; overflow:hidden;
  display:flex; flex-direction:column; justify-content:space-between;
  transition:transform .35s ease, border-color .3s ease, box-shadow .3s ease;
  min-height:190px;
  height:100%;
}
.bento-item::after{
  content:""; position:absolute; inset:0; opacity:0; transition:opacity .4s ease;
  background:radial-gradient(circle at 70% 20%, rgba(124,58,237,.35), transparent 60%);
  pointer-events:none;
}
.bento-item:hover{transform:translateY(-6px); border-color:var(--accent-light); box-shadow:0 20px 50px rgba(124,58,237,.18);}
.bento-item:hover::after{opacity:1;}
/* the big/wide spans are intentionally disabled: with auto-fit they caused
   overlapping cards at in-between widths. Every card is one cell now. */
.bento-top{display:flex; align-items:center; justify-content:space-between; position:relative; z-index:1;}
.bento-ic{
  width:40px; height:40px; flex:0 0 40px; border-radius:11px; background:var(--surface-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; color:var(--accent-light);
}
.bento-ic i{width:19px; height:19px;}
.bento-ctx{
  font-family:var(--font-mono); font-size:11px; color:var(--gray-dim); border:1px solid var(--border);
  padding:4px 9px; border-radius:7px; flex:0 0 auto; white-space:nowrap;
}
.bento-body{position:relative; z-index:1;}
.bento-name{font-family:var(--font-mono); font-size:17px; font-weight:600; margin-bottom:8px; color:#fff;}
.bento-desc{font-size:13.5px; color:var(--gray); line-height:1.55;}
@media (max-width:600px){
  .bento-grid{grid-template-columns:1fr;}
}

/* ============ TOOLS STRIP ============ */
.tools-strip{display:flex; gap:16px; flex-wrap:wrap; justify-content:center;}
.tool-pill{
  display:flex; align-items:center; gap:10px; border:1px solid var(--border); background:var(--surface);
  padding:13px 22px; border-radius:100px; font-size:14px; font-weight:500; transition:transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tool-pill:hover{border-color:var(--accent-light); transform:translateY(-3px); box-shadow:0 10px 24px rgba(124,58,237,.2);}
.tool-pill i{width:17px; height:17px; flex:0 0 17px; color:var(--accent-light);}

/* ============ BALANCE CHECK ============ */
.balance-card{
  max-width:600px; margin:0 auto 100px; border:1px solid var(--border-strong); background:var(--surface);
  border-radius:20px; padding:44px 38px; text-align:center;
  box-shadow:0 30px 80px rgba(0,0,0,.4);
  position:relative;
  z-index:1;
}
.balance-icon{
  width:56px; height:56px; flex:0 0 56px; border-radius:16px; margin:0 auto 20px;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 30px rgba(124,58,237,.4);
}
.balance-icon i{width:24px; height:24px; color:#fff;}
.balance-form{display:flex; gap:10px; margin-top:28px; flex-wrap:wrap;}
.balance-input-wrap{position:relative; flex:1 1 220px; min-width:200px; display:block;}
.balance-input-wrap i{
  position:absolute !important;
  left:16px;
  top:50% !important;
  transform:translateY(-50%) !important;
  width:17px; height:17px;
  color:var(--gray-dim);
  pointer-events:none;
  z-index:2;
  margin:0;
}
.balance-input{
  width:100%; background:var(--surface-2); border:1px solid var(--border-strong); border-radius:12px;
  padding:15px 16px 15px 44px; color:#fff; font-family:var(--font-mono); font-size:14px;
  transition:border-color .25s ease; height:50px;
}
.balance-input:focus{outline:none; border-color:var(--accent-light); box-shadow:0 0 0 3px rgba(124,58,237,.15);}
.balance-input::placeholder{color:var(--gray-dim);}
.balance-form .btn{height:50px; flex:0 0 auto;}

.balance-result{
  margin-top:0; text-align:left; border-radius:14px; border:1px solid transparent; background:var(--surface-2);
  max-height:0; opacity:0; overflow:hidden; transition:max-height .45s cubic-bezier(.2,.9,.3,1.1), opacity .35s ease, margin-top .35s ease;
}
.balance-result.show{max-height:400px; opacity:1; margin-top:24px; border-color:var(--border); padding:22px;}
.balance-result.err{border-color:rgba(239,68,68,.4); background:rgba(239,68,68,.06);}
.balance-row{display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--border);}
.balance-row:last-child{border:none;}
.balance-row .k{color:var(--gray); font-size:13.5px;}
.balance-row .v{font-family:var(--font-mono); font-weight:600; font-size:14px;}
.spinner{
  width:16px; height:16px; flex:0 0 16px; border-radius:50%; border:2px solid rgba(255,255,255,.2); border-top-color:#fff;
  animation:spin 0.7s linear infinite; display:inline-block;
}
@keyframes spin{to{transform:rotate(360deg);}}

/* ============ PLAYGROUND (token-gated mini chat) ============ */
.pg-card{
  background:linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border:1px solid var(--border); border-radius:20px; padding:20px;
  box-shadow:0 30px 70px -40px rgba(124,58,237,0.5);
  display:grid; grid-template-columns:220px 1fr; gap:0; overflow:hidden;
  padding:0; min-height:520px;
}
.pg-side{
  border-right:1px solid var(--border); padding:18px 16px;
  display:flex; flex-direction:column; gap:14px; background:rgba(0,0,0,0.25);
}
.pg-side-label{font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--gray-dim);}
.pg-models{display:flex; flex-direction:column; gap:6px;}
.pg-model{
  display:flex; align-items:center; gap:9px; padding:9px 11px; border-radius:10px;
  border:1px solid transparent; cursor:pointer; font-size:13px; color:var(--gray);
  transition:all .18s ease; background:transparent; text-align:left; width:100%;
  font-family:var(--font-body);
}
.pg-model:hover{background:rgba(255,255,255,0.04); color:#fff;}
.pg-model.on{background:var(--accent-soft); border-color:rgba(124,58,237,0.45); color:#fff;}
.pg-dot{width:7px; height:7px; border-radius:50%; background:var(--accent-light); flex:0 0 auto;}
.pg-side-foot{margin-top:auto; display:flex; flex-direction:column; gap:8px;}
.pg-meter{height:4px; border-radius:2px; background:rgba(255,255,255,0.08); overflow:hidden;}
.pg-meter i{display:block; height:100%; width:100%; background:linear-gradient(90deg,var(--accent),var(--accent-light)); transition:width .4s ease;}
.pg-spent{font-size:11.5px; color:var(--gray-dim); font-family:var(--font-mono);}
.pg-main{display:flex; flex-direction:column; min-width:0;}
.pg-bar{
  display:flex; align-items:center; gap:10px; padding:13px 18px;
  border-bottom:1px solid var(--border); font-size:13px; color:var(--gray);
}
.pg-bar b{color:#fff; font-family:var(--font-head); font-size:13.5px;}
.pg-key-chip{
  margin-left:auto; font-family:var(--font-mono); font-size:11.5px; color:var(--accent-light);
  background:var(--accent-soft); border:1px solid rgba(124,58,237,0.35);
  padding:3px 9px; border-radius:6px; cursor:pointer; max-width:190px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.pg-gate{padding:44px 24px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:14px; justify-content:center; flex:1;}
.pg-gate h3{font-family:var(--font-head); font-size:20px;}
.pg-gate p{color:var(--gray); font-size:13.5px; max-width:340px; line-height:1.6;}
.pg-gate-form{display:flex; gap:8px; flex-wrap:wrap; justify-content:center; width:100%; max-width:420px;}
.pg-gate-err{color:#EF4444; font-size:12.5px; min-height:16px;}
.pg-log{flex:1; overflow-y:auto; padding:20px 18px; display:flex; flex-direction:column; gap:14px; min-height:300px;}
.pg-msg{display:flex; gap:10px; max-width:100%;}
.pg-msg .who{
  width:26px; height:26px; border-radius:8px; flex:0 0 auto; display:flex;
  align-items:center; justify-content:center; font-size:11px; font-weight:600;
  font-family:var(--font-head);
}
.pg-msg.u{flex-direction:row-reverse;}
.pg-msg.u .who{background:rgba(255,255,255,0.08); color:#fff;}
.pg-msg.a .who{background:var(--accent-soft); color:var(--accent-light); border:1px solid rgba(124,58,237,0.35);}
.pg-bubble{
  background:var(--surface-2); border:1px solid var(--border); border-radius:12px;
  padding:10px 13px; font-size:13.5px; line-height:1.62; color:#E4E4E7;
  white-space:pre-wrap; word-break:break-word; max-width:min(100%,640px);
}
.pg-msg.u .pg-bubble{background:rgba(124,58,237,0.16); border-color:rgba(124,58,237,0.32); color:#fff;}
.pg-bubble code{font-family:var(--font-mono); font-size:12.5px; background:rgba(0,0,0,.4); padding:1px 5px; border-radius:4px;}
.pg-bubble pre{background:rgba(0,0,0,.45); border:1px solid var(--border); border-radius:8px; padding:10px 12px; overflow-x:auto; margin:8px 0;}
.pg-bubble pre code{background:none; padding:0;}
.pg-typing i{display:inline-block; width:5px; height:5px; margin-right:3px; border-radius:50%; background:var(--accent-light); animation:pgblink 1.2s infinite;}
.pg-typing i:nth-child(2){animation-delay:.2s;} .pg-typing i:nth-child(3){animation-delay:.4s;}
@keyframes pgblink{0%,60%,100%{opacity:.25;} 30%{opacity:1;}}
.pg-compose{display:flex; gap:10px; padding:14px 18px; border-top:1px solid var(--border); align-items:flex-end;}
.pg-compose textarea{
  flex:1; background:var(--surface-2); border:1px solid var(--border); border-radius:12px;
  color:#fff; font-family:var(--font-body); font-size:13.5px; padding:11px 13px;
  resize:none; min-height:44px; max-height:140px; line-height:1.5; outline:none;
  transition:border-color .2s ease;
}
.pg-compose textarea:focus{border-color:rgba(124,58,237,0.55);}
.pg-compose textarea::placeholder{color:var(--gray-dim);}
.pg-send{
  width:44px; height:44px; border-radius:12px; border:none; cursor:pointer;
  background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff;
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
  transition:transform .15s ease, opacity .2s ease;
}
.pg-send:hover{transform:translateY(-1px);} .pg-send:disabled{opacity:.45; cursor:default; transform:none;}
.pg-hint{padding:0 18px 14px; font-size:11.5px; color:var(--gray-dim);}
.pg-hidden{display:none !important;}

/* ============ TUTORIALS ============ */
.tut-tabs{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:22px;}
.tut-tab{
  padding:8px 15px; border-radius:999px; border:1px solid var(--border);
  background:transparent; color:var(--gray); font-size:13px; cursor:pointer;
  font-family:var(--font-body); transition:all .18s ease;
}
.tut-tab:hover{color:#fff; border-color:var(--border-strong);}
.tut-tab.on{background:var(--accent-soft); border-color:rgba(124,58,237,0.5); color:#fff;}
/* minmax(0,1fr): a long unbreakable line inside a step must not stretch the
   grid column past the viewport (that was pushing the whole page to 914px). */
.tut-body{display:grid; grid-template-columns:minmax(0,1fr); gap:18px;}
.tut-step{
  min-width:0;
  background:linear-gradient(180deg,var(--surface) 0%,var(--surface-2) 100%);
  border:1px solid var(--border); border-radius:16px; padding:20px 22px;
  display:flex; gap:16px; align-items:flex-start;
}
.tut-num{
  width:30px; height:30px; flex:0 0 auto; border-radius:9px; display:flex;
  align-items:center; justify-content:center; font-family:var(--font-head);
  font-size:13px; font-weight:600; background:var(--accent-soft);
  border:1px solid rgba(124,58,237,0.4); color:var(--accent-light);
}
.tut-step h4{font-family:var(--font-head); font-size:15.5px; margin-bottom:6px;}
.tut-step p{color:var(--gray); font-size:13.5px; line-height:1.65; overflow-wrap:anywhere;}
.tut-step > div{min-width:0; flex:1; overflow-wrap:anywhere;}
.tut-step code{overflow-wrap:anywhere; word-break:break-word;}
.tut-code{
  position:relative; margin-top:12px; background:rgba(0,0,0,0.5);
  border:1px solid var(--border); border-radius:10px; padding:12px 14px;
  font-family:var(--font-mono); font-size:12.5px; color:#C4B5FD;
  overflow-x:auto; white-space:pre; line-height:1.65;
  max-width:100%; scrollbar-width:thin;
}
.tut-copy{
  position:absolute; top:8px; right:8px; background:rgba(255,255,255,0.06);
  border:1px solid var(--border); color:var(--gray); border-radius:6px;
  font-size:11px; padding:3px 8px; cursor:pointer; font-family:var(--font-body);
  transition:all .18s ease;
}
.tut-copy:hover{color:#fff; background:rgba(255,255,255,0.12);}
.tut-note{
  margin-top:10px; padding:9px 12px; border-radius:9px; font-size:12.5px;
  background:rgba(34,197,94,0.08); border:1px solid rgba(34,197,94,0.25); color:#86EFAC;
}
.tut-note.warn{background:rgba(239,68,68,0.07); border-color:rgba(239,68,68,0.25); color:#FCA5A5;}

@media(max-width:820px){
  .pg-card{grid-template-columns:1fr; min-height:auto;}
  .pg-side{border-right:none; border-bottom:1px solid var(--border); flex-direction:row; flex-wrap:wrap; align-items:center; gap:10px;}
  .pg-models{flex-direction:row; flex-wrap:wrap;}
  .pg-side-foot{margin-top:0; width:100%;}
  .pg-log{min-height:260px; padding:16px 14px;}
}

/* ============ FOOTER ============ */
footer{border-top:1px solid var(--border); padding:60px 0 150px; position:relative; z-index:1;}
.footer-top{display:flex; justify-content:space-between; align-items:flex-start; gap:40px; flex-wrap:wrap; margin-bottom:40px;}
.footer-links{display:flex; gap:40px; flex-wrap:wrap;}
.footer-col h4{font-size:13px; color:var(--gray-dim); margin-bottom:14px; letter-spacing:.05em; text-transform:uppercase;}
.footer-col a{display:block; font-size:14px; color:var(--gray); margin-bottom:10px; transition:color .2s ease;}
.footer-col a:hover{color:#fff;}
.footer-bottom{display:flex; justify-content:space-between; flex-wrap:wrap; gap:14px; padding-top:28px; border-top:1px solid var(--border); font-size:13px; color:var(--gray-dim);}

/* ============ STICKY BOTTOM BANNER ============ */
.sticky-banner{
  position:fixed; bottom:18px; left:50%; transform:translateX(-50%) translateY(0);
  z-index:200; width:min(92%, 620px);
  background:linear-gradient(120deg, rgba(124,58,237,.9), rgba(79,70,229,.9));
  backdrop-filter:blur(16px);
  border:1px solid rgba(255,255,255,.2);
  border-radius:100px; padding:10px 10px 10px 22px;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  box-shadow:0 20px 50px rgba(124,58,237,.4);
  transition:transform .4s cubic-bezier(.2,.9,.3,1.1), opacity .4s ease;
}
.sticky-banner.hide{transform:translateX(-50%) translateY(160%); opacity:0;}
.sticky-banner p{font-size:13.5px; font-weight:600; display:flex; align-items:center; gap:8px; margin:0;}
.sticky-banner p i{width:15px; height:15px; flex:0 0 15px;}
.sticky-banner .actions{display:flex; align-items:center; gap:8px; flex-shrink:0;}
.tg-btn{
  background:#fff; color:#111; font-size:13px; font-weight:700; padding:9px 16px; border-radius:100px;
  display:flex; align-items:center; gap:6px; transition:transform .2s ease; height:34px;
}
.tg-btn i{width:14px; height:14px; flex:0 0 14px;}
.tg-btn:hover{transform:scale(1.05);}
.banner-close{
  width:30px; height:30px; flex:0 0 30px; border-radius:50%; background:rgba(255,255,255,.15); border:none; color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:16px; line-height:1;
}
@media (max-width:600px){
  .sticky-banner p span.full{display:none;}
}

/* ============ REVEAL (no layout shift: transform+opacity only) ============ */
/* Elements are VISIBLE by default. Only once GSAP has actually loaded do we
   hide them for animation (html.gsap-ready). If the CDN is blocked the page
   stays fully readable instead of blanking at opacity:0 — the bug where the
   whole site "showed nothing". */
.reveal{opacity:1; transform:none;}
html.gsap-ready .reveal{opacity:0; transform:translateY(40px); will-change:transform, opacity;}

/* Dynamically-mounted nodes (tab bodies, injected cards) must not depend on the
   boot-time GSAP pass, which only sees elements present at boot. They self-
   animate via CSS so a node mounted after load is never left at opacity:0. */
.anim-in{animation:animIn .5s cubic-bezier(.22,.61,.36,1) both;}
@keyframes animIn{from{opacity:0; transform:translateY(20px);} to{opacity:1; transform:none;}}
@media (prefers-reduced-motion: reduce){ .anim-in{animation:none;} }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar{width:10px;}
::-webkit-scrollbar-track{background:#050505;}
::-webkit-scrollbar-thumb{background:#2a2a35; border-radius:10px;}
::-webkit-scrollbar-thumb:hover{background:var(--accent);}

/* ============ RESPONSIVE NAV ============ */
@media (max-width:860px){
  nav.main-nav{display:none;}
  .burger{display:flex;}
  .mobile-nav{display:flex;}
}
@media (min-width:861px){
  .mobile-nav{display:none !important;}
}

@media (max-width:600px){
  .hero{padding:calc(var(--header-h) + 60px) 0 70px; min-height:auto;}
  section.pad{padding:80px 0;}
  .footer-top{flex-direction:column;}
  .deal-card{padding:48px 24px;}
  .btn-giant{padding:18px 32px; font-size:16px; width:100%;}
}

/* very narrow phones (<=400px): keep the terminal and code blocks inside the
   viewport instead of letting their content set the page width. */
@media (max-width:400px){
  .wrap{padding:0 16px;}
  .terminal-body{padding:18px 16px; font-size:12px;}
  .terminal-bar{padding:11px 14px;}
  .terminal-title{font-size:11.5px;}
  .terminal-copy{font-size:11px; padding:5px 9px;}
  .tut-step{padding:16px 16px; gap:12px;}
  .tut-code{font-size:11.5px; padding:10px 11px;}
  .pg-card{border-radius:16px;}
  .pg-bar{padding:11px 14px; flex-wrap:wrap;}
  .pg-key-chip{margin-left:0; max-width:100%;}
  .pg-log{padding:14px 12px;}
  .pg-compose{padding:12px 14px;}
  .pg-hint{padding:0 14px 12px;}
}

/* folded / ultra-narrow phones (<=300px): the header was the last thing
   overflowing — its button + burger no longer fit next to the logo. */
@media (max-width:300px){
  .wrap{padding:0 12px;}
  .header-right{gap:8px;}
  .header-right .btn-sm{padding:7px 10px; font-size:12px;}
  .logo-text{font-size:16px;}
  .burger{padding:7px 9px;}
}

/* ultra-narrow phones (<=260px): drop the header CTA, the burger already
   gives access to the same link via the mobile menu. */
@media (max-width:260px){
  .header-right .btn-sm{display:none;}
  .hero h1{font-size:1.6rem;}
  .section-title{font-size:1.5rem;}
}

/* <=320px: the deal card's 48px side padding plus the mono range string was
   holding the page at 312px. Shrink the padding and let long tokens wrap. */
@media (max-width:340px){
  .deal-card{padding:44px 18px; border-radius:20px;}
  .deal-card h2{font-size:1.55rem; overflow-wrap:anywhere;}
  .deal-card p{font-size:14.5px; margin-bottom:28px; overflow-wrap:break-word;}
  .funpay-range{overflow-wrap:anywhere;}
  .btn-giant{padding:15px 20px; font-size:15px;}
  .deal-note{font-size:12.5px; gap:8px;}
  .section-sub, .hero p.sub{font-size:0.95rem; overflow-wrap:break-word;}
  .pg-bubble{font-size:12.5px;}
  .tut-step h4{font-size:14.5px;}
  /* the balance card's inner flex box was the last 11px of overflow */
  .balance-card{padding:26px 16px; border-radius:18px;}
  .balance-card h3{font-size:18px; overflow-wrap:anywhere;}
  .balance-form{gap:8px;}
  .balance-input-wrap{flex:1 1 100%; min-width:0;}
  .balance-input{font-size:13px; padding:13px 14px 13px 40px;}
  .balance-input-wrap i{left:14px;}
}


/* ============ SUBPAGES (shared chrome) ============ */
.page-head{padding:calc(var(--header-h) + 56px) 0 34px; text-align:center;}
.page-head h1{
  font-family:var(--font-head); font-weight:700;
  font-size:clamp(2rem, 4.4vw, 3.1rem); line-height:1.08;
  letter-spacing:-0.035em; margin-bottom:14px;
  overflow-wrap:break-word;
}
.page-head p{color:var(--gray); font-size:15.5px; line-height:1.65; max-width:620px; margin:0 auto;}
.page-head .eyebrow{margin-bottom:14px;}
.crumb{color:var(--gray-dim); font-size:12.5px; font-family:var(--font-mono); margin-bottom:14px;}
.crumb a{color:var(--gray);}
.crumb a:hover{color:var(--accent-light);}

/* a grid of cards used by the models + tutorials index pages */
.card-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:22px;}
.card{
  background:linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border:1px solid var(--border); border-radius:18px; padding:22px;
  transition:transform .2s ease, border-color .2s ease;
  min-width:0;
}
.card:hover{transform:translateY(-3px); border-color:var(--border-strong);}
.card h3{font-family:var(--font-head); font-size:17px; margin-bottom:8px; overflow-wrap:anywhere;}
.card p{color:var(--gray); font-size:13.5px; line-height:1.62;}
.card .row{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px;}
.card .tag{
  font-family:var(--font-mono); font-size:11px; padding:3px 9px; border-radius:6px;
  background:var(--accent-soft); border:1px solid rgba(124,58,237,.35); color:var(--accent-light);
}
.card .ctx{
  font-family:var(--font-mono); font-size:11px; color:var(--gray-dim);
}
.card-foot{display:flex; gap:8px; flex-wrap:wrap; margin-top:16px;}
.card .ic{width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center;
  background:var(--accent-soft); border:1px solid rgba(124,58,237,.35); color:var(--accent-light); flex:0 0 38px;}
.card .ic svg{width:18px; height:18px;}

.empty-state{
  text-align:center; padding:56px 20px; border:1px dashed var(--border-strong);
  border-radius:18px; color:var(--gray);
}
.empty-state svg{width:34px; height:34px; color:var(--gray-dim); margin-bottom:14px;}

@media (max-width:400px){
  .page-head{padding:calc(var(--header-h) + 34px) 0 26px;}
  .card{padding:18px; border-radius:16px;}
}

/* ---- company block: FAQ accordion ---- */
.faq-list{max-width:820px; margin:0 auto; display:flex; flex-direction:column; gap:10px;}
.faq-item{
  border:1px solid var(--border-strong); border-radius:14px; background:var(--card,rgba(255,255,255,.02));
  overflow:hidden;
}
.faq-item summary{
  cursor:pointer; list-style:none; padding:16px 20px; font-family:var(--font-head);
  font-size:15.5px; color:#fff; display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.faq-item summary::-webkit-details-marker{display:none;}
.faq-item summary::after{content:'+'; font-size:20px; color:var(--accent-light); line-height:1; transition:transform .2s;}
.faq-item[open] summary::after{transform:rotate(45deg);}
.faq-item p{padding:0 20px 18px; color:var(--gray); font-size:13.8px; line-height:1.65; margin:0;}
.faq-item code{font-family:var(--font-mono); font-size:12.5px; color:var(--accent-light);}
