/* ══════════════════════════════
   PRELOAD GUARD
   ══════════════════════════════
   Blocks CSS transitions on the very first paint so elements like the
   hamburger bars and mobile dropdown never visibly animate/jitter into
   place before JS has finished syncing layout. Intentionally does NOT
   block `animation` — the hero's staggered entrance (`animation: reveal
   ... backwards`) relies on running immediately from first paint. Killing
   it here and letting it snap back on when the class is removed caused
   the hero to flash fully visible, blink to opacity:0, then fade back in.
   The class is removed by JS (double-rAF after window.load). */
.preload *,
.preload *::before,
.preload *::after {
    transition: none !important;
}

/* ══════════════════════════════
   METRIC-MATCHED FONT FALLBACK
   ══════════════════════════════
   Inter loads via Google Fonts with font-display: swap, so the browser
   paints text in a system fallback (Arial etc.) first, then swaps to
   Inter once it downloads. Because Inter's glyph metrics differ from
   Arial's, that swap visibly reflows/resizes text (the "glitch" on
   load). This synthetic @font-face resizes the local Arial fallback to
   match Inter's ascent/descent/width almost exactly, so the swap is
   dimensionally invisible even though the two fonts still look
   different stylistically. Values are the standard published Inter
   metric-override figures (same ones next/font uses under the hood). */
@font-face {
    font-family: 'Inter Fallback';
    src: local('Arial');
    ascent-override: 90.44%;
    descent-override: 22.52%;
    line-gap-override: 0%;
    size-adjust: 107.06%;
}

/* ═════════════════════════════
   DESIGN SYSTEM & VARIABLES
   ═════════════════════════════ */
:root {
    --primary-green: #09090b;
    /* Zinc 950 - deep black theme primary */
    --primary-green-hover: #27272a;
    /* Zinc 800 - dark charcoal theme primary hover */
    --accent-mint: #18181b;
    /* Zinc 900 - sleek accent dark gray/black */
    --accent-mint-light: #f4f4f5;
    /* Zinc 100 - light gray accent */
    --text-primary: #09090b;
    /* Zinc 950 - deep charcoal for text */
    --text-secondary: #52525b;
    /* Zinc 600 - medium gray for body text */
    --bg-light: #ffffff;
    --bg-gradient: linear-gradient(135deg, #f4f4f5 0%, #ffffff 50%, #e4e4e7 100%);
    /* Clean monochrome gradient */
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(9, 9, 11, 0.08);
    /* Minimalist subtle border */
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --card-shadow-hover: 0 20px 30px -5px rgba(0, 0, 0, 0.07), 0 12px 16px -8px rgba(0, 0, 0, 0.04);
    --font-sans: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --navbar-height: 72px;

    /* Hero load-up stagger. Kept as variables so the mobile media query
       below can slow the whole sequence down without touching each
       individual animation declaration. */
    --reveal-duration: 0.85s;
    --reveal-delay-1: 0.25s;
    --reveal-delay-2: 0.38s;
    --reveal-delay-3: 0.51s;
    --reveal-delay-4: 0.64s;
    --reveal-delay-5: 0.77s;
    --reveal-delay-6: 0.9s;
    --reveal-delay-7: 1.03s;
    --reveal-delay-8: 1.16s;
}

/* ══════════════════════════════
   GLOBAL RESETS & SCROLLBAR
   ══════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Removes the ~300ms tap delay and gray flash on tap for buttons/links on mobile */
a,
button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    /* Fallback matches the gradient's own tone (instead of transparent) so
       if .bg-fixed ever lags a frame behind during a fast scroll/bounce,
       what's revealed is this off-white, not stark browser-white. */
    background: #f4f4f5;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Locks background scroll while mobile menu is open (handles iOS touch/momentum scroll) */
body.menu-open {
    overflow: hidden;
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

.bg-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background: var(--bg-gradient);
    z-index: -10;
    transform: translateZ(0);
    backface-visibility: hidden;
    pointer-events: none;
}

/* Noise background removed for scroll performance */


::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-mint);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}

/* ══════════════════════════════
   NAVBAR (FIXED TOP)
   ══════════════════════════════  */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(9, 9, 11, 0.06);
    z-index: 200;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.02);
    transform: translateZ(0);
    /* Only background/blur/shadow animate on scroll (see .navbar-scrolled) —
       deliberately not padding/height, since --navbar-height is read from
       the navbar's rendered height in a few places (scroll-margin-top,
       Lenis's anchor-scroll offset) and a height that shifts on every
       scroll tick would throw those off by a few px. */
    transition: background 0.3s var(--ease-out-expo), box-shadow 0.3s var(--ease-out-expo);
}

.navbar.navbar-scrolled {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.12);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-symbol {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    display: block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(9, 9, 11, 0.08);
    border-radius: var(--radius-full);
    padding: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-full);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover {
    color: var(--primary-green);
    background: rgba(9, 9, 11, 0.04);
}

.nav-link.active {
    background: var(--primary-green);
    color: #ffffff;
}

.navbar-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-mint-light);
    border: 1px solid rgba(9, 9, 11, 0.1);
    border-radius: var(--radius-full);
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-green);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.navbar-status .dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-mint);
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.navbar-status .dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--accent-mint);
    animation: pulse-dot 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Navbar Right Wrapper */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Navbar Connect Socials */
