/* ============================================================
   CHARLES — trading-terminal design system
   Display: Sora · Mono: JetBrains Mono
   ============================================================ */

:root {
  --bg:        #07100c;
  --bg-2:      #0b1812;
  --surface:   #0f1d16;
  --surface-2: #142519;
  --line:      rgba(120, 235, 165, 0.10);
  --line-2:    rgba(120, 235, 165, 0.18);
  --text:      #e7f3ea;
  --muted:     #7f937f;
  --muted-2:   #5d6e5d;
  --up:        #46f08a;   /* primary / profit / accent */
  --up-dim:    #2bbf6b;
  --amber:     #ffbe5c;
  --down:      #ff6b6b;
  --glow:      0 0 28px rgba(70, 240, 138, 0.28);
  --radius:    14px;
  --maxw:      1180px;
  --font-d:    'Sora', system-ui, sans-serif;
  --font-m:    'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-m);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* faint trading-grid backdrop */
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(70,240,138,0.10), transparent 60%);
  background-size: 56px 56px, 56px 56px, 100% 100%;
}

h1, h2, h3, h4 { font-family: var(--font-d); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-m); }
.accent { color: var(--up); }
.amber { color: var(--amber); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- ticker bar ---------- */
.ticker {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: rgba(7,16,12,0.7);
  overflow: hidden;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.ticker__track {
  display: inline-flex;
  gap: 42px;
  padding: 8px 0;
  animation: scroll 38s linear infinite;
}
.ticker__track span b { color: var(--up); font-weight: 500; }
.ticker__track span .dn { color: var(--down); }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,16,12,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-d); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--up); box-shadow: var(--glow); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.navlinks { display: flex; align-items: center; gap: 30px; font-size: 13.5px; }
.navlinks a { color: var(--muted); transition: color .18s; }
.navlinks a:hover { color: var(--text); }
.navlinks a.active { color: var(--up); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-m); font-size: 13.5px; font-weight: 500;
  padding: 10px 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--up); color: var(--bg); background: var(--up);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.btn--ghost { background: transparent; color: var(--up); border-color: var(--line-2); }
.btn--ghost:hover { background: rgba(70,240,138,0.08); box-shadow: none; }
.btn--lg { padding: 14px 26px; font-size: 14.5px; }

