/* Base layout & typography */
:root {
    --bg: #050814;
    --bg-alt: #0b1022;
    --surface: #111827;
    --surface-alt: #020617;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.15);
    --accent-strong: #0ea5e9;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border-subtle: rgba(148, 163, 184, 0.25);
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-soft: 0 22px 45px rgba(15, 23, 42, 0.7);
    --transition-fast: 150ms ease-out;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top, #0f172a 0, #020617 45%, #000 100%);
    min-height: 100vh;
    line-height: 1.6;
}

/* Layout helpers */

.shell {
    width: 100%;
    max-width: 1080px;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* Header & nav */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    -webkit-backdrop-filter: blur(18px);
    /* for Safari / iOS */
    backdrop-filter: blur(18px);
    /* standard */
    background: linear-gradient(to bottom,
            rgba(15, 23, 42, 0.97),
            rgba(15, 23, 42, 0.7));
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.6rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.brand-initials {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 0%, #22d3ee, #1d4ed8);
    color: #e5e7eb;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}

.brand-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.brand-tagline {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Navigation */

.site-nav ul {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    padding-block: 0.3rem;
    position: relative;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.35rem;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(to right, #22d3ee, #0ea5e9);
    transition: width var(--transition-fast);
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--text);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    width: 100%;
}

/* Mobile nav */

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0.25rem;
}

.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #e5e7eb;
    margin-block: 3px;
}

/* Hero */

.hero {
    padding: 3.5rem 0 2.5rem;
}

.hero-grid {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(1.9rem, 3vw, 2.4rem);
    margin: 0 0 0.75rem;
}

.hero-body {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    max-width: 38rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: #a5b4fc;
    margin-bottom: 0.8rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast),
        border-color var(--transition-fast), transform 80ms ease-out,
        box-shadow 80ms ease-out;
}

.btn.primary {
    background: radial-gradient(circle at 0 0, #22d3ee, #1d4ed8);
    color: white;
    box-shadow: 0 18px 35px rgba(37, 99, 235, 0.55);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 45px rgba(37, 99, 235, 0.75);
}

.btn.ghost {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.6);
    color: var(--text-muted);
}

.btn.ghost:hover {
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.9);
    background: rgba(15, 23, 42, 0.85);
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.hero-links a {
    text-decoration: none;
    color: inherit;
}

.hero-links a:hover {
    color: var(--accent);
}

/* Avatar */

.hero-photo {
    justify-self: center;
}

.avatar-card {
    margin: 0;
    background: radial-gradient(circle at 0 0, #1d4ed8, #020617);
    padding: 0.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    max-width: 260px;
}

.avatar-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: calc(var(--radius-xl) - 6px);
}

.avatar-card figcaption {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem 0.6rem 0.6rem;
}

/* Sections */

.section {
    padding: 2.8rem 0;
}

.section.alt {
    background: radial-gradient(circle at top, #020617, #020617 40%, #000 100%);
}

.section-header h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    margin: 0;
    color: var(--text-muted);
    max-width: 40rem;
}

/* Cards & grids */

.card {
    background: rgba(15, 23, 42, 0.92);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 1.1rem 1.2rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.6);

    display: flex;
    flex-direction: column;
}

/* Shared header block for all cards */
.card-header {
    /* min-height: 3.6rem; */
    /* tune this value if you change font size */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* keep title/meta at the bottom of that space */
}

/* Remove extra top margin between title and meta inside headers */
.card-header h3 {
    margin-bottom: 0.25rem;
}

.card-header .meta {
    margin-top: 0;
}

.cert-media {
    margin-top: 0.75rem;
    border-radius: 1rem;
    padding: 0.5rem;
    background: rgba(8, 16, 32, 0.8);

    /* make both cert blocks same height + centered */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 260px;
    /* adjust up/down if you want them larger/smaller */
}

/* Current focus cards on projects.html */
.current-focus-grid .card-header {
    height: 3.4rem;
}

.cert-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.75rem;
}

/* Make license cards flex columns so we can push the image to the bottom */
.licenses-grid .card {
    display: flex;
    flex-direction: column;
}

/* Licenses grid: ensure headers + meta line are same height */
.licenses-grid .card-header {
    height: 4.5rem;
    /* tweak 4.2–4.8rem until the meta lines align perfectly */
}

/* Inside license cards, push cert block down so all images align */
.licenses-grid .cert-media {
    margin-top: auto;
    /* takes up leftover space above */
}

.card-with-media {
    display: flex;
    flex-direction: column;
}

/* shared image banner style */
.card-with-media .org-photo {
    margin-top: 0.75rem;
    border-radius: 1rem;
    overflow: hidden;

    height: 220px;
    /* tweak up/down if you want */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    background-color: rgba(255, 0, 0, 0.3);
    /* debug */
}

/* per-organization images 
.org-photo-humanitty {
    background-image: url("../img/humanitty1.jpg");
}

.org-photo-cybertronix {
    background-image: url("../img/cybertronix1.jpg");
}
*/

