/* ==========================================================================
   PAGE STAGE & WRAPPER
   ========================================================================== */
.stage {
    padding-top: 140px;
    min-height: 100vh;
}

/* Animations */
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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


/* ==========================================================================
   SERVICES PAGE
   ========================================================================== */
/* ==========================================================================
   SERVICES PAGE
   ========================================================================== */
.service-grid {
    display: grid;
    /* min() keeps columns from overflowing on phones narrower than the track */
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 24px;
    margin-bottom: 120px;
}

.s-card-wrap {
    perspective: 1000px;
}

.s-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 28px 30px;
    border-radius: 24px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.s-card:hover {
    transform: translateY(-12px) rotateX(2deg) rotateY(-2deg);
    border-color: var(--accent);
    box-shadow: 0 20px 40px -15px var(--glow);
    background: var(--bg-2);
}

.s-num {
    font-size: 0.65rem;
    color: var(--text-mute);
    letter-spacing: 0.1em;
    font-family: 'Poppins', system-ui, sans-serif;
}

.s-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.s-card-header h3 {
    margin-bottom: 0;
}

.s-icon {
    width: 48px;
    height: 48px;
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-hi);
    transition: 0.3s;
    flex-shrink: 0;
}

.s-card:hover .s-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.s-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.s-card p {
    color: var(--text-soft);
    line-height: 1.55;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.s-card-content {
    flex: 1;
}

.s-card-footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.s-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-hi);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.3s;
}

.s-link svg {
    transition: transform 0.3s;
}

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

.s-link:hover svg {
    transform: translateX(5px);
}

/* Background element for card */
.s-card-bg {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: var(--accent);
    filter: blur(50px);
    opacity: 0;
    transition: 0.5s;
    z-index: -1;
}

.s-card:hover .s-card-bg {
    opacity: 0.15;
}

/* CTA Section Styles */
.service-cta {
    background: var(--bg-2); /* Use a distinct background */
    border-top: 1px solid var(--border);
    padding: 120px 0;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.service-cta::before {
    content: '';
    position: absolute;
    bottom: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 40%;
    background: radial-gradient(circle, var(--glow) 0%, transparent 80%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

.cta-inner {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.cta-inner h2 {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.cta-inner p {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-soft);
    margin-bottom: 48px;
    line-height: 1.6;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}


@media (max-width: 768px) {
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
}


/* ==========================================================================
   ABOUT PAGE
   ========================================================================== */

.ab-stage {
    padding-top: 90px;
}

/* Scroll-reveal: hold hidden until observed, then fade up */
.ab-stage .animate-in {
    opacity: 0;
    transform: translateY(36px);
    animation: none;
}

.ab-stage .animate-in.in-view {
    animation: fadeInUp 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ---- Hero ---- */
.ab-hero {
    min-height: 92vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(120% 100% at 75% 10%, var(--glow), var(--bg) 55%);
    padding: 80px 0 60px;
}

.ab-hero-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(30, 109, 250, 0.18) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.ab-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 820px;
}

.ab-sub {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-soft);
    line-height: 1.7;
    max-width: 600px;
    margin-top: 1.8rem;
}

.ab-ghost {
    position: absolute;
    right: -2vw;
    bottom: -4vh;
    font-size: 22vw;
    font-weight: 800;
    color: rgba(61, 127, 255, 0.04);
    line-height: 0.8;
    pointer-events: none;
    z-index: 0;
    letter-spacing: -0.05em;
    user-select: none;
}

/* ---- Shared section ---- */
.ab-section {
    padding: 120px 0;
    border-top: 1px solid var(--border);
}

.ab-heading {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin-top: 0;
    margin-bottom: 0;
}

.ab-mv-head {
    margin-bottom: 64px;
}

/* ---- Story grid ---- */
.ab-story-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(3rem, 7vw, 7rem);
    align-items: start;
}

.ab-story-badge {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 40px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.ab-star {
    font-size: 1.3rem;
    color: var(--accent-hi);
    flex-shrink: 0;
    margin-top: 2px;
}

.ab-story-badge p {
    font-size: 0.95rem;
    color: var(--text-soft);
    line-height: 1.6;
    margin: 0;
}

.ab-story-right p {
    font-size: 1.08rem;
    color: var(--text-soft);
    line-height: 1.75;
    margin-bottom: 22px;
}

.ab-quote {
    margin: 28px 0 0;
    padding: 24px 28px;
    border-left: 3px solid var(--accent);
    background: rgba(30, 109, 250, 0.06);
    border-radius: 0 14px 14px 0;
    font-size: 1.02rem;
    color: var(--text-soft);
    line-height: 1.8;
    font-style: normal;
}

.ab-quote strong {
    color: var(--text);
}

/* ---- Stats ---- */
.ab-stats-section {
    padding: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
}

.ab-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

.ab-stat {
    flex: 1;
    text-align: center;
}

.ab-stat-div {
    width: 1px;
    height: 56px;
    background: var(--border);
    flex-shrink: 0;
}

.ab-stat-num {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    color: var(--accent-hi);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 10px;
}

.ab-stat-lab {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-mute);
}

/* ---- Mission & Vision ---- */
.ab-mv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.ab-mv-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    position: relative;
    overflow: hidden;
}

.ab-mv-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hi));
}

