/* ============================================
   QPC Inventory — 802 Flamingo App Portfolio
   Light Mode · Warm Gray · Teal Accent
   ============================================ */

:root {
    /* Light mode tokens (warm gray) */
    --bg-primary: #FAF9F7;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F5F3F0;
    --text-primary: #1A1A1A;
    --text-secondary: #5F6368;
    --text-tertiary: #9AA0A6;
    --border: #E0E0E0;
    --border-hover: #CFCFCF;

    /* App accent */
    --app-accent: #06B6D4;
    --app-accent-light: #22D3EE;
    --app-accent-subtle: rgba(6, 182, 212, 0.08);
    --app-accent-hover: #0891B2;

    /* Status */
    --status-success: #22C55E;
    --status-success-bg: rgba(34, 197, 94, 0.1);
    --status-warning: #F59E0B;
    --status-warning-bg: rgba(245, 158, 11, 0.1);
    --status-error: #EF4444;
    --status-error-bg: rgba(239, 68, 68, 0.1);

    /* Typography */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-app: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================================
   Header
   ============================================ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(250, 249, 247, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s ease;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.back-link:hover { color: var(--text-primary); }

.header-app-name {
    font-family: var(--font-app);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

/* ============================================
   Hero
   ============================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 6rem 2rem 4rem;
}

.stock-bars-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-label {
    display: inline-block;
    font-family: var(--font-app);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--app-accent);
    background: var(--app-accent-subtle);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(10px);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
}

.hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(15px);
}

/* ============================================
   Shared Section Styles
   ============================================ */

.section-label {
    font-family: var(--font-app);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--app-accent);
    margin-bottom: 1.5rem;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.section-subheading {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* ============================================
   The Brief
   ============================================ */

.brief {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.brief-content {
    max-width: 700px;
    margin: 0 auto;
}

.brief-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ============================================
   Inventory Dashboard Demo
   ============================================ */

.demo-section {
    padding: 6rem 2rem;
}

.demo-container {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    text-align: left;
}

.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.dashboard-title {
    font-family: var(--font-app);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-item-count {
    font-family: var(--font-app);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.dashboard-subtitle {
    font-family: var(--font-app);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Search Bar */
.search-bar-wrapper {
    position: relative;
    max-width: 360px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-bar {
    width: 100%;
    font-family: var(--font-app);
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar::placeholder {
    color: var(--text-tertiary);
}

.search-bar:focus {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 3px var(--app-accent-subtle);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-app);
    font-size: 0.85rem;
}

.inventory-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.inventory-table th {
    background: var(--bg-primary);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    user-select: none;
}

.inventory-table th.sortable {
    cursor: pointer;
    transition: color 0.2s ease;
}

.inventory-table th.sortable:hover {
    color: var(--text-primary);
}

.sort-arrow {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.65rem;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.inventory-table th.sorted .sort-arrow {
    opacity: 1;
    color: var(--app-accent);
}

.inventory-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.inventory-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.inventory-table tbody tr:hover {
    background: var(--app-accent-subtle);
}

.inventory-table tbody tr:last-child td {
    border-bottom: none;
}

/* Item name cell */
.item-name-cell {
    font-weight: 500;
    color: var(--text-primary);
}

/* Category cell */
.item-category-cell {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Quantity cells */
.item-qty-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.item-par-cell {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
    white-space: nowrap;
}

.status-badge.in-stock {
    background: var(--status-success-bg);
    color: #15803d;
}

.status-badge.reorder-soon {
    background: var(--status-warning-bg);
    color: #B45309;
}

.status-badge.low-stock {
    background: var(--status-error-bg);
    color: var(--status-error);
}

.status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Checkbox */
.buy-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--app-accent);
    cursor: pointer;
}

/* ============================================
   Mobile Card List
   ============================================ */

.card-list {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.inventory-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inventory-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.inventory-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.inventory-card-name {
    font-family: var(--font-app);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.inventory-card-category {
    font-family: var(--font-app);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.inventory-card-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

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

.inventory-card-stat-label {
    font-family: var(--font-app);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.15rem;
}

.inventory-card-stat-value {
    font-family: var(--font-app);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.inventory-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.inventory-card-buy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-app);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================
   Price Comparison Panel
   ============================================ */

.price-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.price-overlay.active {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.price-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.price-overlay.active .price-backdrop {
    opacity: 1;
}

.price-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 560px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    padding: 2rem;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    max-height: 85vh;
    overflow-y: auto;
}

.price-panel-header {
    margin-bottom: 1.5rem;
}

.price-panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.price-panel-title {
    font-family: var(--font-app);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.price-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--bg-primary);
    transition: all 0.2s ease;
}

.price-close-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.price-panel-subtitle {
    font-family: var(--font-app);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.price-panel-verified {
    font-family: var(--font-app);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Vendor List */
.price-vendor-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vendor-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.vendor-row:hover {
    border-color: var(--border-hover);
}

.vendor-row.best-price {
    border-color: var(--status-success);
    background: var(--status-success-bg);
}

.vendor-info {
    flex: 1;
    min-width: 0;
}

.vendor-name {
    font-family: var(--font-app);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vendor-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
}

.vendor-badge.best {
    background: var(--status-success);
    color: white;
}

.vendor-badge.preferred {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.vendor-meta {
    font-family: var(--font-app);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

.vendor-price {
    font-family: var(--font-app);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.vendor-row.best-price .vendor-price {
    color: var(--status-success);
}

.vendor-actions {
    display: flex;
    gap: 0.5rem;
}

.vendor-action-btn {
    font-family: var(--font-app);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-card);
    transition: all 0.15s ease;
}

.vendor-action-btn:hover {
    border-color: var(--app-accent);
    color: var(--app-accent);
}

/* Panel Footer */
.price-panel-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.price-panel-note {
    font-family: var(--font-app);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* ============================================
   Features
   ============================================ */

.features-section {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.features-container {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.feature-card {
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--app-accent-subtle);
    color: var(--app-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.feature-card h3 {
    font-family: var(--font-app);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ============================================
   Tech Note
   ============================================ */

.tech-section {
    padding: 4rem 2rem;
    border-top: 1px solid var(--border);
}

.tech-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.tech-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ============================================
   More from 802 Flamingo
   ============================================ */

.more-section {
    padding: 6rem 2rem;
    border-top: 1px solid var(--border);
}

.more-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.more-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    border-radius: 16px;
    aspect-ratio: 4/3;
    background: var(--card-gradient);
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.more-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
}

.more-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.more-card-title {
    position: relative;
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.more-card-desc {
    position: relative;
    font-size: 0.8rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* ============================================
   CTA
   ============================================ */

.cta-section {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    text-align: center;
}

.cta-container {
    max-width: 500px;
    margin: 0 auto;
}

.cta-heading {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cta-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    font-family: var(--font-app);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: white;
    background: var(--text-primary);
    padding: 1rem 2.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cta-button:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
}

.site-footer .footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.footer-brand:hover { color: var(--app-accent); }

.footer-portfolio-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-portfolio-link:hover { color: var(--text-primary); }

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .site-header {
        padding: 1rem 1.25rem;
    }

    .hero {
        padding: 5rem 1.5rem 3rem;
        min-height: 85vh;
    }

    .brief { padding: 4rem 1.5rem; }
    .brief-text { font-size: 1.1rem; }

    .demo-section { padding: 4rem 1.5rem; }
    .dashboard-card { padding: 1.25rem; }

    /* Hide table, show cards on mobile */
    .table-wrapper { display: none; }
    .card-list { display: flex; }

    .features-section { padding: 4rem 1.5rem; }

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

    .tech-section { padding: 3rem 1.5rem; }

    .more-section { padding: 4rem 1.5rem; }

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

    .more-card { aspect-ratio: 16/9; }

    .cta-section { padding: 4rem 1.5rem; }

    .site-footer .footer-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    /* Price panel full width on mobile */
    .price-panel {
        padding: 1.5rem;
        border-radius: 16px 16px 0 0;
    }

    .vendor-row {
        flex-wrap: wrap;
    }

    .vendor-actions {
        width: 100%;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-title-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .search-bar-wrapper {
        max-width: 100%;
    }
}

/* ============================================
   Animations
   ============================================ */

:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* GSAP fallback — if animations haven't fired in 4s, show everything */
@keyframes gsap-fallback {
    to { opacity: 1; transform: none; }
}

.hero-label, .hero-title, .hero-subtitle {
    animation: gsap-fallback 0s 4s forwards;
}
