/* ============================================================
   APURVNS.XYZ — Powered by Pretext
   Design: dark charcoal / warm gold / clean editorial
   ============================================================ */

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

:root {
    --bg:          #0e0e0e;
    --bg-2:        #161616;
    --bg-3:        #1e1e1e;
    --surface:     #242424;
    --border:      #2e2e2e;
    --border-soft: #252525;
    --text:        #ede9e1;
    --text-muted:  #7a7672;
    --text-dim:    #4a4744;
    --accent:      #c8a96e;
    --accent-dim:  #8a7045;
    --accent-glow: rgba(200, 169, 110, 0.12);
    --link:        #c8a96e;
    --link-hover:  #e2c98a;
    --mono:        'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
    --sans:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-w:       680px;
    --max-w-wide:  860px;
    --radius:      6px;
    --radius-lg:   12px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== LAYOUT ===== */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.container--wide {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== HEADER / NAV ===== */
#header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(14, 14, 14, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-soft);
}

.header-content {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-logo-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.header-logo-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 3s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius);
    transition: color 0.18s, background 0.18s;
    letter-spacing: 0.01em;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-3);
}

.nav-link.active,
.nav-btn.active {
    color: var(--accent);
}

/* buttons that look like nav links */
.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
}

/* SPA view switching */
.spa-view {
    display: none;
    animation: viewIn 0.35s ease;
}
.spa-view.active {
    display: block;
}

@keyframes viewIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Transition overlay canvas (full screen, created by JS) */
#transition-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.header-socials {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.18s, background 0.18s;
}

.social-link:hover {
    color: var(--text);
    background: var(--bg-3);
}

.social-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ===== HERO SECTION ===== */
#hero {
    padding: 5rem 0 3.5rem;
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(200,169,110,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-inner {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-left { position: relative; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.25rem;
}

.hero-eyebrow::before {
    content: '';
    display: block;
    width: 18px;
    height: 1px;
    background: var(--accent);
}

/* Hero headline container — positions static h1 and canvas overlay */
.hero-headline-wrap {
    position: relative;
    margin-bottom: 1.25rem;
}

/* Hero headline */
.hero-headline {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0;
    font-family: var(--sans);
}

.post-item {
    position: relative;
}

.hero-bio {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 400px;
}

.hero-bio strong {
    color: var(--text);
    font-weight: 500;
}

.hero-cta-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.btn--primary {
    background: var(--accent);
    color: #0e0e0e;
}

.btn--primary:hover {
    background: var(--link-hover);
}

.btn--ghost {
    border-color: var(--border);
    color: var(--text-muted);
    background: transparent;
}

.btn--ghost:hover {
    border-color: var(--accent-dim);
    color: var(--text);
    background: var(--accent-glow);
}

/* Projects on the right side of hero */
.hero-right { position: relative; }

.projects-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 0.75rem;
}

.project-card {
    display: block;
    text-decoration: none;
    padding: 1rem 1.125rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    transition: border-color 0.2s, background 0.2s, transform 0.18s;
    margin-bottom: 0.75rem;
}

.project-card:last-child { margin-bottom: 0; }

.project-card:hover {
    border-color: var(--accent-dim);
    background: var(--bg-3);
    transform: translateY(-1px);
}

.project-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-card-name .arrow {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 0.8rem;
    transition: color 0.18s, transform 0.18s;
}

.project-card:hover .arrow {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.project-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== ABOUT ANCHOR DIVIDER ===== */
#about {
    padding: 0;
    scroll-margin-top: 80px;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-divider hr {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 0;
}

/* ===== BLOG SECTION ===== */
#posts {
    padding: 3.5rem 0 5rem;
    scroll-margin-top: 80px;
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--border-soft);
}

/* ===== POST LIST ===== */
#posts-list { min-height: 100px; }

.post-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-soft);
    position: relative;
}

.post-item:last-child { border-bottom: none; }

.post-item-inner {
    display: block;
    text-decoration: none;
}

.post-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.post-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    transition: color 0.18s;
    letter-spacing: -0.01em;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.post-item:hover .post-title {
    color: var(--accent);
}

.post-item:hover .post-title a {
    color: var(--accent);
}

.post-arrow {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 0.85rem;
    flex-shrink: 0;
    padding-top: 2px;
    transition: color 0.18s, transform 0.18s;
}

.post-item:hover .post-arrow {
    color: var(--accent);
    transform: translate(3px, -3px);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 0.65rem;
    font-family: var(--mono);
}

.post-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-dim);
    flex-shrink: 0;
}

.post-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Preview content (expanded short posts) */
.post-content-preview {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-top: 0.5rem;
}

.post-content-preview p { margin-bottom: 0.65rem; }
.post-content-preview p:last-child { margin-bottom: 0; }
.post-content-preview h1,.post-content-preview h2,.post-content-preview h3,
.post-content-preview h4,.post-content-preview h5,.post-content-preview h6 {
    font-size: 0.95rem; font-weight: 600; margin: 0.75rem 0 0.35rem;
    color: var(--text);
}
.post-content-preview ul,.post-content-preview ol {
    margin: 0.5rem 0; padding-left: 1.25rem;
}
.post-content-preview li { margin-bottom: 0.25rem; }
.post-content-preview code {
    font-family: var(--mono);
    font-size: 0.82em;
    background: var(--surface);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    color: var(--accent);
}
.post-content-preview blockquote {
    border-left: 2px solid var(--accent-dim);
    padding-left: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0.75rem 0;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    margin-top: 0.5rem;
    transition: gap 0.18s, color 0.18s;
}

