/* ============================================================
   PORTFOLIO THEME — Dark Minimalist
   ============================================================ */

/* --- Google Fonts are loaded in import-css.blade.php --- */

/* ======================== VARIABLES ======================== */
:root {
    --bg-primary: #0f172a;
    --bg-body: #000000;
    --bg-surface: #1e293b;
    --bg-elevated: #273549;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #f43f5e;
    --accent-hover: #e11d48;
    --border-color: rgba(148, 163, 184, 0.15);
    --border-strong: rgba(148, 163, 184, 0.3);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --transition: 0.3s ease;
    --max-width: 750px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ======================== UTILITIES ======================== */
.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-wrapper {
    max-width: 1400px;
    width: 85%;
    margin: 0 auto;
    background: var(--bg-primary);
    min-height: 100vh;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

@media (max-width: 1024px) {
    .page-wrapper {
        width: 100%;
        max-width: 100%;
        box-shadow: none;
    }
}

.section {
    padding: 80px 0;
}

.section-border {
    border-top: 1px solid var(--border-color);
}

/* ======================== PRELOADER ======================== */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

#preloader.loaded {
    opacity: 0;
    pointer-events: none;
}

#preloader .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ======================== NAVBAR ======================== */
.site-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 10px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    max-width: 680px;
    width: calc(100% - 48px);
}

.site-nav .nav-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    white-space: nowrap;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 2px 10px;
}

.site-nav .nav-brand:hover {
    color: var(--text-primary);
}

.site-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-nav .nav-links a {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
    white-space: nowrap;
}

.site-nav .nav-links a:hover,
.site-nav .nav-links a.active {
    color: var(--accent);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ======================== HERO ======================== */
.hero {
    padding: 160px 0 80px;
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-primary) 100%);
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-text p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 480px;
}

.hero-image {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ======================== FEATURED ARTICLES ======================== */
.featured-section {
    padding-top: 60px;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    font-family: var(--font-heading);
}

.section-title.no-border {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
}

.article-card {
    display: flex;
    gap: 28px;
    padding: 32px 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 0;
    border-radius: var(--radius-md);
    transition: none;
}

.article-card::before {
    content: '';
    position: absolute;
    inset: -8px -16px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    z-index: -1;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.article-card:hover::before {
    opacity: 1;
    transform: scale(1);
}

.article-card:last-child {
    border-bottom: none;
}

.article-card-image {
    flex-shrink: 0;
    width: 180px;
    height: 140px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: none;
}

.article-card-body {
    flex: 1;
}

.article-card-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.article-card-body h3 a:hover {
    color: var(--accent);
}

.article-card-date {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-body);
    margin-bottom: 10px;
}

.article-card-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.read-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.read-more:hover {
    color: var(--accent);
}

/* ======================== SKILLS GRID ======================== */
.skills-section {
    padding-top: 60px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 24px;
}

.skill-item {
    background: var(--bg-primary);
    padding: 28px 24px;
    position: relative;
    z-index: 0;
    transition: none;
}

.skill-item::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: var(--bg-surface);
    z-index: -1;
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.skill-item:hover::before {
    opacity: 1;
    transform: scale(1);
}

.skill-item h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: var(--font-heading);
}

.skill-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.skill-item .skill-icon {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: block;
}

/* ======================== BLOG LIST ======================== */
.blog-page {
    padding-top: 120px;
    padding-bottom: 60px;
}

.blog-page h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.blog-page .subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 48px;
    line-height: 1.6;
}

.blog-list .article-card:first-child {
    padding-top: 0;
}

/* Article card as full link */
a.article-card {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

a.article-card:hover {
    color: inherit;
    text-decoration: none;
}

a.article-card:hover h3 {
    color: var(--accent);
}

/* ======================== PAGINATION ======================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.page-link:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-surface);
}

.page-link.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.page-link.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* ======================== BLOG DETAIL ======================== */
.blog-detail {
    padding-top: 120px;
    padding-bottom: 60px;
}

.blog-detail .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 500;
}

.blog-detail .back-link:hover {
    color: var(--accent);
}

.blog-detail .post-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.25;
}

.blog-detail .post-hero-image {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 36px;
}

.blog-detail .post-hero-image img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
}

/* Blog content typography */
.post-content {
    font-size: 17px;
    line-height: 1.85;
    color: var(--text-secondary);
}

.post-content h1 {
    font-size: 2rem;
    margin: 40px 0 16px;
    color: var(--text-primary);
}

.post-content h2 {
    font-size: 1.6rem;
    margin: 36px 0 14px;
    color: var(--text-primary);
}

.post-content h3 {
    font-size: 1.3rem;
    margin: 28px 0 12px;
    color: var(--text-primary);
}

.post-content h4 {
    font-size: 1.1rem;
    margin: 24px 0 10px;
    color: var(--text-primary);
}

.post-content p {
    margin-bottom: 20px;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
}

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

.post-content strong,
.post-content b {
    color: var(--text-primary);
    font-weight: 700;
}

.post-content ul,
.post-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 8px;
    list-style: disc;
}

.post-content ol li {
    list-style: decimal;
}

.post-content img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.post-content pre {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
    overflow: hidden;
    margin: 28px 0;
    font-size: 14px;
    line-height: 1.7;
    position: relative;
}

.post-content pre code {
    display: block;
    padding: 20px 24px;
    overflow-x: auto;
    background: transparent;
    color: #e6edf3;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 13.5px;
    border-radius: 0;
    tab-size: 4;
}

/* Highlight.js overrides to match theme */
.post-content pre code.hljs {
    background: transparent;
    padding: 20px 24px;
}

