@import url('https://fonts.googleapis.com/css2?family=Bitcount+Single:wght@100..900&display=swap');
:root {
    --base-clr: #e6e6ef;
    --line-clr: #e2e2e9;
    --hover-clr: #f0f0f7;
    --text-clr: #11121a;
    --accent-clr: #6246ea; 
    --secondary-text-clr: #5b5b71;
    --shadow-clr: rgba(0, 0, 0, 0.2);
}
.darkmode {
    --base-clr: #11121a;
    --line-clr: #222533;
    --hover-clr: #42434a;
    --text-clr: #e6e6ef;
    --accent-clr: #806aff; 
    --secondary-text-clr: #a1a1b8;
    --shadow-clr: rgba(0, 0, 0, 0.8);
}
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html{
    font-family: 'Bitcount Single', monospace;
    font-weight: 500;
    line-height: 1.5rem;
    height: 100vh;
    overflow: hidden;
}
body{
    min-height: 100vh;
    background-color: var(--base-clr);
    color: var(--text-clr);
    display: grid;
    grid-template-columns: auto 1fr;
    overflow: hidden;
}
main{
    height: 100vh;
    overflow-y: auto;
    padding: min(30px, 7%);
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
}
main p{
    color: var(--secondary-text-clr);
    margin-top: 15px;
    margin-bottom: 15px;
}
img {
    max-width: 100%;
    height: auto;
}
.welcome-section{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 60px 0;
    width: 100%;
    height: fit-content;
    margin-bottom: 20px;
}
h1{
    line-height: 3.5rem;
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 500;
    overflow: hidden;
    padding-left: 10px;
    white-space: nowrap;
    width: fit-content;
    border-right: 3px solid var(--accent-clr);
    animation:
        typing 1s steps(9, end) forwards,
        blink 0.7s step-end 1s 5;
}
@keyframes typing {
    from { width: 0 }
    to   { width: 9ch }
}
@keyframes blink {
    0%, 100% { border-color: var(--accent-clr) }
    50%       { border-color: transparent }
}
.welcome-content{
    display: block;
    flex: 1;
}
.welcome-content h3{
    font-size: 1.5rem;
    font-weight: 400;
    max-width: 600px;
    line-height: 1.4;
}
.welcome-content h3 span{
    color: var(--text-clr);
    font-weight: 600;
}
.welcome-section, .container {
    max-width: 1400px; 
    flex-direction: row-reverse;
}
.profile-pic img{
    width: clamp(250px, 15vw, 400px);
    height: clamp(250px, 15vw, 400px);
    margin-left: 25px;
    margin-bottom: 25px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 4px 8px var(--shadow-clr);
    shape-outside: circle(50%);
    transition: transform 0.3s ease;
} 
/* Keeps the sidebar as a fixed mobile rail and preserves readable hero spacing in the narrow content column. */
@media (max-width: 750px) {
    body {
        display: block;
    }

    main {
        width: calc(100vw - 80px);
        margin-left: 80px;
        padding: 24px 16px;
    }

    #sidebar {
        position: fixed;
        z-index: 10;
        left: 0;
        top: 0;
        width: min(250px, 82vw);
    }

    #sidebar.close {
        width: 80px;
    }

    .welcome-section {
        flex-direction: column;
        text-align: left;
        flex-direction: column-reverse;
        gap: 24px;
        padding: 32px 0;
    }
    .profile-pic img {
        float: none;          
        display: block;       
        margin: 0 auto 20px;  
        width: clamp(150px, 50vw, 200px);         
        height: clamp(150px, 50vw, 200px);
        shape-outside: none;  
    }
    .welcome-content h1 {
        font-size: clamp(2rem, 10vw, 2.25rem);
        line-height: 1.25;
    }

    .welcome-content h3 {
        font-size: clamp(1.15rem, 6vw, 1.35rem);
        line-height: 1.5;
    }
}
.welcome-section::after {
    content: "";
    display: table;
    clear: both;
}
.profile-pic img:hover{
    transform: scale(1.05);
}
main::-webkit-scrollbar {
    width: 8px;
}
main::-webkit-scrollbar-track {
    background: var(--base-clr);
}
main::-webkit-scrollbar-thumb {
    background: var(--line-clr);
    border-radius: 10px;
}
main::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-text-clr);
}
/* Sidebar */
#sidebar{
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 100vh;
    width: 250px;
    padding: 20px 1em;
    background-color: var(--base-clr);
    box-shadow: 2px 0 5px var(--shadow-clr);
    top: 0;
    align-self: start;
    overflow: hidden;
}
#sidebar.close{
    width: 80px;
    padding: 5px 1em;
}
#sidebar.close span {
    display: none;
}
#sidebar.close svg {
    /* margin-right: 40px; */
    margin: 0 auto;
}
#sidebar.close a{
    justify-content: center;
    padding: 0.85em 0;
}
#sidebar.close .logo {
    display: none;
}
 #sidebar.close #sidebar_toggle {
    justify-content: center;
    padding: 0.85em 0;
}
#sidebar ul{
    list-style: none;
    flex-grow: 0;
}
#sidebar ul li.active a{
    color: var(--accent-clr);
}
#sidebar ul li.active a svg{
    fill: var(--accent-clr);
}
#sidebar > ul > li:first-child {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 16px;
}
#sidebar > ul > li:first-child .logo {
    font-weight: 600;
}
#sidebar a, #sidebar .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-clr);
    padding: 0.85em;
    border-radius: 0.5em;
    white-space: nowrap; 
}
#sidebar .nav svg, #sidebar #sidebar_toggle svg {
    flex-shrink: 0;
    fill: var(--text-clr);
    margin-right: 10px;
}
#sidebar a span{
    flex-grow: 1;
}
#sidebar a:hover {
    background-color: var(--hover-clr);
}
#sidebar a:active,
#sidebar a:focus-visible {
    background-color: var(--hover-clr);
}
#sidebar_toggle {
    margin-left: auto;
    background: none;
    border: none;
    border-radius: .5em;
    cursor: pointer;
    padding: 1em;
    min-width: 44px;
    min-height: 44px;
}
.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: row;
    align-items: right;
    justify-content: center;
    gap: 15px; 
    padding-bottom: 20px;
}
.social-links {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    border-radius: 50%;
}.social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 44px;
    width: 44px;
    border-radius: 50%;
    background-color: var(--line-clr);
    color: var(--text-clr);
}
.social-links a svg {
    flex-shrink: 0;
    fill: var(--text-clr);
    display: block;
    margin-right: 0;
}
#sidebar.close .sidebar-footer {
    flex-direction: column;
    align-items: center;
}
#sidebar.close .social-links {
    flex-direction: column;
    align-items: center;
}
#sidebar.close .sidebar-footer {
    padding-bottom: 15px;
}
/* Theme Switch Button */
#theme-switch {
    height: 44px;
    width: 44px;
    background: none;
    border: none;
    outline: none;
    border-radius: 50%;
    background-color: var(--line-clr);
    cursor: pointer;

    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
