/* =============================================================================
   SENUSO — Site-specific styles
   Wydzielone z inline <style> bloku i atrybutów style=""
   v2 — a11y fixes, mobile hamburger, reduced-motion, contrast fixes
   ============================================================================= */

/* --- CSS Variables --- */
:root {
    --accent-orange: #FF4F17;
    --deep-bg: #030304;
    --panel-bg: #0A0A0C;
}

/* --- Base --- */
body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--deep-bg);
    color: #e2e8f0;
    cursor: default;
}

.font-tech {
    font-family: 'Space Grotesk', monospace;
}

/* --- Skip Link (a11y P0) --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 0.75rem 1.5rem;
    background: var(--accent-orange);
    color: #000 !important; /* black on orange = 6.38:1 ratio ✅ WCAG AA */
    font-weight: 700 !important;
    font-size: 0.875rem;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0.5rem;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid white;
    outline-offset: 2px;
    box-shadow: 0 4px 24px rgba(255, 79, 23, 0.4);
}

/* --- Focus States (a11y P0 — enhanced per Kamila review) --- */
*:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 3px;
}
button:focus-visible,
a[role="button"]:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(255, 79, 23, 0.25);
}
nav a:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
    border-radius: 2px;
}
input:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 0;
    border-color: var(--accent-orange);
}

/* Nav readability: 12px → 14px (WCAG minimum) */
nav a:not(.skip-link) {
    font-size: 0.875rem !important;
    letter-spacing: 0.08em !important;
}

/* --- Mobile Hamburger Menu --- */
/* Display controlled by Tailwind classes: flex md:hidden in HTML */
.hamburger-btn {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    padding: 8px;
    z-index: 60 !important;
    position: relative;
}
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    transition: transform 0.3s, opacity 0.3s;
}
.hamburger-btn[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu — !important to override Tailwind specificity (Kamila fix) */
.mobile-menu {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 50 !important;
    background: rgba(3, 3, 4, 0.97) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2rem !important;
    padding: 2rem !important;
}
.mobile-menu.is-open {
    display: flex !important;
}
/* Touch targets min 44px (WCAG 2.5.5) */
.mobile-menu a,
.mobile-menu button {
    font-family: 'Space Grotesk', monospace;
    font-size: 1.25rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}
.mobile-menu a:hover,
.mobile-menu a:focus-visible,
.mobile-menu button:hover,
.mobile-menu button:focus-visible {
    color: var(--accent-orange);
}

/* mobile hamburger display handled by Tailwind md:hidden class */

/* --- Technical Grid Overlay --- */
.tech-grid {
    background-size: 3rem 3rem;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}

/* --- Cinematic Grain --- */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 50;
    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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
}

/* --- Magnetic Button Glow --- */
.btn-magnetic {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.btn-magnetic::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}
.btn-magnetic:hover::before {
    left: 100%;
}

/* --- Text Utilities --- */
.text-glow {
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
}

/* --- Animations --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* --- Reduced Motion (a11y P1) --- */
@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;
    }
    html {
        scroll-behavior: auto !important;
    }
    * {
        background-attachment: scroll !important;
    }
    .animate-ping {
        animation: none !important;
    }
    .animate-pulse {
        animation: none !important;
    }
}

/* --- Typography fixes (Kamila P1) --- */
h1 {
    line-height: 1.1;
}
@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem;
        line-height: 1.15;
    }
}

/* --- CTA visual polish (P2) --- */
button:not(.hamburger-btn) {
    border-radius: 4px;
}
/* CTA contrast fix: white on orange-600 = 3.0:1 → orange-700 = 4.6:1 (WCAG AA) */
.bg-orange-600 {
    background-color: #c2410c !important;
}
.hover\:bg-orange-700:hover {
    background-color: #9a3412 !important;
}

/* --- Diagonal cut corner — border follows the shape --- */
.clip-diagonal {
    --cut: 12px; /* corner cut size */
    --border-w: 1px; /* border thickness */
    --border-color: rgba(255, 255, 255, 0.1);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
    border: none !important;
    position: relative;
}
/*
 * Full border that follows the diagonal cut:
 * ::after is 1px larger on all sides (inset: -1px) with background = border color
 * and the SAME clip-path. The main element's clip-path covers the interior,
 * leaving a 1px outline around the entire shape including the diagonal.
 */
.clip-diagonal::after {
    content: "" !important;
    position: absolute !important;
    inset: calc(-1 * var(--border-w)) !important;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%) !important;
    background: var(--border-color) !important;
    pointer-events: none !important;
    z-index: -1 !important;
    border-radius: 0 !important;
}
.clip-diagonal:hover {
    --border-color: rgb(234 88 12);
}
/* Primary CTA — no outline border (has solid bg) */
.bg-orange-600.clip-diagonal::after,
[class*="bg-orange"].clip-diagonal::after {
    background: transparent !important;
}
.bg-slate-200.clip-diagonal::after {
    background: transparent !important;
}

/* --- Contact form --- */
.resize-none {
    resize: none;
}
textarea:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 0;
    border-color: var(--accent-orange);
}

/* --- Custom Selection --- */
::selection {
    background-color: var(--accent-orange);
    color: white;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-orange); }

/* --- Animation delays (ex-inline styles) --- */
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }

/* --- Footer responsive fix (P2 — mobile 1 column under 500px) --- */
@media (max-width: 500px) {
    footer .grid {
        grid-template-columns: 1fr !important;
    }
    footer input[type="email"],
    footer input[type="text"],
    footer button[type="submit"] {
        width: 100% !important;
    }
}
