/* =================================
   GLOBAL (BASE CSS - LOADS ON ALL PAGES)
=================================== */

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

:root {
    --font-m-plus: "M PLUS 1p", sans-serif;
    --font-italiana: "Italiana", sans-serif;
    --primary-color: #000000;
    --text-color: #333333;
    --text-color-light: #555555;
    --bg-color: #f1ede7;
    --bg-color-light: #f5f5f5;
    --bg-color-overlay: rgba(243, 243, 243, 0.95);
    --accent-color: #8b5cf6;
    --border-color: rgba(0, 0, 0, 0.15);
    --max-width: 1200px;
}

html, body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* WCAG 2.1 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation: none !important;
        transition: none !important;
    }
}

html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* WCAG 2.1 */
:focus-visible {
    outline: 3px solid #555555;
    outline-offset: 3px;
}

/* ===================================
   BROWSER SPECIFIC CLASSES
=================================== */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.12) transparent;
}

/* WebKit */
::-webkit-scrollbar { 
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0);
    border-radius: 10px;
    transition: background 0.2s ease-in-out;
}

::-webkit-scrollbar-thumb:hover,
*:hover::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.30);
}

.in-app-browser .construction-popup,
.in-app-browser #page-loader {
    backdrop-filter: none !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    transform: none !important;
    opacity: 1 !important;
}

.in-app-browser .construction-popup,
.in-app-browser .hero-slideshow {
    height: 100svh !important;
    max-height: 100svh !important;
}


/* ===================================
   BASE FONT CLASSES
=================================== */

/* Italiana Font */
.font-italiana {
    font-family: var(--font-italiana);
    font-weight: 400;
    font-style: normal;
}

/* M PLUS 1p Base */
.font-m-plus {
    font-family: var(--font-m-plus);
    font-style: normal;
}

/* M PLUS 1p Weight Variations */
.font-m-plus-thin {
    font-weight: 100;
}

.font-m-plus-light {
    font-weight: 300;
}

.font-m-plus-regular {
    font-weight: 400;
}

.font-m-plus-medium {
    font-weight: 500;
}

.font-m-plus-bold {
    font-weight: 700;
}

/* ===================================
   SEMANTIC FONT CLASSES
=================================== */

/* Primary Headings - Italiana family */
.heading-primary {
    font-family: var(--font-italiana);
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--text-color);
}

.heading-large {
    font-family: var(--font-italiana);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    line-height: 1.3;
}

.heading-section {
    font-family: var(--font-italiana);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.3;
    margin-bottom: 1rem;
}

/* Body Text - M PLUS 1p family */
.text-body {
    font-family: var(--font-m-plus);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.05em;
}

.text-body-large {
    font-family: var(--font-m-plus);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0.05em;
}

.text-body-medium {
    font-family: var(--font-m-plus);
    font-size: clamp(0.8rem, 2.2vw, 1rem);
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.05em;
}

.text-body-small {
    font-family: var(--font-m-plus);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.3;
}

.text-label {
    font-family: var(--font-m-plus);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Button Text */
.text-button {
    font-family: var(--font-m-plus);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.1em;
}

/* Hero/Statement Text */
.text-statement {
    font-family: var(--font-italiana);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-shadow: 0.4px 0 0 currentColor, -0.4px 0 0 currentColor;
}

/* Navigation Text */
.text-nav {
    font-family: var(--font-m-plus);
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* Footer Text */
.text-footer {
    font-size: 0.9rem;
    color: #f3f3f3;
}

/* Legal/Fine Print */
.text-legal {
    font-family: var(--font-m-plus);
    line-height: 1.7;
    color: #555;
}

/* ===================================
   BASE STYLES
=================================== */

body {
    font-family: var(--font-m-plus);
    font-optical-sizing: auto;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0.1em;
    opacity: 0.9;
    background-color: var(--bg-color);
}

/* ===================================
   LAYOUT
=================================== */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 3vw;
}

h1, h2 {
    font-family: var(--font-italiana);
    letter-spacing: 0.1em;
    color: var(--text-color);
}

h3, h4, button {
    font-family: var(--font-m-plus);
    color: var(--text-color);
    letter-spacing: 0.1em;
    opacity: 0.9;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: opacity 0.3s ease;
    letter-spacing: 0.1em;
}

a:hover {
    opacity: 0.7;
}


/* ===================================
   PAGE LOADER
=================================== */

#page-loader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#figure {
    position: fixed;
    inset: 0;
    margin: auto;
    width: 6.25em;
    height: 6.25em;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: rotate 2.4s linear infinite;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    pointer-events: all;              
}

.white { 
    top: 0; bottom: 0; left: 0; right: 0; 
    background: white; 
    animation: flash 2.4s linear infinite;
    opacity: 0;
}

.dot {
    position: absolute;
    margin: auto;
    width: 2.4em; 
    height: 2.4em;
    border-radius: 100%;
    transition: all 1s ease;
}

.dot:nth-child(2) { 
    top: 0; bottom: 0; left: 0; 
    background-color: #172838;
    animation: dotsY 2.4s linear infinite; 
}