.ab-mv-card:hover {
    border-color: var(--border-hi);
    box-shadow: 0 24px 48px -15px var(--glow);
    transform: translateY(-6px);
}

.ab-mv-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.ab-tag {
    /* font-size: 0.65rem; */
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-hi);
    background: rgba(30, 109, 250, 0.1);
    border: 1px solid var(--border-hi);
    padding: 5px 14px;
    border-radius: 100px;
}

.ab-mv-icon {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-hi);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-hi);
}

.ab-mv-card h3 {
    font-size: 1.55rem;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.2;
}

.ab-mv-card p {
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 16px;
}

.ab-mv-note {
    font-size: 0.9rem !important;
    color: var(--text-mute) !important;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 4px;
    font-style: italic;
}

/* ---- Values ---- */
.ab-values-section {
    background: linear-gradient(180deg, transparent 0%, rgba(30, 109, 250, 0.03) 100%);
}

.ab-values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.ab-val {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 36px 30px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.ab-val:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 24px 48px -15px var(--glow);
}

.ab-val-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.ab-val:hover .ico {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: scale(1.1) rotate(5deg);
}

.ab-val h4 {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.ab-val p {
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.45;
    margin: 0;
}

/* ---- Hero intro box (under main heading) ---- */
.ab-intro-box {
    margin-top: 40px;
    width: 142%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 12px 40px 36px;
}

.ab-intro-lead {
    font-size: clamp(1.3rem, 2.5vw, 1.65rem);
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
}

.ab-intro-box p:not(.ab-intro-lead) {
    font-size: 1.02rem;
    color: var(--text-soft);
    line-height: 1.75;
    margin-bottom: 14px;
}

.ab-intro-box p:last-child { margin-bottom: 0; }

/* ---- Who We Are ---- */
.ab-who {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 54px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 44px;
    align-items: start;
}

.ab-who-lead {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.015em;
    margin-top: 18px;
    color: var(--text);
}

.ab-who p {
    font-size: 1.05rem;
    color: var(--text-soft);
    line-height: 1.75;
    margin-bottom: 18px;
}

.ab-who p:last-child { margin-bottom: 0; }

/* ---- Name / Bubble cards ---- */
.ab-name-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-top: 8px;
}

.ab-bubble {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 18px 50px -22px var(--glow);
    transition: transform 0.25s, border-color 0.25s;
}

.ab-bubble:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.ab-bubble::after {
    content: "";
    position: absolute;
    left: 46px;
    bottom: -11px;
    width: 22px;
    height: 22px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
    transition: border-color 0.25s;
}

.ab-bubble:hover::after { border-color: var(--accent); }

.ab-bubble-word {
    font-size: clamp(2.6rem, 5vw, 3.6rem);
    font-weight: 800;
    color: var(--accent-hi);
    letter-spacing: -0.02em;
    line-height: 1;
}

.ab-bubble-note {
    display: block;
    margin-top: 12px;
    font-size: 0.88rem;
    font-style: italic;
    color: var(--accent-hi);
    opacity: 0.8;
}

.ab-bubble-role {
    display: block;
    margin-top: 14px;
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 500;
}

.ab-bubble-role span {
    color: var(--text-soft);
    font-weight: 400;
}

/* ---- How We Work (strip) ---- */
.ab-how-section {
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    padding: 120px 0;
}

.ab-how {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(3rem, 7vw, 7rem);
    align-items: start;
}

.ab-how-left p {
    color: var(--text-soft);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-top: 24px;
    max-width: 440px;
}

/* Three-column numbered strip (How We Work) */
.ab-how-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
}

.ab-how-strip-step {
    padding: 36px 34px 36px 0;
    border-right: 1px solid var(--border);
}

