/* ==========================================================================
   shared design system — portfolio / blog / oss
   loaded by: index.html, blog.html, oss.html, blog/posts/*.html
   ========================================================================== */

:root{
  --bg:#050805;
  --bg-alt:#0a120b;
  --panel:#0b1510;
  --green:#3dff9a;
  --green-bright:#8dffc4;
  --green-dim:#1c7a4a;
  --green-deep:#0e3324;
  --amber:#ffcb6b;
  --red:#ff5f5f;
  --text:#c9f5da;
  --text-dim:#5f8770;
  --border:#153826;
  --mono:'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--mono);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

::selection{ background:var(--green-dim); color:#03110a; }

a{ color:inherit; }

#rain{
  position:fixed;
  inset:0;
  z-index:0;
  opacity:0.16;
  pointer-events:none;
}

.skip-link{
  position:absolute; left:-9999px; top:0;
  background:var(--panel); color:var(--green); padding:.6rem 1rem;
  z-index:999; border:1px solid var(--green-dim);
}
.skip-link:focus{ left:1rem; top:1rem; }

a:focus-visible, button:focus-visible, input:focus-visible{
  outline:2px solid var(--green);
  outline-offset:2px;
}

/* ---------- status bar / nav ---------- */
.statusbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding:.7rem 1.25rem;
  background:rgba(5,8,5,0.88);
  backdrop-filter:blur(6px);
  border-bottom:1px solid var(--border);
  font-size:.8rem;
}
.statusbar .left{ display:flex; align-items:center; gap:.6rem; color:var(--text-dim); }
.statusbar .dot{ width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 8px var(--green); animation:pulse 2.4s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{opacity:1;} 50%{opacity:.35;} }

.tabs{ display:flex; gap:2px; list-style:none; margin:0; padding:0; }
.tabs li a{
  display:block;
  padding:.45rem 1rem;
  text-decoration:none;
  color:var(--text-dim);
  border:1px solid transparent;
  font-size:.82rem;
  transition:color .15s, border-color .15s, background .15s;
}
.tabs li a::before{ content:"["; color:var(--green-dim); }
.tabs li a::after{ content:"]"; color:var(--green-dim); }
.tabs li a:hover, .tabs li a.active{
  color:var(--green-bright);
  background:var(--green-deep);
  border-color:var(--green-dim);
}

.statusbar .clock{ color:var(--text-dim); }

main{ position:relative; z-index:1; max-width:920px; margin:0 auto; padding:0 1.25rem; }

/* ---------- hero / terminal window ---------- */
.hero{ padding:3.5rem 0 2rem; }

