/* =========================================
   VARIABLES & RESETS
   ========================================= */
:root {
    /* Color Palette */
    --color-pink: #FF007F;
    --color-yellow: #E6FB04;
    --color-blue: #0033FF;
    --color-black: #050505;
    --color-white: #FAFAFA;
    --color-bg: #F0F0F0;
    
    /* Typography */
    --font-heading: 'Archivo Black', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    
    /* Brutalist Styles */
    --border-thick: 4px solid var(--color-black);
    --border-ultra: 8px solid var(--color-black);
    --shadow-hard: 8px 8px 0 var(--color-black);
    --shadow-hover: 4px 4px 0 var(--color-black);
    --shadow-inset: inset 4px 4px 0 var(--color-black);
    --transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);

    /* Sticky header height, kept in sync by js/main.js */
    --header-h: 92px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-black);
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* Background Patterns */
.noise-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 1rem;
}

p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.highlight {
    background-color: var(--color-yellow);
    padding: 0 0.5rem;
    display: inline-block;
    border: var(--border-thick);
    transform: rotate(-2deg);
}

.text-center {
    text-align: center;
}

/* Utility Colors */
.color-pink { background-color: var(--color-pink) !important; color: var(--color-white) !important; }
.color-yellow { background-color: var(--color-yellow) !important; color: var(--color-black) !important; }
.color-blue { background-color: var(--color-blue) !important; color: var(--color-white) !important; }
.color-white { background-color: var(--color-white) !important; color: var(--color-black) !important; }

/* =========================================
   COMPONENTS
   ========================================= */

/* Buttons */
.brutal-btn {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-transform: uppercase;
    text-decoration: none;
    padding: 1rem 2rem;
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.primary-btn {
    background-color: var(--color-pink);
    color: var(--color-white);
}

.secondary-btn {
    background-color: var(--color-white);
    color: var(--color-black);
}

.brutal-btn:hover, .brutal-btn:focus {
    transform: translate(4px, 4px);
    box-shadow: var(--shadow-hover);
}

.brutal-btn:active {
    transform: translate(8px, 8px);
    box-shadow: 0 0 0 var(--color-black);
}

/* Cards */
.card {
    background-color: var(--color-white);
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
}

.card:hover {
    transform: translate(-4px, -4px) rotate(1deg);
    box-shadow: 12px 12px 0 var(--color-black);
}

/* Stickers / Tags */
.sticker {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    background-color: var(--color-yellow);
    color: var(--color-black);
    padding: 0.25rem 1rem;
    border: var(--border-thick);
    box-shadow: 4px 4px 0 var(--color-black);
    text-transform: uppercase;
}

.tag {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border: 2px solid var(--color-black);
    text-transform: uppercase;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag-pink { background-color: var(--color-pink); color: white; }
.tag-blue { background-color: var(--color-blue); color: white; }
.tag-yellow { background-color: var(--color-yellow); color: black; }
.tag-black { background-color: var(--color-black); color: white; }

.rotate-left { transform: rotate(-5deg); }
.rotate-right { transform: rotate(5deg); }

/* Images */
.brutal-img {
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    width: 100%;
    display: block;
    filter: grayscale(100%) contrast(120%);
    transition: var(--transition);
}

.brutal-img:hover {
    filter: grayscale(0%) contrast(100%);
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 var(--color-black);
}

/* =========================================
   LAYOUT & SECTIONS
   ========================================= */
main {
    padding: 0 5%;
    max-width: 1400px;
    margin: 0 auto;
}

section {
    padding: 8rem 0;
}

.section-title {
    font-size: 4rem;
    margin-bottom: 4rem;
    word-break: break-word;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: var(--color-white);
    border-bottom: var(--border-thick);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    background-color: var(--color-black);
    color: var(--color-yellow);
    padding: 0.2rem 0.5rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-heading);
    text-decoration: none;
    color: var(--color-black);
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--color-pink);
    text-shadow: 2px 2px 0 var(--color-black);
}