.navbar-socials {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-social-btn {
    background: rgba(9, 9, 11, 0.04);
    border: 1px solid rgba(9, 9, 11, 0.08);
    border-radius: var(--radius-md);
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-green);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.navbar-social-btn:hover {
    background: var(--primary-green);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Hamburger Toggle Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-btn .bar {
    width: 100%;
    height: 2px;
    background-color: var(--primary-green);
    border-radius: 2px;
    transition: transform 0.3s var(--ease-out-expo), opacity 0.3s var(--ease-out-expo);
}

/* Mobile Dropdown Menu */
.mobile-menu {
    position: fixed;
    top: var(--navbar-height, 72px);
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(9, 9, 11, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transform: translate3d(0, -110%, 0);
    opacity: 0;
    /* visibility:hidden is the hard guarantee: on the very first paint a
       fixed + backdrop-filter element can appear at its untransformed
       position for one frame before the compositing layer is promoted.
       transform/opacity alone don't prevent that frame; visibility:hidden
       does, because nothing is rendered until it flips to visible.
       NOTE: will-change is intentionally omitted here — promoting the GPU
       layer in the closed/hidden state can race with visibility:hidden on
       some WebKit versions and cause the FOUC we are preventing. It is
       only applied when the menu is .active (see below). */
    visibility: hidden;
    transition: transform 0.4s var(--ease-out-expo), opacity 0.3s ease, visibility 0s linear 0.4s;
    z-index: 999;
    pointer-events: none;
}

.mobile-menu.active {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.4s var(--ease-out-expo), opacity 0.3s ease;
    pointer-events: all;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.25rem;
}

.mobile-nav-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    padding: 0.5rem 0;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary-green);
}

/* ══════════════════════════════
   HERO SECTION (TWO-COLUMN)
   ══════════════════════════════ */
#hero {
    position: relative;
    margin-top: var(--navbar-height, 72px);
    min-height: calc(100vh - var(--navbar-height, 72px));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    z-index: 1;
}

.hero-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 4rem;
    align-items: center;
}

.hero-profile-column {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    animation: reveal var(--reveal-duration) var(--ease-out-expo) var(--reveal-delay-1) backwards;
}

.profile-img-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 50%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
    /* Parallax transform is applied inline via JS as the hero scrolls
       past; will-change hints the browser to promote this to its own
       compositor layer so the motion stays on the GPU thread. */
    will-change: transform;
}

.profile-img-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid var(--accent-mint);
    opacity: 0.5;
    animation: pulse-border 3s ease-in-out infinite;
}

.profile-img {
    width: 16.5rem;
    height: 16.5rem;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    object-fit: cover;
    display: block;
}

.profile-img-wrapper .open-to-work-badge {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translate(-50%, 50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid var(--accent-mint);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-green);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    z-index: 10;
    white-space: nowrap;
}

.profile-img-wrapper .open-to-work-badge .dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-mint);
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.profile-img-wrapper .open-to-work-badge .dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--accent-mint);
    animation: pulse-dot 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.hero-text-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* See .profile-img-wrapper — same scroll-driven parallax transform. */
    will-change: transform;
}

.hero-greeting {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
    opacity: 1;
    animation: reveal var(--reveal-duration) var(--ease-out-expo) var(--reveal-delay-2) backwards;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 1rem;
    opacity: 1;
    animation: reveal var(--reveal-duration) var(--ease-out-expo) var(--reveal-delay-3) backwards;
}

.hero-tagline {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    opacity: 1;
    animation: reveal var(--reveal-duration) var(--ease-out-expo) var(--reveal-delay-4) backwards;
}

.hero-tagline span.highlight {
    color: var(--accent-mint);
    position: relative;
    display: inline-block;
}

.hero-tagline span.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(9, 9, 11, 0.12);
    border-radius: var(--radius-sm);
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2.2rem;
    opacity: 1;
    animation: reveal var(--reveal-duration) var(--ease-out-expo) var(--reveal-delay-5) backwards;
}

.hero-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    opacity: 1;
    animation: reveal var(--reveal-duration) var(--ease-out-expo) var(--reveal-delay-6) backwards;
}

/* ══════════════════════════════
   BUTTONS
   ══════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.2, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary-green);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.btn-primary:hover {
    background: var(--primary-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-secondary:hover {
    background: rgba(9, 9, 11, 0.04);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.btn-outline:hover {
    background: rgba(9, 9, 11, 0.04);
    border-color: var(--accent-mint);
    color: var(--primary-green);
}

/* "Let's talk" link — a low-key text-link alternative to a third full
   button under the hero CTAs, with a sliding arrow on hover. */
.hero-talk-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-green);
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 100% 1.5px;
    padding-bottom: 2px;
    opacity: 1;
    animation: reveal var(--reveal-duration) var(--ease-out-expo) var(--reveal-delay-7) backwards;
    transition: gap 0.2s ease;
}

.hero-talk-link:hover {
    gap: 0.6rem;
}

.hero-talk-link-arrow {
    transition: transform 0.2s ease;
}

.hero-talk-link:hover .hero-talk-link-arrow {
    transform: translateX(2px);
}

/* ══════════════════════════════
   QUICK OVERVIEW STRIP
   ══════════════════════════════ */
.overview-strip-container {
    width: 100%;
    max-width: 1100px;
    margin: 2.5rem auto 0;
    padding: 0;
    opacity: 1;
    animation: reveal var(--reveal-duration) var(--ease-out-expo) var(--reveal-delay-8) backwards;
}

