/* ============================================
   DESIGN SYSTEM APPLIED - v1.0
   aniabaranska.pl
   ============================================ */

/* ----- DESIGN TOKENS ----- */
:root {
    /* Colors */
    --color-ink: #1A1A1A;
    --color-lab: #F5F5F0;
    --color-alert: #B92B27;
    --color-alert-dark: #a02621;
    --color-white: #FFFFFF;

    /* Opacity variants */
    --color-ink-80: rgba(26,26,26,0.8);
    --color-ink-70: rgba(26,26,26,0.7);
    --color-ink-60: rgba(26,26,26,0.6);
    --color-ink-40: rgba(26,26,26,0.4);
    --color-ink-10: rgba(26,26,26,0.1);
    --color-ink-05: rgba(26,26,26,0.05);
    --color-alert-10: rgba(185,43,39,0.1);

    /* Typography */
    --font-sans: 'Barlow', 'Barlow Fallback', Arial, sans-serif;
    --font-serif: 'Lora', 'Lora Fallback', Georgia, serif;

    /* Font weights (reduced to 3) */
    --font-normal: 400;
    --font-semibold: 600;
    --font-bold: 700;

    /* Spacing (8px scale) */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */

    /* Layout */
    --nav-height: 80px;
    --max-width: 72rem;   /* 1152px */
    --radius-sm: 2px;
    --radius-md: 8px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ----- BUTTON SYSTEM (3 types) ----- */
.btn-primary {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-4) var(--space-8);
    background: var(--color-alert);
    color: var(--color-white);
    border: none;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    cursor: pointer;
}
.btn-primary:hover {
    background: var(--color-ink);
}
.btn-primary:active {
    transform: scale(0.95);
}

.btn-secondary {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-3) var(--space-6);
    background: var(--color-ink);
    color: var(--color-white);
    border: none;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    cursor: pointer;
}
.btn-secondary:hover {
    background: var(--color-alert);
}
.btn-secondary:active {
    transform: scale(0.95);
}

.btn-ghost {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: var(--space-2) var(--space-4);
    background: transparent;
    color: var(--color-ink);
    border: 1px solid var(--color-ink-10);
    transition: all var(--transition-base);
    cursor: pointer;
}
.btn-ghost:hover {
    background: var(--color-ink-05);
    color: var(--color-alert);
}

/* ----- CARD SYSTEM ----- */
.card {
    background: var(--color-white);
    border: 1px solid var(--color-ink-10);
    padding: var(--space-6);
    transition: box-shadow var(--transition-base);
}
.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Font fallback metrics - eliminuje CLS */
@font-face {
    font-family: 'Barlow Fallback';
    src: local('Arial');
    ascent-override: 102%;
    descent-override: 25%;
    line-gap-override: 0%;
    size-adjust: 98%;
}

@font-face {
    font-family: 'Lora Fallback';
    src: local('Georgia');
    ascent-override: 95%;
    descent-override: 28%;
    line-gap-override: 0%;
    size-adjust: 105%;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-lab);
    color: var(--color-ink);
    -webkit-font-smoothing: antialiased;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Lora', 'Lora Fallback', Georgia, serif;
}

/* Nagłówki i UI z Barlow */
h1, h2, h3, h4, h5, h6,
.font-sans,
nav, button, a {
    font-family: 'Barlow', 'Barlow Fallback', Arial, sans-serif;
}

body.menu-open {
    overflow: hidden;
}

*:focus-visible {
    outline: 2px solid var(--color-alert);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Siatka inżynieryjna */
.bg-grid {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(0,0,0,0.03) 1px, transparent 1px);
}

/* Noise Overlay (Ziarno) */
body:before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgNDAwIDQwMCI+PGZpbHRlciBpZD0ibm9pc2UiPjxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjc1IiBvY3RhdmVzPSIzIiBzdGlja2V4PSIwLjM5OTk5OTk5OTk5OTk5OTk3IiBzdGlja2V5PSIwLjE4MDAwMDAwMDAwMDAwMDAzIiByZXN1bHQ9Im5vaXNlIi8+PGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMSAgMCAwIDAgMCAxICAwIDAgMCAwIDEgIDAgMCAwIDAuMDUgMCIvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNub2lzZSkiLz48L3N2Zz4=');
    pointer-events: none;
    z-index: 30;
    opacity: 0.6;
    mix-blend-mode: multiply;
}

/* ----- SYSTEM HYBRYDOWEGO KURSORA ----- */
@media (min-width: 769px) {
    html { cursor: none; }
    #cursor-dot { display: block; }
}
@media (max-width: 768px) {
    html { cursor: auto; }
    #cursor-dot { display: none !important; }
}

#cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 12px; height: 12px;
    background-color: var(--color-alert);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    mix-blend-mode: multiply;
}

body.hovering #cursor-dot {
    width: 50px; height: 50px;
    background-color: rgba(185, 43, 39, 0.1);
    border: 1px solid #B92B27;
}