/* Hero Section */
.hero {
    position: relative;
    /* Fill exactly the first screen: viewport minus the sticky header */
    min-height: calc(100vh - var(--header-h));
    min-height: calc(100svh - var(--header-h));
    padding: clamp(1.5rem, 4vh, 4rem) 0;
    display: flex;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero-title {
    /* Scales with width AND height so four lines always fit above the fold */
    font-size: clamp(2.4rem, min(9.5vw, 12vh), 8rem);
    letter-spacing: -2px;
    line-height: 0.9;
    margin-bottom: clamp(1rem, 3vh, 2rem);
}

.line-wrap {
    overflow: hidden;
}

.char-wrap {
    display: inline-block;
    transform: translateY(100%);
}

.hero-subtitle {
    font-size: clamp(1rem, min(2.4vw, 3vh), 2rem);
    font-weight: bold;
    max-width: 600px;
    margin-bottom: clamp(1.25rem, 4vh, 3rem);
}

/* Short landscape viewports (a phone on its side): tighten the hero so it still fits one screen */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1rem 0;
    }

    .hero-title {
        font-size: clamp(1.8rem, 9vh, 4rem);
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        max-width: 60%;
    }

    .hero-btn {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }

    .hero-shape-1, .hero-shape-2 {
        opacity: 0.5;
        z-index: -1;
    }
}

/* Decorative background shapes in hero */
.shape {
    position: absolute;
    border: var(--border-thick);
    z-index: 1;
}

.hero-shape-1 {
    width: 300px;
    height: 300px;
    background-color: var(--color-blue);
    border-radius: 50%;
    right: 5%;
    top: 10%;
}

.hero-shape-2 {
    width: 200px;
    height: 200px;
    background-color: var(--color-yellow);
    right: 15%;
    bottom: 10%;
    transform: rotate(15deg);
}

/* Marquee */
.marquee-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 1rem 0;
    overflow: hidden;
    border-top: var(--border-thick);
    border-bottom: var(--border-thick);
    font-family: var(--font-heading);
    font-size: 2rem;
    white-space: nowrap;
    display: flex;
}

.marquee-content {
    display: flex;
    animation: marquee 20s linear infinite;
}

.marquee-content span {
    padding: 0 1rem;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image-container {
    position: relative;
    max-width: 500px;
}

.about-sticker {
    position: absolute;
    bottom: -20px;
    right: -20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 3rem;
}

.stat-card {
    border: var(--border-thick);
    padding: 1rem;
    text-align: center;
    background-color: var(--color-white);
    box-shadow: 4px 4px 0 var(--color-black);
}

.stat-num {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-blue);
}

.stat-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    margin: 0;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.service-card {
    padding: 2.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-header h3 {
    margin: 0;
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    word-break: break-word;
}

/* Pink card: keep list separators visible on the dark background */
.service-card.color-pink .service-list li {
    border-bottom-color: var(--color-white);
}

.service-list {
    list-style: none;
    margin-top: 2rem;
}

.service-list li {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.8rem 0;
    border-bottom: 2px solid var(--color-black);
    display: flex;
    align-items: center;
}

.service-list li::before {
    content: '→';
    margin-right: 1rem;
    font-family: var(--font-heading);
}

/* Work Section */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 3rem;
}

.work-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.work-img-wrapper {
    width: 100%;
    height: 250px;
    border-bottom: var(--border-thick);
    overflow: hidden;
    position: relative;
    background-color: var(--color-black);
}

.work-placeholder {
    position: relative;
    top: -20%;
    width: 100%;
    height: 120%; /* oversized so the scroll parallax never exposes a gap */
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    transition: var(--transition);
}

.work-card:hover .work-placeholder {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Typographic tiles for projects without a screenshot yet */
.work-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    filter: none;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0 18px,
        rgba(5, 5, 5, 0.12) 18px 36px
    );
}

.work-card:hover .work-tile {
    filter: none;
}

.tile-yellow { background-color: var(--color-yellow); color: var(--color-black); }
.tile-blue   { background-color: var(--color-blue);   color: var(--color-white); }
.tile-pink   { background-color: var(--color-pink);   color: var(--color-white); }

