/* ============================================
   MABSTUDIO - RESPONSIVE STYLES
   Mobile-first polish for phone & tablet
   ============================================ */

/* =================================
   MOBILE NAVIGATION (Hamburger)
   ================================= */

/* Burger button - hidden on desktop */
.burger-menu {
    display: none;
    position: relative;
    width: 32px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 200;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.burger-menu span {
    display: block;
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--white);
    transition: all 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

.burger-menu span:nth-child(1) { top: 0; }
.burger-menu span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.burger-menu span:nth-child(3) { bottom: 0; }

/* Burger open state */
.burger-menu.is-open span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.burger-menu.is-open span:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

.burger-menu.is-open span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Mobile nav overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.97);
    z-index: 150;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.mobile-nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-overlay .mobile-nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

.mobile-nav-overlay.is-open .mobile-nav-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav-overlay.is-open .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav-overlay.is-open .mobile-nav-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-nav-overlay.is-open .mobile-nav-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-nav-overlay.is-open .mobile-nav-link:nth-child(4) { transition-delay: 0.25s; }

.mobile-nav-overlay .mobile-nav-link:hover,
.mobile-nav-overlay .mobile-nav-link.active {
    color: #E11D2A;
}

.mobile-nav-overlay .mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 0;
    width: 0;
    height: 2px;
    background: #E11D2A;
    transition: width 0.3s ease;
}

.mobile-nav-overlay .mobile-nav-link:hover::after,
.mobile-nav-overlay .mobile-nav-link.active::after {
    width: 100%;
}

/* When menu is open, header should not blend */
.header.nav-open {
    mix-blend-mode: normal;
    z-index: 200;
}