.touch-ripple {
    position: fixed;
    width: 20px; height: 20px;
    background-color: rgba(185, 43, 39, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

/* ----- UI ELEMENTS ----- */
.glass-panel {
    background-color: rgba(250, 250, 250, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(26, 26, 26, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
}

/* Fallback - pokaż treść od razu, JS doda animację */
.scroll-entry {
    opacity: 1;
    transform: translateY(0);
}

/* Gdy JS jest gotowy, ukryj i animuj */
.js-ready .scroll-entry {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.js-ready .scroll-entry.is-visible,
.scroll-entry.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tech-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}
.tech-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 6px;
    height: 6px;
    background-color: var(--color-alert);
    border-radius: 50%;
}

/* Style dla ukrytych pól MailerLite */
.ml-form-embedSubmitLoad { display: inline-block; width: 20px; height: 20px; }
.ml-form-embedSubmitLoad:after { content: " "; display: block; width: 11px; height: 11px; margin: 1px; border-radius: 50%; border: 4px solid #fff; border-color: #ffffff #ffffff #ffffff transparent; animation: ml-form-embedSubmitLoad 1.2s linear infinite; }
@keyframes ml-form-embedSubmitLoad { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Custom Checkbox dla zgód */
.custom-checkbox input:checked + div { background-color: var(--color-alert); border-color: var(--color-alert); }
.custom-checkbox input:checked + div:after { content: ''; position: absolute; top: 2px; left: 6px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Styles for MailerLite Newsletter Form */
#mlb2-34844499 input[type="text"],
#mlb2-34844499 input[type="email"],
#mlb2-34844499 .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input,
.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input,
.ml-form-embedContainer input.form-control {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    border: 1px solid #cccccc !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-family: 'Barlow', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 12px !important;
    line-height: 21px !important;
    height: auto !important;
    min-height: 45px !important;
    display: block !important;
}

#mlb2-34844499 input::placeholder,
.ml-form-embedContainer input::placeholder,
.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input::placeholder {
    color: #666666 !important;
    opacity: 1 !important;
}

#mlb2-34844499 input:focus,
.ml-form-embedContainer input:focus,
.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input:focus {
    outline: 2px solid #B92B27 !important;
    outline-offset: 0 !important;
    border-color: #B92B27 !important;
}

.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedPermissions {
    margin-bottom: 16px !important;
}

#mlb2-34844499 .ml-form-embedWrapper .ml-form-embedPermissions p,
.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedPermissions p {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedPermissions p strong {
    color: rgba(255, 255, 255, 0.9) !important;
}

#mlb2-34844499 .ml-form-embedWrapper .ml-form-embedPermissions a,
.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedPermissions a {
    color: #B92B27 !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedPermissions a:hover {
    color: #a02621 !important;
}

/* Newsletter button override */
#mlb2-34844499 button,
#mlb2-34844499 .ml-form-embedSubmit button,
.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedSubmit button,
.ml-form-embedContainer button[type="submit"] {
    cursor: pointer !important;
    pointer-events: auto !important;
    background-color: #B92B27 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 12px 32px !important;
    font-family: 'Barlow', sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-radius: 8px !important;
    transition: background-color 0.3s ease !important;
}

#mlb2-34844499 button:hover,
.ml-form-embedContainer button[type="submit"]:hover {
    background-color: #a02621 !important;
}

/* Make sure form fields are visible */
#mlb2-34844499 .ml-form-fieldRow,
.ml-form-embedContainer .ml-form-fieldRow {
    margin-bottom: 12px !important;
    display: block !important;
}

#mlb2-34844499 .ml-field-group,
.ml-form-embedContainer .ml-field-group {
    width: 100% !important;
    display: block !important;
}

/* ----- Mobile Menu ----- */
#hamburger-btn {
    width: 30px;
    height: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
    z-index: 50;
}

@media (min-width: 768px) {
    #hamburger-btn {
        display: none;
    }
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--color-ink);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.menu-open #hamburger-btn .hamburger-line:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}

.menu-open #hamburger-btn .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-open #hamburger-btn .hamburger-line:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

#mobile-menu {
    position: fixed;
    inset: 0;
    background-color: var(--color-lab);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

#mobile-menu ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 2rem;
    font-family: 'Barlow', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-ink);
    list-style: none;
    margin: 0;
    padding: 0;
}

#mobile-menu li {
    margin: 0;
}

#mobile-menu li:last-child {
    padding-top: 2rem;
}

#mobile-menu li:last-child a {
    background-color: var(--color-ink);
    color: white;
    padding: 0.75rem 2rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#mobile-menu li:last-child a:hover {
    background-color: var(--color-alert);
    transform: scale(0.95);
}

@media (min-width: 768px) { /* Hide mobile menu on desktop */
    #mobile-menu {
        display: none !important;
    }
}

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

#mobile-menu a {
    color: var(--color-ink);
    text-decoration: none;
    display: inline-block;
}

.mobile-menu-link {
    position: relative;
    padding-bottom: 8px;
}

.mobile-menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-alert);
    transition: width 0.3s ease-in-out;
}

.mobile-menu-link:hover::after {
    width: 100%;
}

/* ----- Desktop Dropdown Menu ----- */
.group .dropdown-panel {
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.group:hover .dropdown-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dropdown-panel .dropdown-box {
    background: #fff;
    border: 1px solid rgba(26,26,26,0.12);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 240px;
}

.dropdown-panel .dropdown-item {
    display: block;
    padding: 14px 20px;
    font-family: 'Barlow', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-ink);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(26,26,26,0.06);
}

.dropdown-panel .dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-panel .dropdown-item:hover {
    background: rgba(26,26,26,0.04);
    color: var(--color-alert);
}

.dropdown-panel .dropdown-desc {
    display: block;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: rgba(26,26,26,0.45);
    margin-top: 3px;
    text-transform: none;
}

/* Wspólna pełna nawigacja: desktop od 1280 px, poniżej menu mobilne. */
.site-nav-full {
    display: none !important;
}

#hamburger-btn.site-menu-toggle {
    display: flex !important;
}

#mobile-menu.site-mobile-menu {
    display: block !important;
}

@media (min-width: 1280px) {
    .site-nav-full {
        display: flex !important;
    }

    #hamburger-btn.site-menu-toggle {
        display: none !important;
    }

    #mobile-menu.site-mobile-menu {
        display: none !important;
    }
}
