/* ========================
   CSS Custom Properties
   ======================== */
:root {
    --dcol: #04b4e0;
    --transition-base: 250ms ease;
    --nav-size-desktop: 60px;
    --nav-bottom-height: 72px;
}

/* ========================
   Reset & Base
   ======================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "my_poppins", serif;
}

h1 {
    letter-spacing: 1px;
}

/* ========================
   Custom Fonts
   ======================== */
@font-face {
    font-family: "my_poppins";
    src: url("assets/fonts/poppins/Poppins-Regular.ttf");
}

@font-face {
    font-family: "my_inter";
    src: url("assets/fonts/inter/Inter-Regular.ttf");
}

/* ========================
   Scrollbar
   ======================== */
::-webkit-scrollbar {
    width: 0;
}

/* ========================
   Animations
   ======================== */

/* ── Section transition keyframes ─────────────────────────────── */

/* Leaving: slides to the left (forward nav) */
@keyframes section-exit-left {
    0%   { opacity: 1; transform: translateX(0)    scale(1)    blur(0px); }
    100% { opacity: 0; transform: translateX(-48px) scale(0.96); }
}

/* Leaving: slides to the right (backward nav) */
@keyframes section-exit-right {
    0%   { opacity: 1; transform: translateX(0)    scale(1);   }
    100% { opacity: 0; transform: translateX(48px) scale(0.96); }
}

/* Entering: arrives from the right (forward nav) */
@keyframes section-enter-right {
    0%   { opacity: 0; transform: translateX(52px) scale(0.97); }
    100% { opacity: 1; transform: translateX(0)    scale(1);    }
}

/* Entering: arrives from the left (backward nav) */
@keyframes section-enter-left {
    0%   { opacity: 0; transform: translateX(-52px) scale(0.97); }
    100% { opacity: 1; transform: translateX(0)     scale(1);    }
}

/* ── Section transition utility classes ───────────────────────── */
.sec-exit-left {
    animation: section-exit-left 180ms cubic-bezier(0.4, 0, 1, 1) both;
    pointer-events: none;
}
.sec-exit-right {
    animation: section-exit-right 180ms cubic-bezier(0.4, 0, 1, 1) both;
    pointer-events: none;
}
.sec-enter-from-right {
    animation: section-enter-right 300ms cubic-bezier(0, 0, 0.2, 1) both;
    pointer-events: none;
}
.sec-enter-from-left {
    animation: section-enter-left 300ms cubic-bezier(0, 0, 0.2, 1) both;
    pointer-events: none;
}

/* Remove pointer-events block once enter is done (JS removes class) */
.page-section:not(.sec-enter-from-right):not(.sec-enter-from-left) {
    pointer-events: auto;
}

/* Reduce motion: simple fade only */
@media (prefers-reduced-motion: reduce) {
    .sec-exit-left,  .sec-exit-right  { animation: section-fade-out 150ms ease both; }
    .sec-enter-from-right, .sec-enter-from-left { animation: section-fade-in  200ms ease both; }
}
@keyframes section-fade-out { to   { opacity: 0; } }
@keyframes section-fade-in  { from { opacity: 0; } }

@keyframes bounce-in-top {
    0% {
        transform: translateY(-500px);
        animation-timing-function: ease-in;
        opacity: 0;
    }
    38% {
        transform: translateY(0);
        animation-timing-function: ease-out;
        opacity: 1;
    }
    55% {
        transform: translateY(-65px);
        animation-timing-function: ease-in;
    }
    72% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
    81% {
        transform: translateY(-28px);
        animation-timing-function: ease-in;
    }
    90% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
    95% {
        transform: translateY(-8px);
        animation-timing-function: ease-in;
    }
    100% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
}

@keyframes tracking-in-expand-fwd {
    0% {
        letter-spacing: -0.5em;
        transform: translateZ(-700px);
        opacity: 0;
    }
    40% {
        opacity: 0.6;
    }
    100% {
        transform: translateZ(0);
        opacity: 1;
    }
}

@keyframes slide-top {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-3px);
    }
}