/* Mobile nav footer info */
.mobile-nav-footer {
    position: absolute;
    bottom: 3rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* =================================
   TOUCH DEVICES
   ================================= */
@media (hover: none) and (pointer: coarse) {
    /* Hide custom cursor on touch */
    .cursor-magnetic {
        display: none !important;
    }

    body {
        cursor: auto !important;
    }

    /* Disable hover-based layout shifts */
    .service-card:hover {
        transform: none;
    }

    .project-card:hover {
        transform: none;
        box-shadow: none;
    }

    .project-card:hover .project-image img {
        transform: none;
    }

    .pricing-card:hover {
        transform: none;
    }

    .landing-split .split-section {
        flex: 1;
    }
}

/* =================================
   TABLET (max-width: 1024px)
   ================================= */
@media (max-width: 1024px) {
    :root {
        --text-4xl: 2.5rem;
        --text-3xl: 2rem;
    }

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

    /* Reduce section paddings */
    .services-section,
    .process-section,
    .about-teaser {
        padding: 6rem 5vw;
    }

    .stats-section {
        padding: 5rem 5vw;
    }
}

/* =================================
   MOBILE (max-width: 768px)
   ================================= */
@media (max-width: 768px) {
    :root {
        --text-4xl: 2rem;
        --text-3xl: 1.75rem;
        --text-2xl: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 3rem;
    }

    /* ---- HEADER / NAV ---- */
    .header {
        padding: 1.2rem 1.5rem;
        align-items: center;
    }

    /* Hide desktop nav links, show burger */
    .header .nav-link:not(:first-child) {
        display: none;
    }

    .burger-menu {
        display: block;
    }

    .mobile-nav-overlay {
        display: flex;
    }

    /* ---- CURSOR ---- */
    .cursor-magnetic {
        display: none !important;
    }

    body {
        cursor: auto !important;
    }

    /* ---- DECORATIVE ELEMENTS ---- */
    .deco-cross {
        display: none;
    }

    .hero-deco-text.deco-right,
    .hero-deco-text.deco-left {
        display: none;
    }

    .hero-deco-text.deco-bottom {
        font-size: 0.65rem;
        left: 1.5rem;
        bottom: 1.5rem;
    }

    .hero-deco-left,
    .hero-deco-right {
        display: none;
    }

    .bg-number {
        font-size: 8rem;
        opacity: 0.04;
    }

    .section-decorated::before {
        top: 1rem;
        left: 1rem;
        font-size: 1rem;
    }

    .section-decorated::after {
        bottom: 1rem;
        right: 1rem;
        font-size: 1rem;
    }

    /* ---- PRELOADER ---- */
    .preloader-logo {
        font-size: 2rem;
        letter-spacing: 0.15em;
        margin-bottom: 2rem;
    }

    .preloader-progress {
        width: 200px;
    }

    .preloader-percent {
        bottom: 2rem;
        right: 2rem;
        font-size: 4rem;
    }

    .preloader::before {
        top: 1.5rem;
        left: 1.5rem;
        font-size: 1rem;
    }

    .preloader::after {
        bottom: 1.5rem;
        left: 1.5rem;
        font-size: 0.8rem;
    }

    /* ---- HERO SECTION (index.html) ---- */
    .hero-section {
        padding: 1.5rem;
        min-height: 100svh;
    }

    .hero-architecture {
        font-size: 0.75rem;
        letter-spacing: 0.2em;
        margin-bottom: 0.75rem;
    }

    .hype-text-wrapper {
        font-size: clamp(3rem, 15vw, 6rem);
    }

    .hype-outline {
        -webkit-text-stroke-width: 1px;
    }

    .scroll-indicator {
        bottom: 1.5rem;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.6rem;
    }

    .scroll-line {
        height: 30px;
    }

    /* ---- SERVICES SECTION ---- */
    .services-section {
        padding: 3.5rem 1.5rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: clamp(1.8rem, 7vw, 3rem);
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .service-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }

    .service-title {
        font-size: 1.25rem;
    }

    .service-desc {
        font-size: 0.9rem;
    }

    /* ---- STATS SECTION ---- */
    .stats-section {
        padding: 3rem 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-item {
        padding: 1.5rem 0.5rem;
    }

    .stat-number {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.08em;
    }

    /* ---- ABOUT TEASER ---- */
    .about-teaser {
        padding: 3.5rem 1.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-title {
        font-size: clamp(1.6rem, 7vw, 2.5rem);
    }

    .about-desc {
        font-size: 1rem;
    }

    .about-visual {
        height: 150px;
    }

    .about-marquee span {
        font-size: 1.5rem;
    }

    .about-link {
        font-size: 0.85rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* ---- PROCESS SECTION ---- */
    .process-section {
        padding: 3.5rem 1.5rem;
    }

    .process-timeline {
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 2.5rem;
    }

    .process-step {
        padding: 1.5rem;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        border-top: none;
    }

    .process-step:first-child {
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    .process-title {
        font-size: 1.1rem;
    }

    .process-desc {
        font-size: 0.85rem;
    }

    /* ---- TECH MARQUEE ---- */
    .tech-section {
        padding: 2.5rem 0;
    }

    .tech-track span {
        font-size: 0.85rem;
        padding: 0 1rem;
    }

    /* ---- FOOTER ---- */
    .footer {
        padding: 3rem 1.5rem 4rem;
        min-height: auto;
    }

    .footer-cta {
        font-size: clamp(2.5rem, 12vw, 5rem);
        margin-bottom: 1.5rem;
        line-height: 1;
    }

    .footer-email {
        font-size: clamp(1rem, 4vw, 1.5rem);
        margin-bottom: 1.5rem;
        word-break: break-all;
    }

    .footer-socials {
        flex-wrap: wrap;
        gap: 1.5rem;
        margin-bottom: 2.5rem;
        justify-content: center;
    }

    .social-link {
        font-size: 0.8rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
        font-size: 0.75rem;
    }

    .footer-left {
        align-items: center;
    }

    .footer-legal {
        order: 3;
    }

    .footer-right {
        justify-content: center;
    }

    .footer-punk-deco {
        font-size: 1rem;
        gap: 0.5rem;
        top: 1.5rem;
    }

    /* Marquee red banner */
    .deco-marquee {
        bottom: 0;
        position: relative;
        margin-top: 3rem;
    }

    .deco-marquee-track span {
        font-size: 0.65rem;
        padding: 0 1rem;
    }

    /* ---- PAGE CONTENT LAYOUT ---- */
    .page-content {
        padding: var(--space-lg) var(--space-md);
        padding-top: calc(var(--space-2xl) + var(--space-md));
    }

    .back-link {
        top: var(--space-md);
        left: var(--space-md);
    }

    /* ---- LANDING SPLIT ---- */
    .landing-split {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .split-section {
        flex: none !important;
        width: 100%;
        min-height: 50vh;
        opacity: 1 !important;
        padding: var(--space-xl) var(--space-md);
    }

    .split-left::after {
        right: auto;
        top: auto;
        bottom: 0;
        left: 10%;
        width: 80%;
        height: 1px;
        background: linear-gradient(to right,
                transparent,
                rgba(255, 255, 255, 0.2),
                transparent);
    }

    .split-content {
        max-width: 100%;
        padding: var(--space-md);
    }

    .split-title {
        font-size: var(--text-3xl);
    }

    /* ---- GRIDS ---- */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card,
    .service-card {
        max-width: 100%;
    }

    /* ---- PROJECT SECTIONS ---- */
    .project-section {
        height: 70vh;
    }

    .project-content {
        padding: 2rem;
        width: 90%;
        max-width: 100%;
    }

    .project-title {
        font-size: clamp(1.5rem, 8vw, 3rem);
    }

    .project-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .project-tags span {
        font-size: 0.65rem;
        padding: 0.4rem 0.75rem;
    }

    /* ---- MAIL CLIENT (Full Screen) ---- */
    .mail-client-modal {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
        transform: none !important;
    }

    .mail-client-overlay.active .mail-client-modal {
        transform: none;
    }

    .mail-body {
        flex: 1;
    }

    .mail-textarea {
        min-height: 150px;
    }

    /* ---- PRICING ---- */
    .pricing-section {
        padding: 3.5rem 1.5rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .pricing-card {
        padding: 2.5rem 1.5rem;
    }

    .pricing-card-price {
        font-size: 3rem;
    }

    .pricing-cta {
        padding: 1rem;
        font-size: 0.85rem;
    }

    /* ---- TESTIMONIAL ---- */
    .testimonial-section {
        padding: 3.5rem 1.5rem;
    }

    /* ---- CONTACT PAGE ---- */
    .contact-hero {
        padding: 100px 1.5rem 3rem;
        min-height: auto;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-info h1 {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .contact-info p {
        font-size: 1rem;
        max-width: 100%;
    }

    .contact-item-value {
        font-size: 1.2rem;
    }

    .contact-socials {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .contact-socials a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-submit {
        width: 100%;
        padding: 1.2rem 2rem;
        justify-content: center;
        min-height: 50px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .contact-deco-cross {
        display: none;
    }

    /* ---- WEBDESIGN PAGE ---- */
    .webdesign-hero {
        padding: 5rem 1.5rem 2.5rem;
        min-height: auto;
    }

    .webdesign-hero-title {
        font-size: clamp(3rem, 15vw, 6rem);
    }

    .webdesign-hero-subtitle {
        font-size: clamp(0.95rem, 3vw, 1.2rem);
        margin-bottom: 2rem;
    }

    .hero-pretitle {
        margin-bottom: 1.5rem;
    }

    .pretitle-line {
        width: 30px;
    }

    .pretitle-text {
        font-size: 0.75rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .hero-stat-divider {
        display: none;
    }

    .stat-value {
        font-size: 2rem;
    }

    .hero-scroll-indicator {
        bottom: 1.5rem;
    }

    /* Energy Tagline */
    .energy-tagline {
        min-height: 40vh;
        padding: 2rem 1.5rem 0;
    }

    .tagline-pre {
        font-size: 0.7rem;
        letter-spacing: 0.2em;
        margin-bottom: 1rem;
    }

    .tagline-main {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .tagline-sub {
        font-size: 1rem;
        margin-top: 1rem;
    }

    /* ===== 3D CAN — in flow, fullscreen centered, hidden at services ===== */
    .can-layer {
        position: relative !important;
        width: 85vw !important;
        height: 65vh !important;
        margin: -12rem auto 4rem !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        z-index: 5 !important;
        pointer-events: none !important;
    }

    .can-canvas {
        width: 100% !important;
        height: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }

    /* ===== SERVICES ===== */
    .pinned-services {
        padding-bottom: 2rem;
    }

    .service-block {
        min-height: 100svh !important;
        padding: 0 1.2rem !important;
    }

    .service-block-inner {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .service-block[data-service="2"] .service-block-inner,
    .service-block[data-service="4"] .service-block-inner {
        direction: ltr !important;
    }

    /* Title - STICKY at top while text scrolls */
    .service-title-wrap {
        position: sticky !important;
        top: 5rem !important;
        z-index: 12;
        width: 100%;
        padding: 0.5rem 0;
    }

    .service-card-glass {
        padding: 1rem 1.2rem !important;
        border-radius: 1rem !important;
        opacity: 1 !important;
        transform: none !important;
        overflow: hidden;
    }

    .service-num {
        font-size: 2.2rem !important;
        margin-bottom: 0.1rem !important;
        line-height: 1 !important;
    }

    .service-name {
        font-size: clamp(1.1rem, 5vw, 1.6rem) !important;
        margin-bottom: 0 !important;
        opacity: 1 !important;
        transform: none !important;
        line-height: 1.1;
        word-break: break-word;
    }

    /* Text — dimmed by default, bright on scroll */
    .pinned-services .service-text-scroll {
        padding: 25vh 0 8vh !important;
        gap: 20vh !important;
        width: 100% !important;
    }

    .scroll-line-item {
        font-size: clamp(1.1rem, 4.5vw, 1.5rem) !important;
        filter: none !important;
        transition: all 0.4s ease !important;
        opacity: 0.3 !important;
        transform: none !important;
        color: rgba(255, 255, 255, 0.4) !important;
    }

    .scroll-line-item.is-visible {
        opacity: 1 !important;
        transform: none !important;
        color: #fff !important;
    }

    .scroll-line-item.accent {
        font-size: clamp(1.3rem, 5vw, 1.7rem) !important;
    }

    .scroll-line-item.accent.is-visible {
        color: #E11D2A !important;
    }

    .service-progress {
        display: none !important;
    }

    /* Service showcase (alternative layout) */
    .services-showcase {
        padding: 4rem 1.5rem;
    }

    .service-showcase-item {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 5rem;
    }

    .service-showcase-item:nth-child(even) {
        direction: ltr;
    }

    .service-showcase-number {
        font-size: 4rem;
        margin-bottom: 1rem;
    }

    .service-showcase-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .service-showcase-desc {
        font-size: 1rem;
    }

    .service-showcase-visual {
        height: 250px;
    }

    /* ---- LEGAL PAGE ---- */
    .legal-container {
        padding: 100px 1.5rem 4rem;
    }

    .legal-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .legal-section h2 {
        font-size: 1.2rem;
    }

    .legal-section h3 {
        font-size: 1rem;
    }

    /* ---- TOUCH TARGETS ---- */
    .btn-liquid-glass,
    .split-cta,
    .footer-link,
    .mail-close,
    .pricing-cta,
    .about-link,
    .project-link {
        min-height: 44px;
        min-width: 44px;
    }

    a,
    button {
        -webkit-tap-highlight-color: transparent;
    }
}

/* =================================
   SMALL MOBILE (max-width: 480px)
   ================================= */
@media (max-width: 480px) {
    :root {
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
    }

    /* Hero smaller */
    .hype-text-wrapper {
        font-size: clamp(2.5rem, 14vw, 4rem);
    }

    .hero-architecture {
        font-size: 0.65rem;
        letter-spacing: 0.15em;
    }

    /* Stats 2x2 grid tight */
    .stats-grid {
        gap: 0.5rem;
    }

    .stat-item {
        padding: 1rem 0.25rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Footer tighter */
    .footer-cta {
        font-size: clamp(2rem, 13vw, 3.5rem);
    }

    .footer-email {
        font-size: 0.95rem;
    }

    .footer-socials {
        gap: 1rem;
    }

    .footer-bottom {
        font-size: 0.65rem;
    }

    /* Contact */
    .contact-info h1 {
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .contact-item-value {
        font-size: 1rem;
    }

    /* Pricing */
    .pricing-card-price {
        font-size: 2.5rem;
    }

    .pricing-card-title {
        font-size: 1.3rem;
    }

    /* Pinned services */
    .service-block {
        min-height: auto;
        padding: 2rem 1rem;
    }

    .service-num {
        font-size: 2.5rem;
    }

    .service-name {
        font-size: 1.3rem;
    }

    .scroll-line-item {
        font-size: clamp(1.1rem, 5vw, 1.5rem);
    }

    .scroll-line-item.accent {
        font-size: clamp(1.2rem, 5.5vw, 1.7rem);
    }
}

/* =================================
   SAFE AREA (iPhone Notch)
   ================================= */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }

    .mobile-nav-overlay {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .header {
        padding-top: max(1.2rem, env(safe-area-inset-top));
    }
}

/* =================================
   LANDSCAPE PHONE
   ================================= */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100svh;
        padding: 1rem;
    }

    .hype-text-wrapper {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .scroll-indicator {
        display: none;
    }

    .hero-scroll-indicator {
        display: none;
    }

    .footer {
        min-height: auto;
    }

    .footer-cta {
        font-size: clamp(2rem, 8vw, 4rem);
        margin-bottom: 1.5rem;
    }

    .webdesign-hero {
        min-height: auto;
        padding: 5rem 1.5rem 2rem;
    }
}
