@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Press+Start+2P&family=VT323&display=swap');

:root{
  --bg:#050010; --panel:#1a0a35; --fg:#eedcfc;
  --line:rgba(176,48,255,.28); --line-soft:rgba(176,48,255,.14);
  --accent:#b030ff; --accent-soft:#deb7ff; --accent-deep:#7b2cbf;
  /* Deliberate, explicit exception to the purple-accent rule: standard
     financial up/down convention, desaturated so it reads as data-color
     rather than competing with the brand accent. */
  --up:#4CAF7D; --down:#E5645B;
}
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; background:var(--bg); color:var(--fg); }
body{ font-family:'JetBrains Mono',monospace; font-weight:400; -webkit-font-smoothing:antialiased; overflow-x:hidden; }
a{ color:var(--fg); text-decoration:none; }
img{ max-width:100%; display:block; }
::selection{ background:var(--accent-deep); color:#fff; }
::-webkit-scrollbar{ width:8px; }
::-webkit-scrollbar-track{ background:var(--bg); }
::-webkit-scrollbar-thumb{ background:var(--accent-deep); border:2px solid var(--bg); }

.hd,.serif{ font-family:'VT323',monospace; font-weight:400; letter-spacing:.01em; text-wrap:balance; text-transform:uppercase; }
.mono{ font-family:'JetBrains Mono',monospace; }
.editorial{ font-family:'JetBrains Mono',monospace; }

/* CRT scanline overlay, same restrained opacity as the main Obsidian site */
body::before{
  content:""; position:fixed; inset:0; pointer-events:none; z-index:90;
  background:linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,.25) 50%);
  background-size:100% 4px; opacity:.12;
}