@keyframes scale-in-hor-left {
    0% {
        transform: scaleX(0);
        transform-origin: 0 0;
        opacity: 1;
    }
    100% {
        transform: scaleX(1);
        transform-origin: 0 0;
        opacity: 1;
    }
}

@keyframes slide-in-blurred-right {
    0% {
        transform: translateX(1000px) scaleX(2.5) scaleY(0.2);
        transform-origin: 0% 50%;
        filter: blur(40px);
        opacity: 0;
    }
    100% {
        transform: translateX(0) scaleY(1) scaleX(1);
        transform-origin: 50% 50%;
        filter: blur(0);
        opacity: 1;
    }
}

/* ========================
   Body & Layout — Desktop
   ======================== */
body {
    height: 100vh;
    display: flex;
    background-image: linear-gradient(-225deg, #fffeff 0%, #d7fffe 100%);
    justify-content: center;
    align-items: center;
    color: white;
}

.main-div {
    width: 170vh;
    max-width: 96vw;
    height: 90vh;
    border-radius: 25px;
    background-color: var(--dcol);
    display: flex;
    box-shadow:
        rgba(0, 0, 0, 0.25) 0 54px 55px,
        rgba(0, 0, 0, 0.12) 0 -12px 30px,
        rgba(0, 0, 0, 0.12) 0 4px 6px,
        rgba(0, 0, 0, 0.17) 0 12px 13px,
        rgba(0, 0, 0, 0.09) 0 -3px 5px;
    animation: bounce-in-top 2s both;
}

.head-container {
    width: 30%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.info-container {
    width: 70%;
    background-color: white;
    border-radius: 25px;
    color: black;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* center caused tall sections to overflow upward and hide the top */
    padding: 60px;
    overflow-y: auto;
    overflow-x: hidden; /* clips horizontal slide animations at the panel edge */
}

/* ========================
   Page Sections (show/hide)
   ======================== */
.page-section {
    width: 100%;
    height: auto;
    /* GPU compositing hint — makes slide animations butter-smooth */
    will-change: transform, opacity;
}

/* Home section stays vertically + horizontally centered */
.page-section--centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative; /* required for .home-symbols absolute layer */
}

/* ========================
   Profile Image
   ======================== */
.image-container {
    border: 4px solid white;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow:
        rgba(0, 0, 0, 0.1) 0 10px 15px -3px,
        rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
}

.image-container img,
.link-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform var(--transition-base);
    position: relative;
}

.image-container img:hover {
    transform: scale(1.15);
}

/* ========================
   Buttons
   ======================== */
button {
    color: white;
    background-color: var(--dcol);
    border-radius: 25px;
    border: 2px solid white;
    font-size: 16px;
    cursor: pointer;
    padding: 9px 35px;
    box-shadow:
        rgba(0, 0, 0, 0.16) 0 3px 6px,
        rgba(0, 0, 0, 0.23) 0 3px 6px;
    transition: color var(--transition-base), background-color var(--transition-base);
}

button:hover {
    color: var(--dcol);
    background-color: white;
}

.link-image:hover {
    background-color: white;
}

/* ========================
   Author Details
   ======================== */
.author-name {
    margin-bottom: 0;
}

footer {
    font-size: 12px;
    margin-top: 120px;
}

.related-links {
    display: flex;
    width: 100%;
    justify-content: center;
    margin: 15%;
}

.author-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.head-name {
    font-size: 3em;
}

.common {
    margin: 0;
    padding: 0;
}

.shade {
    color: rgb(128, 128, 128);
}

.me {
    color: var(--dcol);
}

/* ========================
   Social / Mod Links
   ======================== */
.mod-link {
    width: 55px;
    height: 55px;
    margin: 0 10px;
}

/* ========================
   Navigation Bar — Desktop (vertical sidebar)
   ======================== */
.nav-bar {
    position: relative;
    background: white;
    left: 55px;
    border-radius: 50px;
    padding: 8px;
    z-index: 10; /* must sit above .main-div animation stacking context */
}

.nav-bar ul {
    padding: 0;
}