.overview-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--card-shadow);
}

.overview-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding-right: 1rem;
}

.overview-item:not(:last-child) {
    border-right: 1px solid rgba(9, 9, 11, 0.06);
}

.overview-icon-box {
    background: var(--accent-mint-light);
    color: var(--primary-green);
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.overview-icon-box svg {
    width: 1.2rem;
    height: 1.2rem;
}

.overview-text {
    display: flex;
    flex-direction: column;
}

.overview-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.overview-val1 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.overview-val2 {
    font-size: 0.75rem;
    color: #6b7280;
}

/* ══════════════════════════════
   SECTION COMMONS
   ══════════════════════════════ */
.section {
    position: relative;
    padding: 6rem 2rem;
    z-index: 1;
    /* Anchor target for nav clicks / scrollIntoView. Keeps section content
       clear of the fixed navbar without relying on a hardcoded JS pixel
       offset, which was landing short of the target ("stuck in the
       middle") whenever the navbar's real height differed from the
       assumed value. */
    scroll-margin-top: calc(var(--navbar-height, 72px) + 8px);
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-mint);
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.section-title span {
    position: relative;
    display: inline-block;
    color: var(--primary-green);
}

/* Certifications heading only — "Verified Learning" label + title
   centered, unlike every other section's left-aligned heading. */
#certifications .section-label,
#certifications .section-title {
    text-align: center;
}

/* Scroll reveal helper */
/* No will-change here on purpose: with ~20+ .sr elements on the page,
   a persistent hint on every one of them promotes that many idle
   compositor layers for the entire scroll session, even for sections
   far below the fold that haven't revealed yet. Opacity/transform
   transitions already get auto-promoted by the browser the moment
   they actually start, so the layer only exists while it's needed. */
.sr {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
    transition: opacity 0.65s var(--ease-out-expo), transform 0.65s var(--ease-out-expo);
}

.sr.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sr-delay-1 {
    transition-delay: 0.12s;
}

.sr-delay-2 {
    transition-delay: 0.24s;
}

.sr-delay-3 {
    transition-delay: 0.36s;
}

/* ══════════════════════════════
   ABOUT SECTION
   ══════════════════════════════ */
.about-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    position: relative;
}

.about-card .corner-badge {
    position: absolute;
    top: -0.75rem;
    right: 1.5rem;
    background: var(--accent-mint);
    color: #ffffff;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.about-text p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ══════════════════════════════
   SKILLS SECTION (VISUAL STRIP)
   ══════════════════════════════ */
.skills-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Skills visual strip */
.skills-visual-strip {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    position: relative;
}

.skills-strip-header {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-green);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.25rem 1rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    text-transform: uppercase;
}

.skills-strip-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
    padding-top: 0.5rem;
}

.skill-badge {
    background: #ffffff;
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-md);
    padding: 0.55rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
}

.skill-badge:hover {
    transform: translateY(-2px);
    border-color: var(--accent-mint);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
}

.skill-badge svg,
.skill-badge img {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
}

/* Skills category grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    contain: layout style;
}

.skill-category {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-category:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.skill-cat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.skill-cat-icon {
    background: #ffffff;
    border: 1px solid rgba(9, 9, 11, 0.1);
    border-radius: 0.5rem;
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

.skill-cat-icon svg {
    width: 1.3rem;
    height: 1.3rem;
}

.skill-cat-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.skill-tag:hover {
    background: var(--accent-mint-light);
    border-color: var(--accent-mint);
    color: var(--primary-green);
}


/* ══════════════════════════════
   PROJECTS SECTION (GRID & CARDS)
   ══════════════════════════════ */

.projects-grid {
    display: grid;

    /* Final portfolio: 4 projects = 2 × 2 */
    grid-template-columns: repeat(2, minmax(0, 1fr));

    /* More breathing space between cards */
    gap: 2rem;

    /* Same visual width as Yash's portfolio */
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;

    contain: layout style;
}

.project-card {
    background: rgba(255, 255, 255, 0.92);

    /* Clean separation between cards */
    border: 1px solid #e2e5e9;

    border-radius: var(--radius-lg);
    overflow: hidden;

    display: flex;
    flex-direction: column;

    /* Softer, cleaner shadow */
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.055);

    transition:
        transform 0.25s cubic-bezier(0.2, 1, 0.3, 1),
        box-shadow 0.25s cubic-bezier(0.2, 1, 0.3, 1),
        border-color 0.25s ease;

    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);

    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);

    border-color: #d6dadd;

    will-change: transform;
}


/* ══════════════════════════════
   PROJECT IMAGE
   ══════════════════════════════ */

.project-card-image-wrapper {
    position: relative;

    height: 180px;
    aspect-ratio: 16 / 9;

    overflow: hidden;

    /* Slightly separated image area */
    background: #f6f7f8;

    /* Subtle divider between image and content */
    border-bottom: 1px solid #e5e7eb;

    contain: paint;
}

.project-card-image {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.4s var(--ease-out-expo);
}

.project-card:hover .project-card-image {
    transform: scale(1.05);

    will-change: transform;
}


/* ══════════════════════════════
   PROJECT BADGE
   ══════════════════════════════ */

