/* ──────────────────────────────────────────────────────────────
   marclevin.me/blog - shared styles
   Dracula palette, matched to the site index.
   ────────────────────────────────────────────────────────────── */

:root {
    --bg:        #282a36;
    --bg-card:   #1e2029;
    --surface:   #44475a;
    --fg:        #f8f8f2;
    --comment:   #6272a4;
    --cyan:      #8be9fd;
    --green:     #50fa7b;
    --orange:    #ffb86c;
    --pink:      #ff79c6;
    --purple:    #bd93f9;
    --red:       #ff5555;
    --yellow:    #f1fa8c;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
header {
    position: relative;
    padding: 40px 24px 32px;
    border-bottom: 1px solid var(--surface);
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 70% at 20% 0%, rgba(189,147,249,.16) 0%, transparent 70%),
                radial-gradient(ellipse 50% 50% at 90% 100%, rgba(139,233,253,.09) 0%, transparent 65%);
    pointer-events: none;
}

.header-inner {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

header h1 {
    font-size: clamp(1.9rem, 5vw, 2.9rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--fg) 45%, var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    margin-top: 14px;
    font-size: 1rem;
    color: var(--comment);
    max-width: 620px;
}

/* ── Post meta line ── */
.post-meta {
    margin-top: 16px;
    font-family: 'Fira Code', monospace;
    font-size: 0.74rem;
    color: var(--comment);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.post-meta .dot { opacity: 0.4; }
.post-meta time { color: var(--orange); }
.post-meta .read { color: var(--green); }

/* ── Main ── */
main {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}

/* ── Post list ── */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--surface);
    border-radius: 12px;
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    opacity: 0;
    transition: opacity 0.25s;
}

.post-card:hover {
    border-color: var(--purple);
    box-shadow: 0 0 28px rgba(189,147,249,.12), 0 4px 20px rgba(0,0,0,.4);
    transform: translateY(-2px);
}

.post-card:hover::before { opacity: 1; }

.post-card .date {
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    color: var(--orange);
    letter-spacing: 0.05em;
}

.post-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 8px 0 6px;
    transition: color 0.2s;
}

.post-card:hover h2 { color: var(--purple); }

.post-card p {
    font-size: 0.93rem;
    color: var(--comment);
    margin-bottom: 14px;
}

.post-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.read-more {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--cyan);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more::after { content: '→'; }
.post-card:hover .read-more { color: var(--purple); }

/* ── Tags ── */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid;
    background: transparent;
}

.tag-ai       { color: var(--purple); border-color: rgba(189,147,249,.3); background: rgba(189,147,249,.05); }
.tag-tools    { color: var(--cyan);   border-color: rgba(139,233,253,.3); background: rgba(139,233,253,.05); }
.tag-students { color: var(--green);  border-color: rgba(80,250,123,.3);  background: rgba(80,250,123,.05);  }
.tag-free     { color: var(--yellow); border-color: rgba(241,250,140,.3); background: rgba(241,250,140,.05); }

.tag-blockchain { color: var(--orange); border-color: rgba(255,184,108,.3); background: rgba(255,184,108,.05); }
.tag-fabric     { color: var(--cyan);   border-color: rgba(139,233,253,.3); background: rgba(139,233,253,.05); }
.tag-xrpl       { color: var(--green);  border-color: rgba(80,250,123,.3);  background: rgba(80,250,123,.05);  }
.tag-fintech    { color: var(--pink);   border-color: rgba(255,121,198,.3); background: rgba(255,121,198,.05); }

/* ── Empty state ── */
.empty {
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    color: var(--comment);
    text-align: center;
    padding: 40px 0;
}

/* ── Article prose ── */
.prose { font-size: 1.02rem; }

.prose > * + * { margin-top: 20px; }

.prose .lead {
    font-size: 1.1rem;
    color: var(--fg);
    opacity: 0.92;
}

.prose h2 {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--purple);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 52px;
    scroll-margin-top: 20px;
}

.prose h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--surface);
}

.prose h3 {
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--fg);
    margin-top: 34px;
}

.prose p { color: var(--fg); opacity: 0.88; }

.prose strong { color: var(--fg); font-weight: 600; opacity: 1; }

/* ── Inline links ──
   :where() keeps the exclusions at zero specificity so components
   like .credit can recolour their own links without a fight. */
.prose a:not(:where(.link-card, .back-link)) {
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px solid rgba(139,233,253,.4);
    padding-bottom: 1px;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.prose a:not(:where(.link-card, .back-link)):hover {
    color: var(--purple);
    border-bottom-color: var(--purple);
    background: rgba(189,147,249,.1);
}

.prose a[target="_blank"]:not(:where(.link-card))::after {
    content: '↗';
    font-size: 0.72em;
    margin-left: 3px;
    vertical-align: 1px;
    opacity: 0.7;
}

/* ── Lists ── */
.prose ul, .prose ol {
    padding-left: 4px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prose ul li {
    position: relative;
    padding-left: 22px;
    color: var(--fg);
    opacity: 0.88;
}

.prose ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--purple);
    font-size: 0.85em;
}

