/* ============================================================
   DYNAMIC DESIGNS — Category Pages
   Shared stylesheet for all pages inside /categories/
   ============================================================ */

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

:root {
    --bg:        #0a0a0a;
    --bg-2:      #111111;
    --bg-3:      #161616;
    --fg:        #f4f0ea;
    --fg-muted:  #888580;
    --fg-dim:    #4a4745;
    --accent:    #0268f8;
    --accent-lo: rgba(2, 104, 248, 0.12);
    --border:    rgba(255, 255, 255, 0.08);
    --border-hi: rgba(255, 255, 255, 0.14);

    --font-display: 'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --font-mono:    'DM Mono', monospace;

    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);

    --nav-h:       72px;
    --page-pad:    clamp(24px, 6vw, 80px);
    --section-pad: clamp(72px, 9vw, 120px);
}

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

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

img   { display: block; max-width: 100%; }
a     { color: inherit; text-decoration: none; }
ul    { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ─── Utilities ─── */
.mono-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

/* ─── Scroll Progress ─── */
.scroll-progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ─── Custom Cursor ─── */
.cursor-dot { display: none; }
.cursor-outline {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s, width 0.2s, height 0.2s, background 0.2s;
    opacity: 0;
    width: 18px; height: 18px;
    border: none;
    background: rgba(255,255,255,0.85);
    border-radius: 0;
}

body.show-cursor .cursor-outline { opacity: 1; }
body.show-cursor * { cursor: none !important; }
body.cursor-active .cursor-outline { width: 30px; height: 30px; background: var(--accent); border-color: transparent; }

/* ─── Navigation ─── */
#main-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--page-pad);
    z-index: 1000;
    transition: border-bottom 0.3s, background 0.3s, backdrop-filter 0.3s;
}

#main-nav.scrolled {
    border-bottom: 1px solid var(--border);
    background: rgba(10,10,10,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-logo .logo-img { height: 34px; width: auto; }

.nav-menu { display: flex; gap: 40px; align-items: center; }

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-muted);
    position: relative;
    transition: color 0.2s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px; left: 0;
    width: 0; height: 1px;
    background: var(--fg);
    transition: width 0.3s var(--ease-out);
}
.nav-link:hover { color: var(--fg); }
.nav-link:hover::after { width: 100%; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 4px;
}
.toggle-bar {
    display: block;
    width: 24px; height: 1.5px;
    background: var(--fg);
    transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

/* ─── Mobile Overlay ─── */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 990;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: var(--page-pad);
    transform: translateX(100%);
    transition: transform 0.5s var(--ease-out);
}
.mobile-overlay.open { transform: translateX(0); }

.mobile-close {
    position: absolute;
    top: 24px; right: var(--page-pad);
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
}
.mobile-close span {
    position: absolute;
    width: 24px; height: 1.5px;
    background: var(--fg);
}
.mobile-close span:first-child { transform: rotate(45deg); }
.mobile-close span:last-child  { transform: rotate(-45deg); }

.mobile-menu-list { display: flex; flex-direction: column; gap: 16px; }

.mobile-link {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 9vw, 4rem);
    font-weight: 700;
    color: var(--fg);
    opacity: 0.85;
    transition: opacity 0.2s, color 0.2s;
}
.mobile-link:hover { opacity: 1; color: var(--accent); }

.mobile-footer {
    position: absolute;
    bottom: 40px;
    left: var(--page-pad);
}

/* ─── Page Hero ─── */
.page-hero {
    padding: calc(var(--nav-h) + clamp(48px, 7vw, 96px)) var(--page-pad) clamp(48px, 6vw, 80px);
    border-bottom: 1px solid var(--border);
}

.page-hero-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-dim);
    margin-bottom: 32px;
    transition: color 0.2s;
}
.page-hero-back:hover { color: var(--accent); }

.page-hero-label {
    display: block;
    margin-bottom: 16px;
}

.page-hero-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 8rem);
    letter-spacing: -0.03em;
    line-height: 0.92;
    color: var(--fg);
    margin-bottom: 20px;
}

.page-hero-sub {
    font-size: 0.9rem;
    color: var(--fg-muted);
    max-width: 500px;
    line-height: 1.65;
}

/* ─── Reveal animation ─── */
.js-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.js-fade.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   GALLERY PAGES
   ═══════════════════════════════════════════════════ */

.gallery-section {
    padding: var(--section-pad) var(--page-pad);
}

/* Project group (used in logo, apparel, packaging) */
.project-group {
    margin-bottom: clamp(56px, 8vw, 96px);
}
.project-group:last-child { margin-bottom: 0; }

