/* ============================================
   PERSONAL BIO PORTAL - Shared Stylesheet
   anupraghavavn.in
   ============================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300;1,9..40,400&display=swap');

/* --- CSS Variables --- */
:root {
    --bg-primary: #FAFAFA;
    --bg-secondary: #F5F5F5;
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #8A8A8A;
    --accent: #2D2D2D;
    --border: #E0E0E0;
    --hover-bg: #EBEBEB;

    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 40px;
    --space-6: 48px;
    --space-8: 64px;
    --space-10: 80px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* --- Grain Texture Overlay --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    line-height: 1.15;
    color: var(--text-primary);
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    color: var(--text-secondary);
    line-height: 1.75;
}

/* --- Container --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--space-3);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeInUp 0.5s ease-out both;
}
.animate-1 { animation-delay: 0.1s; }
.animate-2 { animation-delay: 0.2s; }
.animate-3 { animation-delay: 0.3s; }
.animate-4 { animation-delay: 0.4s; }
.animate-5 { animation-delay: 0.5s; }
.animate-6 { animation-delay: 0.6s; }
.animate-7 { animation-delay: 0.7s; }
.animate-8 { animation-delay: 0.8s; }

/* --- Shared Header --- */
.header {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background-color: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
    position: relative;
}

.back-link:hover {
    color: var(--text-primary);
}

.header-nav {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

.header-nav a {
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    position: relative;
    transition: color 0.2s ease;
    padding-bottom: 2px;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-primary);
    transition: width 0.25s ease;
}

.header-nav a:hover {
    color: var(--text-primary);
}

.header-nav a:hover::after {
    width: 100%;
}

/* --- Shared Footer --- */
.footer {
    margin-top: var(--space-10);
    padding: var(--space-6) 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.footer-links {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.8125rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.2s ease;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-primary);
    transition: width 0.25s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* --- Page Title Section --- */
.page-header {
    padding: var(--space-10) 0 var(--space-8);
}

.page-label {
    display: block;
    font-size: 0.75rem;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.page-title {
    font-size: 3rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-bottom: var(--space-3);
}

.page-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.7;
}

/* --- Animated Link Underline --- */
.link-underline {
    position: relative;
    display: inline-block;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.25s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* --- Navigation Cards (Landing Page) --- */
.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.nav-card {
    display: block;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.2s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border-left-color: var(--accent);
}

.nav-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-1);
}

.nav-card-title {
    font-size: 1.375rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    color: var(--text-primary);
}

.nav-card-arrow {
    font-size: 1rem;
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-card:hover .nav-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.nav-card-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Project Cards --- */
.project-section {
    margin-bottom: var(--space-8);
}

.section-label {
    font-size: 0.75rem;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}

.project-card {
    display: block;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-primary);
    margin-bottom: var(--space-3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.project-card.future {
    border-style: dashed;
}

.project-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    gap: var(--space-2);
}

.project-title {
    font-size: 1.25rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    color: var(--text-primary);
}

.project-status {
    font-size: 0.6875rem;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-active {
    background-color: var(--accent);
    color: #FAFAFA;
}

.status-shipped {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.status-future {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.project-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-3);
}

.project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.tech-tag {
    font-size: 0.75rem;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
}

.project-link {
    font-size: 0.8125rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.project-link:hover {
    color: var(--text-primary);
}

/* --- Blog Post Items --- */
.featured-post {
    display: block;
    padding: var(--space-5);
    background-color: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: var(--space-8);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.featured-label {
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    margin-bottom: var(--space-3);
    display: block;
}

.post-date {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-1);
}

.post-title {
    font-size: 1.75rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: var(--space-2);
}

.post-excerpt {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.post-list {
    display: flex;
    flex-direction: column;
}

.post-item {
    display: block;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border);
    transition: transform 0.2s ease;
    transform: translateX(0);
}

.post-item:first-child {
    border-top: 1px solid var(--border);
}

.post-item:hover {
    transform: translateX(4px);
}

.post-item .post-title {
    font-size: 1.375rem;
    margin-bottom: var(--space-1);
}

/* --- Timeline (Journey Page) --- */
.timeline {
    position: relative;
    padding-left: var(--space-5);
    margin-bottom: var(--space-8);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 0;
    width: 1px;
    background-color: var(--border);
}

.timeline-group {
    margin-bottom: var(--space-8);
}

.timeline-era {
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    margin-bottom: var(--space-4);
    position: relative;
}

.timeline-era::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-5));
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    transform: translateY(-50%) translateX(-3.5px);
}

