:root {
    --bg: #050816;
    --accent: #7c3aed;
    --accent-alt: #4f46e5;
    --text: #eef2ff;
    --muted: #9ca3af;
    --surface: rgba(8, 14, 33, 0.9);
    --surface-strong: rgba(8, 17, 42, 0.95);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, "Segoe UI", system-ui, Arial, sans-serif;
    background: radial-gradient(circle at top, rgba(124, 58, 237, 0.14), transparent 24%),
        linear-gradient(180deg, #060814 0%, #07101b 50%, #090f1f 100%);
    color: var(--text);
}

body {
    overflow-x: hidden;
}

.page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 28px 40px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px 24px;
    background: rgba(5, 8, 22, 0.96);
    border-radius: 28px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand a {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    background: rgba(5, 8, 22, 0.98);
    border-radius: 22px;
}

.brand img {
    width: auto;
    max-height: 120px;
    max-width: 100%;
    display: block;
}

.nav {
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 160ms ease, text-decoration-color 160ms ease, transform 160ms ease;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

.nav a:hover,
.nav a.active {
    color: var(--text);
    text-decoration: underline;
}

.nav a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
    border-radius: 6px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    color: white;
    border-radius: 999px;
    padding: 14px 24px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 20px 45px rgba(124, 58, 237, 0.26);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 54px rgba(124, 58, 237, 0.32);
}

.button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.14), 0 24px 54px rgba(124, 58, 237, 0.28);
}

.hero {
    position: relative;
    min-height: calc(100vh - 160px);
    margin-top: 24px;
    padding: 36px 28px 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 28px;
    flex-wrap: nowrap;
    overflow-x: hidden;
}

.hero-copy {
    position: relative;
    z-index: 1;
    flex: 0 0 34%;
    max-width: 34%;
    color: white;
}