#theme-switch svg {
    flex-shrink: 0;
    fill: var(--text-clr);
    margin-right: 0;
}
#theme-switch:hover {
    background-color: var(--hover-clr);
}
#theme-switch:active,
#theme-switch:focus-visible {
    background-color: var(--hover-clr);
}

#theme-switch svg:last-child {
    display: none;
}
.darkmode #theme-switch svg:first-child {
    display: none;
}
.darkmode #theme-switch svg:last-child {
    display: block;
}

/* Keeps the mobile sidebar footer inside the visible dynamic viewport and clear of safe-area browser UI. */
@media (max-width: 750px) {
    #sidebar {
        height: 100dvh;
        max-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: max(20px, calc(12px + env(safe-area-inset-bottom)));
    }

    #sidebar.close {
        padding-bottom: max(20px, calc(12px + env(safe-area-inset-bottom)));
    }

    .sidebar-footer {
        flex-shrink: 0;
        padding-bottom: 0;
    }

    #sidebar.close .sidebar-footer {
        padding-bottom: 0;
    }

    .social-links a,
    #theme-switch,
    #sidebar_toggle {
        min-width: 44px;
        min-height: 44px;
    }

    .social-links a,
    #theme-switch {
        width: 44px;
        height: 44px;
    }
}

/* Projects Section */
.page-header {
    width: 100%;
    max-width: 1400px;
    padding: 50px 0 10px;
    border-bottom: 1px solid var(--line-clr);
    margin-bottom: 10px;
}
.page-header h2 {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 12px;
}
.page-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-text-clr);
    max-width: 650px;
    line-height: 1.7;
    margin: 0;
}
/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1400px;
    padding: 24px 0 0;
}
.filter-btn {
    background: none;
    border: 1px solid var(--line-clr);
    color: var(--secondary-text-clr);
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-btn:hover {
    border-color: var(--accent-clr);
    color: var(--accent-clr);
}
.filter-btn:active,
.filter-btn:focus-visible {
    border-color: var(--accent-clr);
    color: var(--accent-clr);
}
.filter-btn.active {
    background-color: var(--accent-clr);
    border-color: var(--accent-clr);
    color: #fff;
}
.project_item.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}
.project_item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.my-recent-projects{
    width: 100%;
    max-width: 1400px;
    padding: 40px 0;
}
.container{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 350px));
    gap: 20px;
    padding: 40px 0;
    width: 100%;
    justify-content: left;
}
.project_item{
    max-width: 400px;
    background-color: var(--line-clr);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 8px var(--shadow-clr);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}
