/* ── Graeme Richardson — Project Overlay & Responsive ──
   Detail overlay: left text, right images/video.
   Includes "where they are today" section.
   Responsive breakpoints for tile grid + overlay.
   ─────────────────────────────────────────────────── */

/* ── Project Detail Overlay ─────────────────────── */
.project-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.96);
    z-index: 200;
    display: flex;
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

.project-overlay.active {
    opacity: 1; visibility: visible;
}

/* Left: Text content */
.overlay-left {
    flex: 0 0 480px; max-width: 480px;
    overflow-y: auto; padding: 60px 48px 60px 32px;
    display: flex; flex-direction: column;
}

.overlay-left::-webkit-scrollbar { width: 3px; }
.overlay-left::-webkit-scrollbar-track { background: transparent; }
.overlay-left::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* Right: Image / video gallery */
.overlay-right {
    flex: 1; overflow-y: auto;
    padding: 60px 40px;
    display: flex; flex-direction: column; gap: 24px;
    background: rgba(0,0,0,0.3);
}

.overlay-right::-webkit-scrollbar { width: 0; }

.overlay-image {
    max-width: 100%; height: auto; border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: border-color 0.2s;
    display: block;
    margin-left: auto; margin-right: auto;
}

.overlay-image:hover { border-color: rgba(255,255,255,0.15); }

/* Prototype videos */
.overlay-prototype {
    margin-bottom: 8px;
}

.overlay-prototype-desc {
    font-family: var(--font-body);
    font-size: 12px; color: var(--text-muted);
    margin-bottom: 8px; letter-spacing: 0.01em;
}