/* Inline code (not inside pre) */
.post-content code {
    background: rgba(110, 118, 129, 0.2);
    padding: 3px 8px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.85em;
    color: #f0883e;
    border: 1px solid rgba(110, 118, 129, 0.15);
    white-space: nowrap;
}

/* Reset inline styles when code is inside pre */
.post-content pre code {
    border: none;
    white-space: pre;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Force editor-injected fonts to match theme */
.post-content font,
.post-content span,
.post-content div {
    font-family: var(--font-body) !important;
}

/* ======================== ABOUT PAGE ======================== */
.about-page {
    padding-top: 120px;
    padding-bottom: 40px;
}

.about-page h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 32px;
}

.about-bio {
    margin-bottom: 40px;
}

.about-bio p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 24px;
}

.about-contact-row {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
}

.about-contact-row a {
    color: var(--text-secondary);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.about-contact-row a:hover {
    color: var(--text-primary);
}

.about-social-icons {
    display: flex;
    gap: 16px;
}

.about-social-icons a {
    font-size: 20px;
    color: var(--text-secondary);
}

.about-social-icons a:hover {
    color: var(--text-primary);
}

/* Career timeline */
.career-section {
    padding-top: 40px;
}

.career-item {
    display: flex;
    gap: 48px;
    padding: 36px 0;
    border-top: 1px solid var(--border-color);
}

.career-date {
    flex-shrink: 0;
    width: 140px;
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
    padding-top: 3px;
}

.career-body {
    flex: 1;
}

.career-body h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.career-body .career-location {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.career-body p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ======================== CONTACT PAGE ======================== */

/* Make page-wrapper on contact page fill exactly the viewport */
body.contact-body {
    height: 100dvh;
    overflow: hidden;
}

body.contact-body .page-wrapper {
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contact-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: clamp(70px, 10vh, 120px);
    padding-bottom: clamp(10px, 2vh, 30px);
    min-height: 0;
}

.contact-page .container {
    width: 90%;
    max-width: clamp(500px, 60vw, 900px);
}

.contact-page h1 {
    font-size: clamp(1.6rem, 3.5vw, 3rem);
    font-weight: 800;
    margin-bottom: clamp(4px, 1vh, 12px);
    text-align: center;
}

.contact-page .subtitle {
    color: var(--text-secondary);
    margin-bottom: clamp(16px, 3vh, 48px);
    text-align: center;
    font-size: clamp(13px, 1.4vw, 16px);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 1.5vw, 20px);
    margin: 0 auto;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.5vw, 20px);
    padding: clamp(14px, 2.5vh, 40px) clamp(12px, 2vw, 36px);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    position: relative;
    z-index: 0;
}

.contact-card::before {
    content: '';
    position: absolute;
    inset: -6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    z-index: -1;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.contact-card:hover::before {
    opacity: 1;
    transform: scale(1);
}

.contact-card:hover {
    color: inherit;
    border-color: var(--border-strong);
}

.contact-card i {
    font-size: clamp(22px, 3vw, 44px);
    color: var(--text-secondary);
    flex-shrink: 0;
    width: clamp(30px, 4vw, 56px);
    text-align: center;
}

.contact-card-body h4 {
    font-size: clamp(14px, 1.5vw, 20px);
    font-weight: 700;
    margin-bottom: clamp(2px, 0.4vh, 4px);
}

.contact-card-body p {
    font-size: clamp(11px, 1.2vw, 15px);
    color: var(--text-muted);
}

/* Footer on contact page — compact */
body.contact-body .site-footer {
    padding: clamp(12px, 2vh, 30px) 0 clamp(10px, 1.5vh, 20px);
    margin-top: 0;
}

body.contact-body .site-footer .footer-content p {
    margin-bottom: clamp(8px, 1vh, 16px);
    font-size: clamp(11px, 1.2vw, 14px);
}

body.contact-body .site-footer .footer-social {
    gap: clamp(10px, 1.5vw, 20px);
}

body.contact-body .site-footer .footer-social a {
    font-size: clamp(14px, 1.5vw, 20px);
}

/* ======================== FOOTER ======================== */
.site-footer {
    margin-top: auto;
    padding: 60px 0 40px;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-social a {
    font-size: 20px;
    color: var(--text-secondary);
    transition: color var(--transition);
}

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

/* ======================== SCROLL TO TOP ======================== */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 768px) {
    .site-nav {
        top: 12px;
        padding: 8px 16px;
        gap: 16px;
        width: calc(100% - 32px);
        max-width: none;
        justify-content: space-between;
    }

    .site-nav .nav-brand {
        font-size: 15px;
    }

    .site-nav .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 16px 24px;
        flex-direction: column;
        gap: 16px;
        min-width: 160px;
        box-shadow: var(--shadow-lg);
    }

    .site-nav .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        padding: 130px 0 50px;
    }

    .hero-inner {
        flex-direction: column-reverse;
        text-align: center;
        gap: 32px;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .hero-text p {
        max-width: 100%;
    }

    .hero-image {
        width: 150px;
        height: 150px;
    }

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

    .article-card {
        flex-direction: column;
        gap: 16px;
    }

    .article-card-image {
        width: 100%;
        height: 200px;
    }

    .blog-page h1,
    .about-page h1 {
        font-size: 2.2rem;
    }

    .blog-detail .post-title {
        font-size: 1.8rem;
    }

    .career-item {
        flex-direction: column;
        gap: 8px;
    }

    .career-date {
        width: auto;
    }

    .about-contact-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

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

    .hero-text h1 {
        font-size: 1.8rem;
    }

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