/* ==========================================================
   FLEXCODE — Neo-Brutalist Design System
   Palette: White (#fff) + Off-Black (#0a0a0a) + Accent Red (#dc2626)
   Fonts:  Space Grotesk (display) + JetBrains Mono (body)
   ========================================================== */

/* === ACCENT COLOR VARIABLE === */
:root {
    --accent: #dc2626;
}

/* Smooth transition for elements using the accent color */
.accent-transition {
    transition: background-color 1.5s ease, color 1.5s ease, border-color 1.5s ease;
}

/* === GLOBAL RESET === */
*, *::before, *::after {
    border-radius: 0 !important;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', monospace;
    color: #0a0a0a;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: #ffffff;
}

/* === BUTTON WRAPPER (prevents hover flickering) === */
.btn-wrap {
    display: inline-flex;
    cursor: pointer;
}

/* === BUTTONS === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    background: var(--accent);
    color: #ffffff;
    border: 2px solid #0a0a0a;
    padding: 0.875rem 1.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: 5px 5px 0px #0a0a0a;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 1.5s ease;
    cursor: pointer;
    line-height: 1.4;
}
.btn-wrap:hover .btn-primary,
.btn-primary:hover {
    box-shadow: 2px 2px 0px #0a0a0a;
    transform: translate(3px, 3px);
}
.btn-wrap:active .btn-primary,
.btn-primary:active {
    box-shadow: 0px 0px 0px #0a0a0a;
    transform: translate(5px, 5px) scale(0.98);
}
.btn-primary svg {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary:hover svg {
    transform: translateX(2px);
}

/* Small variant (header) */
.btn-primary.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.6875rem;
    box-shadow: 3px 3px 0px #0a0a0a;
}
.btn-wrap:hover .btn-primary.btn-sm,
.btn-primary.btn-sm:hover {
    box-shadow: 1px 1px 0px #0a0a0a;
    transform: translate(2px, 2px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    background: #ffffff;
    color: #0a0a0a;
    border: 2px solid #0a0a0a;
    padding: 0.875rem 1.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: 5px 5px 0px #0a0a0a;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    line-height: 1.4;
}
.btn-wrap:hover .btn-secondary {
    background: #0a0a0a;
    color: #ffffff;
    box-shadow: 2px 2px 0px #0a0a0a;
    transform: translate(3px, 3px);
}
.btn-secondary svg {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-wrap:hover .btn-secondary svg {
    transform: translateX(2px);
}

.btn-on-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    background: #ffffff;
    color: #0a0a0a;
    border: 2px solid #0a0a0a;
    padding: 0.875rem 1.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: 5px 5px 0px #0a0a0a;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    line-height: 1.4;
}
.btn-wrap:hover .btn-on-accent {
    background: #0a0a0a;
    color: #ffffff;
    box-shadow: 2px 2px 0px #0a0a0a;
    transform: translate(3px, 3px);
}
.btn-on-accent svg {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-wrap:hover .btn-on-accent svg {
    transform: translateX(2px);
}

.btn-on-dark {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    background: #ffffff;
    color: #0a0a0a;
    border: 2px solid #0a0a0a;
    padding: 0.875rem 1.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: 4px 4px 0px rgba(255,255,255,0.12);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    line-height: 1.4;
}
.btn-wrap:hover .btn-on-dark,
.btn-on-dark:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 2px 2px 0px rgba(255,255,255,0.12);
    transform: translate(2px, 2px);
}
.btn-on-dark svg {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-on-dark:hover svg {
    transform: translateX(2px);
}

/* === CARDS === */
.card-brutal {
    border: 2px solid #0a0a0a;
    background: #ffffff;
    box-shadow: 4px 4px 0px #0a0a0a;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-brutal:hover {
    box-shadow: 6px 6px 0px #0a0a0a;
    transform: translate(-2px, -2px);
}

/* === NUMBER LABELS === */
.num-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: 0.75rem;
    border: 2px solid #0a0a0a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    line-height: 1;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Num-label activates on parent group hover */
.group:hover .num-label {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* === LINK ARROWS === */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    color: #0a0a0a;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: gap 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
    position: relative;
    padding-bottom: 0.25rem;
}
.link-arrow::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 1.5s ease;
}
.link-arrow:hover::after {
    width: 100%;
}
.link-arrow:hover {
    gap: 0.875rem;
    color: var(--accent);
}
.link-arrow svg {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.link-arrow:hover svg {
    transform: translateX(2px);
}

/* White variant for dark sections */
.link-arrow--white {
    color: #ffffff;
}
.link-arrow--white:hover {
    color: var(--accent);
}

/* === MARQUEE === */
@keyframes marquee {
    to {
        transform: translateX(-50%);
    }
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 25s linear infinite;
    will-change: transform;
}
.marquee-track:hover {
    animation-play-state: paused;
}

/* === TERMINAL === */
.terminal {
    border: 2px solid #0a0a0a;
    background: #0a0a0a;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.9;
    overflow: hidden;
}
.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #27272a;
}
.terminal-dot {
    width: 10px;
    height: 10px;
    border: 1.5px solid #3f3f46;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.terminal-dot.active {
    background: var(--accent);
    border-color: var(--accent);
}
.terminal-title {
    font-size: 0.6875rem;
    color: #52525b;
    margin-left: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.terminal-body {
    padding: 1.25rem;
    min-height: 220px;
}
.terminal-line-cmd {
    color: #4ade80;
}
.terminal-line-out {
    color: #71717a;
}
.terminal-line-success {
    color: #facc15;
}
.cursor-blink::after {
    content: '_';
    animation: blink 0.8s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === SCROLL REVEAL === */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* === HERO LOAD ANIMATION === */
.hero-anim {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-anim-1 { animation-delay: 0.1s; }
.hero-anim-2 { animation-delay: 0.25s; }
.hero-anim-3 { animation-delay: 0.4s; }
.hero-anim-4 { animation-delay: 0.55s; }
.hero-anim-5 { animation-delay: 0.7s; }

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

/* === MOBILE NAV OVERLAY === */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: #0a0a0a;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.nav-overlay a {
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.2s;
    display: block;
    width: 100%;
}
.nav-overlay a:hover {
    color: var(--accent);
}
.nav-overlay a:last-child {
    border-bottom: none;
}

/* === QUOTE MARKS === */
.quote-mark {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: 4rem;
    line-height: 0.8;
    color: var(--accent);
    user-select: none;
}

/* === AVATAR BOX (Testimonials) === */
.avatar-box {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: 0.875rem;
    border: 2px solid #0a0a0a;
    background: #0a0a0a;
    color: #ffffff;
    flex-shrink: 0;
    transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.group:hover .avatar-box {
    background: var(--accent);
    border-color: var(--accent);
}

/* === ACCENT BAR === */
.accent-bar {
    width: 40px;
    height: 3px;
    background: var(--accent);
    display: inline-block;
}

/* === DROPDOWN === */
.dropdown-menu {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.group:hover .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* === NAV LINK HOVER === */
.nav-link {
    position: relative;
    transition: color 0.2s;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(-50%);
}
.nav-link:hover::after {
    width: calc(100% - 2rem);
}

/* === HEADER SCROLL STATE === */
.header-scrolled {
    box-shadow: 0 2px 0 0 #0a0a0a;
}

/* === SERVICE BLOCK HOVER === */
.service-block {
    transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.service-block:hover {
    background: #fafafa;
}

/* === TESTIMONIAL CAROUSEL === */
.testimonial-viewport {
    position: relative;
    overflow: hidden;
    display: grid;
}

.testimonial-curtain {
    position: absolute;
    inset: 0;
    background: var(--accent);
    z-index: 10;
    transform: scaleX(0);
    pointer-events: none;
}
.testimonial-curtain.wipe-in {
    transform-origin: left;
    animation: curtainWipeIn 0.45s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}
.testimonial-curtain.wipe-out {
    transform-origin: right;
    animation: curtainWipeOut 0.45s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes curtainWipeIn {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
@keyframes curtainWipeOut {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

.testimonial-slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.testimonial-slide.active {
    opacity: 1;
    visibility: visible;
}

.testi-nav-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.testi-nav-btn:hover {
    background: #0a0a0a;
    color: #ffffff;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #ffffff;
}
::-webkit-scrollbar-thumb {
    background: #0a0a0a;
    border: 1px solid #ffffff;
}

/* === RESPONSIVE HELPERS === */
@media (max-width: 767px) {
    .btn-primary,
    .btn-secondary,
    .btn-on-accent,
    .btn-on-dark {
        width: 100%;
        justify-content: center;
    }

    /* Don't full-width the header btn */
    .btn-primary.btn-sm {
        width: auto;
    }
}

/* === ACCENT COLOR TRANSITIONS (for color rotation) === */
.accent-bar,
.quote-mark,
.terminal-dot.active,
.testimonial-curtain,
#color-toggle,
#cta {
    transition: background-color 1.5s ease, border-color 1.5s ease, color 1.5s ease;
}
.link-arrow:hover,
.link-arrow--white:hover,
.nav-overlay a:hover {
    transition: color 1.5s ease, gap 0.2s;
}
.nav-link::after {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 1.5s ease;
}
/* Catch-all for Tailwind text-accent / bg-accent spans */
[class*="text-accent"],
[class*="bg-accent"] {
    transition: color 1.5s ease, background-color 1.5s ease;
}

/* === IMAGE PLACEHOLDERS === */
.img-placeholder {
    background-color: #18181b;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(255,255,255,0.03) 8px,
        rgba(255,255,255,0.03) 16px
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 260px;
    border: 2px solid #0a0a0a;
    position: relative;
    overflow: hidden;
}
.img-placeholder::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(255,255,255,0.08);
}

/* === CATEGORY PILLS (anchor nav) === */
.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 2px solid #0a0a0a;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    color: #0a0a0a;
    background: #ffffff;
    box-shadow: 3px 3px 0px #0a0a0a;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    cursor: pointer;
}
.cat-pill:hover,
.cat-pill.active {
    background: #0a0a0a;
    color: #ffffff;
    box-shadow: 1px 1px 0px #0a0a0a;
    transform: translate(2px, 2px);
}
.cat-pill:active {
    box-shadow: 0px 0px 0px #0a0a0a;
    transform: translate(3px, 3px);
}

/* === CASE FRICTION QUOTE === */
.case-friction {
    background: #0a0a0a;
    color: #ffffff;
    border: 2px solid #0a0a0a;
    padding: 1.25rem 1.5rem;
    font-size: 0.8125rem;
    font-style: italic;
    line-height: 1.7;
    position: relative;
}
.case-friction::before {
    content: '\201C';
    font-family: 'Space Grotesk', sans-serif;
    font-style: normal;
    font-weight: 800;
    font-size: 2rem;
    color: var(--accent);
    line-height: 1;
    margin-right: 0.25rem;
}

/* === SCROLL MARGIN for anchor targets === */
[id^="cat-"] {
    scroll-margin-top: 8rem;
}

/* --- Background Patterns --- */
.bg-fine-ruled {
    /* background-color: color-mix(in srgb, #0d9488 2%, #f4f4f5); */
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 23px,
            color-mix(in srgb, #0d9488 5%, #dcdce0) 23px,
            color-mix(in srgb, #0d9488 5%, #dcdce0) 24px
        );
    background-size: 100% 25px;
}

.bg-pattern-mm {
    background-color: #ffffff;
    background-image:
        linear-gradient(#e5e5e5a8 1px, transparent 1px), 
        linear-gradient(90deg, #e5e5e5a8 1px, transparent 1px), 
        linear-gradient(#c4c4c494 1px, transparent 1px), 
        linear-gradient(90deg, #c4c4c494 1px, transparent 1px);
    background-size: 8px 8px, 8px 8px, 40px 40px, 40px 40px;
}