.overlay-prototype video {
    width: 100%; border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* App Store badges */
.overlay-app-stores {
    margin-top: 4px;
}

.overlay-app-store-badges {
    display: flex; gap: 12px;
    flex-wrap: wrap;
}

.overlay-app-store-badge img {
    height: 40px; width: auto;
    border-radius: 6px;
    transition: opacity 0.2s;
}

.overlay-app-store-badge:hover img {
    opacity: 0.8;
}

.overlay-image-caption {
    font-family: var(--font-body);
    font-size: 12px; color: var(--text-muted);
    margin-top: 6px; letter-spacing: 0.01em;
    text-align: center;
}

.overlay-company {
    font-family: var(--font-body);
    font-size: 12px; font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.overlay-title {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.overlay-role {
    font-family: var(--font-body);
    font-size: 14px; color: var(--text-secondary);
    letter-spacing: 0.01em;
    margin-bottom: 24px;
}

.overlay-meta {
    display: flex; gap: 16px; margin-bottom: 32px;
    flex-wrap: wrap;
}

.overlay-meta-item {
    font-family: var(--font-body);
    font-size: 11px; color: var(--text-muted);
    letter-spacing: 0.02em;
    padding: 6px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.overlay-description {
    font-family: var(--font-chat);
    font-size: 14px; color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.overlay-description p { margin-bottom: 12px; }
.overlay-description p:last-child { margin-bottom: 0; }

.overlay-section-title {
    font-family: var(--font-display);
    font-size: 14px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.overlay-list {
    list-style: none; padding: 0;
    margin-bottom: 28px;
}

.overlay-list li {
    font-family: var(--font-chat);
    font-size: 13px; color: var(--text-secondary);
    line-height: 1.6;
    padding: 4px 0 4px 18px;
    position: relative;
}

.overlay-list li::before {
    content: '';
    position: absolute; left: 0; top: 12px;
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--accent);
}

/* ── Where They Are Today ───────────────────────── */
.overlay-where-today {
    margin-top: 4px;
    padding: 20px 24px;
    background: rgba(0,184,204,0.04);
    border: 1px solid rgba(0,184,204,0.12);
    border-radius: var(--radius);
    margin-bottom: 28px;
}

.overlay-where-today-label {
    font-family: var(--font-display);
    font-size: 10px; font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.overlay-where-today-text {
    font-family: var(--font-chat);
    font-size: 13px; color: var(--text-secondary);
    line-height: 1.7;
}

/* Close button */
.overlay-close {
    position: fixed; top: 24px; right: 24px;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(15,15,15,0.9);
    color: var(--text-secondary);
    cursor: pointer; z-index: 210;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(12px);
}

.overlay-close:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border-color: rgba(255,255,255,0.2);
}

/* Back arrow */
.overlay-back {
    font-family: var(--font-body);
    font-size: 12px; color: var(--text-muted);
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: 24px; transition: color 0.2s;
    background: none; border: none;
}

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

/* Lightbox */
.lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.94); z-index: 1000;
    align-items: center; justify-content: center; cursor: pointer;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 92vw; max-height: 92vh;
    border-radius: var(--radius); object-fit: contain;
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
}

/* Chat image in messages */
.chat-image {
    max-width: 100%; border-radius: var(--radius); margin: 8px 0;
    border: 1px solid var(--border); cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.chat-image:hover { border-color: rgba(255,255,255,0.2); transform: scale(1.01); }

/* ── Chat Fullscreen Overlay ─────────────────────── */
.chat-overlay {
    position: fixed; inset: 0;
    width: 100%; height: 100vh; height: 100dvh;
    background: var(--bg);
    z-index: 200;
    display: flex; flex-direction: column;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.chat-overlay-close {
    position: absolute; top: 20px; right: 20px;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
}

.chat-overlay-close:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border-color: rgba(255,255,255,0.15);
}

.chat-overlay-messages {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 60px 32px 20px;
    min-height: 0;
}

.chat-overlay-messages::-webkit-scrollbar { width: 3px; }
.chat-overlay-messages::-webkit-scrollbar-track { background: transparent; }
.chat-overlay-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.chat-overlay-messages-list {
    display: flex; flex-direction: column; gap: 20px;
    max-width: 740px; margin: 0 auto; width: 100%;
}

.chat-overlay-input {
    flex-shrink: 0;
    position: relative; z-index: 5;
    padding: 18px 28px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.chat-overlay-form {
    display: flex; gap: 8px; align-items: center;
    max-width: 740px; margin: 0 auto; width: 100%;
}

.chat-overlay-input-field {
    flex: 1; padding: 13px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg); color: var(--text);
    font-family: var(--font-chat); font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-overlay-input-field:focus {
    border-color: rgba(0,184,204,0.4);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.chat-overlay-input-field::placeholder { color: #4A4A4A; }

.chat-overlay-send-btn {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid rgba(0,184,204,0.25);
    background: rgba(0,184,204,0.08);
    color: var(--accent);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    padding: 0;
}

.chat-overlay-send-btn:hover {
    background: var(--accent); color: #000; border-color: var(--accent);
}

.chat-overlay-send-btn:disabled {
    background: transparent; border-color: var(--border);
    color: var(--text-muted); cursor: not-allowed;
}

/* ── White image background variant ────────────── */
.project-overlay.image-bg-white .overlay-right {
    background: #F5F5F5;
}

.project-overlay.image-bg-white .overlay-image {
    border-color: #E0E0E0;
}

.project-overlay.image-bg-white .overlay-image:hover {
    border-color: rgba(0,0,0,0.2);
}

.project-overlay.image-bg-white .overlay-image-caption,
.project-overlay.image-bg-white .overlay-prototype-desc {
    color: #666666;
}

/* ── Hero Carousel ─────────────────────────────── */
.hero-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.hero-carousel-slide {
    display: none;
    text-align: center;
}

.hero-carousel-slide.active {
    display: block;
    animation: carouselFadeIn 0.6s ease;
}

@keyframes carouselFadeIn {
    from { opacity: 0; transform: scale(1.02); }
    to { opacity: 1; transform: scale(1); }
}

.hero-carousel-slide .overlay-image {
    margin-bottom: 0;
}

.hero-carousel-dots {
    display: flex; justify-content: center; gap: 8px;
    margin-top: 12px;
}

.hero-carousel-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.25);
    background: transparent;
    cursor: pointer; padding: 0;
    transition: all 0.2s ease;
}

.hero-carousel-dot.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.hero-carousel-dot:hover {
    border-color: rgba(255,255,255,0.5);
}

/* ── Chase Ecosystem Lockup ───────────────────── */
.chase-ecosystem {
    width: 100%;
}

/* Header */
.eco-header {
    margin-bottom: 28px;
}

.eco-header-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 10px; font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border: 1px solid rgba(0,184,204,0.25);
    border-radius: var(--radius-full);
    margin-bottom: 16px;
    background: rgba(0,184,204,0.06);
}

.eco-title {
    font-family: var(--font-display);
    font-size: 26px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 10px;
}

.eco-subtitle {
    font-family: var(--font-chat);
    font-size: 13px; color: var(--text-secondary);
    line-height: 1.65;
    max-width: 560px;
}

/* Stats Ribbon */
.eco-stats {
    display: flex; gap: 0;
    background: rgba(0,184,204,0.04);
    border: 1px solid rgba(0,184,204,0.1);
    border-radius: var(--radius);
    padding: 16px 8px;
    margin-bottom: 32px;
    justify-content: space-around;
    align-items: center;
}

.eco-stat {
    text-align: center;
    padding: 4px 12px;
}

.eco-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 18px; font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.eco-stat-label {
    display: block;
    font-family: var(--font-body);
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.eco-stat-divider {
    width: 1px; height: 32px;
    background: rgba(255,255,255,0.06);
}

/* Product Cards Grid */
.eco-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 32px;
}

/* SVG connection overlay */
.eco-connections {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: 1;
    opacity: 0.35;
}

.eco-line {
    stroke: var(--accent);
    stroke-width: 0.5;
    stroke-dasharray: 4 6;
    animation: ecoLinePulse 4s ease-in-out infinite;
}

@keyframes ecoLinePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Center hub dot */
.eco-hub-dot {
    position: absolute; top: 50%; left: 50%;
    width: 10px; height: 10px;
    margin-left: -5px; margin-top: -5px;
    background: var(--accent);
    border-radius: 50%;
    z-index: 2; pointer-events: none;
    box-shadow: 0 0 16px var(--accent-glow), 0 0 32px var(--accent-glow);
    animation: ecoHubPulse 2.5s ease-in-out infinite;
}

.eco-hub-ring {
    position: absolute; top: 50%; left: 50%;
    width: 28px; height: 28px;
    margin-left: -14px; margin-top: -14px;
    border: 1px solid rgba(0,184,204,0.2);
    border-radius: 50%;
    z-index: 2; pointer-events: none;
    animation: ecoHubRingPulse 2.5s ease-in-out infinite;
}

@keyframes ecoHubPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

@keyframes ecoHubRingPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.8); opacity: 0; }
}

/* Product Card */
.eco-card {
    background: rgba(10,10,10,0.95);
    padding: 24px;
    display: flex; flex-direction: column;
    position: relative; z-index: 3;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid transparent;
}

.eco-card:hover {
    background: rgba(15,15,15,0.98);
    box-shadow: inset 0 0 0 1px rgba(0,184,204,0.15), 0 0 40px rgba(0,184,204,0.06);
    border-color: rgba(0,184,204,0.1);
}

.eco-card-top {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 10px;
}

.eco-card-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(0,184,204,0.08);
    border: 1px solid rgba(0,184,204,0.15);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.eco-card:hover .eco-card-icon {
    background: rgba(0,184,204,0.15);
    box-shadow: 0 0 12px rgba(0,184,204,0.15);
}

.eco-card-name {
    font-family: var(--font-display);
    font-size: 15px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.eco-card-tagline {
    font-family: var(--font-chat);
    font-size: 12px; color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 14px;
}

.eco-card-features {
    list-style: none; padding: 0; margin: 0 0 14px;
    flex: 1;
}

.eco-card-features li {
    font-family: var(--font-chat);
    font-size: 11.5px; color: var(--text-secondary);
    line-height: 1.6;
    padding: 2.5px 0 2.5px 16px;
    position: relative;
}

.eco-card-features li::before {
    content: '';
    position: absolute; left: 0; top: 9px;
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

.eco-card-footer {
    font-family: var(--font-body);
    font-size: 10px; color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

/* Screenshots section */
.eco-screenshots {
    margin-top: 8px;
}

.eco-screenshots-title {
    font-family: var(--font-display);
    font-size: 14px; font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

.eco-screenshots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.eco-screenshot-item {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    transition: border-color 0.2s;
}

.eco-screenshot-item:hover {
    border-color: rgba(255,255,255,0.12);
}

.eco-screenshot-item .overlay-image {
    border: none; border-radius: 0;
    margin: 0; width: 100%;
}

.eco-screenshot-item .overlay-image-caption {
    font-size: 10px;
    padding: 8px 10px;
    margin: 0;
    background: rgba(0,0,0,0.3);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
    .tile-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(5, 1fr);
    }

    .tile-cedar    { grid-column: 1 / 3; grid-row: 1 / 3; }
    .tile-equinox  { grid-column: 3; grid-row: 1; }
    .tile-jet      { grid-column: 4; grid-row: 1; }
    .tile-walmart  { grid-column: 3; grid-row: 2; }
    .tile-priceline { grid-column: 4; grid-row: 2; }
    .chat-tile     { grid-column: 3 / 5; grid-row: 3 / 5; }
    .tile-chase    { grid-column: 1 / 3; grid-row: 3; }
    .tile-cbs      { grid-column: 1 / 3; grid-row: 4; }
    .tile-nbc      { grid-column: 1; grid-row: 5; }
    .tile-mtv      { grid-column: 2; grid-row: 5; }
    .tile-akurtz   { grid-column: 3; grid-row: 5; }
    .tile-grnewyork { grid-column: 4; grid-row: 5; }

    .overlay-left {
        flex: 0 0 360px; max-width: 360px;
        padding: 40px 32px;
    }

    /* Chase ecosystem — tablet */
    .eco-title { font-size: 22px; }
    .eco-grid { grid-template-columns: 1fr 1fr; }
    .eco-card { padding: 18px; }
    .eco-card-name { font-size: 13px; }
    .eco-card-features li { font-size: 11px; }
    .eco-stats { padding: 12px 4px; }
    .eco-stat-value { font-size: 16px; }
}

@media (max-width: 768px) {
    .tile-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(8, 1fr);
        overflow-y: auto;
        height: 100dvh;
        gap: 1px;
        background: var(--bg);
    }

    .project-tile {
        min-height: 0;
        padding: 10px 14px;
        overflow: hidden;
    }

    /* Last project tile: span 2 cols to fill odd-count row */
    .project-tile:last-of-type {
        grid-column: 1 / -1 !important;
    }

    .chat-tile {
        grid-column: 1 / 3;
        grid-row: span 2;
        min-height: 0;
    }

    /* Mobile tile typography */
    .tile-company { font-size: 10px; }
    .tile-indicator { width: 18px; height: 18px; bottom: 10px; right: 10px; }
    .tile-indicator svg { width: 12px; height: 12px; }

    /* Mobile chat entry sizing */
    .chat-entry { gap: 8px; padding: 12px; }
    .chat-entry-avatar { width: 50px; height: 50px; }
    .chat-entry-heading { font-size: 15px; }
    .chat-entry-sub { font-size: 12px; }
    .chat-entry-cta { padding: 6px 16px; font-size: 11px; }

    .tile-cedar, .tile-equinox, .tile-walmart, .tile-jet,
    .tile-priceline, .tile-cbs, .tile-chase, .tile-nbc, .tile-mtv,
    .tile-akurtz, .tile-grnewyork { grid-column: auto; grid-row: auto; }

    /* ── Project overlay: stack vertically ── */
    .project-overlay {
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .overlay-left {
        flex: 0 0 auto; max-width: none;
        padding: 56px 24px 16px;
    }

    .overlay-right {
        flex: 1 0 auto;
        padding: 16px 24px 60px;
        gap: 16px;
        background: rgba(0,0,0,0.2);
    }

    .overlay-title { font-size: 28px; }
    .overlay-role { font-size: 14px; margin-bottom: 16px; }
    .overlay-description { font-size: 15px; line-height: 1.75; }
    .overlay-section-title { font-size: 13px; }
    .overlay-list li { font-size: 14px; line-height: 1.7; }

    /* Close button: sticky top-right, always visible */
    .overlay-close {
        position: fixed; top: 16px; right: 16px;
        width: 44px; height: 44px;
        z-index: 220;
    }

    /* Overlay back button: larger tap target */
    .overlay-back {
        font-size: 14px; padding: 8px 0;
        margin-bottom: 20px;
    }

    /* Meta tags: wrap nicely */
    .overlay-meta { gap: 8px; margin-bottom: 24px; }
    .overlay-meta-item { font-size: 12px; padding: 8px 14px; }

    /* Where They Are Today: full-width card */
    .overlay-where-today {
        margin: 0 -24px 24px;
        border-radius: 0;
        border-left: none; border-right: none;
        padding: 20px 24px;
    }
    .overlay-where-today-text { font-size: 14px; line-height: 1.75; }

    /* Images: full-width, less gap */
    .overlay-image {
        border-radius: var(--radius);
        width: 100%;
    }
    .overlay-right > div { margin-bottom: 4px; }

    /* Carousel: touch-friendly dots */
    .hero-carousel { border-radius: var(--radius); margin-bottom: 20px; }
    .hero-carousel-dot {
        width: 12px; height: 12px;
        margin: 0 4px;
    }
    .hero-carousel-dots { margin-top: 14px; gap: 4px; }

    /* Prototypes: full-width video */
    .overlay-prototype video { width: 100%; border-radius: var(--radius); }
    .overlay-prototype-desc { font-size: 13px; }

    /* App store badges: smaller on mobile */
    .overlay-app-store-badge img { height: 36px; }
    .overlay-app-store-badges { gap: 8px; }

    /* Chat overlay */
    .chat-overlay-messages { padding: 56px 16px 16px; }
    .chat-overlay-messages-list { max-width: 100%; gap: 16px; }
    .chat-overlay-input { padding: 12px 16px 16px; }
    .chat-overlay-form { max-width: 100%; }
    .chat-overlay-close { top: 16px; right: 16px; width: 44px; height: 44px; }

    /* Chase ecosystem — stacked single column */
    .eco-title { font-size: 20px; }
    .eco-header-badge { font-size: 9px; padding: 3px 8px; }
    .eco-subtitle { font-size: 13px; max-width: none; }
    .eco-stats { padding: 12px 8px; }
    .eco-stat { padding: 2px 8px; }
    .eco-stat-value { font-size: 16px; }
    .eco-stat-label { font-size: 9px; }
    .eco-stat-divider { display: none; }
    .eco-grid { grid-template-columns: 1fr; margin-bottom: 24px; }
    .eco-card { padding: 18px 20px; }
    .eco-card-name { font-size: 14px; }
    .eco-connections { display: none; }
    .eco-hub-dot, .eco-hub-ring { display: none; }
    .eco-screenshots-grid { grid-template-columns: 1fr; gap: 10px; }

    /* Bubble font adjustments for readability */
    .tile-msg-bubble { font-size: 15px; line-height: 1.75; }
    .tile-msg-bubble h1, .tile-msg-bubble h2, .tile-msg-bubble h3 { font-size: 16px; }
}

@media (max-width: 480px) {
    .tile-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1px;
        height: auto;
        min-height: 100dvh;
        background: var(--bg);
    }
    .chat-tile { grid-column: 1; grid-row: auto; min-height: 70dvh; }
    .project-tile { min-height: 100px; padding: 10px 14px; }

    /* Overlay: tighter padding on smallest screens */
    .overlay-left { padding: 52px 16px 12px; }
    .overlay-right { padding: 12px 16px 64px; gap: 12px; }
    .overlay-title { font-size: 24px; }
    .overlay-description { font-size: 14px; }
    .overlay-where-today {
        margin: 0 -16px 20px;
        padding: 16px 16px;
    }
    .overlay-meta-item { font-size: 11px; padding: 6px 10px; }
    .overlay-close { top: 12px; right: 12px; width: 40px; height: 40px; }

    /* Chase ecosystem — phone small */
    .eco-title { font-size: 20px; }
    .eco-header-badge { font-size: 9px; padding: 3px 8px; }
    .eco-subtitle { font-size: 13px; }
    .eco-stats { flex-wrap: wrap; gap: 10px; padding: 12px 8px; }
    .eco-stat-divider { display: none; }
    .eco-stat { padding: 2px 8px; }
    .eco-stat-value { font-size: 16px; }
    .eco-stat-label { font-size: 9px; }
    .eco-grid { grid-template-columns: 1fr; }
    .eco-card { padding: 18px; }
    .eco-card-name { font-size: 14px; }
    .eco-connections { display: none; }
    .eco-hub-dot, .eco-hub-ring { display: none; }
    .eco-screenshots-grid { grid-template-columns: 1fr; }

    /* Carousel: even larger dots for thumb tapping */
    .hero-carousel-dot { width: 14px; height: 14px; }

    .chat-overlay-messages { padding: 48px 12px 12px; }
    .chat-overlay-input { padding: 10px 12px 14px; }
    .chat-overlay-close { top: 12px; right: 12px; width: 40px; height: 40px; }

    /* Bubble: max width for tiny screens */
    .tile-msg { max-width: 96%; }
    .tile-msg-bubble { font-size: 14px; padding: 10px 12px; }
    .tile-msg-bubble h1, .tile-msg-bubble h2, .tile-msg-bubble h3 { font-size: 15px; }
}

/* ── iPhone notch /Dynamic Island safe areas ── */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 768px) {
        .overlay-left { padding-top: calc(56px + env(safe-area-inset-top)); }
        .overlay-close { top: calc(16px + env(safe-area-inset-top)); }
        .chat-overlay-messages { padding-top: calc(56px + env(safe-area-inset-top)); }
        .chat-overlay-close { top: calc(16px + env(safe-area-inset-top)); }
        .chat-overlay-input { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    }

    @media (max-width: 480px) {
        .overlay-left { padding-top: calc(52px + env(safe-area-inset-top)); }
        .overlay-close { top: calc(12px + env(safe-area-inset-top)); }
        .chat-overlay-messages { padding-top: calc(48px + env(safe-area-inset-top)); }
        .chat-overlay-close { top: calc(12px + env(safe-area-inset-top)); }
        .chat-overlay-input { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
    }
}

/* ── Large screens ── */
@media (min-width: 1400px) {
    .chat-overlay-messages-list { max-width: 840px; }
    .chat-overlay-form { max-width: 840px; }
}
