/* ============================================================
   TradingView — download terminal (v3)
   A deliberately different system from the main site:
   fixed left sidebar nav, blueprint grid, sharp corners,
   mono-forward "developer / trading-desk" aesthetic.
   Violet stays the brand colour, paired with cyan (not fuchsia).
   No frameworks.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

:root {
  --bg: #08070f;
  --bg-2: #0c0b16;
  --surface: #121020;
  --surface-2: #17142a;
  --line: #221d36;
  --line-2: #342b52;
  --text: #ecebf6;
  --muted: #a39cc4;
  --dim: #6d6790;
  --violet: #7c5cff;
  --violet-l: #a78bfa;
  --violet-d: #5b3fd6;
  --cyan: #2dd4ee;
  --cyan-d: #0e9bbb;
  --up: #3ddc97;
  --down: #ff5d73;
  --amber: #f5b545;
  --grad: linear-gradient(120deg, #a78bfa 0%, #7c5cff 45%, #2dd4ee 100%);
  --r: 6px;
  --r-lg: 10px;
  --sidebar-w: 256px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, Arial, sans-serif;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- Blueprint grid background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; background: var(--bg); }
.bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.5;
  mask-image: radial-gradient(120% 90% at 70% 0%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(120% 90% at 70% 0%, black, transparent 80%);
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(40% 50% at 80% 0%, rgba(124, 92, 255, 0.20), transparent 70%),
    radial-gradient(35% 45% at 12% 12%, rgba(45, 212, 238, 0.10), transparent 70%);
}

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.main { padding: 0; }
@media (min-width: 1000px) {
  .main { margin-left: var(--sidebar-w); }
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1rem;
  background: rgba(10, 9, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sidebar__brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 1.02rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.sidebar__brand .m { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r); overflow: hidden; background: rgba(124,92,255,0.12); border: 1px solid var(--line-2); }
.sidebar__brand .m img { width: 100%; height: 100%; object-fit: contain; }
.sidebar__status { display: none; }
.sidebar__nav { display: none; }
.sidebar__foot { display: none; }
.sidebar__actions { display: flex; align-items: center; gap: 0.5rem; }

/* mobile nav: horizontal scroll under brand row handled by .mnav */
.mnav { display: flex; gap: 0.3rem; overflow-x: auto; padding: 0.5rem 1rem; border-bottom: 1px solid var(--line); background: rgba(10,9,18,0.7); position: sticky; top: 3.4rem; z-index: 39; -webkit-overflow-scrolling: touch; }
.mnav::-webkit-scrollbar { display: none; }
.mnav a { white-space: nowrap; font-family: var(--mono); font-size: 0.74rem; color: var(--muted); text-decoration: none; padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; }
.mnav a:hover { color: var(--text); border-color: var(--line-2); }

@media (min-width: 1000px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
    padding: 1.4rem 1.1rem; border-bottom: none; border-right: 1px solid var(--line);
  }
  .sidebar__brand { font-size: 1.1rem; padding: 0 0.4rem; }
  .sidebar__brand .m { width: 32px; height: 32px; }
  .sidebar__status { display: flex; align-items: center; gap: 0.5rem; margin: 1.2rem 0.4rem 1.6rem; font-family: var(--mono); font-size: 0.72rem; color: var(--dim); }
  .sidebar__status .led { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px rgba(61,220,151,0.18); animation: led 2s infinite; }
  @keyframes led { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
  .sidebar__nav { display: block; flex: 1; }
  .sidebar__nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; }
  .sidebar__nav a { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.6rem; color: var(--muted); text-decoration: none; font-size: 0.9rem; border-radius: var(--r); border-left: 2px solid transparent; transition: color 0.15s, background 0.15s, border-color 0.15s; }
  .sidebar__nav a:hover { color: var(--text); background: rgba(124,92,255,0.08); }
  .sidebar__nav a .ix { font-family: var(--mono); font-size: 0.72rem; color: var(--dim); min-width: 1.4rem; }
  .sidebar__nav a:hover .ix { color: var(--cyan); }
  .mnav { display: none; }
  .sidebar__foot { display: grid; gap: 0.7rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
  .sidebar__actions { display: none; }
}

