/* ============================================================
   CHICHO PANEL BEATING — site styles
   Black / scarlet / chrome system derived from the workshop signage.
   Square geometry, hairline borders, no drop shadows on surfaces.
   ============================================================ */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    /* Belt and braces: overflow-x on body alone still lets the root scroll
       sideways when a full-bleed band overshoots by a pixel or two. */
    overflow-x: hidden;
}

body {
    background-color: #050505;
    color: #E0E1E3;
    overflow-x: hidden;
}

button,
[role="button"],
select,
summary,
label[for],
.cursor-pointer {
    cursor: pointer;
}

::selection {
    background: #D81E05;
    color: #fff;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0A0A0A;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border: 2px solid #0A0A0A;
}

::-webkit-scrollbar-thumb:hover {
    background: #D81E05;
}

:focus-visible {
    outline: 2px solid #FF5334;
    outline-offset: 3px;
}

/* ---------- texture layers ---------- */

/* Film grain over everything — stops the large dark surfaces reading as flat black */
.grain::after {
    content: "";
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 90;
    /* kept low: grain over small text is what made it look fuzzy */
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Brushed panel — the flatted-and-primed surface this trade actually works on */
.brushed {
    background-color: #0C0C0C;
    background-image:
        repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.022) 0px,
            rgba(255, 255, 255, 0.022) 1px,
            transparent 1px,
            transparent 3px),
        repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.04) 0px,
            rgba(255, 255, 255, 0.04) 1px,
            transparent 1px,
            transparent 11px),
        linear-gradient(180deg, #121212 0%, #0A0A0A 55%, #101010 100%);
}

/* Workshop floor — diagonal bay markings for full-bleed bands */
.asphalt {
    background-color: #090909;
    background-image:
        repeating-linear-gradient(115deg,
            rgba(255, 255, 255, 0.014) 0 2px,
            transparent 2px 9px),
        radial-gradient(ellipse at 50% 0%, rgba(216, 30, 5, 0.10), transparent 62%);
}

/* Spray-booth glow — soft scarlet bloom for the quote band */
.booth {
    background-color: #070707;
    background-image:
        radial-gradient(ellipse at 18% 120%, rgba(216, 30, 5, 0.16), transparent 58%),
        radial-gradient(ellipse at 84% -10%, rgba(255, 255, 255, 0.05), transparent 52%);
}

/* Hairline used across the site instead of shadows */
.hairline {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Viewfinder corner brackets */
.corner-frame {
    position: relative;
}

.corner-frame::before,
.corner-frame::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: #D81E05;
    border-style: solid;
    z-index: 2;
    pointer-events: none;
}

.corner-frame::before {
    top: -1px;
    left: -1px;
    border-width: 2px 0 0 2px;
}

.corner-frame::after {
    bottom: -1px;
    right: -1px;
    border-width: 0 2px 2px 0;
}

/* Outline / ghost display text */
.text-outline {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.28);
    color: transparent;
}

.text-outline-red {
    -webkit-text-stroke: 1px rgba(255, 83, 52, 0.6);
    color: transparent;
}

.text-ghost {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.07);
    color: transparent;
    user-select: none;
    pointer-events: none;
}

/* Polished-panel display text — what a finished respray looks like in type.
   background-clip needs a painted background, so the fallback colour
   below only shows on engines without it. */