.nav-bar ul li {
    list-style-type: none;
    margin: 20px 0;
    width: 100%;
    height: 100%;
    padding: 25%;
    position: relative;
}

.nav-bar ul li img {
    height: 100%;
    width: 100%;
}

.nav-bar ul li:hover {
    cursor: pointer;
}

.active {
    border: 3px solid var(--dcol);
    border-radius: 45%;
    background-color: rgba(4, 180, 224, 0.5);
}

.nav-info {
    position: absolute;
    left: -96px;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background-color: #4facfe;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 10px;
    letter-spacing: 2px;
    white-space: nowrap;
    color: white;
    pointer-events: none;
    /* Animate with opacity instead of display toggling */
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
}

.nav-bar ul li:hover .nav-info,
.nav-bar ul li:focus .nav-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Never show the tooltip on the currently active item — its label is visible */
.nav-bar ul li.active .nav-info {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ========================
   Animation Utility Classes
   ======================== */
.tracking-in-expand-fwd {
    animation: tracking-in-expand-fwd 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) both;
    animation-delay: 2400ms;
}

.scale-in-hor-left {
    animation: scale-in-hor-left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.slide-in-blurred-right {
    animation: slide-in-blurred-right 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}

/* ========================
   Social Icon Tooltips
   ======================== */
.mod-link {
    position: relative;
}

.mod-link::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 20;
}

.mod-link:hover::after {
    opacity: 1;
}

/* ========================
   Nav Label (mobile active indicator)
   ======================== */
.nav-label {
    display: none; /* hidden on desktop */
}

/* ========================
   Scroll Progress Bar
   ======================== */
#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--dcol) 0%, #7dd3fc 100%);
    border-radius: 0 2px 2px 0;
    z-index: 99999;
    transition: width 100ms linear;
    pointer-events: none;
}

/* ========================
   Toast Notifications
   ======================== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 99998;
    pointer-events: none;
}

.toast {
    background: #1e293b;
    color: #f1f5f9;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 0.84em;
    font-family: "my_poppins", serif;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    max-width: 300px;
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
    border-left: 4px solid transparent;
}

.toast-info    { border-left-color: var(--dcol); }
.toast-success { border-left-color: #22c55e; }
.toast-error   { border-left-color: #ef4444; }

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

/* ========================
   RESPONSIVE — Tablet (768px – 1024px)
   ======================== */
@media (max-width: 1024px) {
    body {
        align-items: center;
        padding: 12px;
    }

    .main-div {
        width: 100%;
        height: 92vh;
        border-radius: 20px;
    }

    .head-container {
        width: 32%;
    }

    .info-container {
        width: 68%;
        padding: 30px 24px;
        border-radius: 20px;
    }

    .image-container {
        width: 160px;
        height: 160px;
    }

    .head-name {
        font-size: 2.2em;
    }

    footer {
        margin-top: 40px;
        font-size: 11px;
    }

    .related-links {
        margin: 8%;
    }

    /* Sidebar nav stays but moves closer */
    .nav-bar {
        left: 20px;
    }

    .nav-info {
        left: -86px;
    }
}