.project-group-header {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.project-group-num { margin-bottom: 10px; }

.project-group-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.6rem, 3.5vw, 3rem);
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--fg);
    margin-bottom: 8px;
}

.project-group-desc {
    font-size: 0.86rem;
    color: var(--fg-muted);
    max-width: 400px;
    line-height: 1.6;
}

.project-group-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-dim);
    flex-shrink: 0;
}

/* Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2px;
}

.gallery-grid--tight {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.gallery-grid--wide {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: var(--bg-2);
    cursor: pointer;
    aspect-ratio: 3 / 4;
}

.gallery-item--square { aspect-ratio: 1 / 1; }
.gallery-item--landscape { aspect-ratio: 4 / 3; }
.gallery-item--poster { aspect-ratio: 2 / 3; }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out), filter 0.4s;
    filter: brightness(0.92);
}

.gallery-item:hover img {
    transform: scale(1.04);
    filter: brightness(1);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 104, 248, 0);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    transition: background 0.35s;
}

.gallery-item:hover .gallery-item-overlay {
    background: var(--accent-lo);
}

.gallery-item-title {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--fg);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s var(--ease-out);
}

.gallery-item:hover .gallery-item-title {
    opacity: 1;
    transform: translateY(0);
}

/* Flat gallery (marketing, image-manipulation) */
.flat-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2px;
}

.flat-item {
    position: relative;
    overflow: hidden;
    background: var(--bg-2);
    cursor: pointer;
}

.flat-item-img {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.flat-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-2);
    transition: transform 0.6s var(--ease-out), filter 0.4s;
    filter: brightness(0.9);
}

.flat-item:hover .flat-item-img img {
    transform: scale(1.04);
    filter: brightness(1);
}

.flat-item-caption {
    padding: 14px 18px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flat-item-name {
    font-family: var(--font-body);
    font-size: 0.84rem;
    color: var(--fg-muted);
    transition: color 0.2s;
}

.flat-item:hover .flat-item-name { color: var(--fg); }

.flat-item-icon {
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s;
}
.flat-item:hover .flat-item-icon { opacity: 1; transform: translateX(0); }

/* ═══════════════════════════════════════════════════
   CASE STUDY PAGES
   ═══════════════════════════════════════════════════ */

/* Case Study Hero */
.cs-hero {
    padding: calc(var(--nav-h) + clamp(48px, 7vw, 96px)) var(--page-pad) 0;
}

.cs-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
    padding-bottom: clamp(48px, 6vw, 80px);
    border-bottom: 1px solid var(--border);
}

.cs-hero-label { margin-bottom: 18px; }

.cs-hero-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.8rem, 6vw, 6rem);
    letter-spacing: -0.03em;
    line-height: 0.96;
    color: var(--fg);
    margin-bottom: 20px;
}

.cs-hero-desc {
    font-size: 0.92rem;
    color: var(--fg-muted);
    line-height: 1.7;
    max-width: 460px;
    margin-bottom: 24px;
}

.cs-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 32px;
}

.cs-hero-tags span {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border: 1px solid var(--border);
    color: var(--fg-muted);
    border-radius: 2px;
}

.cs-hero-ctas {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 500;
    padding: 12px 22px;
    border-radius: 2px;
    transition: background 0.2s, transform 0.2s;
}
.btn-primary:hover { background: #0556ce; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 12px 22px;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s;
}
.btn-secondary:hover { color: var(--fg); border-color: var(--border-hi); }

.cs-hero-img {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    aspect-ratio: 16/10;
}

.cs-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Highlights strip */
.cs-highlights {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid var(--border);
}

.cs-highlight-item {
    padding: clamp(24px, 3vw, 40px) var(--page-pad);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-highlight-item:last-child { border-right: none; }

.cs-highlight-icon {
    font-size: 1.1rem;
    color: var(--accent);
}

.cs-highlight-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.96rem;
    color: var(--fg);
    line-height: 1.2;
}

.cs-highlight-sub {
    font-size: 0.78rem;
    color: var(--fg-muted);
    line-height: 1.45;
}

/* Features section */
.cs-features {
    padding: var(--section-pad) var(--page-pad);
    border-bottom: 1px solid var(--border);
}

.cs-section-label {
    display: block;
    margin-bottom: 14px;
}

.cs-section-heading {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: -0.025em;
    line-height: 1;
    color: var(--fg);
    margin-bottom: 40px;
}

.cs-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.cs-feature-card {
    padding: clamp(24px, 3vw, 36px);
    background: var(--bg-2);
    border-top: 2px solid transparent;
    transition: border-color 0.3s, background 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-feature-card:hover {
    border-top-color: var(--accent);
    background: var(--bg-3);
}

.cs-feature-num {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.cs-feature-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--fg);
}

