@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap');

/* =========================================================
   TOKENS
   ========================================================= */
:root {
  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --surface-2: #eef1f5;
  --border:    #dde2ea;
  --ink:       #10151f;
  --muted:     #5b6472;
  --accent:    #0e7490;
  --accent-2:  #0891b2;
  --accent-soft: #e6f4f7;
  --ok:        #15803d;
  --ok-soft:   #e7f5ec;
  --warn:      #b45309;
  --warn-soft: #fdf1e2;
  --danger:    #b91c1c;
  --sans:  'Syne', sans-serif;
  --mono:  'JetBrains Mono', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --max: 880px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent-soft); color: var(--accent); }

h1, h2, h3, .display {
  font-family: var(--sans);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

/* =========================================================
   NAV
   ========================================================= */
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(246,247,249,0.9);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 100;
}
.nav-logo {
  font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: 5px; text-decoration: none;
}
.cursor {
  display: inline-block; width: 7px; height: 13px;
  background: var(--accent); animation: blink 1.1s step-end infinite; vertical-align: -1px;
}
@keyframes blink { 50% { opacity: 0; } }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft);
  display: inline-block; flex-shrink: 0;
}
.nav-links { display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; }
.nav-links a {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  text-decoration: none; transition: color 0.15s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transition: transform 0.2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--accent); }
.nav-divider { width: 1px; height: 16px; background: var(--border); }
.icon-link {
  color: var(--muted); display: inline-flex; transition: color 0.15s;
}
.icon-link:hover { color: var(--accent); }

/* =========================================================
   STATUS STRIP
   ========================================================= */
.strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0.55rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--mono); font-size: 11.5px; color: var(--ok);
}

/* =========================================================
   LAYOUT
   ========================================================= */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 2.5rem; }
section { max-width: var(--max); margin: 0 auto; padding: 3.25rem 2.5rem; }
section + section { border-top: 1px solid var(--border); }
.section-head { margin-bottom: 1.75rem; max-width: 560px; }
.section-head .kicker { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 6px; }
.section-head h2 { font-size: 24px; margin-bottom: 6px; }
.section-head p { color: var(--muted); font-size: 13.5px; }

