:root,
[data-theme="dark"] {
    color-scheme: dark;
    --bg-color: #323437;
    --text-heading: #d1d0c5;
    --text-primary: #d1d0c5;
    --text-secondary: #909296;
    --accent-yellow: #e2b714;
    --card-btn-bg: #27282b;
    --card-btn-border: rgba(255, 255, 255, 0.08);
    --card-btn-hover: #36383c;
    --divider-color: rgba(255, 255, 255, 0.08);
    --tree-line: #8d9096;
    --toggle-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    color-scheme: light;
    --bg-color: #f7f7f5;
    --text-heading: #202124;
    --text-primary: #2e3033;
    --text-secondary: #6e7075;
    --accent-yellow: #946c00;
    --card-btn-bg: #eae8e1;
    --card-btn-border: rgba(0, 0, 0, 0.08);
    --card-btn-hover: #dfded7;
    --divider-color: rgba(0, 0, 0, 0.1);
    --tree-line: #70706c;
    --toggle-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Smooth transition only while actively toggling */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 40px 20px 80px;
}

.page-container {
    width: 100%;
    max-width: 620px;
}

/* Top Centered Navigation Bar & Theme Toggle */
.top-nav-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 44px;
    min-height: 42px;
}

.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 28px;
}

.nav-item {
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.2s ease, border-bottom 0.2s ease;
    cursor: pointer;
}

.nav-item:hover {
    color: var(--accent-yellow);
}

.nav-item.active {
    color: var(--accent-yellow);
    border-bottom: 2px solid var(--accent-yellow);
    font-weight: 700;
}

.top-nav-header .theme-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-btn-bg);
    color: var(--text-heading);
    border: 1px solid var(--card-btn-border);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--toggle-shadow);
    transition: transform 0.15s ease, border-color 0.2s ease, color 0.2s ease;
}

.top-nav-header .theme-toggle:hover {
    transform: translateY(-50%) scale(1.05);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.top-nav-header .theme-toggle:active {
    transform: translateY(-50%) scale(0.93);
}

.theme-icon {
    display: block;
    pointer-events: none;
    transition: transform 0.35s ease;
}

.top-nav-header .theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}

/* Profile / Page Header & Route Tag */
.profile-header {
    margin-bottom: 24px;
}

.route-tag {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-yellow);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.profile-name {
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--text-heading);
    letter-spacing: -0.3px;
}

/* Bio Section */
.bio-section {
    margin-bottom: 44px;
}

.quote {
    font-size: 0.95rem;
    color: var(--accent-yellow);
    margin-bottom: 12px;
    font-style: italic;
    line-height: 1.5;
}

.bio-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* Writing Section */
.writing-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-heading);
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.article-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.article-title {
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.45;
}

.article-title a {
    color: var(--text-heading);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: var(--accent-yellow);
}

.article-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Experience Tree Timeline */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 36px;
    margin-bottom: 40px;
}

.company-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.company-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.company-header {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    width: fit-content;
    cursor: pointer;
}

.company-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.company-header:hover .company-logo {
    transform: scale(1.08);
}

.company-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-heading);
    transition: color 0.2s ease;
}

.company-header:hover .company-name {
    color: var(--accent-yellow);
}

/* Company Classification Tag (Above Year) */
.company-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-yellow);
    background-color: var(--card-btn-bg);
    border: 1px solid var(--card-btn-border);
    border-radius: 6px;
    padding: 3px 8px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* Brand logo badge colors */
.here-logo { background-color: #00A88F; }
.icici-logo { background-color: #D9381E; }
.bosscoder-logo { background-color: #2563EB; }
.storyproc-logo { background-color: #7C3AED; }
.revoltronx-logo { background-color: #F59E0B; }
.exposys-logo { background-color: #059669; }

/* Dotted/Dashed Tree Branch - High Visibility */
.roles-tree {
    margin-left: 13px; /* Centers with the 28px logo (14px radius - 1px line half-width) */
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.role-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

/* Curved elbow line */
.role-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: -5px;
    width: 14px;
    height: 16px;
    border-left: 2px dashed var(--tree-line);
    border-bottom: 2px dashed var(--tree-line);
    border-bottom-left-radius: 8px;
    pointer-events: none;
}

/* Vertical dashed continuation for items with sibling roles underneath */
.role-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: -20px;
    top: 11px;
    bottom: -14px;
    border-left: 2px dashed var(--tree-line);
    pointer-events: none;
}

.role-title {
    font-size: 0.92rem;
    color: var(--text-heading);
    font-weight: 400;
    letter-spacing: -0.2px;
}

.role-period {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: right;
    font-weight: 400;
}

/* Common Pill Button Styling */
.pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-btn-bg);
    color: var(--text-heading);
    border: 1px solid var(--card-btn-border);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.pill-btn:hover {
    background-color: var(--card-btn-hover);
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
    transform: translateY(-1px);
}

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

.all-writing-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--divider-color);
    margin: 36px 0 28px 0;
}

/* Footer Links */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 600px) {
    body {
        padding: 24px 18px 60px;
    }

    .top-nav-header {
        margin-bottom: 32px;
    }

    .navbar {
        gap: 18px;
    }

    .profile-name {
        font-size: 1.3rem;
    }

    .role-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }

    .role-period {
        font-size: 0.8rem;
    }

    .footer-links {
        gap: 8px;
    }

    .pill-btn {
        padding: 7px 12px;
        font-size: 0.8rem;
    }
}
