/* ============================================
   JEFFREY KENT POST | PORTFOLIO v2.0
   Design System: Apple Cinema Dark
   ============================================ */

/* 1. RESET & VARIABLES */
:root {
    /* Color System (Apple Dark Mode) */
    --bg-root: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;

    /* Text Colors */
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;

    /* Accents (Jewel Tones) */
    --jewel-ruby: #FF2D55;
    --jewel-amethyst: #BF5AF2;
    --jewel-sapphire: #0A84FF;
    --jewel-emerald: #30D158;
    --jewel-topaz: #FFD60A;

    /* Default Accent */
    --accent-blue: var(--jewel-sapphire);
    --accent-cyan: #64d2ff;
    --accent-indigo: #5e5ce6;

    /* Materials */
    --glass-bg: rgba(30, 30, 30, 0.72);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-blur: 20px;

    /* Typography */
    --font-stack: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* Metrics */
    --radius-l: 22px;
    --radius-m: 12px;
    --radius-pill: 999px;
    --nav-height: 56px;

    /* Eases */
    --ease-spring: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background-color: var(--bg-root);
    font-family: var(--font-stack);
    font-weight: 700;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    color: var(--text-primary);
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* 2. ATMOSPHERE (Background) */
.atmosphere {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.atmosphere::before {
    /* Mesh Gradient */
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(191, 90, 242, 0.12), transparent 60%),
        /* Amethyst */
        radial-gradient(circle at 85% 20%, rgba(10, 132, 255, 0.12), transparent 60%),
        /* Sapphire */
        radial-gradient(circle at 50% 50%, rgba(255, 45, 85, 0.08), transparent 50%),
        /* Ruby */
        radial-gradient(circle at 10% 80%, rgba(48, 209, 88, 0.08), transparent 50%),
        /* Emerald */
        radial-gradient(circle at 90% 90%, rgba(255, 214, 10, 0.08), transparent 50%);
    /* Topaz */
    filter: blur(80px);
    opacity: 0.8;
}

.atmosphere::after {
    /* Film Grain */
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3C viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: 0.03;
    mix-blend-mode: overlay;
}

/* 3. NAVIGATION */
.nav-wrapper {
    position: fixed;
    top: 24px;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
}

.nav-pill {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    background: rgba(28, 28, 30, 0.65);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nav-link {
    padding: 8px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-pill);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 4. LAYOUT */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 160px 24px 120px;
}

/* 5. HERO TYPOGRAPHY */
.hero {
    text-align: center;
    margin-bottom: 90px;
    position: relative;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: min(5rem, 12vw);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #fff 0%, #a1a1a6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-bottom: 10px;
    /* fix clip */
}

/* ... */

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 16px auto 0;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Scroll Animation classes */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-spring), transform 0.8s var(--ease-spring);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 6. GRID & CARDS */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* Distributed Accents */
.grid>.card:nth-child(5n+1) {
    --accent-color: var(--jewel-ruby);
}

.grid>.card:nth-child(5n+2) {
    --accent-color: var(--jewel-amethyst);
}

.grid>.card:nth-child(5n+3) {
    --accent-color: var(--jewel-emerald);
}

.grid>.card:nth-child(5n+4) {
    --accent-color: var(--jewel-topaz);
}

.grid>.card:nth-child(5n+5) {
    --accent-color: var(--jewel-sapphire);
}

.card {
    display: block;
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-l);
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.4s var(--ease-bounce), box-shadow 0.4s ease;
    border: 1px solid transparent;

    /* Default fallback */
    --accent-color: var(--jewel-sapphire);
}

.card:hover {
    transform: scale(1.02);
    z-index: 10;
    /* Use the assigned accent color for the glow */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px var(--accent-color);
    /* Bright border */
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
}

.card-media {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: transform 0.6s var(--ease-spring), opacity 0.4s ease;
}

.card:hover .card-media img {
    transform: scale(1.05);
    opacity: 1;
}

.card-content {
    padding: 20px;
}

.card-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meta-role {
    color: var(--text-secondary);
}

.meta-type {
    color: var(--accent-color);
}

.section-title {
    grid-column: 1 / -1;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    margin-bottom: 0px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 7. UTILITIES */
@media (min-width: 960px) {
    .span-2 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding-top: 130px;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .nav-wrapper {
        padding: 0 16px;
    }

    .nav-pill {
        width: 100%;
        justify-content: space-between;
    }

    .nav-link {
        padding: 8px 12px;
        flex: 1;
        text-align: center;
    }
}

/* 8. WORK PAGE REDESIGN ADDITIONS */

/* Services Snapshot */
.services-snapshot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
    margin: 30px auto 50px;
    max-width: 800px;
    color: var(--text-secondary);
    font-size: 14px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-item::before {
    content: "•";
    color: var(--jewel-sapphire);
}

/* Filter Controls */
.filter-controls {
    margin-bottom: 40px;
}

.filter-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn-filter {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: var(--radius-m);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter:hover,
.btn-filter.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.1);
}

.chip-group {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

/* Card Updates */
.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag {
    font-size: 10px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
    transition: color 0.3s ease;
}

.card:hover .tag {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
}

.meta-year {
    font-size: 11px;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

/* CTA Section */
.cta-section {
    text-align: center;
    margin-top: 100px;
    padding: 60px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: var(--text-primary);
    color: var(--bg-root);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-pill);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.cta-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* 9. LABS: TOOL BENCH */
#tool-bench {
    margin-top: 120px;
    padding-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.tool-card {
    background: rgba(28, 28, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-m);
    padding: 24px;
    transition: all 0.3s ease;
}

.tool-card:hover {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.tool-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--text-primary);
}

.tool-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-style: italic;
}

.tool-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tool-bullets li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.tool-bullets li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: bold;
}

.tool-outputs {
    margin-top: 60px;
    text-align: center;
}

.tool-outputs h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.tool-outputs p {
    color: var(--text-primary);
    font-size: 15px;
}

.tool-disclaimer {
    margin-top: 80px;
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    opacity: 0.6;
}

@media (max-width: 960px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
}