/* ---- topbar ---- */
.topbar{
  position:sticky; top:0; z-index:60; background:rgba(25,14,37,.85); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line); box-shadow:0 0 20px rgba(123,44,191,.2);
}
.topbar-inner{ max-width:1280px; margin:0 auto; padding:16px 28px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.wordmark{ display:flex; align-items:center; gap:10px; font-family:'VT323',monospace; font-weight:400; font-size:28px; letter-spacing:.08em; text-transform:uppercase; color:var(--accent-soft); }
.wordmark img{ width:26px; height:26px; display:block; filter:drop-shadow(0 0 6px var(--accent)); }
.signal-bars{ display:flex; align-items:flex-end; gap:2px; height:14px; }
.signal-bars i{ display:block; width:3px; border-radius:0; }
.signal-bars i:nth-child(1){ height:35%; background:var(--accent-deep); }
.signal-bars i:nth-child(2){ height:65%; background:var(--accent-soft); }
.signal-bars i:nth-child(3){ height:100%; background:var(--accent); box-shadow:0 0 6px var(--accent); }
.topnav{ display:flex; gap:22px; align-items:center; flex-wrap:wrap; }
.topnav a{ font-size:12px; font-weight:700; font-family:'JetBrains Mono',monospace; text-transform:uppercase; letter-spacing:.06em; opacity:.7; transition:opacity .2s, color .2s, text-shadow .2s; padding-bottom:3px; border-bottom:2px solid transparent; }
.topnav a::before{ content:"> "; opacity:.6; }
.topnav a:hover{ opacity:1; color:var(--accent); text-shadow:0 0 10px var(--accent); }
.topnav a.active{ opacity:1; color:var(--accent); border-bottom-color:var(--accent); text-shadow:0 0 10px var(--accent); }
.topnav a.qubi-home{ display:flex; align-items:center; gap:6px; opacity:1; border:1px solid var(--line); padding:6px 12px; }
.topnav a.qubi-home:hover{ border-color:var(--accent); color:var(--accent); }
.topnav a.qubi-home i{ width:14px; height:14px; }
@media (max-width:820px){ .topnav a:not(.qubi-home){ display:none; } }

/* ---- ticker (market pulse) ---- */
.ticker-wrap{ border-bottom:1px solid var(--line-soft); overflow:hidden; white-space:nowrap; background:#0e0420; }
.ticker-track{ display:inline-flex; gap:36px; padding:9px 0; animation:ticker-scroll 55s linear infinite; }
.ticker-wrap:hover .ticker-track{ animation-play-state:paused; }
.ticker-item{ font-family:'JetBrains Mono',monospace; font-size:12.5px; font-weight:700; display:inline-flex; gap:7px; align-items:center; white-space:nowrap; }
.ticker-logo{ width:16px; height:16px; border-radius:0; object-fit:contain; flex-shrink:0; border:1px solid var(--line-soft); }
.ticker-item .chg-up, .ticker-item .chg-down{ display:inline-flex; align-items:center; gap:3px; }
.ticker-trend{ font-size:13px !important; width:13px; height:13px; line-height:1; }
a.ticker-item{ transition:opacity .15s; }
a.ticker-item:hover{ opacity:.8; }
@keyframes ticker-scroll{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }

.chg-up{ color:var(--up); }
.chg-down{ color:var(--down); }

.wrap{ max-width:1280px; margin:0 auto; padding:0 28px; }

/* ---- hero ---- */
.hero{ display:flex; align-items:center; justify-content:space-between; gap:48px; padding:56px 0 40px; border-bottom:1px solid var(--line); }
.hero-text{ flex:1; min-width:0; }
.hero-logo{ width:170px; height:auto; flex-shrink:0; filter:drop-shadow(0 0 24px var(--accent)); }
.hero h1{ font-size:clamp(38px,6.4vw,84px); line-height:.96; margin:0 0 22px; color:#fff; text-shadow:0 0 14px var(--accent-deep); }
.hero p.lede{ font-family:'JetBrains Mono',monospace; font-size:16px; line-height:1.7; max-width:640px; margin:0 0 24px; font-weight:400; color:var(--fg); opacity:.85; }
.hero-stats{ display:flex; gap:32px; flex-wrap:wrap; font-family:'JetBrains Mono',monospace; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; opacity:.85; }
.hero-stats b{ font-family:'VT323',monospace; font-weight:400; font-size:30px; display:block; color:var(--accent-soft); }
@media (max-width:900px){
  .hero-logo{ display:none; }
}

/* ---- category grid (home + category page) ---- */
.cat-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:1px; background:var(--line); border:1px solid var(--line); margin:36px 0; }
.cat-card{ background:var(--panel); padding:26px 24px; transition:background .18s; }
.cat-card:hover{ background:#22103f; box-shadow:inset 0 0 24px rgba(176,48,255,.12); }
.cat-card .n{ font-family:'JetBrains Mono',monospace; font-size:11px; opacity:.6; margin-bottom:10px; letter-spacing:.04em; }
.cat-card h3{ font-family:'VT323',monospace; font-weight:400; font-size:26px; margin:0 0 8px; line-height:1.05; color:#fff; }
.cat-card p{ font-size:13px; line-height:1.55; margin:0 0 14px; opacity:.82; }
.avatar-stack{ display:flex; align-items:center; }
.avatar-stack img{ width:24px; height:24px; border-radius:0; object-fit:cover; background:var(--panel); border:1px solid var(--bg); box-shadow:0 0 0 1px var(--line); margin-left:-6px; }
.avatar-stack img:first-child{ margin-left:0; }
.stack-more{ margin-left:4px; font-size:10.5px; opacity:.65; }

/* ---- section head ---- */
.section-head{ display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin:48px 0 20px; padding-bottom:14px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.section-head h2{ font-family:'VT323',monospace; font-weight:400; font-size:34px; margin:0; color:#fff; }
.section-head .meta{ font-family:'JetBrains Mono',monospace; font-size:12px; opacity:.65; }

/* ---- article feed ---- */
.feed{ display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:26px; margin-bottom:40px; }
.art-card{ display:block; background:var(--panel); border:1px solid var(--line-soft); transition:border-color .18s, box-shadow .18s; }
.art-card:hover{ border-color:var(--accent); box-shadow:0 0 20px rgba(176,48,255,.18); }
.art-card .cover{ width:100%; aspect-ratio:1200/630; object-fit:cover; background:#0e0420; border-bottom:1px solid var(--line-soft); }
.art-card .card-body{ padding:16px 18px 18px; }
.art-card .cat-tag{ font-family:'JetBrains Mono',monospace; font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; opacity:.7; color:var(--accent-soft); }
.art-card h3{ font-family:'VT323',monospace; font-weight:400; font-size:25px; line-height:1.08; margin:8px 0 8px; color:#fff; }
.art-card p.dek{ font-size:13px; line-height:1.5; margin:0 0 10px; opacity:.82; }
.art-card .meta{ font-family:'JetBrains Mono',monospace; font-size:11px; opacity:.55; display:flex; gap:10px; flex-wrap:wrap; }
.art-card:hover h3{ text-decoration:underline; text-underline-offset:3px; text-decoration-color:var(--accent); }

/* ---- project grid (category page) ---- */
.proj-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:1px; background:var(--line); border:1px solid var(--line); margin:24px 0 44px; }
.proj-card{ background:var(--panel); display:flex; flex-direction:column; transition:background .18s; }
.proj-card:hover{ background:#22103f; }
.proj-card .hero-thumb{ width:100%; aspect-ratio:16/7; object-fit:cover; background:#0e0420; border-bottom:1px solid var(--line-soft); }
.proj-card .proj-card-body{ padding:18px 20px; display:flex; flex-direction:column; gap:10px; flex:1; }
.proj-card .avatar{ width:32px; height:32px; border-radius:0; border:1px solid var(--line); object-fit:cover; background:#0e0420; }
.proj-card h4{ font-family:'VT323',monospace; font-weight:400; font-size:22px; margin:0; color:#fff; }
.proj-card p{ font-size:12.5px; opacity:.78; line-height:1.45; margin:0; flex:1; }
.proj-card .cnt{ font-family:'JetBrains Mono',monospace; font-size:11px; opacity:.6; }
.proj-card.dim{ opacity:.5; }

/* ---- project/about page ---- */
.proj-hero-banner{ width:100%; aspect-ratio:2.2/1; object-fit:cover; border-bottom:1px solid var(--line); margin:0 0 -1px; filter:saturate(.9) contrast(1.05); }
.proj-hero{ padding:36px 0; border-bottom:1px solid var(--line); }
.proj-head-row{ display:flex; gap:20px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.proj-head-left{ display:flex; gap:20px; align-items:center; }
.proj-head-left .avatar{ width:60px; height:60px; border-radius:0; border:1px solid var(--line); object-fit:cover; flex-shrink:0; box-shadow:0 0 16px rgba(176,48,255,.2); }
.proj-hero h1{ font-size:clamp(34px,5.6vw,64px); margin:0; color:#fff; text-shadow:0 0 14px var(--accent-deep); }
.proj-hero .cat-link{ font-family:'JetBrains Mono',monospace; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; opacity:.7; transition:opacity .15s, color .15s; }
.proj-hero .cat-link:hover{ opacity:1; color:var(--accent); }
.proj-body{ margin-top:22px; }
.proj-hero .about{ font-family:'JetBrains Mono',monospace; font-size:14.5px; line-height:1.75; max-width:660px; opacity:.88; }
.proj-links{ display:flex; gap:18px; margin-top:16px; flex-wrap:wrap; }
.proj-links a{ font-family:'JetBrains Mono',monospace; font-size:12px; font-weight:700; border-bottom:1px dotted var(--fg); transition:color .15s, border-color .15s; }
.proj-links a:hover{ color:var(--accent); border-color:var(--accent); }
.caveat-box{ margin-top:18px; border:1px solid var(--line); border-left:3px solid var(--accent); padding:14px 16px; font-size:13px; line-height:1.6; max-width:660px; background:var(--panel); }
.caveat-box b{ font-family:'JetBrains Mono',monospace; text-transform:uppercase; font-size:10.5px; letter-spacing:.06em; display:block; margin-bottom:6px; opacity:.75; }

/* ---- compact inline market strip: project-page header only, small ---- */
.proj-market-inline{ display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.pmi-price{ display:flex; align-items:baseline; gap:9px; }
.pmi-num{ font-family:'VT323',monospace; font-weight:400; font-size:28px; color:#fff; }
.pmi-price .chg-up, .pmi-price .chg-down{ display:inline-flex; align-items:center; gap:4px; font-family:'JetBrains Mono',monospace; font-size:13px; font-weight:700; }
.pmi-links{ display:flex; gap:8px; }
.pmi-links a{
  display:flex; align-items:center; gap:6px; font-family:'JetBrains Mono',monospace;
  font-size:11px; font-weight:700; border:1px solid var(--line); padding:7px 12px;
  transition:border-color .15s, color .15s, background .15s;
}
.pmi-links a:hover{ border-color:var(--accent); color:var(--accent); background:rgba(176,48,255,.09); }
.pmi-links a svg{ width:14px; height:14px; flex-shrink:0; }
@media (max-width:640px){
  .pmi-num{ font-size:24px; }
}

/* ---- article/project text-only news row (no thumbnail) ---- */
.feed.rows{ display:block; margin-bottom:40px; }
.art-row{ display:flex; justify-content:space-between; align-items:flex-start; gap:20px; padding:22px 0; border-bottom:1px solid var(--line-soft); flex-wrap:wrap; }
.art-row-body{ flex:1; min-width:240px; }
.art-row h3{ font-family:'VT323',monospace; font-weight:400; font-size:22px; line-height:1.1; margin:0 0 6px; color:#fff; }
.art-row .dek{ font-size:13px; line-height:1.5; opacity:.82; margin:0; }
.art-row .meta{ font-family:'JetBrains Mono',monospace; font-size:11px; opacity:.55; display:flex; flex-direction:column; gap:4px; align-items:flex-end; text-align:right; white-space:nowrap; }
.art-row:hover h3{ text-decoration:underline; text-underline-offset:3px; text-decoration-color:var(--accent); }

/* ---- article page ---- */
.article-page{ padding:44px 0 80px; max-width:800px; margin:0 auto; }
.article-page .cat-tag a{ font-family:'JetBrains Mono',monospace; font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; border-bottom:1px dotted var(--fg); transition:color .15s, border-color .15s; color:var(--accent-soft); }
.article-page .cat-tag a:hover{ color:var(--accent); border-color:var(--accent); }
.article-page h1{ font-size:clamp(32px,5.6vw,56px); line-height:1.03; margin:16px 0 16px; max-width:720px; color:#fff; text-shadow:0 0 14px var(--accent-deep); }
.article-page .dek{ font-family:'JetBrains Mono',monospace; font-style:italic; font-size:17px; line-height:1.6; opacity:.85; margin:0 0 24px; max-width:660px; }
.byline-row{ display:flex; gap:16px; flex-wrap:wrap; font-family:'JetBrains Mono',monospace; font-size:12px; opacity:.75; padding:16px 0; border-top:1px solid var(--line-soft); border-bottom:1px solid var(--line-soft); margin-bottom:28px; align-items:center; }
.byline-row .proj-link{ display:flex; align-items:center; gap:8px; opacity:1; transition:color .15s; }
.byline-row .proj-link:hover{ color:var(--accent); }
.byline-row .proj-link img{ width:20px; height:20px; border-radius:0; border:1px solid var(--line); }
.article-page .cover{ width:100%; aspect-ratio:1200/630; object-fit:cover; margin-bottom:32px; border:1px solid var(--line-soft); filter:saturate(.9) contrast(1.05); }
.article-body{ font-family:'JetBrains Mono',monospace; font-size:15.5px; line-height:1.8; max-width:660px; opacity:.92; }
.article-body p{ margin:0 0 22px; white-space:pre-wrap; }
.article-body b{ font-family:'JetBrains Mono',monospace; font-weight:700; font-style:normal; color:#fff; }
.callout{ border:1px solid var(--line); border-left:3px solid var(--accent); padding:20px 22px; margin:28px 0; max-width:660px; background:var(--panel); }
.callout b{ font-family:'JetBrains Mono',monospace; text-transform:uppercase; font-size:11px; letter-spacing:.06em; display:flex; align-items:center; gap:8px; margin-bottom:10px; font-style:normal; color:var(--accent-soft); }
.callout b .material-symbols-outlined{ font-size:16px; color:var(--accent); }
.callout p{ margin:0; font-family:'JetBrains Mono',monospace; font-size:14px; line-height:1.65; }
.source-row{ margin-top:36px; padding-top:24px; border-top:1px solid var(--line); display:flex; gap:20px; flex-wrap:wrap; }
.source-row a{ display:inline-flex; align-items:center; gap:7px; font-family:'JetBrains Mono',monospace; font-size:12.5px; font-weight:700; border:1px solid var(--line); padding:9px 16px; transition:background .18s, color .18s, border-color .18s, box-shadow .18s; }
.source-row a:hover{ background:var(--accent-deep); color:#fff; border-color:var(--accent); box-shadow:0 0 14px rgba(176,48,255,.35); }
.source-row a .material-symbols-outlined{ font-size:15px; }

/* ---- pagination / empty ---- */
.empty-note{ padding:40px 0; opacity:.65; font-size:13px; font-family:'JetBrains Mono',monospace; }

/* ---- footer ---- */
footer{ max-width:1280px; margin:0 auto; padding:44px 28px 70px; border-top:1px solid var(--line); }
.footer-top{ display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap; margin-bottom:26px; padding-bottom:26px; border-bottom:1px solid var(--line-soft); }
.footer-brand{ display:flex; align-items:center; gap:14px; }
.footer-brand img{ width:30px; height:30px; filter:drop-shadow(0 0 8px var(--accent)); }
.footer-brand-name{ font-family:'VT323',monospace; font-weight:400; font-size:20px; letter-spacing:.05em; color:var(--accent-soft); }
.footer-brand-tag{ font-size:12px; opacity:.6; margin-top:2px; }
.footer-social{ display:flex; gap:14px; }
.footer-social a{ display:flex; align-items:center; justify-content:center; width:36px; height:36px; border:1px solid var(--line); border-radius:0; opacity:.8; transition:opacity .15s, color .15s, border-color .15s, box-shadow .15s; color:var(--accent-soft); }
.footer-social a:hover{ opacity:1; color:var(--accent); border-color:var(--accent); box-shadow:0 0 12px rgba(176,48,255,.3); }
.footer-social a svg{ width:16px; height:16px; }

/* thin diagonal rune-stripe rule -- purple/black, emberwatch's own hazard marker */
.hazard-rule{ height:5px; background:repeating-linear-gradient(-45deg, var(--accent) 0 10px, #050010 10px 20px); margin:0 0 40px; opacity:.8; }

@media (max-width:640px){
  .proj-head-row{ flex-direction:column; align-items:flex-start; }
  .art-row{ flex-direction:column; }
  .art-row .meta{ flex-direction:row; align-items:center; text-align:left; }
}