.project_item:hover{
    background-color: var(--hover-clr);
    box-shadow: 0 15px 40px var(--shadow-clr);
    transform: translateY(-8px);
}
.project_item:focus-within {
    background-color: var(--hover-clr);
    box-shadow: 0 15px 40px var(--shadow-clr);
}
.project_item img{
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover; /* cover ensures the image covers the entire container, maintains its aspect ratio, and does not exceed container dimentions */
    display: block;
}
#tic-tac-toe img {
    object-fit: cover;
    object-position: center 10%;
}
.project_item .content{
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.project_item p{
    margin-top: 5px;
    margin-bottom: 5px;
}
.project_item .content .date{
    display: block;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--secondary-text-clr);
    margin-bottom: 10px;
}
.project_item .content h3{
    margin-top: 0;
    margin-bottom: 5px;
    line-height: 1.5;
}
.project-link {
    margin-top: 8px;
    text-decoration: none;
    color: var(--accent-clr);
    font-weight: 500;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.project_item .experience-tags {
    margin-top: auto;
    padding-top: 12px;
}
@media (max-width: 750px) {
    .container {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .project_item {
        max-width: 100%;
    }
}
/* Work Experience Section*/
.experience-section{
    width: 100%;
    max-width: 1400px;
    padding: 40px 0;
}
.section-title {
    font-size: 1.5rem;
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--text-clr);
}
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 48px;
}
.experience-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    padding: 28px;
    border-radius: 12px;
    transition: background-color 0.2s ease;
}
.experience-item:hover {
    background-color: var(--hover-clr);
}
.experience-item:focus-within {
    background-color: var(--hover-clr);
}
.experience-date {
    font-size: 0.85rem;
    color: var(--secondary-text-clr);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 4px;
    white-space: nowrap;
}
.experience-role {
    font-size: 1.1rem;
    line-height: 1.5;
    font-weight: 600;
    color: var(--text-clr);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.experience-link-icon {
    color: var(--accent-clr);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.5;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}
.experience-link-icon:hover {
    transform: translate(2px, -2px);
}
.experience-link-icon:active,
.experience-link-icon:focus-visible {
    transform: translate(2px, -2px);
}
.experience-content p {
    color: var(--secondary-text-clr);
    margin-top: 0;
    margin-bottom: 16px;
    line-height: 1.7;
}
.experience-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 0;
}
.tag {
    background-color: var(--line-clr);
    color: var(--accent-clr);
    border: 1px solid var(--accent-clr);
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
}
/* Gives stacked work entries enough room so dates, roles, and link icons do not collide on phone widths. */
@media (max-width: 600px) {
    .experience-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 20px 0;
    }

    .experience-date {
        white-space: normal;
    }
}

/* Pi Message Section: a card with the Pi drawn on a desk on one side and the ways to poke it on the other. */
.pi-message-section {
    width: 100%;
    max-width: 1400px;
    padding: 40px 0;
    --pi-card-clr: color-mix(in srgb, var(--text-clr) 5%, var(--base-clr));
    --pi-edge-clr: color-mix(in srgb, var(--secondary-text-clr) 25%, transparent);
    --led-off: #213d2c;
    --led-on: #5dff8f;
}
.pi-message-section .section-title {
    margin-bottom: 0;
}
.pi-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    max-width: 1040px;
    margin-top: 10px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--pi-edge-clr);
    background-color: var(--pi-card-clr);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--shadow-clr) 40%, transparent);
}

/* Desk scene */
.pi-scene {
    position: relative;
    display: grid;
    place-items: center;
    padding: 40px 28px;
    background:
        radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--accent-clr) 18%, transparent), transparent 70%),
        repeating-linear-gradient(90deg, color-mix(in srgb, var(--text-clr) 4%, transparent) 0 1px, transparent 1px 28px),
        color-mix(in srgb, var(--accent-clr) 7%, var(--base-clr));
    isolation: isolate;
}
/* A soft green wash spreads across the desk whenever the drawn LED is lit. */
.pi-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 38% 45%, rgba(93, 255, 143, 0.35), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.pi-scene:has(.pi-led.on)::after {
    opacity: 1;
    transition-duration: 0.05s;
}
.pi-board {
    width: 100%;
    max-width: 330px;
    height: auto;
    transform: rotate(-4deg);
    filter: drop-shadow(0 18px 18px var(--shadow-clr));
}
.pi-led {
    fill: var(--led-off);
    transition: fill 0.05s linear;
}
.pi-led.on {
    fill: var(--led-on);
}
.pi-led-halo {
    opacity: 0;
    transition: opacity 0.05s linear;
}
.pi-board:has(.pi-led.on) .pi-led-halo {
    opacity: 1;
}
.pi-scene-tag {
    position: absolute;
    left: 20px;
    bottom: 14px;
    font-size: 0.75rem;
    color: var(--secondary-text-clr);
}

