/* ═══════════════════════════════════════════════════════════
   WELDER PORTFOLIO — Premium Dark Industrial Theme
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-surface: #161616;
    --bg-surface-hover: #1e1e1e;
    --bg-sidebar: #0e0e0e;

    --accent: #c8891a;
    --accent-light: #e8a838;
    --accent-dim: #a06e10;
    --accent-glow: rgba(200, 137, 26, 0.10);
    --accent-glow-strong: rgba(200, 137, 26, 0.25);

    --text-primary: #eaeaea;
    --text-secondary: #999999;
    --text-tertiary: #5a5a5a;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(200, 137, 26, 0.3);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(200, 137, 26, 0.08);

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s ease;
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    --sidebar-width: 260px;
    --header-height: 56px;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

img {
    display: block;
    max-width: 100%;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

/* ── Layout ────────────────────────────────────────────── */
.layout {
    display: flex;
    max-width: 1140px;
    margin: 0 auto;
    width: 100%;
    padding: 56px 36px 72px;
    gap: 44px;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 36px;
    height: fit-content;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    background: transparent;
    border-right: none;
    z-index: 10;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
    padding-right: 8px;
}

/* Custom slim auto-hiding scrollbar for sidebar (3px) */
.sidebar::-webkit-scrollbar {
    width: 3px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 99px;
    transition: background 0.3s ease;
}

/* Appears on hover or while scrolling */
.sidebar:hover::-webkit-scrollbar-thumb,
.sidebar.has-scroll-activity::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
}

.sidebar.has-scroll-activity,
.sidebar:hover {
    scrollbar-color: var(--text-tertiary) transparent;
}


.sidebar-inner {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 4px;
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.profile-title {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.profile-bio p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 12px;
}

.profile-bio p:last-child {
    margin-bottom: 0;
}

/* ── Certifications & Contact Headings ─────────────────── */
.section-label {
    font-family: var(--font-heading);
    font-size: 0.64rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}

.certifications {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent-light);
    background: var(--accent-glow);
    border: 1px solid var(--border-accent);
    border-radius: 100px;
    letter-spacing: 0.02em;
    transition: all var(--transition);
}

.cert-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.cert-badge:hover {
    background: var(--accent-glow-strong);
    transform: translateY(-1px);
}

/* ── Contact Actions ───────────────────────────────────── */
.contact-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
    max-width: 100%;
}

.contact-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-btn .contact-icon,
.contact-btn svg {
    width: 17px;
    height: 17px;
    object-fit: contain;
    flex-shrink: 0;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: 0.3s;
}

.contact-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
    color: var(--text-primary);
}

.contact-btn:hover .contact-icon,
.contact-btn:hover svg,
.contact-btn .contact-icon:hover {
    filter: grayscale(0%);
    opacity: 1;
}

.contact-btn.whatsapp:hover {
    border-color: #25d366;
    box-shadow: 0 0 16px rgba(37, 211, 102, 0.12);
}

.contact-btn.email:hover {
    border-color: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
}

.contact-btn.phone:hover {
    border-color: #5a8fa8;
    box-shadow: 0 0 16px rgba(90, 143, 168, 0.12);
}

/* ── Sidebar Footer ────────────────────────────────────── */
.sidebar-footer {
    margin-top: auto;
    padding-top: 28px;
}

.copyright {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
}

/* ── Mobile Footer (hidden on desktop) ─────────────────── */
.mobile-footer {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   GALLERY
   ═══════════════════════════════════════════════════════════ */

.gallery-wrapper {
    flex: 1;
    min-width: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ── Gallery Header / Filters ──────────────────────────── */
.gallery-header {
    position: sticky;
    top: 0;
    z-index: 9;
    background: linear-gradient(to bottom, var(--bg-primary) 70%, transparent);
    padding: 6px 0 24px;
    margin-bottom: 6px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 28px;
}

.filter-pill {
    padding: 6px 0;
    font-size: 0.84rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: color var(--transition-fast);
    letter-spacing: 0.02em;
    user-select: none;
    position: relative;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

.filter-pill:hover {
    color: var(--text-primary);
    background: transparent;
}

.filter-pill.active {
    color: var(--accent-light);
    background: transparent;
    font-weight: 600;
}

.filter-pill::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: width var(--transition-fast);
}

.filter-pill:hover::after {
    width: 50%;
    background: var(--text-tertiary);
}

.filter-pill.active::after {
    width: 100%;
    background: var(--accent);
}

/* ── Masonry Grid ──────────────────────────────────────── */
.gallery-masonry {
    column-count: 2;
    column-gap: 28px;
    padding: 0 0 40px;
}

.gallery-card {
    break-inside: avoid;
    margin-bottom: 28px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    position: relative;
    transition: all var(--transition);
}

.gallery-card .image-wrapper {
    position: relative;
    overflow: hidden;
}

.gallery-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.gallery-card img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: filter var(--transition);
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
}

.gallery-card:hover img {
    filter: brightness(1.05);
}

.card-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 0.6rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(14, 14, 14, 0.42);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    z-index: 2;
    pointer-events: none;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-fast);
}