.project-card-badge {
    position: absolute;

    top: 1rem;
    left: 1rem;

    background: var(--primary-green);
    color: #ffffff;

    font-size: 0.75rem;
    font-weight: 700;

    padding: 0.25rem 0.75rem;

    border-radius: var(--radius-sm);

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}


/* ══════════════════════════════
   GITHUB ICON
   ══════════════════════════════ */

.project-card-github {
    position: absolute;

    top: 1rem;
    right: 1rem;

    background: rgba(255, 255, 255, 0.92);

    border-radius: 50%;

    width: 2.2rem;
    height: 2.2rem;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-primary);

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease,
        opacity 0.15s ease;

    opacity: 0.7;
}

.project-card-github:hover {
    background: #ffffff;
    color: var(--accent-mint);

    transform: scale(1.1);

    opacity: 1;
}


/* ══════════════════════════════
   PROJECT CONTENT
   ══════════════════════════════ */

.project-card-content {
    padding: 1.5rem;

    display: flex;
    flex-direction: column;

    flex-grow: 1;
}

.project-card-title {
    font-size: 1.2rem;
    font-weight: 800;

    letter-spacing: -0.01em;

    color: var(--text-primary);

    margin-bottom: 0.5rem;
}

.project-card-tags {
    display: flex;
    flex-wrap: wrap;

    gap: 0.4rem;

    margin-bottom: 0.75rem;
}

.project-card-tag {
    background: rgba(9, 9, 11, 0.04);

    border: 1px solid rgba(9, 9, 11, 0.08);

    color: var(--primary-green);

    font-size: 0.7rem;
    font-weight: 700;

    padding: 0.15rem 0.45rem;

    border-radius: var(--radius-sm);
}

.project-card-description {
    font-size: 0.9rem;

    color: var(--text-secondary);

    line-height: 1.5;

    margin-bottom: 1.25rem;

    flex-grow: 1;
}


/* ══════════════════════════════
   PROJECT STATS
   ══════════════════════════════ */

.project-card-stats {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 0.75rem;

    padding-top: 0.75rem;

    margin-bottom: 1.25rem;

    border-top: 1px solid rgba(9, 9, 11, 0.07);
}

.project-card-stat {
    display: flex;
    flex-direction: column;
}

.project-card-stat-val {
    font-size: 0.95rem;
    font-weight: 700;

    color: var(--primary-green);
}

.project-card-stat-label {
    font-size: 0.75rem;

    color: #6b7280;
}


/* ══════════════════════════════
   PROJECT CARD FOOTER & BUTTONS
   ══════════════════════════════ */

.project-card-footer {
    display: flex;
    flex-direction: column;

    gap: 0.5rem;

    margin-top: auto;
}

.project-card-btn {
    width: 100%;

    min-height: 44px;

    border-radius: 0.75rem;

    font-size: 0.88rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    text-decoration: none;

    font-weight: 700;
}

.github-repo-btn {
    background: rgba(255, 255, 255, 0.85);

    color: var(--primary-green);

    border: 2px solid rgba(9, 9, 11, 0.8);

    transition:
        background-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.github-repo-btn:hover {
    background: var(--accent-mint-light);

    transform: translateY(-2px);

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}


/* ══════════════════════════════
   PROJECTS RESPONSIVE
   ══════════════════════════════ */

@media (max-width: 1024px) {

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

        gap: 1.75rem;
    }

}


@media (max-width: 768px) {

    .projects-grid {
        grid-template-columns: 1fr;

        gap: 1.25rem;

        max-width: 100%;
    }

}

/* ══════════════════════════════
   CERTIFICATIONS SECTION
   Desktop/tablet: plain static grid, all cards visible, no motion.
   Mobile only (media query further down): swipeable snap-carousel.
   ══════════════════════════════ */
.certs-marquee {
    position: relative;
}

.certs-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 3.5rem;
    padding-inline: 3.5rem;
    padding-block: 0.5rem;
    scrollbar-width: none;
    contain: layout style;
    overscroll-behavior-x: contain;
}

@media (prefers-reduced-motion: reduce) {
    .certs-grid {
        scroll-behavior: auto;
    }
}

.certs-grid::-webkit-scrollbar {
    display: none;
}

/* Prev/next arrow buttons for the carousel. */
.certs-nav {
    display: flex;
    position: absolute;
    top: 42%;
    z-index: 10;
    width: 2.5rem;
    height: 3.5rem;
    align-items: center;
    justify-content: center;
    background: var(--primary-green);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: background 0.15s ease, transform 0.15s ease;
}

.certs-nav:hover,
.certs-nav:focus-visible {
    background: var(--primary-green-hover);
}

.certs-nav:active {
    transform: translateY(-50%) scale(0.92);
}

.certs-nav-prev {
    left: 0.4rem;
    transform: translateY(-50%);
}

.certs-nav-next {
    right: 0.4rem;
    transform: translateY(-50%);
}


.cert-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    transition: transform 0.25s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.2, 1, 0.3, 1);
    cursor: pointer;
    /* Matches .project-card-image-wrapper: isolates the hover-triggered
       image scale so its repaint stays inside this card instead of
       being considered against the rest of the grid. */
    contain: paint;
    /* Fixed carousel width (overridden with a viewport-relative width on
       phones below) — flex-shrink:0 keeps every card at full size instead
       of squashing to fit the row, which is what made 5 cards look small
       in the old grid. */
    flex: 0 0 300px;
    width: 300px;
    scroll-snap-align: start;
}

