/* ==========================================================================
   Programming CV: dark IDE theme
   ========================================================================== */

:root {
    /* Deep navy + electric blue: a "data platform" palette */
    --bg: #0a0f1c;
    --surface: #10172a;
    --surface-2: #151e35;
    --border: #1f2b48;
    --text: #dbe4f5;
    --muted: #8f9dbb;
    --dim: #7383a6;
    --heading: #f3f6fd;
    --accent-rgb: 77, 141, 255;
    --accent: #4d8dff;
    --accent-bright: #93bbff;
    --accent-dark: #1d4fc4;
    --accent-glow: rgba(var(--accent-rgb), 0.16);
    --live: #34d399;

    --font-main: 'Montserrat', system-ui, sans-serif;
    --font-code: 'Fira Code', ui-monospace, 'SF Mono', Menlo, monospace;

    --sidebar-w: 320px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* Faint dot grid behind the content */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(147, 187, 255, 0.07) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

h1,
h2,
h3,
p {
    margin: 0;
}

a {
    color: inherit;
}

strong {
    color: var(--heading);
    font-weight: 600;
}

:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--accent-dark);
    color: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 1000;
    background: var(--accent);
    color: var(--bg);
    padding: 0.5rem 1rem;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.icon--sm {
    width: 12px;
    height: 12px;
    margin-left: 0.3em;
    vertical-align: -1px;
}

/* --- Layout -------------------------------------------------------------- */

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* --- Sidebar ------------------------------------------------------------- */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1.75rem 2rem 2rem;
    background: rgba(16, 23, 42, 0.88);
    border-right: 1px solid var(--border);
}

.crumbs {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-code);
    font-size: 0.75rem;
}

.crumbs a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.crumbs a:hover,
.crumbs a:focus-visible {
    color: var(--accent-bright);
}

.profile__img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    object-position: 50% 30%;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 0 0 4px var(--surface-2), 0 0 0 5px var(--accent-dark);
    margin-bottom: 1.5rem;
}

.profile__name {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--heading);
}

.profile__at {
    color: var(--muted);
}

.profile__role {
    margin-top: 0.5rem;
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--accent);
}

.prompt {
    color: var(--dim);
}

.caret {
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    margin-left: 0.2em;
    vertical-align: -0.15em;
    background: var(--accent);
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.contact li,
.contact a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact a {
    text-decoration: none;
    transition: color 0.2s;
}

.contact a:hover,
.contact a:focus-visible {
    color: var(--accent-bright);
}

.contact .icon {
    color: var(--accent);
}

/* Section nav */
.toc {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.15rem;
}

.toc a {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 0.45rem 0.75rem;
    margin-inline: -0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.toc__num {
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--dim);
    transition: color 0.2s;
}

.toc a:hover,
.toc a:focus-visible {
    color: var(--text);
    background: var(--surface-2);
}

.toc a.is-active {
    color: var(--accent-bright);
    background: var(--accent-glow);
}

.toc a.is-active .toc__num {
    color: var(--accent);
}

/* --- Content ------------------------------------------------------------- */

.content {
    padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 6vw, 5.5rem) 3rem;
    max-width: 1080px;
}

.section {
    padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
}

.kicker {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--dim);
    margin-bottom: 0.75rem;
}

.kicker span {
    color: var(--accent);
    margin-right: 0.35rem;
}

.section__title {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--heading);
    margin-bottom: 2rem;
}

.summary {
    font-size: clamp(1.2rem, 2.3vw, 1.6rem);
    font-weight: 400;
    line-height: 1.6;
    color: #b8c4dc;
    max-width: 34em;
}

.pipeline {
    display: flex;
    align-items: center;
    max-width: 34em;
    margin-top: 2.25rem;
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--muted);
}

.pipeline__node {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    white-space: nowrap;
}

.pipeline__node--sink {
    color: var(--accent-bright);
    border-color: rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 0 18px -6px rgba(var(--accent-rgb), 0.6);
}

.pipeline__node .icon--sm {
    margin-left: 0;
}

.pipeline__link {
    flex: 1;
    min-width: 1.25rem;
    height: 2px;
    margin: 0 0.4rem;
    background: linear-gradient(90deg, var(--accent) 50%, transparent 0) 0 0 / 10px 2px repeat-x;
    opacity: 0.75;
    animation: flow 0.9s linear infinite;
}

@keyframes flow {
    to {
        background-position: 10px 0;
    }
}

.summary strong {
    font-weight: 600;
    color: var(--accent-bright);
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--accent-rgb), 0.55);
    box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--accent-glow);
}

.pill {
    font-family: var(--font-code);
    font-size: 0.75rem;
    white-space: nowrap;
    color: var(--accent-bright);
    background: var(--accent-glow);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
}

.badge {
    font-family: var(--font-code);
    font-size: 0.7rem;
    white-space: nowrap;
    color: var(--accent-bright);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
}

/* Timeline (experience + education) */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1.75rem;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0.75rem;
    bottom: 0.75rem;
    width: 1px;
    background: linear-gradient(var(--accent), var(--border));
}

.timeline__item {
    position: relative;
}

.timeline__item + .timeline__item {
    margin-top: 1.5rem;
}

.timeline__item::before {
    content: '';
    position: absolute;
    left: calc(-1.75rem + 1px);
    top: 1.85rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Job */
.job__when {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.job__head:last-child {
    margin-bottom: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--live);
}

.status__dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
}

.status__dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--live);
    animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%,
    100% {
        transform: scale(2.6);
        opacity: 0;
    }
}