.org-photo-img {
    display: block;
    width: 100%;
    height: 220px;
    /* controls how tall the banner is */
    object-fit: cover;
    /* crop instead of stretch */
    border-radius: 1rem;
    margin-top: 0.75rem;
}

.about-grid,
.contact-grid,
.projects-grid {
    display: grid;
    gap: 1.3rem;
    margin-top: 1.6rem;
}

/* Lists */

.pill-list,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0.6rem 0 0;
}

.pill-list li,
.tag-list li {
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.45);
}

/* Timeline */

.timeline {
    margin-top: 1.6rem;
    border-left: 1px solid rgba(148, 163, 184, 0.45);
    padding-left: 1rem;
}

.timeline-item {
    position: relative;
    padding-left: 0.7rem;
    padding-bottom: 1.6rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.08rem;
    top: 0.4rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0, #22d3ee, #1d4ed8);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.8);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item h3 {
    margin: 0 0 0.15rem;
    font-size: 1rem;
}

.meta {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bullet-list {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

/* Projects */

.projects-grid {
    margin-top: 1.7rem;
}

/* Home page Selected Projects */
.projects-grid .card-header {
    height: 3.4rem;
    /* adjust until the first paragraph lines align across all three */
}

.project h3 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.project p {
    margin: 0 0 0.7rem;
    color: var(--text-muted);
}

.more-link {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.more-link a {
    color: var(--accent);
    text-decoration: none;
}

.more-link a:hover {
    color: var(--accent-strong);
}

.project-actions {
    margin-top: 1rem;
}

.project-actions .btn {
    font-size: 0.9rem;
}

/* Footer */

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    padding: 1rem 0 1.5rem;
    background: rgba(3, 7, 18, 0.95);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Responsive */

@media (min-width: 720px) {
    .hero-grid {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
    }

    .about-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 719px) {
    .site-nav {
        position: absolute;
        inset-inline: 0;
        top: 100%;
        background: rgba(15, 23, 42, 0.98);
        border-bottom: 1px solid rgba(148, 163, 184, 0.3);

        display: none;
        /* <-- hide by default */
        transform-origin: top;
        transform: scaleY(0);
        opacity: 0;
        pointer-events: none;
        transition: transform 120ms ease-out, opacity 120ms ease-out;
    }

    .site-nav.open {
        display: block;
        /* <-- only show when open */
        transform: scaleY(1);
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav ul {
        flex-direction: column;
        padding: 0.6rem 1.25rem 0.9rem;
        gap: 0.4rem;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;

        margin-left: auto;
        /* push it to the far right */
        padding: 0.18rem 0.6rem;
        border-radius: 999px;
        border: 1px solid rgba(148, 163, 184, 0.85);
        background: rgba(15, 23, 42, 0.95);
        color: #e5e7eb;

        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.12em;
        text-transform: uppercase;

        cursor: pointer;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.9);
        transition:
            transform 120ms ease-out,
            box-shadow 120ms ease-out,
            border-color 120ms ease-out,
            background 120ms ease-out;
    }

    .nav-toggle:hover,
    .nav-toggle:focus-visible {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.95);
        border-color: rgba(56, 189, 248, 0.9);
        background: rgba(15, 23, 42, 0.98);
    }

    .nav-toggle-label {
        line-height: 1;
    }

}

/* Animated underline for nav links – fixed */

.site-nav a {
    position: relative;
    display: inline-block;
    padding-bottom: 0.35rem;
    text-decoration: none;
    border-bottom: none !important;
    /* kill any old underline/border */
    overflow: hidden;
}

/* base underline (hidden off to the left) */
.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #38bdf8, #a855f7);
    transform: translateX(-100%);
    transition: transform 180ms ease-out;
}

/* active page: keep the underline visible */
.site-nav a[aria-current="page"]::after {
    transform: translateX(0);
}

/* hover / focus: slide the underline in */
.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    transform: translateX(0);
}

/* --- LinkedIn contact button --- */

.button-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.85);
    background: radial-gradient(circle at 0% 0%,
            rgba(129, 140, 248, 0.16),
            transparent 55%);
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition:
        transform 150ms ease-out,
        box-shadow 150ms ease-out,
        border-color 150ms ease-out,
        background 150ms ease-out;
}

.button-linkedin:hover,
.button-linkedin:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(129, 140, 248, 1);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.9);
    background: radial-gradient(circle at 0% 0%,
            rgba(129, 140, 248, 0.35),
            transparent 60%);
}

/* keep visited color same as normal */
.button-linkedin:visited {
    color: #e5e7eb;
}

/* --- Section fade-in animation --- */

.fade-in-up {
    opacity: 0;
    transform: translateY(10px);
    animation: fade-in-up 420ms ease-out forwards;
}

.fade-delay-1 {
    animation-delay: 0.08s;
}

.fade-delay-2 {
    animation-delay: 0.16s;
}

.fade-delay-3 {
    animation-delay: 0.24s;
}