.gallery-card:hover .card-tag {
    color: #ffffff;
    background: rgba(14, 14, 14, 0.62);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-info {
    padding: 16px 20px 6px;
}

.card-info h3 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.card-desc {
    padding: 6px 20px 18px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── YouTube Embed ─────────────────────────────────────── */
.gallery-card-video .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}

.gallery-card-video .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── YouTube Shorts (9:16 portrait) ───────────────────── */
.gallery-card-video .video-wrapper.video-shorts {
    padding-bottom: 177.78%; /* 16/9 * 100 = 9:16 ratio */
}

/* ── Video Facade (Carrd-style Clean Poster + Play Button) ── */
.gallery-card-video .video-wrapper.video-facade {
    cursor: pointer;
    background: #0d0d0d;
}

.gallery-card-video .video-wrapper.video-facade .video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.35s ease, filter 0.35s ease;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.gallery-card-video:hover .video-wrapper.video-facade:not(.is-playing) .video-poster {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.gallery-card-video .video-wrapper.video-facade::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.3) 100%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gallery-card-video .video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease, filter 0.2s ease;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.6));
}

.gallery-card-video .video-play-btn svg {
    width: 100%;
    height: 100%;
    display: block;
}

.gallery-card-video:hover .video-play-btn {
    transform: translate(-50%, -50%) scale(1.12);
    color: #e8a838;
    filter: drop-shadow(0 6px 18px rgba(200,137,26,0.5));
}

.gallery-card-video .video-wrapper.video-facade.is-playing::before,
.gallery-card-video .video-wrapper.video-facade.is-playing .video-play-btn,
.gallery-card-video .video-wrapper.video-facade.is-playing .video-poster {
    display: none !important;
}

/* ── Disable iframe pointer events during drag ────────── */
body.is-dragging .gallery-card-video iframe {
    pointer-events: none;
}

/* ── Empty State ───────────────────────────────────────── */
.gallery-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    color: var(--text-tertiary);
}

.empty-icon {
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-icon svg {
    stroke: var(--text-tertiary);
}

.empty-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-sub {
    font-size: 0.85rem;
    max-width: 320px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════════════ */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    animation: lightboxIn 0.3s ease;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

@keyframes lightboxIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-content img {
    max-width: min(80vw, 860px);
    max-height: 60vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    flex-shrink: 1;
    min-height: 0;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
}

.lightbox-info {
    margin-top: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    max-width: 620px;
    width: 100%;
    padding: 0 16px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.lightbox-info:empty {
    display: none;
    margin: 0;
}

.lightbox-info h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.lightbox-info p {
    line-height: 1.5;
    margin: 0;
}

.lightbox-info .lightbox-tag {
    display: inline-block;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    padding: 4px 11px;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 8px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 1002;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    color: var(--text-primary);
    transition: all var(--transition);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.16);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    color: var(--text-primary);
    transition: all var(--transition);
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.14);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: toastIn 0.4s var(--transition), toastOut 0.3s ease 2.7s forwards;
    white-space: nowrap;
}

.toast.success {
    border-color: rgba(37, 211, 102, 0.3);
    background: linear-gradient(135deg, var(--bg-surface), rgba(37, 211, 102, 0.05));
}

.toast.error {
    border-color: rgba(255, 80, 80, 0.3);
    background: linear-gradient(135deg, var(--bg-surface), rgba(255, 80, 80, 0.05));
}

@keyframes toastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* Tablet & small desktop */
@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
        gap: 40px;
        padding: 44px 28px 64px;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: none;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 36px;
        padding-right: 0;
    }

    .sidebar-inner {
        padding: 0;
    }

    /* Hide sidebar footer in mobile/tablet mode */
    .sidebar-footer {
        display: none !important;
    }

    /* Show mobile footer at the very bottom of the page, below all gallery assets */
    .mobile-footer {
        display: block;
        padding: 32px 0 20px;
        text-align: center;
        border-top: 1px solid var(--border);
        margin-top: 32px;
    }

    .profile-name {
        font-size: 1.8rem;
    }

    .gallery-masonry {
        column-count: 2;
        column-gap: 24px;
        padding: 0 0 32px;
    }

    .gallery-card {
        margin-bottom: 24px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .layout {
        padding: 28px 18px 48px;
        gap: 32px;
    }

    .sidebar {
        padding-bottom: 28px;
    }

    .sidebar-inner {
        padding: 0;
    }

    .sidebar-divider {
        margin: 18px 0;
    }

    .mobile-footer {
        padding: 24px 0 32px;
        margin-top: 20px;
    }

    .profile-name {
        font-size: 1.55rem;
    }

    .gallery-header {
        padding: 0 0 18px;
        margin-bottom: 4px;
    }

    .gallery-masonry {
        column-count: 1;
        column-gap: 0;
        padding: 0 0 24px;
    }

    .gallery-card {
        margin-bottom: 20px;
        border-radius: var(--radius-sm);
    }

    .lightbox-nav {
        display: none;
    }

    .lightbox-content {
        max-width: 94vw;
        max-height: calc(100vh - 36px);
    }

    .lightbox-content img {
        max-width: 92vw;
        max-height: 52vh;
        border-radius: var(--radius-sm);
    }

    .filter-pills {
        gap: 18px;
    }

    .filter-pill {
        padding: 4px 0;
        font-size: 0.8rem;
    }

    .card-tag {
        top: 10px;
        left: 10px;
        padding: 3px 8px;
        font-size: 0.56rem;
    }
}

/* ── Accessibility ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