.prose ol {
    counter-reset: step;
}

.prose ol li {
    position: relative;
    padding-left: 34px;
    counter-increment: step;
    color: var(--fg);
    opacity: 0.88;
}

.prose ol li::before {
    content: counter(step) '.';
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    color: var(--green);
}

/* ── Code ── */
.prose code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    background: var(--bg-card);
    border: 1px solid var(--surface);
    border-radius: 5px;
    padding: 1px 6px;
    color: var(--pink);
}

.prose kbd {
    font-family: 'Fira Code', monospace;
    font-size: 0.8em;
    background: var(--surface);
    border: 1px solid #565973;
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 1px 7px;
    color: var(--fg);
    white-space: nowrap;
}

.prose pre {
    background: var(--bg-card);
    border: 1px solid var(--surface);
    border-radius: 10px;
    padding: 18px 20px;
    overflow-x: auto;
    line-height: 1.6;
}

.prose pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--fg);
    font-size: 0.84rem;
    white-space: pre;
}

.prose pre .c { color: var(--comment); }
.prose pre .k { color: var(--pink); }
.prose pre .s { color: var(--yellow); }
.prose pre .n { color: var(--purple); }

/* ── Callout ── */
.note {
    background: rgba(189,147,249,.07);
    border: 1px solid var(--surface);
    border-left: 3px solid var(--purple);
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 0.94rem;
    color: var(--fg);
    opacity: 0.9;
}

.note.warn {
    background: rgba(255,184,108,.07);
    border-left-color: var(--orange);
}

.note .note-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple);
    display: block;
    margin-bottom: 6px;
}

.note.warn .note-label { color: var(--orange); }

/* ── Link cards ── */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.link-card {
    display: block;
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--surface);
    border-radius: 10px;
    padding: 16px 18px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.link-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 18px rgba(139,233,253,.12);
    transform: translateY(-2px);
}

.link-card .name {
    font-weight: 600;
    font-size: 0.96rem;
    color: var(--cyan);
    display: flex;
    align-items: center;
    gap: 6px;
}

.link-card .name::after { content: '↗'; font-size: 0.72em; opacity: 0.7; }
.link-card:hover .name { color: var(--purple); }

.link-card .what {
    font-size: 0.85rem;
    color: var(--comment);
    margin-top: 4px;
    line-height: 1.5;
}

.link-card .price {
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    color: var(--orange);
    margin-top: 8px;
    display: block;
}

/* ── Closing credit ── */
.prose .credit {
    margin-top: 52px;
    position: relative;
    background: linear-gradient(135deg, rgba(255,121,198,.08), rgba(189,147,249,.04) 60%, transparent);
    border: 1px solid var(--surface);
    border-radius: 12px;
    padding: 22px 26px 22px 28px;
    overflow: hidden;
}

.prose .credit::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--pink), var(--purple));
}

.credit-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pink);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.credit-label::before {
    content: '//';
    opacity: 0.45;
}

.prose .credit p {
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.9;
}

.prose .credit a {
    color: var(--pink);
    font-weight: 500;
    border-bottom-color: rgba(255,121,198,.4);
}

.prose .credit a:hover {
    color: var(--purple);
    border-bottom-color: var(--purple);
    background: rgba(189,147,249,.1);
}

/* ── Post nav ── */
.post-nav {
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--surface);
}

.back-link {
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    color: var(--cyan);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--surface);
    border-radius: 8px;
    background: var(--bg-card);
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.back-link:hover {
    border-color: var(--purple);
    color: var(--purple);
    box-shadow: 0 0 14px rgba(189,147,249,.15);
}

.back-link::before { content: '←'; }

/* ── Footer ── */
footer {
    text-align: center;
    padding: 28px 24px;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    border-top: 1px solid var(--surface);
}

.footer-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-prompt { color: var(--green); }
.footer-name   { color: var(--fg); }
.footer-sep    { color: var(--surface); }
.footer-role   { color: var(--purple); }
.footer-loc    { color: var(--cyan); }
.footer-year   { color: var(--comment); }

footer a {
    color: var(--fg);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover { color: var(--purple); }

/* ── Responsive ── */
@media (max-width: 500px) {
    header { padding: 28px 16px 24px; }
    main { padding: 40px 16px 60px; }
    .post-card { padding: 18px 20px; }
    .prose { font-size: 0.98rem; }
}