/* Controls */
.pi-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 32px;
}
main p.pi-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    font-size: 0.85rem;
}
.pi-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--secondary-text-clr) 35%, transparent);
}
.pi-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--secondary-text-clr);
}
/* Hides the seen/blinks details until the status endpoint has answered. */
#pi-online:not(.online, .offline) + span {
    display: none;
}
#pi-online.online {
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.5);
    background-color: rgba(34, 197, 94, 0.1);
}
.darkmode #pi-online.online {
    color: #4ade80;
}
#pi-online.online .pi-status-dot {
    background-color: #22c55e;
    animation: pi-pulse 2s ease-out infinite;
}
#pi-online.offline {
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.45);
}
.darkmode #pi-online.offline {
    color: #ff7b72;
}
#pi-online.offline .pi-status-dot {
    background-color: #ef4444;
}
@keyframes pi-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}
.pi-heading {
    font-size: 1.35rem;
    line-height: 1.4;
    font-weight: 600;
}
.pi-heading-accent {
    color: var(--accent-clr);
}
.pi-pokes {
    display: flex;
    gap: 12px;
}
.pi-poke {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--secondary-text-clr);
    background: none;
    border: none;
    cursor: pointer;
}
.pi-poke-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 1.6rem;
    background-color: var(--base-clr);
    border: 1px solid var(--pi-edge-clr);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.pi-poke:hover,
.pi-poke:focus-visible {
    color: var(--accent-clr);
    outline: none;
}
.pi-poke:hover .pi-poke-icon,
.pi-poke:focus-visible .pi-poke-icon {
    transform: translateY(-3px) rotate(-6deg);
    border-color: var(--accent-clr);
}
.pi-poke:active .pi-poke-icon {
    transform: translateY(0) scale(0.95);
}
.pi-poke:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pi-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}
.pi-form-label {
    font-size: 0.8rem;
    color: var(--secondary-text-clr);
}
.pi-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background-color: var(--base-clr);
    border: 1px solid var(--pi-edge-clr);
}
.pi-pill:focus-within {
    border-color: var(--accent-clr);
}
.pi-pill input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 16px;
    color: var(--text-clr);
    background: transparent;
    border: none;
    outline: none;
}
.pi-pill input::placeholder {
    color: var(--secondary-text-clr);
}
.pi-pill .pi-pill-name {
    flex: 0 0 9.5em;
    border-right: 1px solid var(--pi-edge-clr);
}
.pi-send {
    min-height: 40px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 0.9rem;
    color: #fff;
    background-color: var(--accent-clr);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.pi-send:hover {
    filter: brightness(1.1);
}
.pi-send:focus-visible {
    outline: 2px solid var(--accent-clr);
    outline-offset: 2px;
}
main p.pi-note {
    min-height: 1.5em;
    margin: -8px 0 0;
    font-size: 0.82rem;
}
.pi-note.ok {
    color: #15803d;
}
.darkmode .pi-note.ok {
    color: #4ade80;
}
.pi-note.err {
    color: #dc2626;
}
.darkmode .pi-note.err {
    color: #ff7b72;
}
/* Kept off-screen rather than display: none so bots still fill it in. */
.pi-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}
/* Stacks the desk scene above the controls once the halves stop fitting side by side. */
@media (max-width: 860px) {
    .pi-card {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* Puts the name field on its own row so the message keeps a usable width on phones. */
@media (max-width: 520px) {
    .pi-body {
        padding: 20px;
    }
    .pi-scene {
        padding: 28px 20px 48px;
    }
    .pi-pill {
        flex-wrap: wrap;
        border-radius: 16px;
    }
    .pi-pill .pi-pill-name {
        flex-basis: 100%;
        border-right: none;
        border-bottom: 1px solid var(--pi-edge-clr);
    }
}
@media (prefers-reduced-motion: reduce) {
    #pi-online.online .pi-status-dot {
        animation: none;
    }
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.reveal-left {
    transform: translateX(-30px);
}
.reveal.visible {
    opacity: 1;
    transform: translate(0);
}
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