.tile-text {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    line-height: 1;
    letter-spacing: -1px;
    text-transform: uppercase;
    text-shadow: 4px 4px 0 var(--color-black);
    padding: 0 1rem;
}

.tile-blue .tile-text,
.tile-pink .tile-text {
    text-shadow: 4px 4px 0 rgba(5, 5, 5, 0.6);
}

.tile-sticker {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    background-color: var(--color-pink);
    color: var(--color-white);
}

/* Disabled-looking button for unreleased projects */
.btn-disabled {
    cursor: not-allowed;
    background-color: var(--color-bg);
    color: var(--color-black);
    background-image: repeating-linear-gradient(
        45deg,
        transparent 0 8px,
        rgba(5, 5, 5, 0.08) 8px 16px
    );
}

.btn-disabled:hover,
.btn-disabled:focus,
.btn-disabled:active {
    transform: none;
    box-shadow: var(--shadow-hard);
}

.work-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.work-title {
    font-size: 2rem;
    margin-top: 1rem;
}

.work-desc {
    flex-grow: 1;
}

/* Toolkit Section */
.toolkit {
    padding-bottom: 0;
}

.toolkit-banner {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 3rem;
    align-items: center;
    padding: 3rem;
}

.toolkit-title {
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    margin: 1.5rem 0 1rem;
    text-shadow: 4px 4px 0 var(--color-black);
}

.toolkit-banner-text p {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0;
}

.toolkit-banner .service-list {
    margin: 0 0 2rem;
}

.toolkit-banner .service-list li {
    border-bottom-color: var(--color-white);
}

@media (max-width: 768px) {
    .toolkit-banner {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
}

/* Contact Section */
.contact-box {
    border: var(--border-ultra);
    padding: 5rem 3rem;
    text-align: center;
    box-shadow: 16px 16px 0 var(--color-black);
}

.contact-title {
    font-size: clamp(2rem, 6vw, 5rem);
    margin-bottom: 1rem;
}

.contact-subtitle {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 3rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 3rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 1rem;
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 1024px) {
    .about-grid, .services-grid {
        grid-template-columns: 1fr;
    }
    
    .about-image-container {
        margin: 0 auto;
    }
    
    .hero-shape-1, .hero-shape-2 {
        opacity: 0.5;
        z-index: -1;
    }
}

@media (max-width: 768px) {
    /* Scale down brutalist elements for mobile so they don't overflow */
    :root {
        --shadow-hard: 6px 6px 0 var(--color-black);
        --border-thick: 3px solid var(--color-black);
        --border-ultra: 5px solid var(--color-black);
    }

    main {
        padding: 0 1rem;
    }

    .header {
        position: sticky;
        top: 0;
        z-index: 100;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }

    .nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: clamp(1.4rem, 7.5vw, 2.2rem); /* keeps SELECTED_WORK on one line on phones */
        margin-bottom: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card {
        padding: 1.5rem;
        margin-right: 6px;
        margin-bottom: 6px;
    }

    .service-card {
        padding: 1.5rem;
    }

    .work-card {
        padding: 0;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .card-header h3 {
        font-size: 1.5rem;
    }
    
    .contact-box {
        padding: 2rem 1rem;
        margin-right: 8px;
        margin-bottom: 8px;
        box-shadow: 8px 8px 0 var(--color-black);
    }
    
    .footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .brutal-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .about-sticker {
        bottom: 10px;
        right: 10px;
    }
}

/* =========================================
   ACCESSIBILITY
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .char-wrap, .reveal-element {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* =========================================
   PROJECT PAGES
   ========================================= */
.project-hero {
    min-height: 50vh;
    padding-top: 4rem;
    padding-bottom: 2rem;
}

.project-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.project-links {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-gallery {
    padding: 4rem 0;
    column-count: 2;
    column-gap: 2rem;
}

.project-gallery img {
    width: 100%;
    margin-bottom: 2rem;
    display: block;
}

@media (max-width: 768px) {
    .project-gallery {
        column-count: 1;
    }
}

.about-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1.5rem;
    display: block;
}

/* =========================================
   PROJECT PAGE DETAILS
   ========================================= */
.project-section {
    padding: 2rem 0;
}

.project-section .section-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 2rem;
}

.project-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 1.5rem;
}