/* ---------- Language select (sidebar + mobile) ---------- */
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.65rem; font-family: var(--mono); font-size: 0.78rem; font-weight: 600; color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r); }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-1px); margin-left: 0.15rem; }
.lang summary:hover { border-color: var(--violet); }
.lang__menu { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 168px; list-style: none; margin: 0; padding: 0.3rem; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 20px 50px -20px rgba(0,0,0,0.8); }
.lang--up .lang__menu { bottom: auto; top: calc(100% + 8px); }
.lang__menu a { display: block; padding: 0.5rem 0.7rem; color: var(--muted); text-decoration: none; font-size: 0.88rem; border-radius: var(--r); }
.lang__menu a:hover { background: rgba(124,92,255,0.12); color: var(--text); }
.lang__menu a[aria-current="true"] { color: var(--cyan); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.7rem 1.15rem; font-size: 0.9rem; font-weight: 700; font-family: var(--sans); text-decoration: none; border-radius: var(--r); border: 1px solid transparent; cursor: pointer; transition: transform 0.12s, box-shadow 0.18s, border-color 0.18s, background 0.18s, color 0.18s; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; }
.btn--block { width: 100%; }
.btn--primary { color: #0a0814; background: var(--grad); box-shadow: 0 10px 26px -12px rgba(124,92,255,0.8); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -14px rgba(45,212,238,0.6); }
.btn--ghost { color: var(--text); background: transparent; border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--violet); background: rgba(124,92,255,0.08); }
.btn--sm { padding: 0.42rem 0.8rem; font-size: 0.82rem; }

/* ---------- Layout helpers ---------- */
.section { padding: 4.5rem 0; border-bottom: 1px solid var(--line); position: relative; }
.section:last-of-type { border-bottom: none; }
.inner { max-width: 1040px; margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 1000px) { .inner { padding: 0 3rem; } }

.eyebrow { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); margin: 0 0 1rem; }
.eyebrow .ix { color: var(--dim); }
.section__title { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 0.8rem; }
.section__title .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section__lead { color: var(--muted); font-size: 1.02rem; margin: 0 0 2.4rem; max-width: 60ch; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--violet); color: #fff; padding: 0.5rem 1rem; border-radius: var(--r); z-index: 1000; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 4rem; border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; } }
.hero__tag { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--mono); font-size: 0.76rem; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 0.3rem 0.75rem; margin-bottom: 1.4rem; }
.hero__tag b { color: var(--cyan); font-weight: 700; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; margin: 0 0 1.1rem; }
.hero h1 .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.08rem; color: var(--muted); margin: 0 0 1.8rem; max-width: 42ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 1.4rem; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-family: var(--mono); font-size: 0.78rem; color: var(--dim); }
.hero__meta span b { color: var(--muted); font-weight: 600; }

/* Terminal manifest card */
.term { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: linear-gradient(180deg, var(--surface-2), var(--surface)); overflow: hidden; box-shadow: 0 30px 70px -34px rgba(124,92,255,0.5); }
.term__bar { display: flex; align-items: center; gap: 0.45rem; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02); }
.term__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.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__bar span { margin-left: 0.5rem; font-family: var(--mono); font-size: 0.72rem; color: var(--dim); }
.term__body { padding: 1.1rem 1.15rem; font-family: var(--mono); font-size: 0.82rem; line-height: 1.9; }
.term__body .pr { color: var(--violet-l); }
.term__body .cm { color: var(--dim); }
.term__body .key { color: var(--muted); }
.term__body .val { color: var(--text); }
.term__body .hl { color: var(--cyan); }
.term__body .ok { color: var(--up); }
.term__cta { padding: 0 1.15rem 1.15rem; }