.text-chrome {
    color: #E8E9EB;
    background: linear-gradient(176deg,
            #FFFFFF 0%,
            #C8CACD 22%,
            #6E7175 44%,
            #F2F3F5 52%,
            #9A9DA1 62%,
            #4A4D51 82%,
            #D6D8DB 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Diagonal scarlet hazard tape strip */
.hazard {
    background: repeating-linear-gradient(-45deg,
            #D81E05 0 14px,
            #050505 14px 28px);
}

/* Service icon tile — solid scarlet so each card announces what it is at a
   glance, with a soft halo to lift it off the near-black card. */
.svc-icon {
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #D81E05;
    color: #fff;
    box-shadow: 0 0 0 6px rgba(216, 30, 5, 0.16), 0 10px 30px -8px rgba(216, 30, 5, 0.55);
    transition: background-color 0.3s, color 0.3s, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover .svc-icon {
    background: #fff;
    color: #D81E05;
    transform: translateY(-3px);
}

/* On the scarlet Mag Repairs card the tile flips to white so it still pops */
.svc-icon--invert {
    background: #fff;
    color: #D81E05;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18), 0 10px 30px -8px rgba(0, 0, 0, 0.5);
}

.group:hover .svc-icon--invert {
    background: #050505;
    color: #fff;
}

/* Paint-chip swatch — the colour-match strip in the services band */
.chip-swatch {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
}

/* ---------- motion ---------- */

/* Scroll reveal — hidden states gated behind html.js so content stays
   visible if JavaScript never runs */
html.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

html.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

html.js [data-reveal="left"] {
    transform: translateX(-36px);
}

html.js [data-reveal="right"] {
    transform: translateX(36px);
}

html.js [data-reveal="scale"] {
    transform: scale(0.94);
}

/* Staggered children — parent carries data-reveal-group */
html.js [data-reveal-group]>* {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

html.js [data-reveal-group].is-visible>* {
    opacity: 1;
    transform: none;
}

html.js [data-reveal-group].is-visible>*:nth-child(1) { transition-delay: 0s; }
html.js [data-reveal-group].is-visible>*:nth-child(2) { transition-delay: 0.07s; }
html.js [data-reveal-group].is-visible>*:nth-child(3) { transition-delay: 0.14s; }
html.js [data-reveal-group].is-visible>*:nth-child(4) { transition-delay: 0.21s; }
html.js [data-reveal-group].is-visible>*:nth-child(5) { transition-delay: 0.28s; }
html.js [data-reveal-group].is-visible>*:nth-child(6) { transition-delay: 0.35s; }

/* Hero headline line mask */
.line-mask {
    display: block;
    overflow: hidden;
    /* tight display line-heights clip glyph descenders without this compensation */
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}

html.js .line-mask>span {
    display: block;
    transform: translateY(110%);
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

html.js.loaded .line-mask>span {
    transform: none;
}

html.js.loaded .line-mask:nth-child(2)>span { transition-delay: 0.1s; }
html.js.loaded .line-mask:nth-child(3)>span { transition-delay: 0.2s; }

/* Marquee */
.marquee {
    overflow: hidden;
    white-space: nowrap;
    display: flex;
}

.marquee-track {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 100%;
    animation: marquee 30s linear infinite;
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

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

/* Slow spin (decor rings) */
@keyframes spin-slow {
    to { transform: rotate(360deg); }
}

.spin-slow {
    animation: spin-slow 14s linear infinite;
}

/* Scroll cue */
@keyframes cue {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(10px); opacity: 0.4; }
}

.scroll-cue {
    animation: cue 1.8s ease-in-out infinite;
}

/* Scarlet pulse dot (open-for-business feel) */
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(216, 30, 5, 0.55); }
    60% { box-shadow: 0 0 0 9px rgba(216, 30, 5, 0); }
}

.pulse-dot {
    animation: pulse-dot 1.6s ease-out infinite;
}

/* Underline sweep for links */
.link-sweep {
    position: relative;
}

.link-sweep::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    height: 2px;
    width: 100%;
    background: #D81E05;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.link-sweep:hover::after,
.link-sweep:focus-visible::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ---------- buttons ---------- */

.btn-red {
    position: relative;
    overflow: hidden;
    background: #D81E05;
    color: #fff;
    transition: color 0.3s;
    isolation: isolate;
}

.btn-red::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    transform: translateX(-101%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}

.btn-red:hover,
.btn-red:focus-visible {
    color: #050505;
}

.btn-red:hover::before,
.btn-red:focus-visible::before {
    transform: translateX(0);
}

.btn-ghost {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    transition: color 0.3s, border-color 0.3s;
    isolation: isolate;
}

.btn-ghost::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #D81E05;
    transform: translateY(101%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    border-color: #D81E05;
}

.btn-ghost:hover::before,
.btn-ghost:focus-visible::before {
    transform: translateY(0);
}

/* WhatsApp is how this trade actually books work — it gets its own token */
.btn-wa {
    background: #1EA55A;
    color: #fff;
    transition: background-color 0.3s;
}

.btn-wa:hover,
.btn-wa:focus-visible {
    background: #157A45;
}

/* The flyer's yellow phone strip, kept for the one "ring us" button */
.btn-amber {
    background: #FFD400;
    color: #0A0A0A;
    transition: background-color 0.3s;
}

.btn-amber:hover,
.btn-amber:focus-visible {
    background: #FFE457;
}

/* ---------- header / nav ---------- */

#site-header {
    transition: background-color 0.4s, border-color 0.4s, transform 0.4s;
    background: transparent;
    border-bottom: 1px solid transparent;
}

#site-header.scrolled {
    background: rgba(5, 5, 5, 0.88);
    backdrop-filter: blur(14px);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* Mobile menu overlay */
#mobile-menu {
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-menu.open {
    transform: translateX(0);
}

.menu-open {
    overflow: hidden;
}

/* ---------- before / after comparison ---------- */

.ba {
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
    background: #0A0A0A;
    cursor: ew-resize;
}

.ba img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* The "after" plate is clipped from the left edge to the handle position. */
.ba-after {
    position: absolute;
    inset: 0;
    clip-path: inset(0 0 0 var(--pos, 50%));
}

.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos, 50%);
    width: 3px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(216, 30, 5, 0.9), 0 0 22px rgba(0, 0, 0, 0.65);
    transform: translateX(-1.5px);
    z-index: 3;
    pointer-events: none;
}

/* The knob — big, scarlet, and pulsing until someone has used it */
.ba-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    background: #D81E05;
    border: 3px solid #fff;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Left/right arrows drawn on the knob */
.ba-handle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 18px;
    transform: translate(-50%, -50%);
    z-index: 2;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 18' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpath d='M9 2 2 9l7 7M27 2l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ba:not(.is-touched) .ba-handle::after {
    animation: knob-pulse 1.7s ease-out infinite;
}

.ba:hover .ba-handle::after,
.ba.is-demo .ba-handle::after {
    transform: translate(-50%, -50%) scale(1.08);
}

@keyframes knob-pulse {
    0% { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(216, 30, 5, 0.75); }
    70% { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55), 0 0 0 22px rgba(216, 30, 5, 0); }
    100% { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(216, 30, 5, 0); }
}