.hero-panel {
    position: relative;
    flex: 0 0 66%;
    max-width: 66%;
    min-height: 620px;
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hero-panel img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.hero-copy h1,
.hero-panel h1 {
    margin: 0;
    font-size: clamp(2.7rem, 4.5vw, 4.8rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
    max-width: 12ch;
}

.hero-copy h1 .highlight {
    display: block;
    background: linear-gradient(90deg, #8b5cf6, #38bdf8);
    -webkit-background-clip: text;
    color: transparent;
}

.hero-copy p {
    margin: 24px 0 0;
    max-width: 680px;
    line-height: 1.85;
    color: var(--muted);
    font-size: 1rem;
}

.hero-copy .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 0.92rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero-copy .eyebrow::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #38bdf8);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.hero-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 170px;
    border-radius: 999px;
    padding: 14px 22px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.hero-actions a:hover {
    transform: translateY(-1px);
}

.current-projects {
    margin: 32px 0 0;
    width: 100%;
    max-width: 100%;
    text-align: left;
}

.current-projects__header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.current-projects__list {
    display: grid;
    gap: 16px;
}

.current-projects__inner {
    padding: 18px 20px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.14);
}

.current-projects__tag {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.project-card {
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(10, 16, 34, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.project-card__link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
}

.project-card__link:hover h2 {
    color: #c4b5fd;
}

.project-card h2 {
    margin: 0 0 12px;
    font-size: 1.75rem;
    color: white;
}

.project-card__description {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.project-card__status {
    margin: 12px 0 0;
    color: #a855f7;
    font-weight: 700;
}

.hero-actions .primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    color: white;
    box-shadow: 0 18px 40px rgba(124, 58, 237, 0.22);
}

.hero-actions .secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
}

/* Button icon container */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg,
.btn-icon-svg {
    width: 16px;
    height: 16px;
    display: block;
    color: currentColor;
}

/* Primary button arrow */
.btn-icon--arrow {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

/* Secondary button doc icon */
.btn-icon--doc {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.hero-actions a:hover .btn-icon--arrow {
    background: rgba(255, 255, 255, 0.10);
}

.hero-actions a:hover .btn-icon--doc {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 42px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 28px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.2);
    min-height: 180px;
}

.feature-card a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.feature-card:hover {
    transform: translateY(-4px);
    transition: transform 0.2s ease;
}

.feature-card h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
    font-size: 0.95rem;
}

.feature-card {
    position: relative;
    padding: 36px 28px 36px;
}

.feature-card__icon {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.feature-card__emoji {
    display: block;
    width: 20px;
    height: 20px;
}

.feature-card__emoji svg,
.feature-card__emoji {
    width: 20px;
    height: 20px;
}

.feature-card__content {
    display: block;
    padding-left: 80px;
}

.feature-card__cta {
    display: inline-flex;
    gap: 8px;
    margin-top: 18px;
    font-weight: 800;
    text-decoration: none;
}

.feature-card__cta--purple {
    color: var(--accent);
}

.feature-card__cta--green {
    color: #10b981;
}

.feature-card__cta--orange {
    color: #fb923c;
}

.feature-card__cta--blue {
    color: #3b82f6;
}

.feature-card__icon--projects {
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
}

.feature-card__icon--blog {
    background: linear-gradient(135deg, #059669, #10b981);
}

.feature-card__icon--kb {
    background: linear-gradient(135deg, #f97316, #fb923c);
}

.feature-card__icon--github {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.feature-card a:hover .feature-card__cta {
    text-decoration: underline;
}

/* Link hover / focus styles (CTAs and card content) */
.feature-card__cta {
    transition: color 160ms ease, transform 140ms ease, text-decoration-color 160ms ease;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.feature-card__cta:hover {
    transform: translateY(-3px);
    text-decoration: underline;
}

.feature-card__cta:focus-visible,
.feature-card__content:focus-visible,
.feature-card a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
    border-radius: 8px;
}

.feature-card__content h3 {
    transition: color 160ms ease;
}

.feature-card__content:hover h3 {
    color: #c4b5fd;
}

/* Hero buttons: subtle underline on secondary and stronger contrast on hover */
.hero-actions a {
    transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.hero-actions .secondary:hover {
    text-decoration: underline;
    text-underline-offset: 6px;
}

.footer {
    margin-top: 42px;
    padding: 24px 0 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
    text-align: center;
}

.footer-left {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.01em;
}

.footer-icons {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.footer-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.footer-icons a:hover {
    background: rgba(124, 58, 237, 0.22);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.16);
}

.footer-icons svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@media (max-width: 1160px) {
    .feature-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 840px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        width: 100%;
        gap: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .feature-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .page {
        padding: 20px 16px 28px;
    }

    .hero {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-copy,
    .hero-panel {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .hero-panel {
        min-height: 420px;
    }
}

/* Projects page specific */
.page-hero .hero-copy h1 {
    font-size: 2.2rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin: 8px 0 18px;
}

.current-project-section {
    margin-top: 28px;
}

.current-project-card .project-card {
    padding: 26px;
    min-height: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.projects-grid {
    margin-top: 30px;
}

.projects-grid .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

/* Popup that appears on hover/focus */
.project-card {
    position: relative;
    overflow: visible;
}

.card-popup {
    position: absolute;
    left: 20px;
    right: 20px;
    top: calc(100% - 6px);
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
    z-index: 40;
    max-width: 520px;
}

.card-popup h4 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.project-card:hover .card-popup,
.project-card:focus-within .card-popup,
.project-card:focus .card-popup,
.feature-card:hover .card-popup,
.feature-card:focus-within .card-popup,
.feature-card:focus .card-popup,
.post-card:hover .card-popup,
.post-card:focus-within .card-popup,
.post-card:focus .card-popup {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* Keep popup visible when hovering over it to avoid flicker when moving mouse */
.card-popup:hover {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

/* Ensure popup remains usable on small screens (stacked) */
@media (max-width: 620px) {
    .card-popup {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        margin-top: 12px;
    }
}