/* Pine Script indicators hub. Colours follow TradingView's dark chart theme and its UI font stack, so the page feels
   familiar to TradingView users; no TradingView logo or artwork is used. */
:root {
  --bg: #131722;          /* chart background */
  --bg-deep: #0c0e15;     /* page band behind the hero */
  --panel: #1e222d;       /* panels, dialogs */
  --panel-hi: #2a2e39;    /* hover, borders */
  --line: #2a2e39;
  --line-soft: #363a45;
  --text: #d1d4dc;
  --text-hi: #f0f3fa;
  --muted: #787b86;
  --blue: #2962ff;
  --blue-hi: #1e53e5;
  --blue-soft: rgba(41, 98, 255, .14);
  --green: #089981;
  --green-soft: rgba(8, 153, 129, .14);
  --red: #f23645;
  --red-soft: rgba(242, 54, 69, .14);
  --amber: #f7a600;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: #5b8def; text-decoration: none; }
a:hover { color: #8fb0ff; text-decoration: underline; }
h1, h2, h3 { color: var(--text-hi); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: .9em; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: .05em .35em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--blue); color: #fff; padding: 8px 12px; border-radius: 4px; }

/* top bar, like the chart header */
.tv-nav { position: sticky; top: 0; z-index: 20; background: rgba(19, 23, 34, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tv-nav .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.tv-brand { display: flex; align-items: center; gap: 10px; color: var(--text-hi); font-weight: 700; white-space: nowrap; }
.tv-brand:hover { text-decoration: none; color: #fff; }
.tv-brand .mark { width: 28px; height: 28px; border-radius: 6px; background: var(--blue); display: grid; place-items: center; }
.tv-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.tv-links::-webkit-scrollbar { display: none; }
.tv-links a { color: var(--text); padding: 6px 10px; border-radius: 4px; font-size: .92rem; white-space: nowrap; }
.tv-links a:hover { background: var(--panel-hi); text-decoration: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 6px; font-weight: 600; font-size: .98rem; border: 1px solid transparent; transition: background .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hi); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-hi); border-color: var(--line-soft); }
.btn-ghost:hover { background: var(--panel-hi); color: #fff; }
.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* hero */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(41, 98, 255, .22), transparent 60%), var(--bg-deep); border-bottom: 1px solid var(--line); padding: 56px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 36px; align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.02fr 1fr; } }
.eyebrow { color: #5b8def; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .82rem; margin-bottom: 14px; }
.lede { font-size: 1.12rem; color: var(--text); max-width: 620px; }
.proof { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.proof li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.proof b { display: block; color: var(--text-hi); font-size: .95rem; }
.proof span { color: var(--muted); font-size: .85rem; }

/* chart window frame around screenshots */
.chart { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.chart-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--text); }
.chart-bar .sym { font-weight: 700; color: var(--text-hi); }
.chart-bar .tf { color: var(--muted); }
.chart-bar .ind { margin-left: auto; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: .85rem; padding: 8px 12px; border-top: 1px solid var(--line); }

/* sections */
section { padding: 64px 0; border-bottom: 1px solid var(--line); }
section.alt { background: var(--bg-deep); }
.section-head { margin-bottom: 28px; }
.section-head p { color: var(--muted); max-width: 720px; }

/* product cards */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 860px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; }
.card .head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.card .head img { width: 56px; height: 56px; border-radius: 10px; }
.card h3 { margin: 0 0 4px; }
.card p { color: var(--text); }
.card ul { margin: 0 0 12px; padding-left: 20px; color: var(--text); }
.card .actions { margin-top: auto; padding-top: 6px; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 6px; letter-spacing: .02em; }
.tag.free { background: var(--green-soft); color: #22ab94; }
.tag.paid { background: var(--blue-soft); color: #5b8def; }
.tag.soon { background: rgba(247, 166, 0, .14); color: var(--amber); }
.tag.v6 { background: var(--panel-hi); color: var(--text); }

.next { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.next li { background: var(--panel); border: 1px dashed var(--line-soft); border-radius: var(--radius); padding: 12px 14px; }
.next b { color: var(--text-hi); display: block; font-size: .95rem; }
.next span { color: var(--muted); font-size: .85rem; }

/* steps */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; position: relative; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; margin-bottom: 12px; }
.steps li > b { color: var(--text-hi); display: block; margin-bottom: 4px; }
.steps p b { color: var(--text-hi); }
.steps p { color: var(--text); margin: 0; font-size: .95rem; }

/* gallery */
.gallery { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 860px) { .gallery { grid-template-columns: 1fr 1fr; } }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--panel); color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(42, 46, 57, .45); }
td.yes { color: #22ab94; font-weight: 600; }
td.no { color: var(--muted); }
td.num { font-family: var(--mono); color: var(--text-hi); }

/* FAQ */
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 600; color: var(--text-hi); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 18px 16px; color: var(--text); }

.note { background: var(--panel); border-left: 3px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; color: var(--text); }

/* footer */
.tv-foot { padding: 36px 0 48px; color: var(--muted); font-size: .88rem; }
.tv-foot p { margin: 0 0 8px; }
.tv-foot a { color: var(--text); }

@media (max-width: 560px) {
  .proof { grid-template-columns: 1fr; }
  .hero { padding: 36px 0; }
  section { padding: 44px 0; }
  .tv-brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* custom work */
.two-col { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; gap: 40px; } }
.ticks, .crosses { list-style: none; padding: 0; margin: 0; }
.ticks li, .crosses li { position: relative; padding: 0 0 10px 28px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #22ab94; font-weight: 700; }
.crosses li::before { content: "✕"; position: absolute; left: 2px; top: 0; color: var(--red); font-weight: 700; }
.ticks b { color: var(--text-hi); }
.flow { list-style: none; counter-reset: f; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 860px) { .flow { grid-template-columns: repeat(5, 1fr); } }
.flow li { counter-increment: f; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: var(--radius); padding: 14px; }
.flow li b { display: block; color: var(--text-hi); }
.flow li b::before { content: counter(f) ". "; color: #5b8def; }
.flow li span { color: var(--muted); font-size: .9rem; }
.cta-box { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; background: linear-gradient(90deg, var(--blue-soft), transparent), var(--panel); border: 1px solid var(--line-soft); border-radius: 12px; padding: 20px 22px; }
.cta-box div { max-width: 720px; }
.cta-box b { color: var(--text-hi); }

/* how I build */
.grid-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .grid-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .grid-cards { grid-template-columns: repeat(4, 1fr); } }
.grid-cards li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.grid-cards b { color: var(--text-hi); display: block; margin-bottom: 6px; }
.grid-cards p { margin: 0; font-size: .92rem; }
.anatomy { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 32px; align-items: start; }
@media (min-width: 980px) { .anatomy { grid-template-columns: .8fr 1.2fr; } }
.anatomy .notes { padding-left: 20px; }
.anatomy .notes li { margin-bottom: 6px; }
pre.code { margin: 0; background: #0c0e15; border: 1px solid var(--line-soft); border-radius: 10px; padding: 18px; overflow-x: auto; font: 13.5px/1.55 var(--mono); color: var(--text); }
pre.code code { background: none; border: 0; padding: 0; font-size: inherit; }
pre.code .c { color: #787b86; }
pre.code .k { color: #2962ff; font-weight: 600; }
pre.code .s { color: #22ab94; }
pre.code .n { color: #f7a600; }

/* technical notes */
.notes-grid details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.notes-grid summary { cursor: pointer; padding: 16px 18px; font-weight: 600; color: var(--text-hi); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.notes-grid summary::-webkit-details-marker { display: none; }
.notes-grid summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.notes-grid details[open] summary::after { content: "−"; }
.notes-grid details > div { padding: 0 18px 16px; }
.notes-grid ul { padding-left: 20px; }
.notes-grid li { margin-bottom: 6px; }
.notes-grid .table-wrap table { min-width: 0; }
.qs { padding-left: 22px; }
.qs li { margin-bottom: 8px; color: var(--text-hi); }