.project-facts .stat-num {
    font-size: 2.2rem;
}

.project-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 2.5rem;
}

.project-card-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.project-columns .card p,
.project-tech p {
    font-size: 1.05rem;
}

.project-columns .service-list li,
.project-tech .service-list li {
    font-size: 1rem;
    align-items: flex-start;
}

.project-columns .service-list li::before,
.project-tech .service-list li::before {
    flex-shrink: 0;
}

.project-columns .card.color-blue .service-list li,
.project-columns .card.color-pink .service-list li {
    border-bottom-color: var(--color-white);
}

.project-tech .service-list {
    margin-top: 0;
}

.project-note {
    font-size: 0.95rem;
    border-left: var(--border-thick);
    padding-left: 1rem;
    max-width: 800px;
}

.project-note a {
    color: var(--color-black);
    font-weight: bold;
}

/* Veldash dashboard illustration */
.hud {
    position: relative;
    height: 400px;
    background-color: #0B0C10;
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    overflow: hidden;
    color: var(--color-white);
    font-family: var(--font-body);
    background-image:
        linear-gradient(#1a1c22 1px, transparent 1px),
        linear-gradient(90deg, #1a1c22 1px, transparent 1px);
    background-size: 40px 40px;
}

.hud-route {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hud-car {
    position: absolute;
    width: 180px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -62%);
    filter: drop-shadow(0 0 18px rgba(230, 251, 4, 0.55));
}

.hud-island {
    position: absolute;
    background-color: rgba(11, 12, 16, 0.9);
    border: 1px solid #3A3D44;
    padding: 0.6rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-weight: bold;
}

.hud-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #A0A4AD;
}

.hud-big {
    font-size: 1.6rem;
    line-height: 1.1;
}

.hud-yellow { color: var(--color-yellow); }

.hud-pill {
    top: 16px;
    left: 16px;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    font-size: 1rem;
}

.hud-turn {
    top: 70px;
    left: 16px;
    border-left: 6px solid var(--color-yellow);
}

.hud-arrow {
    font-size: 1.8rem;
    line-height: 1;
    color: var(--color-yellow);
}

.hud-trip {
    bottom: 16px;
    left: 16px;
}

.hud-speed {
    bottom: 16px;
    right: 16px;
    flex-direction: row;
    align-items: baseline;
    gap: 0.3rem;
    font-size: 1.6rem;
}

.hud-unit {
    font-size: 0.7rem;
    color: #A0A4AD;
}

/* Dark work tile with the batmobile */
.tile-dark {
    background-color: #0B0C10;
    color: var(--color-yellow);
    background-image:
        linear-gradient(#1a1c22 1px, transparent 1px),
        linear-gradient(90deg, #1a1c22 1px, transparent 1px);
    background-size: 40px 40px;
}

.tile-dark img {
    height: 85%;
    width: auto;
    filter: drop-shadow(0 0 16px rgba(230, 251, 4, 0.5));
}

@media (max-width: 768px) {
    .hud {
        height: 320px;
    }

    .hud-car {
        width: 130px;
    }

    .hud-turn {
        display: none;
    }
}

/* =========================================
   TOOL PAGES: IMAGE UPSCALER
   ========================================= */
.tool-page .hidden {
    display: none !important;
}

.tool-hero {
    padding: 3rem 0 2rem;
}

.tool-hero .project-title {
    /* One long word, so let it shrink with the screen instead of overflowing */
    font-size: clamp(1.6rem, 8vw, 6rem);
    overflow-wrap: anywhere;
    margin-bottom: 0.5rem;
}

.tool-hero .hero-subtitle {
    max-width: 760px;
    margin-bottom: 0;
}

.studio {
    padding: 1rem 0 4rem;
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 2rem;
    align-items: start;
}

.studio-side,
.studio-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* Static panel: like .card but without the hover tilt, so sliders stay put */
.panel {
    background-color: var(--color-white);
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    padding: 1.5rem;
}

.panel-group + .panel-group {
    border-top: 3px solid var(--color-black);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.panel-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* Drop zone */
.drop-zone {
    background-color: var(--color-yellow);
    border: 4px dashed var(--color-black);
    box-shadow: var(--shadow-hard);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.drop-zone:hover,
.drop-zone.is-dragover {
    background-color: var(--color-pink);
    color: var(--color-white);
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 var(--color-black);
}

.drop-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    background-color: var(--color-white);
    color: var(--color-black);
    border: var(--border-thick);
    box-shadow: 4px 4px 0 var(--color-black);
}

.drop-title {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.drop-zone p {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

/* Chip buttons (presets, scale, view modes) */
.chip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.chip-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.chip {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 0.6rem 0.5rem;
    background-color: var(--color-white);
    color: var(--color-black);
    border: 3px solid var(--color-black);
    box-shadow: 3px 3px 0 var(--color-black);
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--color-black);
}

.chip.is-active {
    background-color: var(--color-black);
    color: var(--color-yellow);
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 var(--color-black);
}

.res-badge {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    background-color: var(--color-yellow);
    border: 2px solid var(--color-black);
    padding: 0 0.5rem;
    white-space: nowrap;
}

/* Form fields */
.field-label {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.brutal-input,
.brutal-select {
    width: 100%;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.5rem 0.6rem;
    background-color: var(--color-white);
    color: var(--color-black);
    border: 3px solid var(--color-black);
    border-radius: 0;
    outline: none;
}

.brutal-input:focus,
.brutal-select:focus {
    box-shadow: 4px 4px 0 var(--color-pink);
}

.custom-dims {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Sliders */
.slider-row + .slider-row {
    margin-top: 1rem;
}

.slider-head {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.slider-val {
    font-family: var(--font-heading);
    color: var(--color-blue);
}

.text-btn {
    background: none;
    border: none;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--color-black);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.text-btn:hover {
    color: var(--color-pink);
}

.tool-page input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 22px;
    background: transparent;
    cursor: pointer;
}

.tool-page input[type=range]:focus {
    outline: none;
}

.tool-page input[type=range]::-webkit-slider-runnable-track {
    height: 10px;
    background-color: var(--color-white);
    border: 3px solid var(--color-black);
}

.tool-page input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -8px;
    background-color: var(--color-pink);
    border: 3px solid var(--color-black);
    box-shadow: 2px 2px 0 var(--color-black);
}

.tool-page input[type=range]::-moz-range-track {
    height: 4px;
    background-color: var(--color-white);
    border: 3px solid var(--color-black);
}

.tool-page input[type=range]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 0;
    background-color: var(--color-pink);
    border: 3px solid var(--color-black);
    box-shadow: 2px 2px 0 var(--color-black);
}

.tool-page input[type=range]:focus-visible::-webkit-slider-thumb {
    background-color: var(--color-yellow);
}

.tool-page input[type=range]:focus-visible::-moz-range-thumb {
    background-color: var(--color-yellow);
}

.btn-block {
    width: 100%;
    text-align: center;
    margin-top: 1.75rem;
}

.btn-yellow {
    background-color: var(--color-yellow);
    color: var(--color-black);
}

/* Image info readout */
.readout {
    background-color: var(--color-black);
    color: var(--color-white);
    border: var(--border-thick);
    box-shadow: 8px 8px 0 var(--color-pink);
    padding: 0.75rem 1.25rem;
}

.readout-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.45rem 0;
    border-bottom: 2px dashed #444;
}

.readout-row:last-child {
    border-bottom: none;
}

.readout-row strong {
    font-family: var(--font-heading);
    font-weight: normal;
    color: var(--color-yellow);
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.segmented {
    display: flex;
    border: 3px solid var(--color-black);
    box-shadow: 3px 3px 0 var(--color-black);
}

.segmented .chip,
.segmented .chip:hover,
.segmented .chip.is-active {
    border: none;
    box-shadow: none;
    transform: none;
}

.segmented .chip + .chip {
    border-left: 3px solid var(--color-black);
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Preview viewport */
.viewport {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    background-color: var(--color-white);
    background-image:
        linear-gradient(45deg, #E2E2E2 25%, transparent 25%),
        linear-gradient(-45deg, #E2E2E2 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #E2E2E2 75%),
        linear-gradient(-45deg, transparent 75%, #E2E2E2 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.viewport-empty {
    text-align: center;
    max-width: 420px;
    padding: 2rem;
}

.viewport-empty .sticker {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.viewport-empty p {
    font-weight: bold;
    background-color: var(--color-white);
    margin-bottom: 0;
}

/* Split wipe */
.split-wrap {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-box {
    position: relative;
    max-width: 100%;
    line-height: 0;
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    cursor: ew-resize;
    touch-action: pan-y;
}

.split-box canvas {
    display: block;
    max-width: 100%;
    max-height: 520px;
}

.split-clip {
    position: absolute;
    inset: 0;
}

.split-clip canvas {
    width: 100%;
    height: 100%;
    max-height: none;
}

.split-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--color-black);
    transform: translateX(-50%);
    z-index: 3;
}

.split-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    line-height: 1;
    background-color: var(--color-yellow);
    border: 3px solid var(--color-black);
    box-shadow: 3px 3px 0 var(--color-black);
}

.view-label {
    position: absolute;
    top: 12px;
    z-index: 4;
    margin: 0;
    line-height: 1.4;
    pointer-events: none;
}

.view-label-left { left: 12px; }
.view-label-right { right: 12px; }

/* Side by side */
.side-wrap {
    width: 100%;
    align-self: stretch;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.side-pane {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0.75rem 0.75rem;
    background-color: var(--color-white);
    border: 3px solid var(--color-black);
    box-shadow: 4px 4px 0 var(--color-black);
}

.side-scroll {
    width: 100%;
    max-height: 440px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-scroll canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Zoom lens */
.lens {
    position: fixed;
    width: 160px;
    height: 160px;
    z-index: 200;
    overflow: hidden;
    pointer-events: none;
    background-color: var(--color-black);
    border: 4px solid var(--color-black);
    box-shadow: 6px 6px 0 var(--color-black);
}

.lens canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.lens-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    background-color: var(--color-yellow);
    border-top: 3px solid var(--color-black);
}

/* Processing overlay */
.processing {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(240, 240, 240, 0.85);
}

.processing-box {
    width: min(90%, 340px);
    text-align: center;
    padding: 1.5rem 2rem;
    background-color: var(--color-white);
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
}

.processing-box h4 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.processing-box p {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 1rem;
    background-color: var(--color-blue);
    border: 3px solid var(--color-black);
    box-shadow: 3px 3px 0 var(--color-black);
    animation: tool-spin 1s steps(4) infinite;
}

@keyframes tool-spin {
    to { transform: rotate(360deg); }
}

.progress {
    height: 20px;
    background-color: var(--color-white);
    border: 3px solid var(--color-black);
}

.progress-fill {
    height: 100%;
    width: 0;
    background-color: var(--color-pink);
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0 8px,
        rgba(5, 5, 5, 0.25) 8px 16px
    );
    transition: width 0.3s ease;
}

/* Export bar */
.export-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
}

.export-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex: 1 1 320px;
}

.export-fields label {
    flex: 1 1 140px;
}

@media (max-width: 1024px) {
    .studio {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tool-hero {
        padding: 2rem 0 1rem;
    }

    .panel,
    .drop-zone,
    .viewport {
        margin-right: 6px;
    }

    .panel {
        padding: 1.25rem;
    }

    .readout {
        margin-right: 8px;
    }

    .viewport {
        min-height: 360px;
    }

    .split-wrap,
    .side-wrap {
        padding: 1rem;
    }

    .split-box canvas {
        max-height: 420px;
    }

    .split-clip canvas {
        max-height: none;
    }

    .side-wrap {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .chip-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .export-bar .brutal-btn {
        margin-bottom: 0;
    }
}