.ab-how-strip-step:last-child {
    border-right: none;
    padding-right: 0;
}

.ab-how-strip-step:not(:first-child) { padding-left: 34px; }

.ab-how-strip-num {
    font-size: clamp(2.4rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--accent-hi);
    letter-spacing: -0.03em;
    line-height: 1;
    opacity: 0.9;
}

.ab-how-strip-step h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 18px 0 8px;
    color: var(--text);
}

.ab-how-strip-step p {
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.ab-how-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ab-step {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
    transition: 0.3s;
}

.ab-step:last-child {
    border-bottom: none;
}

.ab-step:hover .ab-step-num {
    color: var(--accent-hi);
}

.ab-step-num {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--text-mute);
    flex-shrink: 0;
    padding-top: 4px;
    min-width: 28px;
    transition: 0.3s;
}

.ab-step h5 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.ab-step p {
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.6;
    margin: 0;
}

/* ---- CTA ---- */
.ab-cta-section {
    border-top: 1px solid var(--border);
    padding: 140px 0;
    position: relative;
    overflow: hidden;
}

.ab-cta {
    text-align: center;
    position: relative;
    z-index: 2;
}

.ab-cta-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(30, 109, 250, 0.14) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.ab-cta > *:not(.ab-cta-glow) {
    position: relative;
    z-index: 2;
}

.ab-cta p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-soft);
    max-width: 520px;
    margin: 1.2rem auto 0;
    line-height: 1.65;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .ab-story-grid,
    .ab-mv-grid,
    .ab-how,
    .ab-who,
    .ab-name-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .ab-who { padding: 32px; }

    .ab-values-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .ab-stats {
        flex-wrap: wrap;
        gap: 32px;
        padding: 48px 30px;
    }

    .ab-stat-div { display: none; }

    .ab-stat {
        flex: 1 1 calc(50% - 16px);
        min-width: 120px;
    }

    .ab-ghost { display: none; }

    .ab-how-strip {
        grid-template-columns: 1fr;
        border-top: none;
    }

    .ab-how-strip-step {
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 28px 0;
    }

    .ab-how-strip-step:not(:first-child) { padding-left: 0; }

    .ab-bubble::after { display: none; }

    /* Creative-studio intro box: stop the 142% overflow on smaller screens */
    .ab-intro-box {
        width: 100%;
        padding: 30px 28px;
    }

    /* Keep the "Ready to build" CTA centered even though .ed-big
       switches to left-aligned at this breakpoint. */
    .ab-cta .ed-big {
        text-align: center;
    }

    .ab-cta .ctas {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .ab-values-grid { grid-template-columns: 1fr; }

    /* Hero headings (services / works / contact) scale down and tighten
       line spacing on phones — overrides the inline font-size: 53px. */
    h1.contact-hero {
        font-size: clamp(2rem, 9vw, 53px) !important;
        line-height: 1.15;
        /* Drop the desktop negative margin so the heading and the
           paragraph below sit with even spacing on phones. */
        margin-bottom: 14px !important;
    }

    .ab-section,
    .ab-how-section {
        padding: 80px 0;
    }

    .ab-cta-section { padding: 100px 0; }

    .ab-intro-box {
        padding: 24px 20px;
        border-radius: 18px;
    }

    /* Stack the CTA buttons full-width on phones */
    .ab-cta .ctas {
        flex-direction: column;
        align-items: center;
    }

    .ab-cta .ctas .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* ==========================================================================
   CONTACT PAGE
   ========================================================================== */
.contact-hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 20px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 80px;
    margin-bottom: 120px;
}

.contact-form-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 50px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

.contact-form-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 28px;
    letter-spacing: -0.01em;
}

.form-group-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.contact-form label {
    font-size: 0.75rem;
    color: var(--accent-hi);
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    color: var(--text);
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-mute);
}

.contact-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.contact-form select option {
    background: var(--surface);
    color: var(--text);
    padding: 8px;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
    background: var(--bg-2);
}

.contact-info-block {
    margin-bottom: 50px;
}

.contact-info-block h5 {
    color: var(--accent-hi);
    margin-bottom: 20px;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
}

.contact-info-block p,
.contact-info-block a {
    font-size: 1.1rem;
    color: var(--text-soft);
    line-height: 1.6;
    font-family: 'Poppins', system-ui, sans-serif;
}