/* "Slide to see the repair" badge — sits over the plate until first use */
.ba-hint {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    padding: 10px 16px;
    background: #fff;
    color: #0A0A0A;
    font-family: "Chakra Petch", monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: opacity 0.5s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ba-hint-arrow {
    width: 14px;
    height: 14px;
    color: #D81E05;
    flex-shrink: 0;
}

.ba-hint-arrow--l { animation: nudge-l 1.2s ease-in-out infinite; }
.ba-hint-arrow--r { animation: nudge-r 1.2s ease-in-out infinite; }

@keyframes nudge-l {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-4px); }
}

@keyframes nudge-r {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

.ba.is-touched .ba-hint {
    opacity: 0;
    transform: translate(-50%, -8px);
}

@media (max-width: 640px) {
    .ba-handle::after { width: 50px; height: 50px; }
    .ba-handle::before { width: 28px; height: 14px; }
    .ba-hint { top: 10px; padding: 8px 12px; gap: 8px; font-size: 10.5px; letter-spacing: 0.14em; }
}

/* The range input is the real control — visually hidden, but it keeps the
   whole comparison keyboard- and screen-reader-operable. Pointer events are
   off so the native thumb cannot fight the drag handler in main.js, which
   maps pointer x across the full plate rather than the shorter thumb track.
   opacity:0 (rather than display/visibility) keeps it in the tab order. */
.ba-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 4;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.ba-range:focus-visible+.ba-handle::after {
    outline: 3px solid #FF5334;
    outline-offset: 3px;
}

/* Job selector above the comparison plate */
.ba-tab {
    font-family: "Chakra Petch", monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    font-weight: 600;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #C4C5C7;
    background: #0F0F0F;
    transition: color 0.25s, background-color 0.25s, border-color 0.25s;
}

.ba-tab:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.ba-tab[aria-pressed="true"] {
    background: #D81E05;
    border-color: #D81E05;
    color: #fff;
}

.ba-tag {
    position: absolute;
    bottom: 14px;
    z-index: 2;
    font-family: "Chakra Petch", monospace;
    font-size: 11px;
    letter-spacing: 0.24em;
    font-weight: 700;
    padding: 7px 12px;
    background: rgba(5, 5, 5, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* ---------- before/after flip (more from the floor) ----------
   One frame; the "after" plate fades in over the "before" and back again.
   main.js toggles .is-after on a timer — hidden states are gated behind
   html.js so without JavaScript the finished car simply shows. */

.flip {
    --hold: 3200ms;
    cursor: pointer;
}

.flip-stage {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #0A0A0A;
}

.flip-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 3.6s ease-out;
}

html.js .flip-img[data-flip-state="after"] {
    opacity: 0;
    transform: scale(1.05);
}

html.js .flip.is-after .flip-img[data-flip-state="after"] {
    opacity: 1;
    transform: scale(1);
}

.flip-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    font-family: "Chakra Petch", monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    padding: 8px 13px;
    color: #fff;
    transition: opacity 0.5s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.flip-tag--before {
    background: rgba(5, 5, 5, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.flip-tag--after {
    background: #D81E05;
}

html:not(.js) .flip-tag--before,
html.js .flip:not(.is-after) .flip-tag--after,
html.js .flip.is-after .flip-tag--before {
    opacity: 0;
    transform: translateY(-6px);
}

/* Two-step progress bar under the frame — shows which state is up and when it turns */
.flip-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding-top: 12px;
}

.flip-step {
    font-family: "Chakra Petch", monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: #8D8E90;
    transition: color 0.4s;
}

.flip-step i {
    display: block;
    height: 3px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.14);
    background-image: linear-gradient(#D81E05, #D81E05);
    background-repeat: no-repeat;
    background-size: 0% 100%;
}

.flip:not(.is-after) .flip-step--before,
.flip.is-after .flip-step--after {
    color: #fff;
}

.flip:not(.is-after) .flip-step--before i,
.flip.is-after .flip-step--after i {
    animation: flip-fill var(--hold) linear forwards;
}

.flip.is-idle .flip-step i {
    animation: none;
}

@keyframes flip-fill {
    to { background-size: 100% 100%; }
}

/* ---------- forms ---------- */

/* Element-qualified so these beat the Tailwind forms plugin's [type='…']
   rules, which the CDN injects after this stylesheet. */
input.field,
select.field,
textarea.field {
    width: 100%;
    background-color: transparent;
    background-image: none;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: #fff;
    padding: 14px 0;
    transition: border-color 0.3s;
}

input.field::placeholder,
textarea.field::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

input.field:focus,
select.field:focus,
textarea.field:focus {
    outline: none;
    box-shadow: none;
    border-color: transparent;
    border-bottom-color: #D81E05;
}

/* The forms plugin's chevron goes with its background-image, so draw our own. */
select.field {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none' stroke='%23D81E05' stroke-width='2'%3E%3Cpath d='M1 1.5 7 7.5 13 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
}

select.field option {
    background: #101010;
    color: #fff;
}

/* Spec pill — service tags and the makes strip */
.spec {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Chakra Petch", monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    font-weight: 600;
    color: #C4C5C7;
    background: #151515;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 10px;
}

/* ---------- responsive spec (mobile margins) ---------- */

@media (max-width: 767px) {
    .px-margin-edge {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-reveal],
    [data-reveal-group]>* {
        opacity: 1 !important;
        transform: none !important;
    }

    .line-mask>span {
        transform: none !important;
    }

    .marquee-track {
        animation: none !important;
    }
}

/* ---------- print ---------- */

@media print {
    #site-header,
    #mobile-menu,
    .marquee,
    .hazard,
    canvas,
    .grain::after {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}
