/* ============================================================
   Public Portfolio Showcase
   Modern Agency Design · Blue & Orange Palette
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1e3a8a;
    --primary-light: #dbeafe;
    --accent: #f97316;
    --accent-dark: #ea580c;
    --accent-light: #ffedd5;
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
    --shadow-blue: 0 10px 40px rgba(37, 99, 235, 0.25);
    --shadow-orange: 0 10px 40px rgba(249, 115, 22, 0.25);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px; line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ========== Header ========== */
.public-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 72px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 18px; color: var(--text);
}
.logo-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px;
    box-shadow: var(--shadow-blue);
}
.main-nav { display: flex; gap: 8px; align-items: center; }
.main-nav a {
    padding: 8px 16px;
    color: var(--text-2); font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition);
}
.main-nav a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.main-nav .nav-cta {
    background: var(--primary); color: white;
    margin-left: 8px;
}
.main-nav .nav-cta:hover { background: var(--primary-dark); color: white; }
.mobile-toggle {
    display: none;
    background: none; border: 0;
    font-size: 22px; color: var(--text);
    cursor: pointer;
}

/* ========== Hero ========== */
.hero {
    position: relative;
    padding: 100px 0 80px;
    overflow: hidden;
    background: linear-gradient(180deg, #fafafa 0%, white 100%);
}
.hero-bg {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}
.blob-1 { width: 500px; height: 500px; background: var(--primary); top: -200px; left: -100px; }
.blob-2 { width: 400px; height: 400px; background: var(--accent); top: 100px; right: -100px; animation-delay: -5s; }
.blob-3 { width: 350px; height: 350px; background: #06b6d4; bottom: -150px; left: 30%; animation-delay: -10s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-30px, 30px) scale(0.95); }
}
.hero-inner { position: relative; text-align: center; max-width: 880px; margin: 0 auto; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px; font-weight: 500; color: var(--text-2);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease-out;
}
.hero-badge .dot {
    width: 8px; height: 8px; background: var(--success); border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    animation: fadeUp 0.6s ease-out 0.1s both;
}
.hero-title .accent {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.hero-subtitle {
    font-size: 18px; color: var(--text-2);
    margin: 0 0 36px; max-width: 640px; margin-left: auto; margin-right: auto;
    animation: fadeUp 0.6s ease-out 0.2s both;
}
.hero-actions {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 60px;
    animation: fadeUp 0.6s ease-out 0.3s both;
}
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 15px; font-weight: 600;
    cursor: pointer; user-select: none;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
}
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-primary {
    background: var(--primary); color: white;
    box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
    background: var(--primary-dark); color: white;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.35);
}
.btn-accent {
    background: var(--accent); color: white;
    box-shadow: var(--shadow-orange);
}
.btn-accent:hover {
    background: var(--accent-dark); color: white;
    transform: translateY(-2px);
}
.btn-ghost {
    background: transparent; color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--surface);
    border-color: var(--primary); color: var(--primary);
    transform: translateY(-2px);
}
.hero-stats {
    display: flex; justify-content: center; gap: 60px;
    flex-wrap: wrap;
    animation: fadeUp 0.6s ease-out 0.4s both;
}
.hero-stats > div { text-align: center; }
.hero-stats strong {
    display: block; font-size: 36px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats span { font-size: 14px; color: var(--text-3); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ========== Section Header ========== */
.section-header { text-align: center; margin-bottom: 48px; }
.section-tag {
    display: inline-block;
    padding: 4px 14px;
    background: var(--accent-light); color: var(--accent-dark);
    border-radius: 999px;
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}
.section-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800; margin: 0 0 12px;
    letter-spacing: -0.02em;
}
.section-subtitle { color: var(--text-2); font-size: 17px; max-width: 600px; margin: 0 auto; }

/* ========== Portfolio Section ========== */
.portfolio-section { padding: 100px 0; background: var(--bg); }

.filter-tabs {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 8px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: max-content;
    margin-left: auto; margin-right: auto;
}
.filter-tab {
    padding: 10px 20px;
    background: transparent;
    border: 0;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px; font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
}
.filter-tab:hover { background: var(--primary-light); color: var(--primary); }
.filter-tab.active {
    background: var(--primary); color: white;
    box-shadow: var(--shadow-blue);
}
.filter-tab.active:hover { background: var(--primary-dark); color: white; }

.subfilter-tabs {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center;
    margin-bottom: 40px;
    animation: fadeUp 0.4s ease-out;
}
.subfilter-tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px; font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: all var(--transition);
}
.subfilter-tab:hover { border-color: var(--accent); color: var(--accent); }
.subfilter-tab.active {
    background: var(--accent); color: white;
    border-color: var(--accent);
}

/* ========== Portfolio Grid ========== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.empty-filter, .empty-showcase {
    text-align: center; padding: 80px 20px;
    color: var(--text-3);
}
.empty-filter i, .empty-showcase i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-filter h3, .empty-showcase h3 { color: var(--text); margin: 0 0 8px; }

/* ========== Portfolio Card ========== */
.portfolio-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    display: flex; flex-direction: column;
    animation: cardFadeIn 0.5s ease-out backwards;
}
@keyframes cardFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.portfolio-card.hidden { display: none; }
.portfolio-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.card-image-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}
.card-image-scroll {
    position: absolute; inset: 0;
    overflow: hidden;
    cursor: pointer;
}
.card-image-scroll img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: top;
    transition: transform 8s linear;
    transform: translateY(0);
    user-select: none;
    pointer-events: none;
}