.page-header { max-width: var(--max); margin: 0 auto; padding: 3.5rem 2.5rem 1.5rem; }
.page-kicker { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 10px; }
.page-title { font-size: clamp(1.9rem, 4.2vw, 2.75rem); margin-bottom: 0.6rem; }
.page-title em { font-style: normal; color: var(--accent); }
.page-desc { color: var(--muted); font-size: 14px; max-width: 620px; line-height: 1.8; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  padding: 10px 20px; border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn-accent:hover { background: var(--accent); color: #fff; }

/* =========================================================
   TAGS / FILTER CHIPS
   ========================================================= */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono); font-size: 11px; padding: 3px 10px;
  border-radius: 100px; background: var(--surface-2); color: var(--muted);
}
.chip {
  font-family: var(--mono); font-size: 12.5px; padding: 7px 16px;
  border-radius: 100px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .count { color: inherit; opacity: 0.6; margin-left: 4px; }

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* Project card */
.project-card { display: flex; flex-direction: column; gap: 12px; }
.project-card .cat { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.project-card h3 { font-size: 16px; font-weight: 700; font-family: var(--sans); }
.project-card h2 { font-size: 16px; font-weight: 700; font-family: var(--sans); }
.project-card p { color: var(--muted); font-size: 13px; line-height: 1.7; flex: 1; }
.project-card .foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.repo-link {
  font-family: var(--mono); font-size: 12px; color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.repo-link:hover { text-decoration: underline; }
.project-card[hidden] { display: none; }
.data-error {
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: #fff1f1;
  color: var(--danger);
  padding: 0.9rem 1rem;
  font-size: 13px;
}
.article-view { max-width: 720px; margin: 0 auto; }
.article-kicker { margin-top: 2rem; }
.article-title { margin-bottom: 0.8rem; }
.article-summary { margin-bottom: 1rem; }
.article-topics { margin-bottom: 2rem; }
.markdown-content { color: var(--ink); font-size: 14px; line-height: 1.85; overflow-wrap: anywhere; }
.markdown-content h2, .markdown-content h3, .markdown-content h4, .markdown-content h5 {
  margin: 2rem 0 0.8rem;
}
.markdown-content p, .markdown-content ul, .markdown-content ol, .markdown-content pre, .markdown-content blockquote {
  margin-bottom: 1rem;
}
.markdown-content ul, .markdown-content ol { padding-left: 1.6rem; }
.markdown-content ul { list-style: disc; }
.markdown-content ol { list-style: decimal; }
.markdown-content li { padding-left: 0.25rem; margin-bottom: 0.35rem; }
.markdown-content blockquote {
  border-left: 3px solid var(--accent);
  color: var(--muted);
  padding-left: 1rem;
}
.markdown-content hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.markdown-content mark { background: var(--warn-soft); color: var(--ink); padding: 0 0.2em; }
.markdown-content a { color: var(--accent); }
.markdown-content code {
  font-size: 0.9em;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
}
.markdown-content pre {
  overflow-x: auto;
  background: #10151f;
  color: #cbd5e1;
  border-radius: var(--radius);
  padding: 1rem;
}
.markdown-content pre code { background: transparent; padding: 0; }
.article-navigation { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }

/* Timeline (genuinely sequential content only) */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--border);
}
.tl-item { position: relative; margin-bottom: 2.1rem; }
.tl-item::before {
  content: ''; position: absolute; left: -1.75rem; top: 6px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.tl-item.exp::before { background: var(--ok); }
.tl-date { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.tl-item.exp .tl-date { color: var(--ok); }
.tl-title { font-family: var(--sans); font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.tl-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.tl-desc li { position: relative; padding-left: 1rem; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.tl-desc li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }

/* Cert card */
.cert-card { display: flex; gap: 14px; align-items: flex-start; }
.cert-mark {
  width: 42px; height: 42px; border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.cert-name { font-family: var(--sans); font-size: 14.5px; font-weight: 700; margin-bottom: 2px; }
.cert-issuer { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.cert-desc { font-size: 12.5px; color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10.5px; padding: 3px 10px; border-radius: 100px;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.progress-bar {
  width: 100%; max-width: 180px; height: 4px; border-radius: 100px;
  background: var(--surface-2); overflow: hidden; margin-top: 8px;
}
.progress-bar span {
  display: block; height: 100%; width: 40%; border-radius: 100px;
  background: var(--warn); animation: indeterminate 1.8s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}

/* =========================================================
   CERT CAROUSEL (auto-scroll, pause on hover)
   ========================================================= */
.carousel { overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.carousel-track { display: flex; gap: 14px; width: max-content; animation: scroll-x 28s linear infinite; }
.carousel:hover .carousel-track { animation-play-state: paused; }
@keyframes scroll-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.carousel-item {
  flex: 0 0 auto; width: 240px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; display: flex; gap: 12px; align-items: center;
}

/* =========================================================
   SIGNAL LINE (hero — the one bold motion moment)
   ========================================================= */
.signal { width: 100%; max-width: 420px; margin: 1.5rem 0 2rem; }
.signal path {
  fill: none; stroke: var(--accent); stroke-width: 1.6;
  stroke-dasharray: 340; stroke-dashoffset: 340;
  animation: draw 2.4s ease-out forwards, pulse-op 3.2s ease-in-out 2.4s infinite;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse-op { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  .signal path { animation: none; stroke-dashoffset: 0; }
  .carousel-track { animation: none; }
  .cursor { animation: none; }
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty {
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  padding: 3rem 2rem; text-align: left; max-width: 480px;
}
.empty h3 { font-family: var(--sans); font-size: 17px; margin-bottom: 8px; }
.empty p { color: var(--muted); font-size: 13.5px; }

/* =========================================================
   STATS
   ========================================================= */
.stats-row { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1; min-width: 130px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stat-val { font-family: var(--sans); font-size: 22px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* =========================================================
   TERMINAL (kept once, restrained — for the profile page)
   ========================================================= */
.terminal { background: #10151f; border-radius: var(--radius-lg); overflow: hidden; }
.terminal-bar { background: #171e2b; padding: 9px 14px; display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dr { background: #ff5f56; } .dy { background: #ffbd2e; } .dg { background: #27c93f; }
.terminal-title { margin-left: 6px; font-size: 11px; color: #6b7280; flex: 1; text-align: center; }
.terminal-body { padding: 1.4rem 1.6rem; font-size: 12px; line-height: 1.9; color: #cbd5e1; }
.t-key { color: #67e8f9; } .t-val { color: #86efac; } .t-mut { color: #6b7280; }

/* =========================================================
   FOOTER
   ========================================================= */
footer { text-align: left; padding: 2.5rem 2.5rem; border-top: 1px solid var(--border); max-width: var(--max); margin: 0 auto; }
.footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 12px; }
.footer-links a:hover { color: var(--accent); }
.footer-note { color: var(--muted); font-size: 12px; }
.footer-note span { color: var(--accent); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 760px) {
  nav { padding: 1rem 1.25rem; }
  .nav-links a:not(.icon-link) { display: none; }
  .strip { padding: 0.5rem 1.25rem; }
  section, .page-header, footer { padding-left: 1.25rem; padding-right: 1.25rem; }
}
