/* Terminal Dark Theme - Portfolio Style */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Palette */
    --bg-color: #050507;
    --card-bg: rgba(20, 20, 23, 0.6);
    --card-hover: rgba(30, 30, 35, 0.8);
    --text-primary: #f2f2f2;
    --text-secondary: #888890;
    --accent: #32d74b;
    /* Terminal Green */
    --glass-border: rgba(255, 255, 255, 0.08);
    --blur-strength: 20px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-serif: "Fraunces", "Playfair Display", "Crimson Text", Georgia, serif;
    --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", "Roboto Mono", monospace;

    --max-width: 700px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 6rem;
    overflow-y: scroll;
    /* Always show scrollbar to prevent jump */
    animation: pageLoad 0.5s cubic-bezier(0.23, 1, 0.320, 1);
}

/* --- The 'MacBook' Glass Navigation --- */
.nav-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: auto;
    /* Subtle entrance animation */
    animation: floatUp 0.8s ease-out 0.5s backwards;
}

nav {
    background: rgba(20, 20, 23, 0.75);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    padding: 0.75rem 0.5rem;
    border-radius: 999px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    color: var(--text-secondary);
    background: transparent;
    border: none;
    padding: 0.6rem 1.3rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    border-radius: 99px;
    position: relative;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: var(--bg-color);
    background: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(242, 242, 242, 0.15);
}

/* --- Layout & Animation --- */
.wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 6rem 1.5rem;
    min-height: 80vh;
}

.view-section {
    display: none;
    /* Hidden by default */
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s cubic-bezier(0.23, 1, 0.320, 1), transform 0.5s cubic-bezier(0.23, 1, 0.320, 1);
}

.view-section.active {
    display: block;
    animation: fadeInView 0.5s cubic-bezier(0.23, 1, 0.320, 1) forwards;
}

@keyframes fadeInView {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* --- Common Typography --- */
h1 {
    font-size: 3rem;
    font-weight: 200;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    font-family: var(--font-serif);
    font-optical-sizing: auto;
}

h2 {
    font-size: 2rem;
    font-weight: 200;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.2;
    font-family: var(--font-serif);
    font-optical-sizing: auto;
}

.section-header {
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 2.5rem;
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 1.2rem;
    display: block;
    font-weight: 500;
    letter-spacing: 0.05em;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* --- Cards & Lists --- */
.card {
    padding: 1.5rem;
    background: rgba(20, 20, 23, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    cursor: pointer;
    text-decoration: none;
    display: block;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.card:hover {
    transform: translateY(-4px);
    background: rgba(25, 25, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.tag-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* --- Thoughts (Blog) Specific --- */
.thought-item {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.thought-item:hover {
    color: var(--text-primary);
    padding-left: 0.5rem;
}

.thought-item:hover .thought-date {
    color: var(--accent);
}

.thought-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.thought-title {
    font-size: 1.1rem;
}

.thought-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.thought-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    font-family: var(--font-mono);
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* --- Filter buttons --- */
.filter-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    font-family: var(--font-mono);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.filter-btn.active {
    background: var(--accent);
    color: var(--bg-color);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(50, 215, 75, 0.2);
}

.filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.project-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(50, 215, 75, 0.1);
    color: var(--accent);
    display: inline-block;
}

/* --- CV Specific --- */
.cv-block {
    margin-bottom: 3rem;
}

.cv-block h3 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.cv-entry {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.cv-time {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.cv-detail h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.cv-detail .company {
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 0.8rem;
    display: block;
}

.cv-detail p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.9rem 1.8rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    text-decoration: none;
    margin-right: 1rem;
    position: relative;
    overflow: hidden;
    vertical-align: middle;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #2bc73e 100%);
    color: var(--bg-color);
    box-shadow: 0 4px 15px rgba(50, 215, 75, 0.2);
    font-family: var(--font-mono);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2bc73e 0%, var(--accent) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(50, 215, 75, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: var(--font-mono);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
}

/* --- Page Transitions --- */
body {
    animation: pageLoad 0.4s ease-out;
}

body.page-transitioning {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

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

/* --- Glow FX --- */
.glow {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(50, 215, 75, 0.06) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    filter: blur(100px);
    pointer-events: none;
}

/* --- Decorative Header Bar --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(50, 215, 75, 0.4) 0%,
        rgba(50, 200, 100, 0.5) 12%,
        rgba(50, 150, 150, 0.45) 25%,
        rgba(100, 150, 220, 0.4) 40%,
        rgba(150, 100, 220, 0.35) 55%,
        rgba(200, 100, 180, 0.4) 70%,
        rgba(200, 120, 150, 0.35) 85%,
        rgba(50, 215, 75, 0.3) 100%
    );
    z-index: 999;
    filter: blur(0.5px);
    box-shadow: 0 0 25px 10px rgba(50, 215, 75, 0.2),
                0 0 50px 20px rgba(100, 150, 200, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* --- Enhanced Bottom Glow --- */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: radial-gradient(ellipse 800px 300px at 50% 100%, 
        rgba(50, 215, 75, 0.1) 0%,
        rgba(50, 215, 75, 0.05) 30%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: -1;
    filter: blur(60px);
    pointer-events: none;
}

/* --- Project Detail Page Specific --- */
.back-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}

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

.project-content,
.post-content {
    max-width: 750px;
}

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

.project-header h1,
.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.project-meta,
.post-meta {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.post-meta .read-time {
    color: var(--text-secondary);
    opacity: 0.7;
}

.project-status {
    padding: 0.3rem 0.8rem;
    background: rgba(50, 215, 75, 0.1);
    border: 1px solid rgba(50, 215, 75, 0.3);
    border-radius: 6px;
    color: var(--accent);
}

.project-tech {
    color: var(--text-secondary);
}

#projectBody,
#postBody {
    line-height: 1.8;
}

#projectBody h2,
#postBody h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

#projectBody h3,
#postBody h3 {
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

#projectBody p,
#postBody p {
    margin-bottom: 1.5rem;
}

#projectBody ul,
#projectBody ol,
#postBody ul,
#postBody ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

#projectBody li,
#postBody li {
    margin-bottom: 0.5rem;
}

#projectBody blockquote,
#postBody blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

#projectBody code,
#postBody code {
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    border: 1px solid var(--glass-border);
    font-size: 0.9em;
}

#projectBody pre,
#postBody pre {
    background: rgba(0, 0, 0, 0.35) !important;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

/* Let the Prism theme's own syntax colors show through our glass frame,
   instead of stacking its grey panel on top of ours. */
#projectBody pre[class*="language-"],
#postBody pre[class*="language-"],
#projectBody code[class*="language-"],
#postBody code[class*="language-"] {
    background: transparent !important;
    text-shadow: none;
}

#projectBody pre code,
#postBody pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.85em;
}

/* Tie code blocks back to the terminal-green accent */
#postBody .token.keyword,
#projectBody .token.keyword {
    color: var(--accent);
}

#postBody .token.comment,
#projectBody .token.comment {
    color: #5c6370;
}

#projectBody img,
#postBody img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
}

