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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #121826 0, #030712 55%);
    color: #f9fafb;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ---------- Layout ---------- */
.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.7s ease-out forwards;
}

header h1 {
    font-size: 2.4rem;
    letter-spacing: 0.04em;
}

header h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #9ca3af;
}

header .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.95rem;
    color: #9ca3af;
}

header .meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

header .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 118, 110, 0.2);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: #a5f3fc;
}

main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

section {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 16px;
    padding: 18px 18px 20px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.6);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.7s ease-out forwards;
    animation-delay: 0.1s;
}

section:nth-of-type(2) {
    animation-delay: 0.18s;
}

section:nth-of-type(3) {
    animation-delay: 0.26s;
}

section:nth-of-type(4) {
    animation-delay: 0.34s;
}

section:nth-of-type(5) {
    animation-delay: 0.42s;
}

section h3 {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

section h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #22c55e, #3b82f6);
    border-radius: 999px;
    transition: width 0.25s ease-out;
}

section:hover h3::after {
    width: 100%;
}

#about h3,
#skills h3,
#apps h3,
#contact h3,
#experience h3 {
    font-size: 1.9rem;
}

section p {
    font-size: 0.95rem;
    color: #d1d5db;
    margin-bottom: 6px;
}

ul {
    list-style: none;
    padding-left: 0;
    margin-top: 4px;
}

ul li {
    font-size: 0.92rem;
    color: #d1d5db;
    padding-left: 16px;
    position: relative;
    margin-bottom: 4px;
}

ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #22c55e;
    font-size: 0.8rem;
    top: 3px;
}

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 18px;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.badge {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(55, 65, 81, 0.7);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.3);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, border-color 0.15s ease-out;
}

.badge:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.8);
    border-color: rgba(59, 130, 246, 0.8);
}

/* ---------- Experience ---------- */
.experience-role {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 8px;
}

.experience-dates {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 6px;
}

/* ---------- Buttons & Links ---------- */
.button-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(45, 212, 191, 0.7);
    background: radial-gradient(circle at top left, #0f766e, #022c22);
    color: #ecfeff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out,
        background 0.15s ease-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.35);
    background: radial-gradient(circle at top left, #14b8a6, #064e3b);
}

.btn-secondary {
    border-color: rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
}

.btn-secondary:hover {
    box-shadow: 0 10px 24px rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.95);
}

.link-muted {
    font-size: 0.88rem;
    color: #9ca3af;
}

/* ---------- Chat widget ---------- */
.chat-launcher {
    position: fixed;
    bottom: 18px;
    right: 18px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #22c55e, #15803d);
    color: #f9fafb;
    font-size: 26px;
    box-shadow: 0 14px 30px rgba(22, 163, 74, 0.55);
    transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
    z-index: 40;
    animation: pulseChat 2.8s ease-in-out infinite;
}

.chat-launcher:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 18px 38px rgba(22, 163, 74, 0.7);
}

.chat-widget {
    position: fixed;
    bottom: 86px;
    right: 18px;
    width: 320px;
    max-height: 70vh;
    background: rgba(15, 23, 42, 0.96);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
    z-index: 50;
}

.chat-widget.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chat-header {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(30, 64, 175, 0.9);
    background: radial-gradient(circle at top left, #1d4ed8, #020617);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-header-title span:first-child {
    font-size: 0.9rem;
    font-weight: 600;
}

.chat-header-title span:last-child {
    font-size: 0.8rem;
    color: #cbd5f5;
}

.chat-close-btn {
    border: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 4px;
}

.chat-messages {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
}

.chat-bubble {
    max-width: 90%;
    padding: 8px 10px;
    border-radius: 14px;
    word-wrap: break-word;
}

.chat-bubble-ai {
    background: rgba(30, 64, 175, 0.9);
    color: #e5e7eb;
    border-bottom-left-radius: 2px;
    align-self: flex-start;
}

.chat-bubble-user {
    background: rgba(22, 163, 74, 0.95);
    color: #ecfdf5;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
}

.chat-form {
    border-top: 1px solid rgba(55, 65, 81, 0.9);
    padding: 8px;
    display: flex;
    gap: 6px;
    background: rgba(15, 23, 42, 0.98);
}

.chat-input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(75, 85, 99, 0.9);
    background: rgba(15, 23, 42, 1);
    color: #f9fafb;
    font-size: 0.9rem;
    padding: 6px 10px;
    outline: none;
}

.chat-input:focus {
    border-color: rgba(59, 130, 246, 1);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6);
}

.chat-send-btn {
    border-radius: 999px;
    border: none;
    background: rgba(37, 99, 235, 1);
    color: #f9fafb;
    font-size: 0.85rem;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}

.chat-send-btn:hover {
    background: rgba(59, 130, 246, 1);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ---------- Responsive tweaks ---------- */
@media (max-width: 640px) {
    .page {
        padding: 18px 12px 80px;
    }

    header h1 {
        font-size: 2rem;
    }

    .chat-widget {
        width: 92vw;
        right: 4vw;
    }
}

@keyframes pulseChat {

    0%,
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 14px 30px rgba(22, 163, 74, 0.55);
    }

    50% {
        transform: translateY(-1px) scale(1.04);
        box-shadow: 0 18px 40px rgba(22, 163, 74, 0.8);
    }
}

.apps-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.app-card {
    width: 30%;
    background: #161616;
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition:
        transform 0.2s ease-out,
        box-shadow 0.2s ease-out,
        border 0.2s ease-out;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.app-card:hover {
    transform: translateY(-6px) rotate3d(1, 0, 0, 4deg);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.8);
    border-color: rgba(45, 212, 191, 0.8);
}


.app-card h4 {
    margin: 10px 0 6px;
}

.app-tags {
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.app-desc {
    color: #d1d5db;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20%;
    margin-bottom: 8px;
}

/* Center the tappable tags inside cards */
.app-card .button-row {
    width: 100%;
    justify-content: center;
    /* center buttons horizontally */
    margin-top: auto;
    /* push buttons to the bottom of the card */
}