/* ============================================
   TYPOGRAPHY APP — Case Study Styles
   Clean, column-aligned layout where all content
   (text + images) lives within a single column.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --color-bg: #fafafa;
    --color-text: #1a1a1a;
    --color-text-muted: #6b7280;
    --color-accent: #9333ea;
    --color-accent-light: #c084fc;
    --color-accent-soft: #f3e8ff;
    --color-purple-deep: #7c3aed;
    --color-border: rgba(0, 0, 0, 0.06);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --content-width: 720px;
}

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

html {
    scroll-behavior: smooth;
}

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

/* ============================================
   BACK BUTTON
   ============================================ */
.back-button {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.back-button svg {
    flex-shrink: 0;
}

/* ============================================
   HERO SECTION — Text-only, purple gradient
   ============================================ */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 5rem;
    background: linear-gradient(165deg, #f3e8ff 0%, #e8d5f5 30%, #dbc4ef 60%, #d4b8ea 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(221, 14, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    max-width: var(--content-width);
    width: 100%;
    text-align: left;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.hero-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-purple-deep);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    padding: 0.35rem 1rem;
    border-radius: 100px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(26, 26, 26, 0.6);
    max-width: 540px;
}

/* ============================================
   INFO BAR — Stays within content column
   ============================================ */
.info-bar {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2.5rem 0;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 0.6s forwards;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.info-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.info-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
}

/* ============================================
   TEXT SECTIONS — All left-aligned in column
   ============================================ */
.text-section {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 1.5rem 0 1.25rem;
}

.content-col {
    margin-bottom: 2rem;
}

.section-number {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.text-section h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.text-section p {
    font-size: 1rem;
    line-height: 1.8;
    color: #4b5563;
}

/* ============================================
   PHONE ROW — Phones aligned within column
   ============================================ */
.phone-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.phone-row.two-up .phone-frame {
    flex: 1;
    max-width: 50%;
}

.phone-row.three-up .phone-frame {
    flex: 1;
    max-width: 33.333%;
}

.phone-row.four-up .phone-frame {
    flex: 1;
    max-width: 25%;
}

.phone-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.phone-frame img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.5s ease;
}

.phone-frame:hover img {
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.06);
}

.phone-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

/* ============================================
   IMAGE ROW — For flat screenshots (no labels)
   ============================================ */
.image-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.image-row.two-up .image-frame {
    flex: 1;
    max-width: 50%;
}

.image-row.single {
    justify-content: center;
}

.image-row.single .image-frame {
    max-width: 340px;
    flex: none;
}

.image-frame img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-frame:hover img {
    transform: translateY(-4px);
}

/* ============================================
   SCROLL-LINKED PHONE SHOWCASE
   A tall screenshot scrolls inside a fixed phone container
   as the user scrolls the page.
   ============================================ */
.scroll-phone-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.scroll-phone {
    width: 320px;
    height: 580px;
    overflow: hidden;
    border-radius: 24px;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    position: relative;
    background: #fff;
}

.scroll-phone img {
    width: 100%;
    height: auto;
    display: block;
    will-change: transform;
    transition: none;
}

/* ============================================
   MOCKUP ROW — Full-width device photography
   ============================================ */
.mockup-row {
    display: flex;
    gap: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.mockup-row.two-up .mockup-frame {
    flex: 1;
    max-width: 50%;
}

.mockup-frame {
    flex: 1;
}

.mockup-frame img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.5s ease;
}

.mockup-frame:hover img {
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.14),
        0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   FOOTER
   ============================================ */
.project-footer {
    text-align: center;
    padding: 3rem 2rem 4rem;
    border-top: 1px solid var(--color-border);
    max-width: var(--content-width);
    margin: 2rem auto 0;
}

.footer-back {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-back:hover {
    opacity: 0.7;
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-child {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-child:nth-child(1) {
    transition-delay: 0s;
}

.reveal-child:nth-child(2) {
    transition-delay: 0.12s;
}

.reveal-child:nth-child(3) {
    transition-delay: 0.24s;
}

.reveal-child.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   LIGHTBOX — Click-to-zoom overlay
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    transform: scale(0.92);
    transition: transform 0.15s ease-out;
}

.lightbox.is-open .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 1001;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

.lightbox-img {
    user-select: none;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero {
        padding: 5rem 1.25rem 3rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .text-section {
        padding: 2.5rem 1.25rem 1.5rem;
    }

    .info-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
        margin: 2rem 1.25rem;
    }

    .text-section {
        padding: 2.5rem 1.25rem 1.5rem;
    }

    .phone-row {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .phone-row.two-up .phone-frame,
    .phone-row.three-up .phone-frame,
    .phone-row.four-up .phone-frame {
        max-width: 260px;
        flex: none;
    }

    .image-row {
        flex-direction: column;
        gap: 1rem;
    }

    .image-row.two-up .image-frame {
        max-width: 100%;
        flex: none;
    }

    .phone-frame img {
        border-radius: 12px;
    }

    .image-frame img {
        border-radius: 12px;
    }

    .mockup-row {
        flex-direction: column;
        gap: 1rem;
    }

    .mockup-row.two-up .mockup-frame {
        max-width: 100%;
    }

    .back-button {
        top: 16px;
        left: 16px;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .project-footer {
        padding: 2rem 1.25rem 3rem;
        margin: 1rem 1.25rem 0;
    }
}