/* ========================
   RESPONSIVE — Mobile (≤ 768px)
   ======================== */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 0;
        height: 100dvh;
        overflow: hidden;
    }

    /* Card becomes full-screen column */
    .main-div {
        width: 100vw;
        height: calc(100dvh - var(--nav-bottom-height));
        max-width: 100vw;
        border-radius: 0;
        flex-direction: column;
        animation: none; /* skip bounce on mobile for perf */
        box-shadow: none;
    }

    /* Sidebar becomes a compact horizontal top header */
    .head-container {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 14px;
        padding: 10px 18px;
        background-color: var(--dcol);
        flex-shrink: 0;
        min-height: 72px;
    }

    .image-container {
        width: 50px;
        height: 50px;
        border-width: 2px;
        flex-shrink: 0;
    }

    /* Author name block: stack name + subtitle */
    .head-container .author-details {
        align-items: flex-start;
        flex: 1 1 0;
        min-width: 0;
    }

    .head-container .author-details h1 {
        font-size: 1em;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .head-container .author-details h3 {
        font-size: 0.68em;
        font-weight: 400;
        opacity: 0.85;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Push social icons to the trailing (right) edge */
    .related-links {
        margin: 0;
        margin-left: auto;
        width: auto;
        gap: 0;
        flex-shrink: 0;
        /* subtle left separator */
        padding-left: 12px;
        border-left: 1px solid rgba(255, 255, 255, 0.3);
    }

    .mod-link {
        width: 34px;
        height: 34px;
        margin: 0 5px;
    }

    /* Hide the Download CV button in the mobile top bar —
       it's accessible via the home section CTA instead */
    .head-container button {
        display: none;
    }

    button {
        font-size: 13px;
        padding: 6px 18px;
    }

    footer {
        display: none; /* hidden on mobile to avoid clutter */
    }

    /* Info container fills the rest */
    .info-container {
        width: 100%;
        border-radius: 0;
        padding: 20px 16px;
        flex: 1;
        overflow-y: auto;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .head-name {
        font-size: 2em;
    }

    /* ========================
       Mobile Bottom Navigation Bar
       ======================== */
    .nav-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        height: var(--nav-bottom-height);
        background: white;
        border-radius: 20px 20px 0 0;
        padding: 6px 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        z-index: 1000;

        /* override desktop positioning */
        display: flex;
        align-items: center;
        left: 0; /* override the desktop `left: 55px` */
    }

    .nav-bar ul {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        padding: 0;
    }

    .nav-bar ul li {
        margin: 0;
        padding: 6px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        position: relative;
    }

    .nav-bar ul li img {
        width: 26px;
        height: 26px;
    }

    /* Hide desktop tooltips on mobile */
    .nav-info {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Mobile nav labels — show text under active icon */
    .nav-bar ul li {
        flex-direction: column;
        gap: 1px;
        height: 54px;
        width: 54px;
        padding: 5px 4px;
    }

    .nav-label {
        display: block;
        font-size: 9px;
        line-height: 1;
        color: #aaa;
        text-align: center;
        font-family: "my_poppins", serif;
        letter-spacing: 0.3px;
    }

    .active .nav-label {
        color: var(--dcol);
        font-weight: 600;
    }

    /* Social tooltips off on mobile */
    .mod-link::after {
        display: none;
    }

    /* Toast shifts up above bottom nav */
    #toast-container {
        bottom: calc(var(--nav-bottom-height) + 12px);
    }

    .active {
        border-radius: 12px;
    }
}

/* ========================
   RESPONSIVE — Small Mobile (≤ 400px)
   ======================== */
@media (max-width: 400px) {
    .head-container {
        padding: 8px 12px;
        gap: 10px;
        min-height: 64px;
    }

    .head-container .author-details h1 {
        font-size: 0.88em;
    }

    .head-container .author-details h3 {
        font-size: 0.62em;
    }

    .mod-link {
        width: 28px;
        height: 28px;
        margin: 0 3px;
    }

    .image-container {
        width: 44px;
        height: 44px;
    }

    .related-links {
        padding-left: 8px;
    }

    .info-container {
        padding: 16px 12px;
    }
}

/* ============================================================
   HOME HERO — full redesign
   ============================================================ */

/* Make the home section fill the panel so symbols use full height */
#home-section {
    overflow: hidden;
    min-height: calc(90vh - 120px); /* card height - 2 × 60px padding */
}

/* ========================
   Floating code symbols
   ======================== */