#projectBody a,
#postBody a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

#projectBody a:hover,
#postBody a:hover {
    border-bottom-color: var(--accent);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    .cv-entry {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .cv-time {
        margin-bottom: 0.2rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .wrapper {
        padding: 4rem 1rem 2rem 1rem;
    }

    .nav-container {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        width: auto;
    }

    nav {
        width: 100%;
        justify-content: center;
    }

    .pagination {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pagination-btn {
        width: 100%;
    }
}

/* --- Holographic Sticker Text Effect --- */
.holo-text {
    --mouse-x: 0.5;
    --mouse-y: 0.5;
    --rotate-x: 0deg;
    --rotate-y: 0deg;
    position: relative;
    display: inline-block;
    transform-style: preserve-3d;
    perspective: 1000px;
    cursor: default;
}

.holo-text .text-content {
    position: relative;
    display: inline-block;
    transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y));
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
    font-size: 3rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* Base text layer */
.holo-text .text-base {
    position: relative;
    color: var(--text-primary);
    transition: opacity 0.3s ease;
}

/* Holographic rainbow layer - clipped to text */
.holo-text .holo-layer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        calc(var(--mouse-x) * 360deg),
        hsl(0, 90%, 70%) 0%,
        hsl(45, 90%, 65%) 15%,
        hsl(90, 85%, 60%) 30%,
        hsl(150, 90%, 65%) 45%,
        hsl(200, 95%, 70%) 60%,
        hsl(260, 90%, 70%) 75%,
        hsl(310, 85%, 68%) 90%,
        hsl(360, 90%, 70%) 100%
    );
    background-size: 200% 200%;
    background-position: calc(var(--mouse-x) * 100%) calc(var(--mouse-y) * 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Texture overlay - clipped to text */
.holo-text .holo-texture {
    position: absolute;
    inset: 0;
    background: 
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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"),
        linear-gradient(
            calc(var(--mouse-x) * 360deg),
            hsl(0, 90%, 70%) 0%,
            hsl(60, 90%, 65%) 20%,
            hsl(120, 85%, 60%) 40%,
            hsl(180, 90%, 65%) 60%,
            hsl(240, 95%, 70%) 80%,
            hsl(300, 90%, 70%) 100%
        );
    background-size: 50px 50px, 200% 200%;
    background-position: 0 0, calc(var(--mouse-x) * 100%) calc(var(--mouse-y) * 100%);
    background-blend-mode: overlay;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    mix-blend-mode: color-dodge;
}

/* Specular glare - clipped to text */
.holo-text .holo-glare {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 60% 40% at calc(var(--mouse-x) * 100%) calc(var(--mouse-y) * 100%),
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.6) 20%,
        transparent 60%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    mix-blend-mode: overlay;
}

/* Hover states */
.holo-text:hover .text-base {
    opacity: 0;
}

.holo-text:hover .holo-layer {
    opacity: 1;
}

.holo-text:hover .holo-texture {
    opacity: 0.4;
}

.holo-text:hover .holo-glare {
    opacity: 0.8;
}