.read-more:hover {
    color: var(--link-hover);
    gap: 0.5rem;
}

.post-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.post-tag {
    font-size: 0.7rem;
    font-weight: 500;
    font-family: var(--mono);
    color: var(--text-dim);
    background: var(--bg-3);
    border: 1px solid var(--border-soft);
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}

.post-tag:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
}

/* ===== PAGINATION ===== */
.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-controls button {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all 0.18s;
}

.pagination-controls button:hover {
    border-color: var(--accent-dim);
    color: var(--text);
    background: var(--accent-glow);
}

.pagination-controls button.active {
    background: var(--accent);
    color: #0e0e0e;
    border-color: var(--accent);
    font-weight: 600;
}

/* ===== INDIVIDUAL POST PAGE ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 2.5rem;
    font-family: var(--mono);
    transition: color 0.18s, gap 0.18s;
}

.back-link:hover {
    color: var(--accent);
    gap: 0.6rem;
}

.post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-soft);
}

.post-header h1 {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 1rem;
}

.post-header .post-meta {
    margin-bottom: 0;
}

/* ── Post page layout ──────────────────────────────────────────────────────── */
.post-page {
    padding: 3rem 0 6rem;
    max-width: 720px;
}

.post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-soft);
}

.post-header h1,
.post-header .post-title-h1 {
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.post-header .post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

/* ── Post prose ────────────────────────────────────────────────────────────── */
.post-content {
    font-size: 1.125rem;
    line-height: 1.85;
    color: rgba(237, 233, 225, 0.82);
    font-feature-settings: "kern" 1, "liga" 1;
}

/* First paragraph gets a slightly larger, more prominent treatment */
.post-content > p:first-of-type {
    font-size: 1.2rem;
    line-height: 1.8;
    color: rgba(237, 233, 225, 0.92);
}

.post-content p {
    margin-bottom: 1.6rem;
}
.post-content p:last-child { margin-bottom: 0; }

/* Headings */
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 3rem 0 1rem;
}
.post-content h1 { font-size: 1.75rem; }
.post-content h2 {
    font-size: 1.35rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-soft);
}
.post-content h3 { font-size: 1.15rem; color: var(--text); }
.post-content h4 { font-size: 1rem; color: var(--text); }

/* Links */
.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(200, 169, 110, 0.35);
    text-underline-offset: 3px;
    transition: color 0.15s, text-decoration-color 0.15s;
}
.post-content a:hover {
    color: #e5c87a;
    text-decoration-color: rgba(229, 200, 122, 0.7);
}

/* Lists */
.post-content ul, .post-content ol {
    margin: 1.5rem 0;
    padding-left: 1.75rem;
}
.post-content ul { list-style: none; }
.post-content ul li {
    position: relative;
    padding-left: 0.25rem;
    margin-bottom: 0.6rem;
}
.post-content ul li::before {
    content: '—';
    position: absolute;
    left: -1.5rem;
    color: var(--accent);
    opacity: 0.7;
}
.post-content ol li { margin-bottom: 0.6rem; }

/* Blockquote */
.post-content blockquote {
    margin: 2.5rem 0;
    padding: 1.5rem 1.75rem;
    border-left: 3px solid var(--accent);
    background: rgba(200, 169, 110, 0.04);
    border-radius: 0 var(--radius) var(--radius) 0;
    position: relative;
}
.post-content blockquote p {
    margin: 0;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text);
    line-height: 1.7;
}

/* Inline code */
.post-content code {
    font-family: var(--mono);
    font-size: 0.875em;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    color: #e5c87a;
}

/* Code blocks */
.post-content pre {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 2rem 0;
    position: relative;
}
.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    color: rgba(237, 233, 225, 0.88);
    line-height: 1.65;
}

/* HR divider */
.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

/* Images */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 2rem 0;
    border: 1px solid var(--border);
    display: block;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}
.post-content th, .post-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.post-content th {
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}



/* ===== PRETEXT BADGE in footer ===== */
footer {
    border-top: 1px solid var(--border-soft);
    padding: 2rem 0;
    margin-top: 0;
}

.footer-inner {
    max-width: var(--max-w-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-family: var(--mono);
}

.pretext-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 500;
    font-family: var(--mono);
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.18s;
}

.pretext-badge:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: var(--accent-glow);
}

.pretext-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* ===== LOADING STATE ===== */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-title { height: 20px; width: 75%; }
.skeleton-meta { height: 12px; width: 35%; margin-top: 0.4rem; }
.skeleton-line { height: 12px; width: 100%; margin-top: 0.75rem; }
.skeleton-line-short { height: 12px; width: 65%; margin-top: 0.35rem; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===== HIDDEN UTILITY ===== */
.hidden { display: none !important; }

/* ===== BACK BUTTON (for blog page) ===== */
#back-button { display: none !important; }
.back-button { display: none; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero-bio { max-width: 100%; }

    #hero { padding: 3rem 0 2.5rem; }

    .header-nav { display: none; }

    .header-content { height: 50px; }

    .post-header h1 { font-size: 1.45rem; }

    .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

@media (max-width: 480px) {
    .hero-cta-row { flex-direction: column; }
    .btn { justify-content: center; }
    .post-header h1 { font-size: 1.25rem; }
    .section-header { margin-bottom: 1.25rem; }
}

/* ===== TRANSITIONS (global, minimal) ===== */
a, button { transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease; }