.window{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:0 0 0 1px rgba(61,255,154,.04), 0 20px 60px rgba(0,0,0,.6);
  overflow:hidden;
}
.window-bar{
  display:flex; align-items:center; gap:.5rem;
  padding:.6rem .8rem;
  background:var(--bg-alt);
  border-bottom:1px solid var(--border);
}
.window-bar .traffic{ width:10px; height:10px; border-radius:50%; }
.traffic.r{ background:#ff5f56; }
.traffic.y{ background:#ffbd2e; }
.traffic.g{ background:#27c93f; }
.window-bar .title{ margin-left:.5rem; color:var(--text-dim); font-size:.75rem; }

.window-body{ padding:1.1rem 1.2rem 1.4rem; font-size:.86rem; }
.boot-line{ white-space:pre-wrap; word-break:break-word; }
.boot-line .ok{ color:var(--green); }
.boot-line .path{ color:var(--amber); }
.boot-line .dim{ color:var(--text-dim); }

.prompt-row{ display:flex; gap:.5rem; align-items:baseline; flex-wrap:wrap; }
.prompt-row .ps{ color:var(--green-bright); white-space:nowrap; }
.prompt-row .ps .path{ color:var(--amber); }

#term-output{ margin-top:.3rem; }
#term-output p{ margin:.15rem 0; }
#term-output .cmd-echo{ color:var(--green-bright); }
#term-output .cmd-echo::before{ content:"guest@portfolio:~$ "; color:var(--green-bright); opacity:.8; }
#term-output .err{ color:var(--red); }
#term-output .heading{ color:var(--amber); }

#term-form{ display:flex; align-items:baseline; gap:.5rem; margin-top:.4rem; }
#term-input{
  flex:1;
  background:transparent;
  border:none;
  color:var(--green-bright);
  font-family:var(--mono);
  font-size:.86rem;
  caret-color:var(--green);
}
#term-input::placeholder{ color:var(--text-dim); }

.hint{ margin-top:.9rem; font-size:.72rem; color:var(--text-dim); }
.hint kbd{ border:1px solid var(--border); border-radius:3px; padding:0 .3rem; color:var(--green); }

/* ---------- section framing ---------- */
section{ padding:3rem 0; border-top:1px dashed var(--border); scroll-margin-top:4.5rem; }
.section-head{ display:flex; align-items:baseline; gap:.6rem; margin-bottom:1.4rem; }
.section-head .tag{ color:var(--green-dim); font-size:.78rem; }
.section-head h2{
  margin:0; font-size:1.05rem; font-weight:600;
  color:var(--green-bright); letter-spacing:.02em;
}
.section-head h2::before{ content:"// "; color:var(--green-dim); }

/* ---------- about (index only) ---------- */
.about-grid{ display:grid; grid-template-columns: 1.1fr 1fr; gap:2rem; align-items:start; }
@media (max-width:720px){ .about-grid{ grid-template-columns:1fr; } }

.bio p{ margin:0 0 .9rem; color:var(--text); font-size:.92rem; }
.bio .var{ color:var(--amber); }
.bio .str{ color:var(--green-bright); }
.bio .comment{ color:var(--text-dim); }

.status-list{ list-style:none; margin:0; padding:0; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.status-list li{
  display:flex; justify-between:space-between; gap:1rem;
  padding:.55rem .8rem;
  font-size:.78rem;
  border-bottom:1px solid var(--border);
  background:var(--panel);
}
.status-list li:last-child{ border-bottom:none; }
.status-list .svc{ color:var(--text); }
.status-list .svc small{ display:block; color:var(--text-dim); font-size:.7rem; margin-top:.15rem; }
.status-list .state{ color:var(--green); white-space:nowrap; font-size:.72rem; }
.status-list .state::before{ content:"● "; }

/* ---------- nav cards (index -> blog / oss) ---------- */
.card-grid{ display:grid; grid-template-columns:1fr 1fr; gap:1.1rem; }
@media (max-width:720px){ .card-grid{ grid-template-columns:1fr; } }

.nav-card{
  display:block;
  text-decoration:none;
  border:1px solid var(--border);
  border-radius:8px;
  padding:1.2rem 1.2rem 1.4rem;
  background:linear-gradient(180deg, var(--panel), var(--bg-alt));
  transition:border-color .15s, transform .15s, box-shadow .15s;
  position:relative;
  overflow:hidden;
}
.nav-card::before{
  content:"";
  position:absolute; inset:0;
  background:radial-gradient(circle at 0% 0%, rgba(61,255,154,.08), transparent 60%);
  opacity:0; transition:opacity .2s;
}
.nav-card:hover, .nav-card:focus-visible{
  border-color:var(--green-dim);
  transform:translateY(-2px);
  box-shadow:0 10px 30px rgba(0,0,0,.4);
}
.nav-card:hover::before, .nav-card:focus-visible::before{ opacity:1; }
.nav-card .path{ color:var(--green-dim); font-size:.72rem; margin-bottom:.5rem; }
.nav-card h3{ margin:0 0 .5rem; color:var(--green-bright); font-size:1rem; }
.nav-card p{ margin:0; color:var(--text-dim); font-size:.82rem; }
.nav-card .go{ display:inline-block; margin-top:.8rem; font-size:.76rem; color:var(--amber); }

/* ---------- page header (blog.html / oss.html) ---------- */
.page-header{ padding:2.6rem 0 1rem; }
.page-header .breadcrumb{ font-size:.78rem; color:var(--text-dim); margin-bottom:.6rem; }
.page-header .breadcrumb a{ color:var(--green); text-decoration:none; }
.page-header .breadcrumb a:hover{ color:var(--green-bright); }
.page-header h1{ margin:0 0 .5rem; font-size:1.5rem; color:var(--green-bright); }
.page-header h1::before{ content:"$ "; color:var(--green-dim); }
.page-header .sub{ color:var(--text-dim); font-size:.86rem; max-width:60ch; }

/* ---------- blog listing ---------- */
.filter-row{ display:flex; flex-wrap:wrap; gap:.5rem; margin:1.4rem 0 1.8rem; }
.filter-chip{
  font-size:.72rem; padding:.3rem .7rem;
  border:1px solid var(--border); border-radius:20px;
  background:var(--panel); color:var(--text-dim);
  cursor:pointer; transition:all .15s;
}
.filter-chip:hover{ color:var(--green-bright); border-color:var(--green-dim); }
.filter-chip.active{ color:var(--green-bright); background:var(--green-deep); border-color:var(--green-dim); }

.post-list{ display:flex; flex-direction:column; gap:0; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.post-row{
  display:block; text-decoration:none;
  padding:1rem 1.2rem;
  border-bottom:1px solid var(--border);
  background:var(--panel);
  transition:background .15s;
}
.post-list a.post-row:last-child{ border-bottom:none; }
.post-row:hover, .post-row:focus-visible{ background:var(--bg-alt); }
.post-row .meta-line{ display:flex; gap:.8rem; align-items:baseline; flex-wrap:wrap; margin-bottom:.35rem; }
.post-row .date{ color:var(--green-dim); font-size:.72rem; white-space:nowrap; }
.post-row .date::before{ content:"["; }
.post-row .date::after{ content:"]"; }
.post-row h3{ margin:0; font-size:.95rem; color:var(--green-bright); font-weight:600; }
.post-row .excerpt{ margin:.3rem 0 0; color:var(--text-dim); font-size:.82rem; }
.post-row .tags{ margin-top:.5rem; display:flex; gap:.4rem; flex-wrap:wrap; }
.post-row .tag-pill{ font-size:.68rem; color:var(--amber); background:rgba(255,203,107,.08); padding:.1rem .5rem; border-radius:10px; }

.empty-state{ padding:2rem 1rem; text-align:center; color:var(--text-dim); font-size:.85rem; border:1px dashed var(--border); border-radius:8px; }

/* ---------- oss contributions ---------- */
.stat-row{ display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; margin:1.6rem 0 2rem; }
@media (max-width:600px){ .stat-row{ grid-template-columns:1fr; } }
.stat-box{ border:1px solid var(--border); border-radius:8px; padding:1rem 1.1rem; background:var(--panel); }
.stat-box .num{ font-size:1.6rem; color:var(--green-bright); font-weight:700; }
.stat-box .label{ font-size:.72rem; color:var(--text-dim); margin-top:.2rem; }

.commit-log{ display:flex; flex-direction:column; gap:.9rem; }
.commit{
  border:1px solid var(--border); border-radius:8px; background:var(--panel);
  padding:1rem 1.2rem; position:relative;
}
.commit .repo-line{ display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin-bottom:.4rem; }
.commit .repo{ color:var(--green-bright); font-size:.9rem; font-weight:600; text-decoration:none; }
.commit .repo:hover{ text-decoration:underline; }
.commit .status-pill{ font-size:.68rem; padding:.15rem .55rem; border-radius:10px; white-space:nowrap; }
.commit .status-pill.merged{ color:#8dffc4; background:rgba(61,255,154,.1); }
.commit .status-pill.open{ color:var(--amber); background:rgba(255,203,107,.1); }
.commit .status-pill.review{ color:#7fc7ff; background:rgba(127,199,255,.1); }
.commit .desc{ color:var(--text); font-size:.85rem; margin:.2rem 0 .5rem; }
.commit .commit-meta{ display:flex; gap:1rem; flex-wrap:wrap; font-size:.72rem; color:var(--text-dim); }
.commit .commit-meta a{ color:var(--text-dim); text-decoration:none; }
.commit .commit-meta a:hover{ color:var(--green); }
.commit .diffstat .add{ color:var(--green); }
.commit .diffstat .rem{ color:var(--red); }

/* ---------- article (blog/posts/*.html) ---------- */
.article-meta{ color:var(--text-dim); font-size:.78rem; margin-bottom:1.8rem; display:flex; gap:1rem; flex-wrap:wrap; }
article.post-content{ font-size:.92rem; color:var(--text); }
article.post-content h2{ color:var(--green-bright); font-size:1.1rem; margin-top:2rem; }
article.post-content h2::before{ content:"## "; color:var(--green-dim); }
article.post-content h3{ color:var(--green-bright); font-size:.98rem; margin-top:1.5rem; }
article.post-content h3::before{ content:"### "; color:var(--green-dim); }
article.post-content p{ margin:0 0 1.1rem; }
article.post-content a{ color:var(--green); text-decoration:underline; text-decoration-color:var(--green-dim); }
article.post-content code{ background:var(--panel); border:1px solid var(--border); border-radius:4px; padding:.1rem .35rem; font-size:.85em; color:var(--amber); }
article.post-content pre{ background:var(--panel); border:1px solid var(--border); border-radius:8px; padding:1rem 1.1rem; overflow-x:auto; }
article.post-content pre code{ background:none; border:none; padding:0; color:var(--text); }
article.post-content blockquote{ margin:1.2rem 0; padding:.4rem 1rem; border-left:2px solid var(--green-dim); color:var(--text-dim); }
article.post-content ul, article.post-content ol{ margin:0 0 1.1rem; padding-left:1.3rem; }
article.post-content li{ margin-bottom:.4rem; }
article.post-content img{ max-width:100%; border-radius:6px; border:1px solid var(--border); }
.post-nav{ display:flex; justify-content:space-between; gap:1rem; margin-top:2.5rem; padding-top:1.5rem; border-top:1px dashed var(--border); font-size:.82rem; }
.post-nav a{ color:var(--green); text-decoration:none; }
.post-nav a:hover{ color:var(--green-bright); }

/* ---------- text box (callouts / definitions / asides) ---------- */
article.post-content .text-box{
  margin:1.4rem 0;
  padding:1rem 1.2rem;
  background:var(--bg-alt);
  border:1px solid var(--border);
  border-left:3px solid var(--amber);
  border-radius:6px;
  font-size:.88rem;
}
article.post-content .text-box p{ margin:0 0 .6rem; }
article.post-content .text-box p:last-child{ margin-bottom:0; }
article.post-content .text-box ul{ margin:0 0 .3rem; }
article.post-content .text-box ul:last-child{ margin-bottom:0; }
article.post-content .text-box .label{
  display:block; font-size:.7rem; color:var(--amber);
  letter-spacing:.05em; text-transform:uppercase; margin-bottom:.5rem;
}

/* ---------- text block (annotated code / instruction breakdowns) ---------- */
article.post-content .text-block{
  margin:1.4rem 0;
  padding:1rem 1.2rem;
  background:var(--bg-alt);
  border:1px solid var(--border);
  border-left:3px solid #7fc7ff;
  border-radius:6px;
  font-size:.88rem;
}
article.post-content .text-block pre{
  margin:0 0 1rem;
  background:var(--panel);
}
article.post-content .text-block p{ margin:0 0 .6rem; }
article.post-content .text-block p:last-child{ margin-bottom:0; }
article.post-content .text-block .label{
  display:block; font-size:.7rem; color:#7fc7ff;
  letter-spacing:.05em; text-transform:uppercase; margin-bottom:.5rem;
}

/* ---------- inline highlight ---------- */
article.post-content mark, article.post-content .hl{
  background:rgba(61,255,154,.14);
  color:var(--green-bright);
  padding:.05rem .25rem;
  border-radius:3px;
  box-shadow:0 0 8px rgba(61,255,154,.15);
}

/* ---------- figure / image with caption ---------- */
article.post-content figure{ margin:1.6rem 0; }
article.post-content figure img{ display:block; width:100%; }
article.post-content figure figcaption{
  margin-top:.5rem; font-size:.74rem; color:var(--text-dim); text-align:center;
}
article.post-content figure figcaption::before{ content:"// "; color:var(--green-dim); }

/* ---------- equation line ---------- */
article.post-content .equation{
  text-align:center; color:var(--green-bright);
  font-size:1rem; margin:1.4rem 0; letter-spacing:.02em;
}

/* ---------- table of contents ---------- */
article.post-content .toc{
  margin:1.4rem 0 1.8rem;
  padding:1rem 1.2rem;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--panel);
}
article.post-content .toc .label{
  display:block; font-size:.7rem; color:var(--green-dim);
  letter-spacing:.05em; text-transform:uppercase; margin-bottom:.7rem;
}
article.post-content .toc ol{
  margin:0; padding-left:1.3rem; font-size:.85rem;
}
article.post-content .toc li{ margin-bottom:.45rem; }
article.post-content .toc li:last-child{ margin-bottom:0; }
article.post-content .toc a{
  color:var(--green-bright); text-decoration:none;
}
article.post-content .toc a:hover{ text-decoration:underline; }
article.post-content .toc .change{ color:var(--text-dim); }
article.post-content .toc .change::before{ content:" — "; }

/* ---------- data table (perf comparison, references) ---------- */
article.post-content table{
  width:100%; border-collapse:collapse; margin:1.4rem 0;
  font-size:.85rem; border:1px solid var(--border); border-radius:8px; overflow:hidden;
}
article.post-content th, article.post-content td{
  text-align:left; padding:.6rem .9rem; border-bottom:1px solid var(--border);
}
article.post-content thead th{
  background:var(--bg-alt); color:var(--green-bright);
  font-size:.72rem; text-transform:none; letter-spacing:.05em;
}
article.post-content tbody tr:last-child td{ border-bottom:none; }
article.post-content tbody tr:hover{ background:rgba(61,255,154,.04); }
article.post-content td.num{ color:var(--green-bright); font-weight:600; }

/* ---------- references box ---------- */
article.post-content .references{
  margin:1.4rem 0;
  padding:1rem 1.2rem;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--panel);
}
article.post-content .references .label{
  display:block; font-size:.7rem; color:var(--green-dim);
  letter-spacing:.05em; text-transform:uppercase; margin-bottom:.7rem;
}
article.post-content .references ul{ margin:0; padding-left:1.2rem; font-size:.85rem; }
article.post-content .references li{ margin-bottom:.5rem; }
article.post-content .references li:last-child{ margin-bottom:0; }
article.post-content .references a{ color:var(--green); }
article.post-content .references .src{ color:var(--text-dim); font-size:.78rem; }

/* ---------- footer ---------- */
footer{ padding:2.5rem 0 3rem; border-top:1px dashed var(--border); font-size:.8rem; color:var(--text-dim); }
.footer-inner{ max-width:920px; margin:0 auto; padding:0 1.25rem; }
.links{ display:flex; flex-wrap:wrap; gap:.4rem 1.1rem; margin-bottom:1rem; }
.links a{ text-decoration:none; color:var(--text); }
.links a:hover{ color:var(--green-bright); }
.links a::before{ content:"$ open "; color:var(--green-dim); }
footer .copyright{ color:var(--text-dim); font-size:.72rem; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; }
}