.timeline__item--current::before {
    border-color: var(--live);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.timeline__item--current .card {
    border-color: rgba(52, 211, 153, 0.28);
}

.job {
    padding: clamp(1.4rem, 3vw, 2rem);
}

.job__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.job__role {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--heading);
}

.job__company {
    display: inline-flex;
    align-items: center;
    margin-top: 0.2rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.job__company:hover,
.job__company:focus-visible {
    color: var(--accent-bright);
}

.job__details {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.85rem;
}

.job__details li {
    position: relative;
    padding-left: 1.4rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.job__details li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Scoped under .job so it wins over the generic .tags reset defined later. */
.job .job__tags {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px dashed var(--border);
}

/* Projects */
.project--wide {
    grid-column: 1 / -1;
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
}

.project {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
}

.project__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.project__num {
    font-family: var(--font-code);
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px var(--accent);
    transition: color 0.35s;
}

.project:hover .project__num {
    color: var(--accent);
}

.project h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--heading);
}

.project p {
    font-size: 0.9rem;
    color: var(--muted);
}

/* Skills */
.skills {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 600px) {
    .skills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .skills__group--primary {
        grid-column: span 2;
    }
}

@media (min-width: 1200px) {
    .skills {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.skills__group--primary {
    border-color: rgba(var(--accent-rgb), 0.35);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), 0.12), transparent 55%),
        var(--surface);
}

.skills__group--primary h3 {
    color: var(--accent-bright);
}

.skills__group {
    padding: 1.4rem 1.5rem;
}

.skills__group h3 {
    font-family: var(--font-code);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: lowercase;
    color: var(--dim);
    margin-bottom: 1rem;
}

.skills__group h3::before {
    content: '# ';
    color: var(--accent);
}

.tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags li {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: #a9c6ff;
    background: rgba(29, 79, 196, 0.2);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    padding: 0.25rem 0.65rem;
    border-radius: 5px;
    transition: transform 0.25s var(--ease), border-color 0.25s;
}

.tags li:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.list li {
    position: relative;
    padding-left: 1.2rem;
}

.list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.list__note {
    display: block;
    font-size: 0.78rem;
    color: var(--dim);
}

/* Education */
.edu {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: clamp(1.4rem, 3vw, 2rem);
}

.edu h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--heading);
}

.edu__sub {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
}

.footer {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--dim);
}

/* --- Responsive ---------------------------------------------------------- */

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

    .sidebar {
        position: static;
        height: auto;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 1.5rem clamp(1.25rem, 6vw, 3rem) 2rem;
        gap: 1.5rem;
    }

    .profile {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 1.25rem;
        align-items: center;
    }

    .profile__img {
        grid-row: span 2;
        width: 88px;
        height: 88px;
        margin-bottom: 0;
    }

    .profile__name {
        align-self: end;
    }

    .profile__role {
        align-self: start;
        margin-top: 0.25rem;
    }

    .contact {
        display: flex;
        flex-wrap: wrap;
        gap: 0.6rem 1.5rem;
    }

    .toc {
        margin-top: 0;
        padding-top: 1.25rem;
    }

    .toc ol {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .toc a {
        margin: 0;
        padding: 0.35rem 0.75rem;
        border: 1px solid var(--border);
        font-size: 0.8rem;
    }
}

@media (max-width: 560px) {
    .job__head,
    .edu {
        flex-direction: column;
        align-items: flex-start;
    }

    .job__when {
        align-items: center;
        flex-direction: row-reverse;
        gap: 0.75rem;
    }

    .pipeline {
        font-size: 0.68rem;
    }

    .pipeline__node {
        padding: 0.25rem 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .card:hover,
    .tags li:hover {
        transform: none;
    }
}

/* --- Print: clean, light, single column --------------------------------- */

@media print {
    :root {
        --bg: #fff;
        --surface: #fff;
        --surface-2: #fff;
        --border: #ccc;
        --text: #111;
        --muted: #333;
        --dim: #555;
        --accent: #1d4fc4;
        --accent-bright: #1d4fc4;
        --heading: #000;
        --accent-glow: transparent;
    }

    @page {
        margin: 14mm;
    }

    body {
        font-size: 10pt;
        line-height: 1.45;
    }

    body::before,
    .pipeline,
    .status__dot,
    .skip-link,
    .crumbs,
    .toc,
    .caret,
    .kicker,
    .footer {
        display: none !important;
    }

    strong,
    .profile__name,
    .section__title,
    .job__role,
    .project h3,
    .edu h3 {
        color: #000 !important;
    }

    .layout {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        background: none;
        border: 0;
        padding: 0 0 1rem;
        gap: 0.75rem;
    }

    .profile__img {
        width: 70px;
        height: 70px;
        box-shadow: none;
        margin-bottom: 0.5rem;
    }

    .contact {
        display: flex;
        gap: 1.5rem;
    }

    .content {
        padding: 0;
        max-width: none;
    }

    .section {
        padding-bottom: 1.25rem;
    }

    .section__title {
        font-size: 13pt;
        margin-bottom: 0.6rem;
        border-bottom: 1px solid #ccc;
    }

    .summary {
        font-size: 10.5pt;
        max-width: none;
    }

    .card {
        border: 0;
        padding: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        break-inside: avoid;
    }

    .projects,
    .skills {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem 1.5rem;
    }

    .timeline {
        padding-left: 0;
    }

    .timeline::before,
    .timeline__item::before {
        display: none;
    }

    .project__num {
        -webkit-text-stroke: 0;
        color: var(--accent);
        font-size: 10pt;
    }

    .pill,
    .badge,
    .tags li {
        border: 1px solid #ccc;
        background: none;
        color: #222;
    }
}