.timeline-item {
    margin-bottom: var(--space-6);
}

.timeline-period {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    margin-bottom: var(--space-1);
}

.timeline-role {
    font-size: 1.375rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-company {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    margin-bottom: var(--space-2);
}

.timeline-story {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: var(--space-2);
}

.timeline-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.highlight-tag {
    font-size: 0.75rem;
    font-family: 'DM Sans', sans-serif;
    padding: 3px 10px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
}

/* --- Skills Grid --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.skills-column h3 {
    font-size: 1rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--border);
}

.skills-list {
    list-style: none;
}

.skills-list li {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    padding: var(--space-1) 0;
    border-bottom: 1px solid var(--bg-secondary);
}

/* --- Philosophy Card --- */
.philosophy-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: var(--space-5);
    margin-bottom: var(--space-8);
    border: 1px solid var(--border);
}

.philosophy-card p {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-3);
}

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

/* --- Download Button --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.875rem;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.04em;
    padding: var(--space-2) var(--space-3);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-primary);
    border: 1px solid var(--accent);
}

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

.btn-outline {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

/* --- Gallery Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-8);
}

.gallery-item {
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1;
    background-color: var(--bg-secondary);
    position: relative;
}

.gallery-item.wide {
    grid-column: span 2;
    aspect-ratio: 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.4s ease, transform 0.4s ease;
    display: block;
}

.gallery-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.02);
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.05em;
    text-align: center;
}

/* --- Hobbies/Pursuits Grid --- */
.pursuits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.pursuit-card {
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pursuit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.pursuit-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
    display: block;
}

.pursuit-title {
    font-size: 1.25rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.pursuit-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* --- Currently Section --- */
.currently-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    padding: var(--space-5);
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: var(--space-8);
}

.currently-item-label {
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    margin-bottom: var(--space-2);
    display: block;
}

.currently-item-value {
    font-size: 1rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.currently-item-author {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: 'DM Sans', sans-serif;
}

/* --- Quote Block --- */
.quote-block {
    text-align: center;
    padding: var(--space-8) var(--space-5);
    margin-bottom: var(--space-8);
}

.quote-text {
    font-size: 1.5rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 640px;
    margin: 0 auto var(--space-3);
}

.quote-attribution {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.05em;
}

/* --- Blog Post Content (reading view) --- */
.post-content {
    max-width: 720px;
    margin: 0 auto;
}

.post-content-body {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

.post-content-body p {
    margin-bottom: var(--space-4);
}

.post-content-body h2 {
    font-size: 1.875rem;
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
}

.post-content-body h3 {
    font-size: 1.375rem;
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
}

.post-content-body blockquote {
    border-left: 3px solid var(--border);
    padding-left: var(--space-4);
    margin: var(--space-5) 0;
    font-style: italic;
    color: var(--text-muted);
}

.post-content-body pre {
    background-color: var(--accent);
    color: #f0f0f0;
    padding: var(--space-4);
    border-radius: 8px;
    overflow-x: auto;
    margin: var(--space-5) 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.post-content-body code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875em;
}

.post-content-body p code {
    background-color: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.post-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-10);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    gap: var(--space-3);
}

.post-nav-item {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.post-nav-item:hover {
    color: var(--text-primary);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-top: var(--space-6);
}

.post-tag {
    font-size: 0.75rem;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 12px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

    .page-title {
        font-size: 2.25rem;
    }

    .nav-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .pursuits-grid {
        grid-template-columns: 1fr;
    }

    .currently-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-item.wide {
        grid-column: span 1;
        aspect-ratio: 1;
    }

    .post-nav {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .project-card-top {
        flex-wrap: wrap;
    }

    .page-header {
        padding: var(--space-6) 0 var(--space-5);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item.wide {
        grid-column: span 1;
    }

    .quote-text {
        font-size: 1.25rem;
    }
}