.cert-card:hover,
.cert-card:focus-visible {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
    will-change: transform;
}

.cert-card:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.cert-card-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e2e8f0;
}

.cert-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s var(--ease-out-expo);
}

.cert-card:hover .cert-card-image,
.cert-card:focus-visible .cert-card-image {
    transform: scale(1.05);
    will-change: transform;
}

.cert-card-badge {
    /* Reuses .project-card-badge positioning/typography; only overrides needed */
    z-index: 2;
}

.cert-card-scrim {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(9, 9, 11, 0) 40%, rgba(9, 9, 11, 0.55) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.cert-card:hover .cert-card-scrim,
.cert-card:focus-visible .cert-card-scrim {
    opacity: 1;
}

.cert-card-view-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ffffff;
    color: var(--primary-green);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(8px);
    transition: transform 0.25s ease;
}

.cert-card:hover .cert-card-view-pill,
.cert-card:focus-visible .cert-card-view-pill {
    transform: translateY(0);
}

.cert-card-body {
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cert-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--text-primary);
    /* Long certificate names (e.g. "Complete Guide to Power BI for Data
       Analysts") clamp to 2 lines with an ellipsis instead of wrapping
       indefinitely and stretching the card taller than its neighbours. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cert-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.cert-card-dot {
    opacity: 0.5;
}

/* ══════════════════════════════
   CERTIFICATE LIGHTBOX (left image / right info, no scroll)
   ══════════════════════════════ */
.cert-modal-box {
    max-width: 1040px;
    width: 92vw;
    max-height: 88vh;
    position: relative;
    overflow: hidden;
}

.cert-modal-close-btn {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 5;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.cert-modal-close-btn:hover {
    background: #ffffff;
}

.cert-modal-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    max-height: 88vh;
    overflow: hidden;
}

.cert-modal-image-col {
    flex: 1.15;
    min-width: 0;
    background: #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.75rem;
}

.cert-modal-image {
    max-width: 100%;
    max-height: calc(88vh - 3.5rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12);
}

.cert-modal-info-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding: 2.5rem 2.5rem 2.5rem 1.25rem;
    overflow-y: auto;
}

.cert-modal-heading {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.cert-modal-issuer-tag {
    align-self: flex-start;
    background: var(--accent-mint-light);
    color: var(--primary-green);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
}

.cert-modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--text-primary);
}

.cert-modal-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.cert-modal-skills {
    width: 100%;
}

.cert-modal-skills-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
}

.cert-modal-skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cert-modal-skill-tag {
    background: rgba(9, 9, 11, 0.04);
    border: 1px solid rgba(9, 9, 11, 0.08);
    color: var(--primary-green);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* ══════════════════════════════
   CONTACT SECTION (TWO-COLUMN)
   ══════════════════════════════ */
.contact-section {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

#hero {
    /* Must match #hero's own margin-top (navbar height) — not 0 — or
       scrollIntoView (used by the "Home" nav click) overscrolls by the
       navbar's height and tucks hero content under the fixed navbar
       instead of landing at the natural top-of-page position. */
    scroll-margin-top: var(--navbar-height, 72px);
}

.contact-layout {
    display: grid;
    grid-template-columns: 0.9fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.contact-left {
    max-width: 460px;
}

.contact-left p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.contact-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(244, 244, 245, 0.85));
    border: 1px solid rgba(9, 9, 11, 0.1);
    border-radius: 1.25rem;
    padding: 1.75rem 1.75rem 1rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.09);
    width: 100%;
}

.contact-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.contact-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* Contact info list (left column) — full email + LinkedIn id, industry-standard style */
.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.75rem;
    max-width: 380px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(9, 9, 11, 0.1);
    border-radius: 0.9rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.contact-info-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-mint);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.contact-info-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-info-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: left;
    min-width: 0;
}

.contact-info-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.contact-info-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Contact form (right column) */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: left;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.form-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.char-counter {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.char-counter.char-counter-warn {
    color: #dc2626;
}

.form-group input,
.form-group textarea {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 0.96rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(9, 9, 11, 0.14);
    border-radius: 0.6rem;
    padding: 0.6rem 0.8rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(82, 82, 91, 0.6);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.08);
}

.form-group input.invalid,
.form-group textarea.invalid {
    border-color: #dc2626;
}

.form-group input.invalid:focus,
.form-group textarea.invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field-error {
    display: block;
    min-height: 0.95em;
    font-size: 0.76rem;
    font-weight: 600;
    color: #dc2626;
}

/* Honeypot — visually hidden, still reachable by bots that fill every field */
.form-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.contact-submit-btn {
    width: 100%;
    /* Base .btn padding (0.75rem 1.6rem) reads oversized on a full-width
       button sitting right under compact form fields (0.55rem padding).
       Trim it down and tighten the label so it lines up visually with the
       rest of the form instead of towering over it. */
    padding: 0.7rem 1.5rem;
    font-size: 0.94rem;
    margin-top: 0.15rem;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.2, 1, 0.3, 1), background-color 0.2s ease, opacity 0.2s ease;
}

.contact-submit-btn .btn-label {
    transition: opacity 0.15s ease;
}

.contact-submit-btn .btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -9px;
    margin-top: -9px;
    animation: spin 0.7s linear infinite;
}

.contact-submit-btn.is-loading {
    cursor: progress;
}

.contact-submit-btn.is-loading .btn-label {
    opacity: 0;
}