.fade-delay-4 {
    animation-delay: 0.32s;
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Heartbeat effect for LinkedIn button */

/* Calm, continuous breathing for the LinkedIn button */
.button-linkedin {
    animation: linkedin-breathe 1.8s ease-in-out infinite alternate;
}

/* From normal → slightly expanded and glowing, then back.
   "alternate" makes it go forward then backward smoothly. */
@keyframes linkedin-breathe {
    from {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.0);
    }

    to {
        transform: translateY(-1px) scale(1.04);
        box-shadow: 0 0 22px 6px rgba(129, 140, 248, 0.5);
    }
}


/* Floating zen toggle */
.zen-toggle {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: rgba(15, 23, 42, 0.92);
    color: #e5e7eb;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.9);
    transition:
        transform 150ms ease-out,
        box-shadow 150ms ease-out,
        border-color 150ms ease-out,
        background 150ms ease-out;
}

.zen-toggle:hover,
.zen-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
    border-color: rgba(129, 140, 248, 0.9);
}

.zen-toggle-icon {
    font-size: 1rem;
}

/* When Zen mode is active */
body.zen-mode .zen-toggle {
    border-color: rgba(129, 140, 248, 1);
    background: radial-gradient(circle at 0% 0%,
            rgba(129, 140, 248, 0.3),
            rgba(15, 23, 42, 0.95));
}

/* --- Tech snapshot strip under hero --- */

.tech-snapshot {
    border-top: 1px solid rgba(30, 64, 175, 0.6);
    border-bottom: 1px solid rgba(15, 23, 42, 0.9);
    background: radial-gradient(circle at 0% 0%,
            rgba(56, 189, 248, 0.12),
            transparent 55%);
}

.tech-snapshot-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-block: 1.1rem;
}

.tech-snapshot-label {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.9);
}

.tech-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.96);
    font-size: 0.75rem;
    color: #e5e7eb;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition:
        transform 120ms ease-out,
        box-shadow 120ms ease-out,
        border-color 120ms ease-out,
        background 120ms ease-out;
}

.tech-chip:hover,
.tech-chip:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.95);
    border-color: rgba(56, 189, 248, 0.9);
    background: radial-gradient(circle at 0% 0%,
            rgba(56, 189, 248, 0.28),
            rgba(15, 23, 42, 0.98));
}

/* --- Tech chip tooltips --- */

.tech-chip {
    position: relative;
    text-decoration: none;
    cursor: pointer;
}

/* Tooltip bubble */
.tech-chip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 135%;
    transform: translateX(-50%) translateY(4px);

    width: min(340px, 90vw);
    /* fixed-ish width, but capped on small screens */
    padding: 0.75rem 1rem;
    border-radius: 0.9rem;

    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: #e5e7eb;

    font-size: 0.8rem;
    line-height: 1.5;
    text-align: left;

    pointer-events: none;
    opacity: 0;
    white-space: normal;

    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
    z-index: 20;
    transition:
        opacity 140ms ease-out,
        transform 140ms ease-out;
}

/* Tooltip arrow */
.tech-chip::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 122%;
    width: 10px;
    height: 10px;
    background: rgba(15, 23, 42, 0.98);
    border-left: 1px solid rgba(148, 163, 184, 0.7);
    border-bottom: 1px solid rgba(148, 163, 184, 0.7);
    transform-origin: center;
    transform: translateX(-50%) rotate(45deg);
    opacity: 0;
    transition: opacity 140ms ease-out;
}

/* Show tooltip on hover/focus */
.tech-chip:hover::after,
.tech-chip:focus-visible::after,
.tech-chip:hover::before,
.tech-chip:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Projects filter bar --- */

.projects-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0 1rem;
}

.project-filter {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.85);
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        transform 120ms ease-out,
        box-shadow 120ms ease-out,
        border-color 120ms ease-out,
        background 120ms ease-out,
        color 120ms ease-out;
}

.project-filter:hover,
.project-filter:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.95);
}

.project-filter.is-active {
    background: linear-gradient(120deg, #0ea5e9, #6366f1);
    border-color: rgba(56, 189, 248, 1);
    color: #0b1120;
}

.project-card {
    transition: opacity 140ms ease-out, transform 140ms ease-out;
}

/* Hidden cards should not take up layout space */
.project-card.is-hidden {
    display: none;
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

/* Hide sections whose grids have no visible cards */
.section-header.is-section-hidden,
.projects-grid.is-section-hidden {
    display: none;
}

/* Make in-page nav jumps land with headings visible below the fixed header */
#about,
#experience,
#projects,
#academics,
#contact {
    scroll-margin-top: 5rem;
    /* adjust if your header is taller/shorter */
}

/* Global text justification for main content */
main p,
main li,
main dd {
    text-align: justify;
    text-justify: inter-word;
}

.shell p,
.shell li,
.shell dd {
    text-align: justify;
    text-justify: inter-word;
}

/* Keep UI elements from being justified */
.site-nav a,
.tech-chip,
.button-linkedin,
.project-filter,
.zen-toggle,
.card-header h1,
.card-header h2,
.card-header h3 {
    text-align: left;
}