/* The magic: hover scroll effect */
@media (hover: hover) {
    .portfolio-card:hover .card-image-scroll img {
        transform: translateY(calc(-100% + 100%));
        animation: scrollDown 8s ease-in-out forwards;
    }
    @keyframes scrollDown {
        0% { transform: translateY(0); }
        80% { transform: translateY(calc(-100% + 400px)); }
        100% { transform: translateY(calc(-100% + 400px)); }
    }
}

.placeholder-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); font-size: 48px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

/* Card overlay buttons */
.card-overlay {
    position: absolute; top: 12px; right: 12px;
    display: flex; gap: 6px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all var(--transition);
}
.portfolio-card:hover .card-overlay { opacity: 1; transform: translateY(0); }
.overlay-btn {
    width: 40px; height: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 0; border-radius: 50%;
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px;
    transition: all var(--transition);
    text-decoration: none;
}
.overlay-btn:hover { background: var(--primary); color: white; transform: scale(1.1); }

.featured-badge {
    position: absolute; top: 12px; left: 12px;
    padding: 5px 10px;
    background: var(--accent);
    color: white;
    border-radius: 999px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: var(--shadow-orange);
    display: inline-flex; align-items: center; gap: 4px;
}

.scroll-hint {
    position: absolute; bottom: 12px; left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 5px 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 999px;
    font-size: 11px; font-weight: 500;
    opacity: 0;
    transition: all var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
    pointer-events: none;
}
.portfolio-card:hover .scroll-hint { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Card body */
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-light); color: var(--primary);
    border-radius: 999px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tag-sub { background: var(--accent-light); color: var(--accent-dark); }
.card-title {
    margin: 0 0 6px;
    font-size: 18px; font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}
.card-company { font-size: 13px; color: var(--text-2); margin: 0 0 12px; font-weight: 500; }
.card-description { font-size: 14px; color: var(--text-2); margin: 0 0 16px; line-height: 1.5; flex: 1; }
.card-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 600;
    color: var(--primary);
    transition: gap var(--transition);
}
.card-link:hover { gap: 10px; }

/* ========== CTA ========== */
.cta-section {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; text-align: center;
    position: relative; overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(249, 115, 22, 0.3), transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(37, 99, 235, 0.4), transparent 50%);
    pointer-events: none;
}
.cta-inner { position: relative; }
.cta-section h2 {
    font-size: clamp(28px, 4vw, 44px); margin: 0 0 12px;
    font-weight: 800; letter-spacing: -0.02em;
}
.cta-section p { font-size: 18px; margin: 0 0 32px; opacity: 0.9; }

/* ========== Footer ========== */
.public-footer {
    background: #0f172a; color: white;
    padding: 60px 0 24px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-inner .logo { color: white; }
.footer-inner .text-muted { color: rgba(255, 255, 255, 0.6); margin-top: 12px; }
.footer-inner strong { display: block; margin-bottom: 16px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.api-link { margin-bottom: 8px; }
.api-link a {
    color: rgba(255, 255, 255, 0.7); font-size: 14px;
    display: inline-flex; align-items: center; gap: 6px;
}
.api-link a:hover { color: white; text-decoration: none; }
.footer-bottom {
    padding-top: 24px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-align: center;
}

/* ========== Preview Modal ========== */
.preview-modal {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: none;
    align-items: center; justify-content: center;
    padding: 40px 20px;
}
.preview-modal.show { display: flex; }
.preview-close {
    position: absolute; top: 20px; right: 20px;
    width: 44px; height: 44px;
    background: rgba(255, 255, 255, 0.1); color: white;
    border: 0; border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background var(--transition);
}
.preview-close:hover { background: var(--accent); }
.preview-content {
    max-width: 1400px; max-height: 90vh;
    overflow: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.preview-content::-webkit-scrollbar { width: 10px; }
.preview-content::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 5px; }
.preview-content img { width: 100%; height: auto; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .portfolio-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .main-nav { display: none; }
    .main-nav.show {
        display: flex; flex-direction: column;
        position: absolute; top: 72px; left: 0; right: 0;
        background: white; padding: 16px;
        box-shadow: var(--shadow);
        border-top: 1px solid var(--border);
    }
    .main-nav.show a { width: 100%; }
    .mobile-toggle { display: block; }
    .hero { padding: 60px 0; }
    .hero-stats { gap: 30px; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .filter-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding: 6px; max-width: 100%; justify-content: flex-start; }
    .filter-tab { white-space: nowrap; flex-shrink: 0; }
    .subfilter-tabs { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 6px; }
    .subfilter-tab { white-space: nowrap; flex-shrink: 0; }
    .footer-inner { grid-template-columns: 1fr; gap: 30px; }
    .cta-section { padding: 60px 0; }
}