.contact-submit-btn.is-loading .btn-spinner {
    display: block;
}

.contact-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.85;
    transform: none;
}

.form-status {
    margin: 0;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, max-height 0.2s ease, margin-top 0.2s ease;
}

.form-status.show {
    opacity: 1;
    max-height: 2em;
    margin-top: 0.4rem;
}

.form-status.success {
    color: #16a34a;
}

.form-status.error {
    color: #dc2626;
}

/* ══════════════════════════════
   FOOTER (STRONG / DARK GREEN)
   ══════════════════════════════ */
footer {
    background: var(--primary-green);
    color: #ffffff;
    padding: 4rem 2rem 2.5rem;
    z-index: 10;
    position: relative;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: #ffffff;
}

.footer-logo-symbol {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.footer-description {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    max-width: 500px;
    line-height: 1.6;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.footer-links-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
}

.footer-socials {
    display: flex;
    gap: 0.85rem;
}

.footer-social-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.footer-social-btn:hover {
    background: #ffffff;
    color: var(--primary-green);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.footer-social-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ══════════════════════════════
   MODAL OVERLAY & CONTENT
   ══════════════════════════════ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(9, 9, 11, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    transform: translateZ(0);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #ffffff;
    border: 1px solid rgba(9, 9, 11, 0.1);
    border-radius: var(--radius-lg);
    width: 90vw;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    transform: scale(0.95) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .modal-box {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-header-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-header-title .project-tag {
    align-self: flex-start;
    background: var(--accent-mint-light);
    color: var(--primary-green);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

#modalProjectTitle {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close-btn {
    background: rgba(0, 0, 0, 0.03);
    border: none;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
    /* Momentum scroll on iOS + stop rubber-banding from chaining to the
       page behind the modal, which otherwise feels janky on touch. */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* ══════════════════════════════
   RESUME PREVIEW MODAL
   ══════════════════════════════ */
.resume-modal-box {
    max-width: 900px;
    width: 92vw;
    height: 85vh;
    max-height: 900px;
}

.resume-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.resume-iframe-wrapper {
    position: relative;
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.resume-iframe {
    flex-grow: 1;
    width: 100%;
    min-height: 0;
    border: 1px solid rgba(9, 9, 11, 0.08);
    border-radius: var(--radius-md);
    background: var(--accent-mint-light);
}

/* Sits over the iframe while the PDF is loading, matching the spinner
   pattern already used for project-README fetches (.modal-loader +
   .spinner) so the resume preview doesn't feel like a blank/broken box
   on slower connections. Hidden on the iframe's load event via JS. */
.resume-iframe-loader {
    position: absolute;
    inset: 0;
    background: var(--accent-mint-light);
    border-radius: var(--radius-md);
    padding: 0;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.resume-iframe-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.resume-fallback-note {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.5rem;
}

.resume-modal-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.resume-modal-actions .btn {
    flex: 1 1 auto;
    min-width: 180px;
}

@media (max-width: 640px) {

    /* Modal was rendering flush against the fixed navbar on mobile since it
       was vertically centered in the full viewport. Anchor it below the
       navbar instead, with a clear gap, and cap height to the remaining
       space so it never gets clipped at the bottom either. */
    .modal-overlay {
        align-items: flex-start;
        padding-top: calc(var(--navbar-height, 72px) + 1rem);
        padding-bottom: 1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .modal-box {
        width: 100%;
        max-height: calc(100vh - var(--navbar-height, 72px) - 2rem);
        max-height: calc(100dvh - var(--navbar-height, 72px) - 2rem);
    }

    .resume-modal-box {
        width: 100%;
        height: calc(100vh - var(--navbar-height, 72px) - 2rem);
        height: calc(100dvh - var(--navbar-height, 72px) - 2rem);
        max-height: calc(100vh - var(--navbar-height, 72px) - 2rem);
        max-height: calc(100dvh - var(--navbar-height, 72px) - 2rem);
    }

    .resume-modal-actions {
        flex-direction: column;
    }

    .resume-modal-actions .btn {
        width: 100%;
    }
}

.modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    gap: 1rem;
    color: var(--text-secondary);
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(9, 9, 11, 0.08);
    border-top: 3px solid var(--accent-mint);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.modal-markdown {
    line-height: 1.6;
    color: var(--text-secondary);
    /* Long unbroken tokens (raw URLs, badge chains, long filenames pulled in
       from READMEs) were wider than the modal on mobile and forced the whole
       modal-body into horizontal scroll. Let them wrap instead. */
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.modal-markdown h1,
.modal-markdown h2,
.modal-markdown h3 {
    color: var(--text-primary);
    font-weight: 800;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-markdown h1 {
    font-size: 1.6rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 0.35rem;
}

.modal-markdown h2 {
    font-size: 1.3rem;
}

.modal-markdown h3 {
    font-size: 1.1rem;
}

.modal-markdown p {
    margin-bottom: 1rem;
}

.modal-markdown ul,
.modal-markdown ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.modal-markdown li {
    margin-bottom: 0.25rem;
}

.modal-markdown code {
    background: #f3f4f6;
    color: var(--primary-green);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.88em;
}

.modal-markdown pre {
    background: #f9fafb;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 1rem;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.modal-markdown pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.modal-markdown table {
    /* Wide tables (many columns) were forcing the whole modal-body wider
       than the screen instead of scrolling on their own. display:block lets
       the table become its own horizontally-scrollable region. */
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.modal-markdown th,
.modal-markdown td {
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.modal-markdown th {
    background: #f9fafb;
    font-weight: 700;
}

.modal-markdown blockquote {
    border-left: 4px solid var(--accent-mint);
    background: var(--accent-mint-light);
    color: var(--primary-green);
    padding: 0.75rem 1.25rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 1rem;
}

.modal-markdown img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.modal-repo-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-repo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-green);
    color: #ffffff;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.modal-repo-btn:hover {
    background: var(--primary-green-hover);
    transform: translateY(-1px);
}

/* ══════════════════════════════
   TOAST
   ══════════════════════════════ */
#toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translate3d(-50%, 15px, 0);
    opacity: 0;
    pointer-events: none;
    background: var(--primary-green);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.3s ease;
}

#toast.show {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
    pointer-events: auto;
}

#toast.toast-error {
    background: #dc2626;
}

/* ══════════════════════════════
   BACK TO TOP
   ══════════════════════════════ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-green);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out-expo), visibility 0.3s, background 0.15s ease;
    z-index: 500;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* While any modal is open, the floating back-to-top button sits above it
   (z-index 500 vs 300) and can overlap/block the modal's action buttons,
   especially on mobile where space is tight. Hide it while a modal is open. */
.modal-overlay.show~#backToTop {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.back-to-top:hover {
    background: var(--primary-green-hover);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Performance: backdrop-filter on a sticky/fixed element forces a re-blur
   on every scroll frame — expensive on phones. Swap to a near-opaque solid
   background on touch devices so scrolling stays smooth. */
@media (max-width: 768px),
(hover: none) and (pointer: coarse) {
    .navbar {
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .mobile-menu {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .modal-overlay {
        background: rgba(9, 9, 11, 0.45);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* ══════════════════════════════
   ANIMATIONS & TRANSITIONS
   ══════════════════════════════ */
@keyframes reveal {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes pulse-border {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes pulse-dot {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ══════════════════════════════
   RESPONSIVE MEDIA QUERIES
   ══════════════════════════════ */
@media (max-width: 1024px) {

    /* Intermediate tablet: tighten section vertical rhythm */
    .section {
        padding: 5rem 1.5rem;
    }

    .hero-grid {
        gap: 2.5rem;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .overview-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .overview-item:nth-child(2) {
        border-right: none;
    }

    .overview-item:nth-child(even) {
        padding-left: 0.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1.2fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {

    /* Slow the hero load-up stagger down on mobile. Same 8-step sequence
       as desktop, just stretched out — a bigger starting delay so the
       page has a beat to settle before anything moves, and wider gaps
       between each element so the reveal reads as a stagger instead of
       everything popping in almost at once. */
    :root {
        --navbar-height: 60px;
        --reveal-duration: 1s;
        --reveal-delay-1: 0.35s;
        --reveal-delay-2: 0.5s;
        --reveal-delay-3: 0.65s;
        --reveal-delay-4: 0.8s;
        --reveal-delay-5: 0.95s;
        --reveal-delay-6: 1.1s;
        --reveal-delay-7: 1.25s;
        --reveal-delay-8: 1.4s;
    }

    /* Mobile section vertical rhythm */
    .section {
        padding: 3.5rem 1.25rem;
    }

    .navbar {
        padding: 0.75rem 1rem;
        z-index: 1000;
    }

    .nav-pill {
        display: none;
        /* Hide center links on tablet/mobile */
    }

    .hamburger-btn {
        display: flex;
        /* Show hamburger button */
    }

    .navbar-right {
        gap: 0.6rem;
    }

    .navbar-socials {
        gap: 0.4rem;
    }

    /* Increase touch target to meet 44px standard */
    .navbar-social-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    .navbar-social-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Hamburger to X state toggles */
    .hamburger-btn.active .bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .hamburger-btn.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.active .bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    #hero {
        padding: 2.5rem 1rem 3rem;
        min-height: auto;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .hero-profile-column {
        order: 1;
        margin-bottom: 0;
    }

    .hero-text-column {
        order: 2;
        align-items: center;
    }

    .profile-img-wrapper {
        width: 180px;
        height: 180px;
        padding: 8px;
    }

    .profile-img {
        width: 100%;
        height: 100%;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-cta-group {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 0.5rem;
    }

    /* Only widen buttons inside the hero CTA group on mobile.
       Scoping prevents modal, contact card, and footer buttons from
       being forced full-width where they should not be. */
    .hero-cta-group .btn {
        width: 100%;
        justify-content: center;
    }

    .about-card {
        padding: 1.5rem;
    }

    .overview-strip {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .overview-item {
        border-right: none !important;
        padding-right: 0;
        padding-bottom: 0.75rem;
    }

    .overview-item:not(:last-child) {
        border-bottom: 1px solid rgba(9, 9, 11, 0.06);
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .cert-card {
        flex-basis: 82vw;
        width: 82vw;
        max-width: 300px;
        /* Without this, flexbox's default flex-shrink:1 squashes all 4
           cards to cram them into one screen width instead of letting
           them keep their intended size and scroll horizontally — that
           squashing is what causes the cramped, word-wrapped cards and
           the nav arrow swallowing half the first card. */
        flex-shrink: 0;
        scroll-snap-align: center;
    }

    /* Phone-specific tuning: tighter edge padding and viewport-relative
       card width than the shared desktop/tablet carousel above (which uses
       a fixed 300px card and wider edge padding for the arrow buttons).

       The scroll container is .certs-grid, NOT .certs-marquee — the prev/
       next buttons live inside .certs-marquee alongside .certs-grid, so if
       .certs-marquee itself were the scrolling element, the buttons (its
       direct descendants) would scroll along with the cards instead of
       staying pinned to the left/right edges. Keeping .certs-marquee
       static and scoping the scroll to .certs-grid alone is what keeps the
       buttons fixed in place while only the cards move. */
    .certs-marquee {
        cursor: default;
    }

    .certs-grid {
        width: 100%;
        min-width: 0;
        -webkit-overflow-scrolling: touch;
        scroll-padding-inline: 1.25rem;
        padding-inline: 1.25rem;
        gap: 1.25rem;
        scrollbar-width: none;
        /* Contain the horizontal swipe to this carousel only — without
           this, hitting the first/last card and continuing to swipe can
           chain into the page's own vertical bounce, which is what was
           flashing a white box in the background. */
        overscroll-behavior-x: contain;
    }

    .certs-grid::-webkit-scrollbar {
        display: none;
    }

    /* Certificate lightbox: side-by-side doesn't fit narrow screens,
       so stack image above info. Image height is capped to leave the
       info column (title + skills + button) visible without the box
       exceeding the viewport; overflow-y on the info column is a
       fallback only for unusually long content, not the normal case. */
    .cert-modal-box {
        width: 94vw;
        max-height: 92vh;
    }

    .cert-modal-body {
        flex-direction: column;
        max-height: 92vh;
        overflow-y: auto;
    }

    .cert-modal-image-col {
        padding: 1.25rem 1.25rem 0.75rem;
        flex: none;
    }

    .cert-modal-image {
        max-height: 34vh;
    }

    .cert-modal-info-col {
        padding: 1rem 1.5rem 1.5rem;
        gap: 1.1rem;
        overflow-y: visible;
    }

    .cert-modal-title {
        font-size: 1.2rem;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .contact-left {
        max-width: 100%;
    }

    .contact-left p {
        margin-top: 1rem;
    }

    .contact-card {
        padding: 1.5rem 1.25rem 1.25rem;
        max-width: 100%;
        margin-left: 0;
    }

    .contact-info-list {
        max-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-left,
    .footer-right {
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }
}

/* Tablet-only modal sizing. Scoped to 641-768px so it never overrides the
   navbar-aware, viewport-capped .modal-box rules set for phones (<=640px)
   further up the file — that collision was pushing modal content (e.g. the
   "View Repository" button) below the visible viewport on mobile. */
@media (min-width: 641px) and (max-width: 768px) {
    .modal-box {
        width: 95vw;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    :root {
        --navbar-height: 56px;
    }

    .navbar {
        padding: 0.6rem 1rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .navbar-status {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }

    .hero-title {
        font-size: 2.1rem;
    }

    .hero-tagline {
        font-size: 1.15rem;
    }

    /* Allow badges to wrap naturally instead of forcing 2-col grid:
       long badge names (PostgreSQL, Matplotlib) would get squeezed. */
    .skills-strip-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .skill-badge {
        padding: 0.45rem 0.9rem;
        font-size: 0.82rem;
    }

    /* Proportional heading scale for small phones */
    .section-title {
        font-size: 1.85rem;
        margin-bottom: 2rem;
    }

    /* "Certifications & Credentials" is long enough to wrap to two lines
       at the regular mobile heading size — scale it down with the
       viewport instead so it always stays on one line. */
    #certifications .section-title {
        font-size: clamp(1.05rem, 6.5vw, 1.85rem);
        white-space: nowrap;
    }

    .hero-description {
        font-size: 1rem;
    }

    .mobile-nav-links {
        padding: 1.25rem 1.5rem;
    }
}

@media (max-width: 390px) {
    :root {
        --navbar-height: 50px;
    }

    .navbar {
        padding: 0.5rem 0.75rem;
    }

    .logo-text {
        font-size: 0.9rem;
    }

    .navbar-right {
        gap: 0.4rem;
    }

    .navbar-socials {
        gap: 0.3rem;
    }

    .navbar-social-btn {
        width: 1.8rem;
        height: 1.8rem;
    }

    .navbar-status {
        padding: 0.3rem 0.6rem;
    }

    .navbar-status span:last-child {
        display: none;
        /* Hide "Open to Work" text on small devices */
    }

    .navbar-status::after {
        content: 'Open';
        font-size: 0.75rem;
        font-weight: 600;
    }

    .profile-img-wrapper {
        width: 170px;
        height: 170px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }
}

/* ══════════════════════════════
   PERFORMANCE OPTIMIZATIONS
   ══════════════════════════════ */
/* Performance optimizations - keep GPU compositing minimal to avoid memory thrashing on mobile */
.mobile-menu.active {
    will-change: transform, opacity;
}

#projects {
    padding-bottom: 3.5rem;
}

/* Touch device hover optimization: prevent hover styles from sticking or jittering after tap on touch screens */
@media (hover: none) and (pointer: coarse) {
    .project-card:hover {
        transform: none;
        box-shadow: var(--card-shadow);
    }

    .project-card:hover .project-card-image {
        transform: none;
    }

    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-outline:hover,
    .back-to-top:hover {
        transform: none;
    }
}
