/* Zen Minimal + Reference Typography */

:root {
    --bg-color: #fafaf8;
    /* From Reference */
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-tertiary: #888888;
    --accent: #2563eb;
    --border-color: #e0ddd8;
    --hover-bg: #f4f2f0;
}

body.dark-mode {
    --bg-color: #111111;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --border-color: #2a2a2a;
    --hover-bg: #1a1a1a;
    --accent: #60a5fa;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: "Lora", serif;
    /* Reference Font */
    font-size: 16px;
    line-height: 1.65;
    /* Reference Line Height */
    -webkit-font-smoothing: antialiased;
}

a {
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid transparent;
}

a:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Main Container - Single Column (Zen) */
.main-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.profile-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.profile-avatar img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    /* Disables long-press context menu on iOS */
    -webkit-tap-highlight-color: transparent;
    /* Removes blue tap box on mobile */
}

.profile-avatar img:hover {
    transform: rotate(10deg);
    border-color: var(--text-primary);
}

/* Dark mode specific avatar style */
body.dark-mode .profile-avatar img {
    background-color: #e0e0e0;
    border-color: #e0e0e0;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.profile-bio {
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-family: "Inter", sans-serif;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: lowercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.social-links a:hover {
    color: var(--accent);
}

.social-links svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Inline Styled Links */
.styled-link {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 1px;
    transition: all 0.2s;
}

.styled-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

.styled-link svg {
    display: none;
}

/* Demo Link (Project Style) */
.demo-link {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 1px;
    text-decoration: none;
    font-size: 0.85rem;
    margin-left: 8px;
    /* Spacing from text */
    vertical-align: middle;
}

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

.demo-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1px;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-color);
    padding-top: 0.5rem;

    /* Mobile Scroll Support */
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    /* smooth scroll on iOS */

    /* Hide scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.nav-tabs::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

@media (max-width: 600px) {
    .nav-tabs {
        justify-content: flex-start;
        /* Align start to allow scrolling */
        padding-left: 1rem;
        /* Add some padding so first item isn't glued */
        padding-right: 1rem;
    }
}

.tab-btn {
    background: none;
    border: none;
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.8rem 0;
    position: relative;
    transition: color 0.2s;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    -webkit-tap-highlight-color: transparent;
    /* Removes blue tap box on mobile */
    white-space: nowrap;
    /* Prevent multiline on mobile */
    flex-shrink: 0;
    /* Prevent squishing */
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--text-primary);
    font-weight: 600;
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.2s cubic-bezier(0.2, 0.0, 0.0, 1.0);
    /* Faster and snappy */
    pointer-events: none;
    z-index: 20;
    /* Ensure on top */
    /* Hidden initially, set by JS */
    width: 0;
}