.cs-feature-desc {
    font-size: 0.82rem;
    color: var(--fg-muted);
    line-height: 1.6;
}

/* Screenshots */
.cs-screenshots {
    padding: var(--section-pad) var(--page-pad);
    border-bottom: 1px solid var(--border);
}

.cs-screenshots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    margin-top: 40px;
}

.cs-screenshot {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-2);
}

.cs-screenshot-img {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.cs-screenshot-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}
.cs-screenshot:hover .cs-screenshot-img img { transform: scale(1.03); }

.cs-screenshot-cap {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--fg-muted);
}

/* Tech stack */
.cs-tech {
    padding: clamp(40px, 5vw, 64px) var(--page-pad);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cs-tech-label {
    flex-shrink: 0;
}

.cs-tech-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cs-tech-pill {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1px solid var(--border);
    color: var(--fg-muted);
    border-radius: 2px;
    transition: border-color 0.2s, color 0.2s;
}
.cs-tech-pill:hover { border-color: var(--accent); color: var(--fg); }

/* Notes */
.cs-notes {
    padding: clamp(40px, 5vw, 64px) var(--page-pad);
    border-bottom: 1px solid var(--border);
    max-width: 680px;
}
.cs-notes p {
    font-size: 0.9rem;
    color: var(--fg-muted);
    line-height: 1.8;
}
.cs-notes p + p { margin-top: 14px; }

/* Page Footer CTA */
.page-cta {
    padding: var(--section-pad) var(--page-pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

.page-cta-text h3 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.6rem, 3.5vw, 3.2rem);
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--fg);
    margin-top: 10px;
}

/* ─── Lightbox ─── */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 2px;
    transition: opacity 0.2s;
}

.lightbox-close {
    position: absolute;
    top: 24px; right: 28px;
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--fg-muted);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    background: none;
    border: none;
}
.lightbox-close:hover { color: var(--fg); }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-muted);
    cursor: pointer;
    padding: 16px 20px;
    transition: color 0.2s;
    background: none;
    border: none;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { color: var(--fg); }

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
}

/* ─── Logo / contain variant ─── */
.gallery-item--contain img {
    object-fit: contain;
    padding: 16px;
    background: var(--bg-3);
}

.gallery-item--contain:hover img { transform: scale(1.03); }
.site-footer {
    border-top: 1px solid var(--border);
    padding: 26px var(--page-pad);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-logo img {
    height: 26px;
    width: auto;
    opacity: 0.65;
    transition: opacity 0.2s;
}
.footer-logo:hover img { opacity: 1; }

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fg-dim);
}

.footer-social { display: flex; gap: 18px; }
.footer-social a {
    font-size: 1.1rem;
    color: var(--fg-dim);
    transition: color 0.2s;
}
.footer-social a:hover { color: var(--fg); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .nav-menu   { display: none; }
    .nav-toggle { display: flex; }

    .cs-hero-inner { grid-template-columns: 1fr; }
    .cs-hero-img   { order: -1; }

    .cs-highlights { grid-template-columns: repeat(2, 1fr); }
    .cs-highlight-item:nth-child(even) { border-right: none; }
    .cs-highlight-item:nth-child(1),
    .cs-highlight-item:nth-child(2)    { border-bottom: 1px solid var(--border); }

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

    .cs-tech { flex-direction: column; align-items: flex-start; gap: 16px; }

    .page-cta     { flex-direction: column; align-items: flex-start; }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (max-width: 680px) {
    :root {
        --page-pad:    20px;
        --section-pad: clamp(48px, 10vw, 72px);
    }

    .cs-hero-title { font-size: clamp(2rem, 10vw, 3.2rem); }
    .cs-hero-desc  { max-width: 100%; }

    .cs-section-heading { font-size: clamp(1.5rem, 7vw, 2.4rem); margin-bottom: 28px; }

    .cs-screenshots-grid { margin-top: 24px; }
    .cs-screenshot-cap   { padding: 10px 14px; }

    .cs-feature-card { padding: 20px 18px; }

    .cs-tech { padding-top: 32px; padding-bottom: 32px; gap: 12px; }

    .page-cta-text h3 { font-size: clamp(1.3rem, 7vw, 2rem); }
    .page-cta         { gap: 24px; }

    .flat-gallery  { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid  { grid-template-columns: repeat(2, 1fr); }

    .cs-highlights { grid-template-columns: 1fr; }
    .cs-highlight-item { border-right: none !important; border-bottom: 1px solid var(--border); }
    .cs-highlight-item:last-child { border-bottom: none; }

    .cs-features-grid { grid-template-columns: 1fr; }

    .project-group-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
    .flat-gallery { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .js-fade { opacity: 1 !important; transform: none !important; }
}