.dot:nth-child(3) { 
    left: 0; right: 0; top: 0; 
    background-color: #172838;
    animation: dotsX 2.4s linear infinite; 
}

.dot:nth-child(4) { 
    top: 0; bottom: 0; right: 0; 
    background-color: #172838;
    animation: dotsY 2.4s linear infinite; 
}

.dot:nth-child(5) { 
    left: 0; right: 0; bottom: 0; 
    background-color: #172838;
    animation: dotsX 2.4s linear infinite; 
}

@keyframes rotate {
    0% { transform: rotate(0); }
    10% { width: 6.250em; height: 6.250em; }
    66% { width: 2.4em; height: 2.4em; }
    100% { transform: rotate(360deg); width: 6.250em; height: 6.250em; }
}

@keyframes dotsY {
    66% { opacity: .1; width: 2.4em; }
    77% { opacity: 1; width: 0; }
}

@keyframes dotsX {
    66% { opacity: .1; height: 2.4em;}
    77% { opacity: 1; height: 0; }
}

@keyframes flash {
    33% { opacity: 0; border-radius: 0%; }
    55% { opacity: .6; border-radius: 100%; }
    66% { opacity: 0; }
}

/* ===================================
   HEADER STYLES
=================================== */

.header-wrapper { 
    position: relative;
    display: inline-block;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgb(32, 28, 23, 0);
    color: white;
    z-index: 1000;
    transition: 
        background-color 0.4s ease,
        backdrop-filter 0.4s ease,
        padding 0.4s ease;
    backdrop-filter: none;
    padding-top: 1vw;
}

.site-header .header-inner {
    padding: 0vw 0vw;
}

.site-header.menu-open {
    background-color: var(--bg-color-overlay);
}

.site-header.scrolled {
    background-color: var(--bg-color-overlay);
    padding: 1vw;
}

.menu-toggle span.scrolled {
    width: 25px;
    height: 1px;
    background-color: var(--text-color);
    opacity: 0.5;
    margin: 4px 0;
    transition: 0.3s;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4vw 3v; 
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.header-logo img {
    height: 50px;
    width: auto;
    margin-left: 2rem;
}

.header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - 85px);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: var(--bg-color-overlay);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}

.header-nav.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    flex-direction: column;
    align-items: center;
    height: 100vh;
}

.header-nav a {
    font-size: 1.4rem;
    font-weight: 300;
    white-space: nowrap;
    color: var(--text-color);
}

.language-switcher {
    gap: 0.5rem;
    align-items: center;
    padding-top: 2rem;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.language-switcher a {
    text-decoration: none;
    color: var(--text-color);
}

.language-switcher a:hover {
    opacity: 0.6;
}

.language-switcher span {
    color: var(--text-color);
}

.language-switcher a.active {
    font-weight: 500;
}

.social-icons {
    gap: 1rem;
    align-items: center;
}

.social-icons svg {
    fill: var(--text-color);
    transition: opacity 0.3s ease;
}

.social-icons a:hover svg {
    opacity: 0.7;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 0.7px;
    background-color: #ffffff;
    margin: 4px 0;
    transition:
        transform 0.3s ease,
        opacity 0.2s ease,
        background-color 0.3s ease;
}

.menu-toggle.scrolled span {
    background-color: var(--text-color);
}

.menu-toggle.is-open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
    background-color: #7c7c7c;
}

.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
    background-color: #7c7c7c;
}

.menu-toggle.is-open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
    background-color: #7c7c7c;
}

.btn-primary-header {
    font-family: var(--font-m-plus);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.1em;
    color: #ffffff;
    display: inline-block;
    padding: 0.4rem 2rem;
    background-color: transparent;
    border: 1px solid #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease;
    margin-right: 2rem;
    margin-left: 2rem;
}

.btn-primary-header.scrolled, 
.btn-primary-header.scrolled.menu-open, 
.btn-primary-header.menu-open {
    color: var(--text-color);
    opacity: 0.8;
    border: 1px solid var(--text-color);
}

.btn-primary-header:hover {
    background-color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.696);
    color: rgba(255, 255, 255, 0.696);
}

.btn-primary-header.scrolled.menu-open {
    color: var(--text-color);
    opacity: 0.5;
    border: 1px solid var(--text-color);
}

/* ===================================
   FOOTER STYLES
=================================== */

.site-footer {
    background-color: var(--text-color);
    padding: 4rem 0;
    text-align: center;
}

.footer-content {
    max-width: 55%;
    margin: 0 auto;
}

.footer-logo {
    margin-bottom: 2rem;
}

.footer-logo img {
    width: 20%;
    min-width: 150px;
    margin: 0 auto;
}

.footer-links p {
    margin-bottom: 0.75rem;
    color: #f3f3f3;
}

.footer-links a {
    margin: 0 0.5rem;
    color: #f3f3f3;
}

.small-text {
    font-size: 0.9rem;
    color: #f3f3f3;
}

