/* ===== TorchRank Learn — Fixed Header + Bright Gradient Bar (2025-09-04) ===== */
:root{
  /* Global palette */
  --bg:#0b0f14;             /* page bg */
  --txt:#e5eef7;            /* primary text */
  --muted:#9bb0c3;          /* secondary text */
  --card:#121922;           /* generic card bg */
  --accent:#38bdf8;         /* link color (legacy) */

  /* Brand header + strip (match main site footprints) */
  --top-strip: 18px;        /* TALLER strip so it reads */
  --brand-height: 60px;     /* header height */
  /* Per-page gradient colors (override in <style> on each page if desired) */
  --strip-c1:#0dd3c5;       /* teal */
  --strip-c2:#6a5cff;       /* purple */
  --strip-c3:#64ffda;       /* electric mint */
  --strip-grad: linear-gradient(90deg, var(--strip-c1) 0%, var(--strip-c2) 50%, var(--strip-c3) 100%);
  --strip-glow:#64ffda;     /* neon line just under the strip */

  /* Learn “laser” theme */
  --ink:#e8f7ff;
  --ink-dim:#b9d7e6;
  --panel:#101621;
  --panel-2:#0c121b;
  --teal:#0dd3c5;
  --purple:#6a5cff;
  --electric:#64ffda;
  --muted-panel:#1a2230;
  --shadow:0 10px 30px rgba(0,0,0,.45);
  --radius:18px;
}

/* Global reset */
*{box-sizing:border-box}
html{font-size:16px}
body{
  margin:0;
  background:var(--bg);
  color:var(--txt);
  -webkit-font-smoothing:antialiased;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;

  /* Compensate for fixed strip + fixed header so content starts below them */
  padding-top: calc(var(--top-strip) + var(--brand-height));
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}

/* ===== Fixed gradient strip + fixed header (no gap, no wriggle) ===== */

/* Bright gradient bar */
.brand-bar{
  position:fixed; top:0; left:0; right:0;
  height:var(--top-strip);
  background: var(--strip-grad);
  box-shadow: 0 8px 18px rgba(100,255,218,.28);
  z-index: 1000;
  line-height:0;
}
.brand-bar::after{
  content:"";
  position:absolute; left:0; right:0; bottom:-3px;
  height:3px; background:var(--strip-glow); opacity:.95;
}

/* Header fixed directly under the strip */
.brand{
  position:fixed; top:var(--top-strip); left:0; right:0;
  height:var(--brand-height);
  display:flex; align-items:center;
  border-bottom:1px solid rgba(255,255,255,.08);
  background: transparent;             /* don’t darken the area */
  z-index: 1001;
}
.brand-inner{
  max-width:1120px; margin:0 auto; padding:0 18px; width:100%;
  display:flex; align-items:center; gap:1rem;
}
.brand-link{display:flex;align-items:center;color:inherit;text-decoration:none}
.brand-logo{height:40px;max-height:40px;width:auto;display:block}
.brand-title{font-size:1.25rem;font-weight:700;margin-left:.25rem;color:inherit}