/* ---------- hero ---------- */
.hero { padding: 80px 0 60px; position: relative; }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 54px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--up); border: 1px solid var(--line-2);
  background: rgba(70,240,138,0.06); padding: 6px 13px; border-radius: 100px; margin-bottom: 26px;
}
.hero h1 { font-size: clamp(38px, 5.4vw, 62px); margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--up); text-shadow: var(--glow); }
.hero p.lede { color: var(--muted); font-size: 16px; max-width: 30em; margin-bottom: 32px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero__note { font-size: 12.5px; color: var(--muted-2); margin-top: 20px; }

/* ---------- terminal window ---------- */
.term {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
  overflow: hidden; font-size: 13px;
}
.term__bar { display: flex; align-items: center; gap: 7px; padding: 11px 15px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,0.25); }
.term__bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.term__bar i:nth-child(1){ background:#ff5f57; } .term__bar i:nth-child(2){ background:#febc2e; } .term__bar i:nth-child(3){ background:#28c840; }
.term__title { margin-left: 10px; color: var(--muted); font-size: 12px; }
.term__body { padding: 18px 18px 22px; line-height: 1.75; }
.term__body .cmd { color: var(--up); }
.term__body .cmd::before { content: "$ "; color: var(--muted-2); }
.term__body .out { color: var(--muted); }
.term__body .ok { color: var(--up); }
.term__body .warn { color: var(--amber); }
.term__cursor { display:inline-block; width:8px; height:15px; background:var(--up); vertical-align:middle; animation: blink 1.05s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- sections ---------- */
section { padding: 72px 0; position: relative; }
.eyebrow { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--up-dim); margin-bottom: 14px; }
.h-sec { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 16px; }
.sub-sec { color: var(--muted); max-width: 46em; margin-bottom: 40px; }

/* feature grid */
.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: border-color .2s, transform .2s, background .2s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-4px); background: var(--surface-2); }
.card .ico { font-size: 22px; margin-bottom: 14px; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 13.5px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step__n { font-family: var(--font-d); font-weight: 700; font-size: 13px; color: var(--bg); background: var(--up); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 16px; }
.step h4 { font-size: 15.5px; margin-bottom: 7px; }
.step p { color: var(--muted); font-size: 13px; }

/* cost table */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.cost { width: 100%; border-collapse: collapse; font-size: 14px; }
table.cost th, table.cost td { text-align: left; padding: 15px 22px; border-bottom: 1px solid var(--line); }
table.cost th { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
table.cost td:last-child, table.cost th:last-child { text-align: right; }
table.cost tr:last-child td { border-bottom: none; }
table.cost .total td { background: rgba(70,240,138,0.05); font-weight: 600; }
table.cost .total .accent { color: var(--up); font-size: 16px; }
.free { color: var(--up); }

/* pricing */
.price { display: flex; justify-content: center; align-items: stretch; gap: 22px; }
.plan { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 36px; position: relative; max-width: 420px; width: 100%; }
.plan--feature { background: linear-gradient(180deg, var(--surface-2), var(--surface)); box-shadow: 0 24px 60px rgba(0,0,0,0.4); }
.plan .tag { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--up); }
.plan .amt { font-family: var(--font-d); font-size: 52px; font-weight: 700; margin: 14px 0 4px; letter-spacing: -0.03em; }
.plan .amt span { font-size: 16px; color: var(--muted); font-family: var(--font-m); font-weight: 400; }
.plan ul { list-style: none; margin: 26px 0; display: grid; gap: 12px; }
.plan li { font-size: 13.5px; color: var(--text); display: flex; gap: 11px; }
.plan li::before { content: "▸"; color: var(--up); }
.plan li.muted { color: var(--muted-2); }
.plan li.muted::before { color: var(--muted-2); }

/* callout / disclaimer */
.callout { border: 1px solid var(--line-2); background: rgba(255,190,92,0.04); border-left: 3px solid var(--amber); border-radius: 10px; padding: 18px 22px; font-size: 13px; color: var(--muted); }
.callout b { color: var(--amber); }

/* ---------- setup page ---------- */
.doc { display: grid; grid-template-columns: 220px 1fr; gap: 48px; padding-top: 48px; }
.toc { position: sticky; top: 90px; align-self: start; font-size: 13px; }
.toc a { display: block; color: var(--muted); padding: 7px 0; border-left: 2px solid transparent; padding-left: 14px; transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--text); border-color: var(--line-2); }
.docbody h2 { font-size: 26px; margin: 0 0 8px; scroll-margin-top: 90px; }
.docbody .lead { color: var(--muted); margin-bottom: 36px; max-width: 50em; }
.docstep { margin-bottom: 44px; scroll-margin-top: 90px; }
.docstep > h3 { font-size: 19px; margin-bottom: 6px; display: flex; align-items: baseline; gap: 12px; }
.docstep > h3 .num { font-family: var(--font-m); font-size: 13px; color: var(--up); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 8px; }
.docstep > p { color: var(--muted); margin-bottom: 16px; max-width: 50em; }
.os-tag { display: inline-block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bg); background: var(--up-dim); border-radius: 5px; padding: 2px 9px; margin: 18px 0 8px; }
.os-tag.win { background: var(--amber); }

pre.code {
  background: #050b08; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.7;
  color: #cfe8d6; margin: 6px 0 4px; position: relative;
}
pre.code .c { color: var(--muted-2); }      /* comment */
pre.code .k { color: var(--up); }            /* command/keyword */
pre.code .s { color: var(--amber); }         /* string/path */
.copy-hint { font-size: 11px; color: var(--muted-2); margin-bottom: 14px; }

table.cmd { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0; }
table.cmd th, table.cmd td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.cmd th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
table.cmd td:first-child { color: var(--up); white-space: nowrap; }
table.cmd tr:last-child td { border-bottom: none; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 44px 0; color: var(--muted-2); font-size: 12.5px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
footer .brand { font-size: 15px; color: var(--muted); }
footer .dot { animation: none; box-shadow: none; }

/* reveal on load */
.reveal { opacity: 0; transform: translateY(16px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* responsive */
@media (max-width: 920px) {
  .hero__grid, .price, .doc { grid-template-columns: 1fr; }
  .feat { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .toc a { border-left: none; padding-left: 0; }
  .navlinks { display: none; }
}
@media (max-width: 560px) {
  .feat, .steps { grid-template-columns: 1fr; }
}