/* ---------- Hero product video stage ---------- */
.stage { position: relative; margin-top: 3.2rem; }
.stage::before {
  content: ""; position: absolute; left: 50%; top: 4%; transform: translateX(-50%);
  width: 88%; height: 92%; z-index: -1; filter: blur(55px);
  background: radial-gradient(ellipse at center, rgba(124,92,255,0.40), rgba(45,212,238,0.14) 48%, transparent 70%);
}
.stage .ticker { margin-bottom: 0.85rem; border: 1px solid var(--line-2); border-radius: var(--r-lg); }
.window {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line-2); background: var(--surface);
  box-shadow: 0 50px 110px -46px rgba(124,92,255,0.7);
}
.window::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); padding: 1px;
  background: linear-gradient(150deg, rgba(167,139,250,0.55), transparent 38%, rgba(45,212,238,0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.window__bar { display: flex; align-items: center; gap: 0.45rem; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02); }
.window__bar i { width: 10px; height: 10px; border-radius: 50%; }
.window__bar i:nth-child(1) { background: #ff5f57; } .window__bar i:nth-child(2) { background: #febc2e; } .window__bar i:nth-child(3) { background: #28c840; }
.window__url { margin-left: 0.7rem; flex: 1; max-width: 300px; font-family: var(--mono); font-size: 0.72rem; color: var(--dim); padding: 0.24rem 0.75rem; background: rgba(124,92,255,0.06); border: 1px solid var(--line); border-radius: 999px; }
.window__body { aspect-ratio: 16 / 9; background: #0a0814; }
.window__body video { width: 100%; height: 100%; object-fit: cover; display: block; }

.buildbar {
  margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.1rem;
  padding: 0.85rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); font-family: var(--mono); font-size: 0.79rem; color: var(--muted);
}
.buildbar .seg { display: inline-flex; align-items: center; gap: 0.45rem; }
.buildbar .k { color: var(--dim); }
.buildbar .hl { color: var(--cyan); }
.buildbar .ok { color: var(--up); }
.buildbar .sep { color: var(--line-2); display: none; }
@media (min-width: 760px) { .buildbar .sep { display: inline; } }
.buildbar .btn { margin-left: auto; }

/* ---------- Ticker marquee ---------- */
.ticker {
  --ticker-gap: 2.4rem;
  --ticker-gap-half: 1.2rem;
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(124, 92, 255, 0.04); padding: 0.85rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker__track {
  display: flex; gap: var(--ticker-gap); width: max-content;
  animation: marquee 42s linear infinite; will-change: transform;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(-50% - var(--ticker-gap-half)), 0, 0); } }
.tick { display: inline-flex; align-items: baseline; gap: 0.5rem; font-family: var(--mono); font-size: 0.84rem; white-space: nowrap; }
.tick b { color: var(--text); font-weight: 700; letter-spacing: 0.02em; }
.tick .px { color: var(--muted); }
.tick .up { color: var(--up); } .tick .dn { color: var(--down); }

/* ---------- Fixed top-right language switch (desktop) ---------- */
.lang-fixed { display: none; }
@media (min-width: 1000px) {
  .lang-fixed { display: block; position: fixed; top: 1.05rem; right: 1.5rem; z-index: 60; }
  .lang-fixed summary { background: rgba(18, 16, 32, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .sidebar__foot .lang { display: none; }
}

/* ---------- Product feature cards ---------- */
.channels { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 760px) { .channels { grid-template-columns: repeat(3, 1fr); } }
.channel { padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 0.9rem; transition: border-color 0.18s, transform 0.18s; }
.channel:hover { border-color: var(--line-2); transform: translateY(-2px); }
.channel.is-rec { border-color: var(--violet); box-shadow: inset 0 0 0 1px rgba(124,92,255,0.3); }
.channel__top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.channel__name { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text); }
.channel__tag { font-family: var(--mono); font-size: 0.66rem; font-weight: 700; padding: 0.18rem 0.5rem; border-radius: 999px; letter-spacing: 0.08em; text-transform: uppercase; }
.channel__tag.rec { color: #0a0814; background: var(--grad); }
.channel__tag.dim { color: var(--dim); border: 1px solid var(--line-2); }
.channel__ver { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.channel__ver small { font-family: var(--mono); font-size: 0.74rem; font-weight: 500; color: var(--dim); display: block; letter-spacing: 0; }
.channel__bars { display: flex; gap: 4px; }
.channel__bars i { height: 5px; flex: 1; border-radius: 2px; background: var(--line-2); }
.channel__bars i.on { background: var(--grad); }
.channel__desc { color: var(--muted); font-size: 0.88rem; margin: 0; flex: 1; }
.channel .btn { margin-top: auto; }

/* ---------- Data table styles ---------- */
.matrix-wrap { border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.matrix-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.matrix { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.82rem; min-width: 620px; }
table.matrix th, table.matrix td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.matrix thead th { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); background: rgba(255,255,255,0.02); font-weight: 600; }
table.matrix tbody tr:last-child td { border-bottom: none; }
table.matrix tbody tr:hover td { background: rgba(124,92,255,0.05); }
table.matrix .os { color: var(--text); font-weight: 700; font-family: var(--sans); }
table.matrix .os .ic { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 0.5rem; }
table.matrix .fmt { color: var(--violet-l); }
table.matrix .sz { color: var(--muted); }
table.matrix .sum { color: var(--cyan); }
table.matrix .get a { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--line-2); padding-bottom: 1px; }
table.matrix .get a:hover { color: var(--cyan); border-color: var(--cyan); }

/* ---------- Platform download buttons ---------- */
.download-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 760px) { .download-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1120px) { .download-grid { grid-template-columns: repeat(3, 1fr); } }
.download-card {
  display: flex; align-items: center; gap: 0.9rem; min-height: 96px;
  padding: 1rem; color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}
.download-card:hover { border-color: var(--violet); background: rgba(124,92,255,0.08); transform: translateY(-2px); }
.download-card--primary { border-color: var(--violet); box-shadow: inset 0 0 0 1px rgba(124,92,255,0.22); }
.download-card__icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(255,255,255,0.03); }
.download-card__icon .ic { width: 22px; height: 22px; }
.download-card__body { display: grid; gap: 0.18rem; min-width: 0; flex: 1; }
.download-card__body b { font-size: 0.98rem; }
.download-card__body small { color: var(--dim); font-family: var(--mono); font-size: 0.72rem; line-height: 1.5; white-space: normal; }
.download-card__action { font-family: var(--mono); font-size: 0.74rem; color: var(--cyan); white-space: nowrap; }

/* ---------- Package-manager install blocks ---------- */
.pkgs { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 820px) { .pkgs { grid-template-columns: repeat(3, 1fr); } }
.pkg { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.pkg__head { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
.pkg__head .ic { width: 20px; height: 20px; }
.pkg__head b { font-family: var(--sans); font-size: 0.9rem; }
.pkg__head .os { margin-left: auto; font-family: var(--mono); font-size: 0.7rem; color: var(--dim); }
.pkg pre { margin: 0; padding: 1rem; font-family: var(--mono); font-size: 0.8rem; line-height: 1.8; color: var(--text); overflow-x: auto; }
.pkg pre .pr { color: var(--violet-l); user-select: none; }
.pkg pre .cm { color: var(--dim); }
.pkg pre .ar { color: var(--cyan); }
.pkg__body { padding: 1rem; color: var(--muted); font-size: 0.9rem; line-height: 1.75; }
.pkg__body b { color: var(--text); }

/* ---------- Blog ---------- */
.blog-hero { padding-top: 4rem; }
.blog-kicker { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1.3rem 0 0; }
.blog-kicker span,
.article-tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 0.24rem 0.62rem; color: var(--muted);
  font-family: var(--mono); font-size: 0.72rem;
  background: rgba(255,255,255,0.02);
}
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 780px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card {
  min-height: 270px; display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1.25rem; color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}
.post-card:hover { border-color: var(--violet); background: rgba(124,92,255,0.08); transform: translateY(-2px); }
.post-card--featured { border-color: var(--line-2); background: linear-gradient(180deg, rgba(124,92,255,0.10), var(--surface)); }
@media (min-width: 780px) { .post-card--featured { grid-column: span 2; } }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 0.45rem 0.8rem; font-family: var(--mono); font-size: 0.7rem; color: var(--dim); }
.post-card h2 { margin: 0; font-size: 1.22rem; line-height: 1.25; letter-spacing: 0; }
.post-card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.75; }
.post-card__tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: auto; }
.post-card__tags span { color: var(--cyan); font-family: var(--mono); font-size: 0.68rem; }
.article-wrap { padding-top: 3.6rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--cyan); }
.article { max-width: 880px; }
.article__header { padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.article__header h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.08; letter-spacing: 0; margin: 0 0 1rem; }
.article__lead { color: var(--muted); font-size: 1.08rem; line-height: 1.8; max-width: 68ch; margin: 0 0 1.2rem; }
.article__meta { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; font-family: var(--mono); font-size: 0.75rem; color: var(--dim); }
.article__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.article__body { color: var(--muted); font-size: 1rem; line-height: 1.9; }
.article__body h2 { color: var(--text); font-size: 1.45rem; line-height: 1.25; letter-spacing: 0; margin: 2.3rem 0 0.75rem; }
.article__body h3 { color: var(--text); font-size: 1.05rem; margin: 1.4rem 0 0.55rem; }
.article__body p { margin: 0 0 1rem; }
.article__body ul,
.article__body ol { margin: 0 0 1.2rem; padding-left: 1.2rem; }
.article__body li { margin: 0.4rem 0; }
.article__body b { color: var(--text); font-weight: 700; }
.article-callout {
  margin: 1.5rem 0; padding: 1rem 1.1rem;
  border: 1px solid var(--line); border-left: 2px solid var(--cyan);
  border-radius: var(--r); background: rgba(45,212,238,0.06);
  color: var(--text);
}
.article-checklist { display: grid; gap: 0.55rem; margin: 1rem 0 1.4rem; padding: 0; list-style: none; }
.article-checklist li { padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: var(--r); background: rgba(255,255,255,0.02); }
.article-related { display: grid; gap: 1rem; margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .article-related { grid-template-columns: 1fr 1fr; } }
.article-related a { display: block; padding: 1rem; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.article-related a:hover { border-color: var(--violet); }
.article-related span { display: block; margin-bottom: 0.35rem; color: var(--dim); font-family: var(--mono); font-size: 0.7rem; }

/* ---------- Changelog ---------- */
.log { display: grid; gap: 0; border-left: 2px solid var(--line); padding-left: 1.6rem; }
.log__item { position: relative; padding: 0 0 2.2rem; }
.log__item:last-child { padding-bottom: 0; }
.log__item::before { content: ""; position: absolute; left: calc(-1.6rem - 6px); top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--violet); }
.log__item.alt::before { border-color: var(--cyan); }
.log__ver { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 0.6rem; }
.log__ver b { font-family: var(--mono); font-size: 0.95rem; color: var(--text); }
.log__ver time { font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
.log__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.log__list li { display: flex; gap: 0.7rem; font-size: 0.9rem; color: var(--muted); }
.log__list .t { flex-shrink: 0; font-family: var(--mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.12rem 0.45rem; border-radius: var(--r); height: fit-content; margin-top: 0.18rem; }
.log__list .t.new { color: var(--up); background: rgba(61,220,151,0.12); }
.log__list .t.perf { color: var(--cyan); background: rgba(45,212,238,0.12); }
.log__list .t.fix { color: var(--amber); background: rgba(245,181,69,0.12); }
.log__list b { color: var(--text); font-weight: 600; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0.5rem; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.faq details[open] { border-color: var(--line-2); }
.faq summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; display: flex; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: ">"; font-family: var(--mono); color: var(--cyan); transition: transform 0.18s; }
.faq details[open] summary::before { transform: rotate(90deg); }
.faq p { margin: 0; padding: 0 1.2rem 1.1rem 2.4rem; color: var(--muted); font-size: 0.93rem; }

/* ---------- CTA ---------- */
.cta { text-align: center; }
.cta h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.6rem; }
.cta p { color: var(--muted); margin: 0 auto 1.6rem; max-width: 46ch; }
.cta .hero__actions { justify-content: center; margin: 0; }

/* ---------- Footer ---------- */
.foot { padding: 2.5rem 0 3rem; }
.foot__note { font-family: var(--mono); font-size: 0.78rem; color: var(--dim); border: 1px solid var(--line); border-left: 2px solid var(--amber); border-radius: var(--r); padding: 0.8rem 1rem; margin-bottom: 1.8rem; line-height: 1.7; }
.foot__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-bottom: 2rem; }
@media (min-width: 760px) { .foot__cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.foot__cols h4 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin: 0 0 0.7rem; }
.foot__cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.foot__cols a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.foot__cols a:hover { color: var(--cyan); }
.foot__brand p { color: var(--dim); font-size: 0.88rem; max-width: 30ch; margin: 0.6rem 0 0; }
.foot__bottom { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
@media (min-width: 700px) { .foot__bottom { flex-direction: row; justify-content: space-between; } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  /* Keep the market ticker scrolling; it is a core, opt-in design element. */
  .ticker__track { animation: marquee 38s linear infinite !important; }
}