.brand-nav{margin-left:auto;display:flex;align-items:center;gap:1.5rem}
.brand-nav a{color:#cbd5e1;text-decoration:none;font-size:.95rem}
.brand-nav a:hover{color:#ffffff}
.brand-nav a.is-active{color:#ffffff;border-bottom:2px solid rgba(255,255,255,.35);padding-bottom:2px}

/* ===== Learn “laser” layout/components ===== */
.wrap{max-width:1050px;margin:40px auto;padding:0 20px}

.hero{
  display:grid; grid-template-columns:1.2fr .8fr; gap:22px; align-items:center;
  margin:28px 0 14px
}
.hero .blurb{
  background:linear-gradient(180deg,rgba(13,211,197,.08),rgba(106,92,255,.08));
  border:1px solid rgba(100,255,218,.2);
  padding:26px; border-radius:var(--radius); box-shadow:var(--shadow)
}
.hero h1{font-size:40px;line-height:1.15;margin:0 0 10px;letter-spacing:.3px}
.hero p.lead{font-size:18px;color:var(--ink-dim);margin:0}

.panel{background:var(--panel);border:1px solid #152033;border-radius:var(--radius);padding:18px}

/* Make sticky TOC respect fixed header */
.toc{
  position:sticky;
  top: calc(var(--top-strip) + var(--brand-height) + 12px);
  background:var(--panel); border:1px solid #17263b;
  padding:16px; border-radius:14px
}
.toc h4{margin:0 0 10px;font-size:14px;color:var(--ink-dim);text-transform:uppercase;letter-spacing:.12em}
.toc a{display:block;padding:6px 0;color:var(--ink-dim)}
.toc a:hover{color:var(--electric)}

section{margin:36px 0}
section h2{font-size:26px;margin:0 0 8px}
.sub{color:var(--ink-dim);margin-top:2px}

.grid{display:grid;gap:16px}
.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}

.card{
  background:var(--panel);
  border:1px solid #162136;
  border-radius:16px; padding:16px; box-shadow:var(--shadow)
}
.card .k{font-size:12px;color:var(--ink-dim);text-transform:uppercase;letter-spacing:.14em}
.card h3{margin:6px 0 8px;font-size:18px}
.card p{margin:0}

.callout{
  border-left:4px solid var(--electric);
  background:var(--panel-2);
  padding:14px 16px; border-radius:12px; margin:16px 0
}

.steps{counter-reset:step}
.step{
  display:flex; gap:14px; align-items:flex-start;
  background:var(--panel); border:1px dashed #2a3b57;
  padding:14px; border-radius:14px; margin:12px 0
}
.step::before{
  counter-increment:step; content:counter(step);
  display:inline-grid; place-items:center; min-width:30px; height:30px;
  border-radius:999px; border:2px solid var(--electric)
}

pre{background:#0a1018;border:1px solid #162136;border-radius:12px;padding:14px;overflow:auto}
code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}

.np{display:flex;gap:16px;justify-content:space-between;margin:36px 0}
.np a{display:block;background:var(--panel);border:1px solid #162136;padding:14px;border-radius:14px}

.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{background:var(--muted-panel);border:1px solid #1e2b42;padding:6px 10px;border-radius:999px;font-size:12px;color:var(--ink-dim)}

.cta{
  background:linear-gradient(90deg,rgba(100,255,218,.1),rgba(106,92,255,.12));
  border:1px solid rgba(100,255,218,.25);
  padding:18px; border-radius:16px; display:flex; gap:14px; align-items:center; justify-content:space-between; box-shadow:var(--shadow)
}
.cta .btn{background:var(--electric);color:#002b24;border:none;border-radius:12px;padding:10px 14px;font-weight:700}
.cta .btn:hover{filter:brightness(1.05)}

footer{border-top:1px solid #1d2a39;color:#9fb2c5;padding:18px;margin-top:28px}

/* ===== Responsive ===== */
@media (max-width:900px){
  .hero{grid-template-columns:1fr}
  .grid.cols-3,.grid.cols-2{grid-template-columns:1fr}
}
/* LEARN_HEADER_LOCK: bt-20250904-l1 — single top bar + fixed header under it (match bittensor sizing) */
:root{
  --learn-bar-h: 12px;           /* thickness of the color bar (10–14px works) */
  --learn-header-h: 60px;        /* header height to match bittensor pages */
  --c-orange: #ff8a00;           /* BT orange */
  --c-gold:   #ffc000;           /* BT gold */
  --c-teal:   #12e3d3;           /* teal center */
}

/* Make the Learn bar the only bar and fix it to the top */
.learn-strip, .color-bar{
  position: fixed !important;
  top: 0; left: 0; right: 0;
  height: var(--learn-bar-h) !important;
  /* Orange→Gold edges with Teal in the middle */
  background: linear-gradient(
    90deg,
    var(--c-orange) 0%,
    var(--c-gold)   14%,
    var(--c-teal)   50%,
    var(--c-gold)   86%,
    var(--c-orange) 100%
  ) !important;
  z-index: 2000 !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}

/* Header fixed directly under the bar (no scroll jump, no gap) */
.tr-header, .site-header{
  position: fixed !important;
  top: var(--learn-bar-h) !important;
  left: 0; right: 0; width: 100%;
  z-index: 1500 !important;
  margin: 0 !important;

  min-height: var(--learn-header-h);
  background: rgba(11,15,24,.92);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: saturate(120%) blur(6px);
  -webkit-backdrop-filter: saturate(120%) blur(6px);
}

/* Brand sizing (match bittensor header look) */
.tr-brand .tr-logo, .brand-logo{ height: 40px !important; width: auto !important; }
.tr-brand-name, .brand-name{ color:#e6edf3 !important; font-weight:800 !important; font-size:1.15rem !important; }

/* Nav sizing (compact like bittensor) */
.tr-nav a, .site-nav a{
  font-size: .90rem !important;
  padding: 6px 8px !important;
}

/* Push page content below the fixed bar + header */
html, body{ scroll-padding-top: calc(var(--learn-bar-h) + var(--learn-header-h)); }
body{ padding-top: calc(var(--learn-bar-h) + var(--learn-header-h)) !important; }

/* Kill any earlier offsets or margins that were used for sticky headers */
:root{ --top-strip-h: 0px !important; }
.site-header, .tr-header{ margin-top: 0 !important; }