.small-text-header a, .small-text-header span {
    font-size: 0.9rem;
    color: var(--text-color);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.footer-social svg {
    fill: #f3f3f3;
}

/* ===================================
   SCROLL TO TOP BUTTON
=================================== */

.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0,0,0,0.5);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ===================================
   COOKIE CONSENT POPUP
=================================== */

.cookie-consent {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: clamp(320px, 90vw, 700px);
    background-color: var(--bg-color);
    border-radius: 0.2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    z-index: 9000;
    transition: all 0.3s ease;
}

.cookie-consent.hidden {
    opacity: 0;
    visibility: hidden;
}

.cookie-consent p {
    font-size: clamp(0.8rem, 2.2vw, 1rem);
    font-weight: 400;
    padding-bottom: 1rem;
    color: var(--text-color);
}

.cookie-header {
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.cookie-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-italiana);
    line-height: 1.3;
    padding-bottom: 1rem;
}

.cookie-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.cookie-section {
    margin-top: 0.75rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    background-color: #3333330c;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
}

.cookie-toggle-btn {
    font-family: var(--font-m-plus);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.6;
    text-align: left;
    width: 100%;
    background: none;
    border: none;
    padding: 0.5rem 0;
    cursor: pointer;
}

.cookie-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.cookie-section-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.cookie-section-content.visible {
    max-height: 500px;
    opacity: 1;
}

.cookie-section-content p {
    font-size: 0.9rem;
}

.cookie-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-ui {
    position: relative;
    width: 42px;
    height: 22px;
    background-color: #ccc;
    border-radius: 999px;
    transition: background-color 0.25s ease;
}

.cookie-toggle-ui::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cookie-toggle input:checked + .cookie-toggle-ui {
    background-color: #6fad6d;
}

.cookie-toggle input:checked + .cookie-toggle-ui::before {
    transform: translateX(20px);
}

.cookie-toggle input:focus-visible + .cookie-toggle-ui {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.cookie-toggle.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    font-size: 0.8rem;
    font-family: var(--font-m-plus);
    font-weight: 500;
    letter-spacing: .1em;
}

.cookie-toggle.disabled .cookie-toggle-ui {
    background-color: #999;
}

.cookie-section label {
    display: flex;
    align-items: center; 
    justify-content: space-between;
    text-align: right;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.6;
    cursor: pointer;
}

.cookie-toggle-content {
    margin-bottom: 0.5rem;
}

.cookie-toggle-content p {
    font-size: 0.85rem;
}

.cookie-toggle-label {
    opacity: 0.9;
    cursor: not-allowed;
    font-size: 0.8rem;
    font-family: var(--font-m-plus);
    font-weight: 500;
    letter-spacing: .1em;
}

.cookie-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.cookie-actions button, .cookie-actions a {
    font-family: var(--font-m-plus);
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#accept-all, #save-preferences, #deny-all, #cookies {
    font-size: 0.9rem;
    font-family: var(--font-m-plus);
    font-weight: 500;
    letter-spacing: .1em;
    color: #333;
    background-color: var(--bg-color);
    line-height: 1.6;
    opacity: 1;
}

#accept-all:hover, #save-preferences:hover, #deny-all:hover, #cookies:hover {
    background-color: #33333394;
    transition: background-color 0.2s ease, color 0.2s ease;
    color: #fff;
}

/* ===================================
   RESPONSIVE STYLES (BASE)
=================================== */

@media screen and (min-width: 1025px) {
    .header-nav {
        display: none;
        position: absolute;
        top: 100%; 
        left: 0;
        right: 0;
        height: calc(100vh - 75px);
        background-color: var(--bg-color-overlay); 
        flex-direction: row;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .header-nav.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .footer-content {
        max-width: 90%;
    }

    .footer-logo img {
        width: 40%;
    }
}

@media screen and (max-width: 1024px) {
    .header-nav {
        background-color: var(--bg-color-overlay); 
    }

    .header-logo {
        width: 20%;
    }

    .menu-toggle {
        order: 2;
        width: 20%;
        display: flex;
        justify-content: flex-end; /* align toggle to right */
    }

    .menu-toggle span {
        margin-left: clamp(0.5rem, 10vw, 10rem);
    }

    .btn-primary-header {
        order: 1;
    }
}

@media (max-width: 640px) {
    .header-logo,
    .btn-primary-header,
    .menu-toggle {
        flex: 0 0 auto; /* prevent shrinking */
    }

    .header-logo img {
        height: 50px;
        padding-top: 5px;
        padding-bottom: 5px;
        margin-left: 1rem;
    }

    .menu-toggle span {
        margin-left: clamp(0.5rem, 3vw, 10rem);
    }

    .btn-primary-header {
        margin-right: 1rem;
        margin-left: 1rem;
    }

    .small-text-header a {
        font-size: 0.7rem !important;
    }

    #cookie-consent {
        left: 1rem;
        width: auto;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1rem;
        box-sizing: border-box;
    }

    #cookie-consent::-webkit-scrollbar {
        width: 6px;
    }

    #cookie-consent::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.2);
        border-radius: 3px;
    }

    .cookie-toggle input:checked + .cookie-toggle-ui::before {
        transform: translateX(10px);
    }
}