/* ─────────────────────────────────────────
   CSS Variables & Reset
───────────────────────────────────────── */
:root {
    --blue:       #0077bb;
    --blue-light: #e8f4fb;
    --blue-dim:   rgba(0,119,187,0.12);

    --bg:         #FAFAFA;
    --surface:    #ffffff;
    --surface2:   #f0f2f5;
    --border:     rgba(0,0,0,0.07);
    --text:       #1a1a1a;
    --text-sub:   #555;
    --text-muted: #888;

    --shadow-sm:  0 2px 8px rgba(0,0,0,0.07);
    --shadow-md:  0 6px 20px rgba(0,0,0,0.09);
    --shadow-lg:  0 12px 32px rgba(0,0,0,0.12);

    --radius:     12px;
    --font-body:  'DM Sans', Arial, Helvetica, sans-serif;
    --font-mono:  'DM Mono', monospace;

    --sidebar-w:  40%;
}

[data-theme="dark"] {
    --bg:        #191B19;
    --surface:   #272927;
    --surface2:  #2f312f;
    --border:    rgba(255,255,255,0.07);
    --text:      #C0C4C4;
    --text-sub:  #9a9e9a;
    --text-muted:#6b7060;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
    --blue-light: rgba(0,119,187,0.15);
    --blue-dim:  rgba(0,119,187,0.18);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    transition: background-color 0.35s ease, color 0.35s ease;
    min-height: 100vh;
}

/* ─────────────────────────────────────────
   Scrollbar
───────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0,119,187,0.25);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0,119,187,0.45); }

/* ─────────────────────────────────────────
   Layout
───────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ─────────────────────────────────────────
   Sidebar
───────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--border);
    background: var(--surface);
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    width: 100%;
}

.profile-wrap {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
}

.profileimg {
    border-radius: 10px;
    border: 1.5px solid;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    display: block;
    opacity: 0.9;
    transition: opacity 0.3s;
    width: 130px;
    height: 130px;
    object-fit: cover;
}

.profileimg:hover {
    opacity: 1;
}

/* ── Typewriter ── */
.typewriter {
    display: flex;
    justify-content: center;
}

.typewriter h1 {
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid var(--blue);
    width: max-content;
    max-width: 0;
    animation:
        typing 2.2s steps(14, end) forwards,
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { max-width: 0 }
    to   { max-width: 20ch }
}
@keyframes blink-caret {
    from, to { border-color: transparent }
    50%      { border-color: var(--blue) }
}

.accent { color: var(--blue); }

.role {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-sub);
    letter-spacing: 0.01em;
    margin-top: 0.1rem;
}

.role-underline {
    text-decoration: underline;
    text-decoration-color: var(--blue);
    text-decoration-thickness: 2.5px;
    text-underline-offset: 3px;
}

.updated {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 0.1rem;
}

/* ── Social buttons ── */
.social-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
    justify-content: center;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.38rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
    border: 1px solid var(--border);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    opacity: 0.85;
}

.social-btn.linkedin {
    background: #0a66c2;
    color: #fff;
    border-color: #0a66c2;
}

.social-btn.github {
    background: var(--surface2);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .social-btn.github {
    background: var(--surface2);
    color: var(--text);
}

/* ── Theme toggle ── */
.theme-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.theme-switch {
    display: inline-block;
    height: 28px;
    width: 52px;
    position: relative;
}

.theme-switch input { display: none; }

.slider {
    background-color: var(--surface2);
    border: 1px solid var(--border);
    bottom: 0; left: 0; right: 0; top: 0;
    position: absolute;
    cursor: pointer;
    transition: 0.35s;
}

.slider:before {
    background-color: var(--blue);
    bottom: 3px;
    content: "";
    height: 20px;
    left: 4px;
    position: absolute;
    width: 20px;
    transition: 0.35s;
}

input:checked + .slider { background-color: var(--blue-dim); border-color: var(--blue); }
input:checked + .slider:before { transform: translateX(24px); }

.slider.round { border-radius: 28px; }
.slider.round:before { border-radius: 50%; }

/* ─────────────────────────────────────────
   Main Content
───────────────────────────────────────── */
.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2.5rem 2rem 4rem;
    max-width: 780px;
}