.home-symbols {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.sym {
    position: absolute;
    font-family: "Courier New", monospace;
    color: var(--dcol);
    opacity: 0;
    font-size: 13px;
    bottom: -40px;
    user-select: none;
    animation: sym-float linear infinite;
}

@keyframes sym-float {
    0%   { transform: translateY(0) rotate(0deg);       opacity: 0; }
    8%   { opacity: 0.08; }
    92%  { opacity: 0.08; }
    100% { transform: translateY(-110vh) rotate(18deg); opacity: 0; }
}

.sym:nth-child(1)  { left:  4%; animation-duration:  9s; animation-delay:  0s;   font-size: 12px; }
.sym:nth-child(2)  { left: 14%; animation-duration: 13s; animation-delay:  2.1s; font-size: 16px; }
.sym:nth-child(3)  { left: 22%; animation-duration: 11s; animation-delay:  4.3s; }
.sym:nth-child(4)  { left: 33%; animation-duration: 10s; animation-delay:  0.8s; font-size: 11px; }
.sym:nth-child(5)  { left: 43%; animation-duration: 12s; animation-delay:  3.2s; }
.sym:nth-child(6)  { left: 54%; animation-duration:  8s; animation-delay:  5.1s; font-size: 14px; }
.sym:nth-child(7)  { left: 63%; animation-duration: 15s; animation-delay:  0.3s; }
.sym:nth-child(8)  { left: 72%; animation-duration: 10s; animation-delay:  2.7s; font-size: 15px; }
.sym:nth-child(9)  { left: 82%; animation-duration: 13s; animation-delay:  4.6s; }
.sym:nth-child(10) { left:  9%; animation-duration: 11s; animation-delay:  6.2s; font-size: 11px; }
.sym:nth-child(11) { left: 49%; animation-duration: 14s; animation-delay:  1.5s; }
.sym:nth-child(12) { left: 91%; animation-duration:  9s; animation-delay:  7.3s; font-size: 12px; }

/* ========================
   Home content wrapper
   ======================== */
.home-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* "Hello, I'm" sub-label */
.home-greeting {
    font-size: 0.82em;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 6px;
    font-weight: 400;
}

/* Gradient name */
.home-name {
    margin: 0 0 12px;
    padding: 0;
    font-size: 3.8em;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.15;
    background: linear-gradient(135deg, #04b4e0 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Typewriter line */
.home-role-wrapper {
    font-size: 1.15em;
    color: #475569;
    min-height: 1.8em;
    margin-bottom: 4px;
}

.home-role-prefix { color: #94a3b8; }

.home-typewriter {
    color: #1e293b;
    font-weight: 600;
}

.home-cursor {
    color: var(--dcol);
    font-weight: 300;
    animation: blink-cursor 0.72s step-end infinite;
}

@keyframes blink-cursor {
    from, to { opacity: 1; }
    50%       { opacity: 0; }
}

/* Gradient divider */
.home-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #04b4e0, #7c3aed);
    border-radius: 2px;
    margin: 22px auto;
}

/* ========================
   Home CTA buttons
   ======================== */
.home-cta {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-cta-primary {
    background: linear-gradient(135deg, #04b4e0, #0582ca);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(4, 180, 224, 0.38);
    transition: transform 200ms ease, box-shadow 200ms ease;
    letter-spacing: 0.4px;
    font-family: "my_poppins", serif;
}

.btn-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(4, 180, 224, 0.52);
    color: white;
    background: linear-gradient(135deg, #04b4e0, #0582ca);
}

.btn-cta-outline {
    background: transparent;
    color: var(--dcol);
    border: 2px solid var(--dcol);
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease, box-shadow 200ms ease;
    letter-spacing: 0.4px;
    font-family: "my_poppins", serif;
    box-shadow: none;
}

.btn-cta-outline:hover {
    background: var(--dcol);
    color: white;
    box-shadow: 0 4px 18px rgba(4, 180, 224, 0.38);
}

/* ========================
   Home Hero — Responsive
   ======================== */
@media (max-width: 1024px) {
    #home-section  { min-height: calc(92vh - 60px); }
    .home-name     { font-size: 3em; }
}

@media (max-width: 768px) {
    #home-section {
        min-height: calc(100dvh - var(--nav-bottom-height) - 90px);
    }
    .home-name         { font-size: 2.2em; }
    .home-role-wrapper { font-size: 0.95em; }
    .home-greeting     { font-size: 0.72em; letter-spacing: 3px; }
    .btn-cta-primary,
    .btn-cta-outline   { padding: 10px 22px; font-size: 0.82em; }
    .home-divider      { margin: 16px auto; }
}

@media (max-width: 400px) {
    .home-name { font-size: 1.9em; }
    .home-cta  { gap: 10px; }
}