/* Content Area */
.content-area {
    animation: fadeIn 0.4s ease;
    flex: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* Typography styles */
.section-intro {
    font-family: "Lora", serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.group-title {
    font-family: "Inter", sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    margin-top: 3.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

/* Item Lists */
.item-list {
    list-style: none;
}

.item-row {
    margin-bottom: 2.5rem;
    display: block;
}

/* Specific Separator for Projects only */
.project-row {
    padding-bottom: 2rem;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 2.5rem;
}

.project-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.item-row:last-child {
    margin-bottom: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

/* Resume Style Headers */
.item-title {
    font-family: "Lora", serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.item-meta {
    font-family: "Lora", serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
}

.item-location {
    font-family: "Inter", sans-serif;
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    font-weight: 300;
}

.item-subtitle {
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-style: italic;
}

/* Bullets styling from Reference */
.item-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    padding-left: 0;
    list-style: none;
    font-family: "Lora", serif;
}

.item-desc li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.6rem;
}

.item-desc li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-tertiary);
    font-size: 1em;
    top: 0px;
}

/* Blog System */

/* Standalone Post Mode (Hide Portfolio Chrome) */
body.standalone-post .profile-header,
body.standalone-post .nav-tabs,
body.standalone-post .simple-footer {
    display: none;
}

body.standalone-post .main-container {
    padding-top: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.blog-card {
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--bg-color);
}

.blog-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.blog-meta {
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.blog-title {
    font-family: "Lora", serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.blog-desc {
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.back-btn {
    background: none;
    border: none;
    font-family: "Inter", sans-serif;
    font-size: 0.9rem;
    color: var(--accent);
    cursor: pointer;
    margin-bottom: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.back-btn:hover {
    text-decoration: underline;
}

/* Markdown Body (Post View) */
.markdown-body {
    font-family: "Lora", serif;
    color: var(--text-secondary);
    line-height: 1.8;
}

.post-header {
    margin-bottom: 2rem;
}

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

.mini-profile {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
    background-color: #e5e5e5;
    /* Match .profile-avatar */
    -webkit-tap-highlight-color: transparent;
    /* Remove blue box on mobile */
    /* overflow: hidden; Not needed on img tag itself but good for container */
}

.mini-profile:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.post-date {
    font-family: "Inter", sans-serif;
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.markdown-body h1 {
    font-size: 2rem;
}

.markdown-body h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.markdown-body h3 {
    font-size: 1.25rem;
}

.markdown-body p {
    margin-bottom: 1.5rem;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.5rem;
}

.markdown-body strong {
    color: var(--text-primary);
}

.post-footer {
    margin-top: 4rem;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.footer-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin-bottom: 2rem;
}

.home-link {
    font-family: "Inter", sans-serif;
    font-weight: 500;
    /* Clean, consistent link style */
    color: var(--text-primary);
    opacity: 0.7;
    transition: opacity 0.2s;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.home-link:hover {
    opacity: 1;
    border-bottom: 1px solid var(--text-primary);
}

/* Carousel Styles */
.carousel-wrapper {
    margin-top: 1.2rem;
    margin-bottom: 2rem;
    position: relative;
    width: 92%;
    /* Reduced width */
    margin-left: auto;
    margin-right: auto;
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--hover-bg);
}

.carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    min-width: 100%;
    scroll-snap-align: start;
    position: relative;
    height: 350px;
    /* Increased for better visibility */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--hover-bg);
    /* frame background */
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Shows full image without cropping */
    object-position: center;
    display: block;
}

/* Project Links */
.project-links {
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    margin-top: 1rem;
    color: var(--text-tertiary);
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.project-links a {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 1px;
}

.project-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.project-links svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
}

/* Footer */
.simple-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding-top: 2rem;
    text-align: center;
    color: var(--text-tertiary);
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
}

/* Contact Form */
.contact-form-container {
    max-width: 100%;
    margin-top: 2rem;
}

.contact-title {
    font-family: "Lora", serif;
    font-size: 1.3rem;
    /* Reduced from 2rem */
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 2rem;
    /* More breathing room */
    position: relative;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 0.8rem;
    font-family: "Inter", sans-serif;
    font-size: 1.05rem;
    color: var(--text-primary);
    background-color: transparent;
    border: 1px solid var(--border-color);
    outline: none;
    transition: border-color 0.3s ease, color 0.3s ease;
    resize: none;
    border-radius: 4px;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--text-primary);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-tertiary);
    font-weight: 300;
}

.send-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.8rem;
    background-color: var(--text-primary);
    color: var(--bg-color);
    border: none;
    border-radius: 4px;
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    margin-top: 1rem;
}

.send-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: var(--text-secondary);
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Code Block Styling (GitHub Dark) */
.markdown-body pre {
    background-color: #0d1117;
    border-radius: 6px;
    padding: 16px;
    overflow: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    color: #e6edf3;
    /* Force light text for readability on dark bg */
}

.markdown-body pre code {
    background-color: transparent;
    padding: 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9em;
    color: inherit;
}

.markdown-body :not(pre)>code {
    background-color: rgba(110, 118, 129, 0.4);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.85em;
    color: var(--text-primary);
}