.contact-info-block .email-link {
    font-size: 1.4rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

/* --- Contact polish: heading rhythm, fonts & smoothness --- */

/* Tighter internal spacing for the hero heading (it wraps to two lines) */
h1.contact-hero {
    line-height: 1.06;
    letter-spacing: -0.015em;
}

.about-hero .eyebrow {
    margin-bottom: 16px;
}

.about-hero .about-intro-p {
    max-width: 620px;
}

/* Keep the contact social icons left-aligned on every screen size —
   overrides the footer's centred .socials rule that kicks in on mobile. */
.contact-info-block .socials {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 1.1rem;
}

/* Belt-and-braces: force Poppins across the whole contact stage */
.contact-grid,
.contact-grid input,
.contact-grid select,
.contact-grid textarea,
.contact-grid button {
    font-family: 'Poppins', system-ui, sans-serif;
}

/* Smooth transitions so the layout feels responsive on touch/hover */
.contact-info-block,
.contact-form-box,
.contact-form input,
.contact-form select,
.contact-form textarea {
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

/* ==========================================================================
   WORKS PAGE
   ========================================================================== */
.works-proj-grid {
    display: grid;
    /* min() keeps cards from overflowing on phones narrower than the track */
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 28px;
    margin-bottom: 120px;
}

@keyframes worksCardIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .works-proj-grid {
        gap: 20px;
        margin-bottom: 80px;
        justify-items: center;
    }

    /* Phones: let each card fill its column and stay centred, instead of
       the fixed 380px / 280px carousel width set in hero.css. */
    .works-proj-grid .proj-panel {
        width: 100%;
        max-width: 460px;
        /* Always-on glow so the desktop hover effect is felt on touch. */
        box-shadow: 0 16px 42px -24px var(--glow);
        border-color: var(--border-hi);
        /* Gentle entrance so the grid doesn't feel static on mobile. */
        animation: worksCardIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }
}

@media (prefers-reduced-motion: reduce) {
    .works-proj-grid .proj-panel { animation: none; }
}

.works-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.work-tile {
    aspect-ratio: 16/9;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: 0.4s;
}

.work-tile:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (PAGES)
   ========================================================================== */
@media (max-width: 900px) {
    .vision-section,
    .contact-grid,
    .works-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    /* Contact: tighten the gap between the details and the form, then lay
       the detail blocks out as cards that fill the available width. */
    .contact-grid {
        gap: 40px;
        margin-bottom: 80px;
    }

    .contact-info {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: start;
    }

    .contact-info-block {
        margin-bottom: 0;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border);
        border-radius: 18px;
        padding: 26px 24px;
    }

    .contact-info-block:hover {
        border-color: var(--border-hi);
    }

    /* The social card spans the full width beneath the two detail cards. */
    .contact-info-block:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    /* Hero: tighter heading + intro spacing on phones */
    .about-hero .eyebrow { margin-bottom: 12px; }
    .about-hero .about-intro-p { margin-bottom: 26px; }

    /* Stack the detail cards one per row so each fills the screen width */
    .contact-info {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .contact-info-block { padding: 22px 20px; }

    .contact-info-block .email-link { font-size: 1.2rem; }

    /* Form: reduce the heavy desktop padding so inputs aren't squeezed */
    .contact-form-box {
        padding: 26px 20px;
        border-radius: 22px;
    }

    .contact-form-title {
        font-size: 1.35rem;
        margin-bottom: 20px;
    }

    /* Stack the name / email pair */
    .form-group-2 { grid-template-columns: 1fr; }

    /* Tighter vertical rhythm inside the form (overrides inline gap: 30px) */
    .contact-form { gap: 20px !important; }

    .contact-form input,
    .contact-form select,
    .contact-form textarea {
        padding: 13px 14px;
        font-size: 0.95rem;
    }

    .contact-form label { margin-bottom: 8px; }
}

/* ===== GET A QUOTE MODAL ===== */
.quote-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.quote-modal.is-open {
    display: flex;
}

.quote-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 15, 30, 0.72);
    backdrop-filter: blur(6px);
    animation: quoteFade 0.25s ease;
}

.quote-modal-box {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: auto;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 44px;
    box-shadow: 0 30px 80px rgba(7, 15, 30, 0.55);
    animation: quotePop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.quote-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-soft);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.25s;
}

.quote-modal-close:hover {
    color: var(--text);
    border-color: var(--border-hi);
}

.quote-modal-close svg {
    width: 18px;
    height: 18px;
}

@keyframes quoteFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes quotePop {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
    .quote-modal { padding: 16px; }
    .quote-modal-box { padding: 32px 22px; border-radius: 18px; }
}