/* ─────────────────────────────────────────
   Cards
───────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.6rem 1.8rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    opacity: 0;
    animation: fadeUp 0.55s ease forwards;
    animation-delay: var(--delay, 0s);
    transition: background-color 0.35s ease, border-color 0.35s ease,
                box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

.card h2 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.card h4 {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1.1rem 0 0.5rem;
}

.card p {
    color: var(--text);
    font-size: 0.9rem;
}

/* ─────────────────────────────────────────
   Entry (experience / education rows)
───────────────────────────────────────── */
.entry {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.entry:last-child { border-bottom: none; }
.entry:first-child { padding-top: 0; }

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.entry-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.entry-date {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.entry-org {
    display: block;
    font-size: 0.82rem;
    font-style: italic;
    color: var(--blue);
    margin-top: 0.1rem;
    margin-bottom: 0.3rem;
}

.entry ul {
    list-style: circle;
    margin: 0.4rem 0 0 1.2rem;
    padding: 0;
}

.entry ul li {
    font-size: 0.87rem;
    color: var(--text-sub);
    margin-bottom: 0.2rem;
    line-height: 1.5;
}

/* ─────────────────────────────────────────
   Skills
───────────────────────────────────────── */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.skill-group { display: flex; flex-direction: column; gap: 0.4rem; }

.skill-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-block;
    background: var(--blue-light);
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(0,119,187,0.18);
    transition: background 0.2s, transform 0.2s;
}

.tag:hover {
    background: var(--blue);
    color: #fff;
    transform: translateY(-1px);
}

/* ─────────────────────────────────────────
   Projects
───────────────────────────────────────── */
.project-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.project-list li {
    font-size: 0.88rem;
}

.card a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
}

.card a:hover { opacity: 0.75; }

/* ─────────────────────────────────────────
   Footer
───────────────────────────────────────── */
/* ─────────────────────────────────────────
   Responsive — Mobile & Tablet
   Mimics the original stacked layout on small screens
───────────────────────────────────────── */
@media (max-width: 900px) {

    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 2rem 1.5rem 1.5rem;
    }

    .sidebar-inner {
        gap: 0.5rem;
    }

    .typewriter {
        justify-content: center;
    }

    .typewriter h1 {
        font-size: 1.7rem;
        white-space: nowrap;
    }

    .content {
        margin-left: 0;
        padding: 1.5rem 1rem 3rem;
        max-width: 100%;
    }

    .entry-header {
        flex-direction: column;
        gap: 0.1rem;
    }

    .social-buttons {
        margin-top: 0.2rem;
    }
}

@media (max-width: 480px) {

    body { font-size: 14px; }

    .profileimg { width: 110px; height: 110px; }

    .typewriter h1 { font-size: 1.45rem; }

    .card {
        padding: 1.2rem 1.1rem;
        margin-bottom: 1rem;
    }

    .content {
        padding: 1rem 0.75rem 2.5rem;
    }
}

/* ─────────────────────────────────────────
   Floating Action Button
───────────────────────────────────────── */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,119,187,0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 900;
}

.fab:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 8px 24px rgba(0,119,187,0.5);
}

/* ─────────────────────────────────────────
   Modal overlay
───────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 1rem;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    padding: 1.8rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(16px);
    transition: transform 0.25s ease, background-color 0.35s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.4rem;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 0.2rem;
    transition: color 0.2s;
}

.modal-close:hover { color: var(--text); }

/* ─────────────────────────────────────────
   Contact form
───────────────────────────────────────── */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 0.02em;
}

.required { color: var(--blue); }

.form-group input,
.form-group textarea {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-dim);
}

.captcha-group input { max-width: 120px; }

.captcha-error {
    display: none;
    font-size: 0.76rem;
    color: #e05252;
    margin-top: 0.1rem;
}

.submit-btn {
    margin-top: 0.4rem;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.submit-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ─────────────────────────────────────────
   Success state
───────────────────────────────────────── */
.form-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text);
    font-size: 0.95rem;
}
