/* ============================================
   KALIMALIO — Styles
   Palette extraite du site actuel + affinée
   ============================================ */

/* --- Custom Properties --- */
:root {
    --color-dark: #1a1f23;
    --color-dark-alt: #39454b;
    --color-accent: #9c014b;
    --color-accent-light: #c4176a;
    --color-accent-glow: rgba(156, 1, 75, 0.35);
    --color-gray-light: #f5f6f7;
    --color-gray: #e5e6e7;
    --color-gray-mid: #b9babb;
    --color-white: #ffffff;
    --color-text: #2c2c2c;
    --color-text-light: rgba(255, 255, 255, 0.9);

    --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --header-height: 72px;
    --container-max: 1120px;
    --section-padding: 100px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Screen-reader only (SEO + a11y) --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent-light);
}

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

/* --- Container --- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Header --- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: transparent;
    transition: background var(--transition), box-shadow var(--transition);
}

#header.scrolled {
    background: rgba(26, 31, 35, 0.97);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-img {
    height: 28px;
    width: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), filter var(--transition);
}

#header.scrolled .logo-img {
    opacity: 1;
    pointer-events: auto;
    filter: brightness(0) invert(1);
}

#header.scrolled .logo:hover .logo-img {
    opacity: 0.7;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-dark-alt);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    position: relative;
    padding: 4px 0;
}

#header.scrolled .nav-link {
    color: var(--color-text-light);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text);
}

#header.scrolled .nav-link:hover,
#header.scrolled .nav-link.active {
    color: var(--color-white);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.cta-nav {
    background: var(--color-accent);
    color: var(--color-white) !important;
    padding: 8px 20px !important;
    border-radius: 4px;
    font-weight: 500;
}

.cta-nav::after {
    display: none;
}

.cta-nav:hover {
    background: var(--color-accent-light);
}

/* --- Hamburger (mobile) --- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    position: relative;
    transition: background var(--transition);
}

#header.scrolled .hamburger,
#header.scrolled .hamburger::before,
#header.scrolled .hamburger::after {
    background: var(--color-white);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: transform var(--transition), background var(--transition);
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

.menu-toggle.active .hamburger {
    background: transparent;
}

.menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--color-white);
    color: var(--color-text);
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--color-white);
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.hero-video.loaded {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 24px;
}

.hero-logo {
    width: clamp(200px, 30vw, 320px);
    margin: 0 auto 24px;
    opacity: 0;
    transform: scale(0.92);
    animation: heroLogoIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards,
               heroFloat 6s ease-in-out 1.5s infinite;
    animation-play-state: running, paused;
}

.hero.anim-active .hero-logo {
    animation-play-state: running, running;
}

@keyframes heroLogoIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* --- Scroll indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--color-dark-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    opacity: 0;
    animation: heroScrollIn 0.8s ease 1.4s forwards;
}

@keyframes heroScrollIn {
    to {
        opacity: 1;
    }
}

.scroll-indicator:hover {
    background: var(--color-accent);
}

.scroll-arrow {
    display: block;
    width: 16px;
    height: 16px;
    border-right: 2px solid var(--color-white);
    border-bottom: 2px solid var(--color-white);
    transform: rotate(45deg);
    margin-top: -4px;
    animation: scrollBounce 2s ease-in-out infinite;
    animation-play-state: paused;
}

.hero.anim-active .scroll-arrow {
    animation-play-state: running;
}

@keyframes scrollBounce {
    0%, 100% { margin-top: -4px; }
    50%      { margin-top: 4px; }
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-accent-light);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--color-accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
    background: var(--color-white);
    color: var(--color-dark);
    border-color: var(--color-white);
    transform: translateY(-2px);
}

/* --- Sections --- */
.section {
    padding: var(--section-padding) 0;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 400;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.section-keywords {
    font-size: clamp(0.75rem, 1.5vw, 0.95rem);
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 20px;
}

.section-lead {
    font-size: 1.125rem;
    font-weight: 300;
    color: var(--color-dark-alt);
    max-width: 600px;
    margin-bottom: 24px;
}

.section-light {
    background: var(--color-gray-light);
    color: var(--color-text);
    position: relative;
    overflow: hidden;
}

.section-light::before,
.section-light::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    animation-play-state: paused;
}

.section-light.anim-active::before,
.section-light.anim-active::after {
    animation-play-state: running;
}

.section-light::before {
    background: var(--color-accent);
    top: -100px;
    right: -100px;
    animation: aboutGlow1 14s ease-in-out infinite;
}

.section-light::after {
    background: #e8a87c;
    bottom: -100px;
    left: -100px;
    animation: aboutGlow2 18s ease-in-out infinite;
}

@keyframes aboutGlow1 {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    33%  { transform: translate(-60px, 40px) scale(1.1) rotate(120deg); }
    66%  { transform: translate(30px, 70px) scale(0.95) rotate(240deg); }
    100% { transform: translate(0, 0) scale(1) rotate(360deg); }
}

@keyframes aboutGlow2 {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    33%  { transform: translate(50px, -30px) scale(1.08) rotate(-120deg); }
    66%  { transform: translate(-40px, -60px) scale(1.12) rotate(-240deg); }
    100% { transform: translate(0, 0) scale(1) rotate(-360deg); }
}

.section-light .container {
    position: relative;
    z-index: 1;
}

.section-dark {
    background: var(--color-dark);
    color: var(--color-white);
}

/* --- About --- */
.about-content {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.about-separator {
    border: none;
    width: 48px;
    height: 2px;
    background: var(--color-accent);
    margin: 28px auto;
}

.about-content .section-lead {
    margin-left: auto;
    margin-right: auto;
}

.about-body {
    font-size: 1.125rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--color-dark-alt);
}

.about-body a {
    font-weight: 500;
}

/* --- Pillar Sections --- */
.section-pillar {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--color-white);
}

.section-pillar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85%;
    background: linear-gradient(to top, rgba(10, 12, 14, 0.97) 0%, rgba(10, 12, 14, 0.85) 35%, rgba(10, 12, 14, 0.4) 65%, transparent 100%);
    pointer-events: none;
}

.pillar-card {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    border: none;
    padding: 0 48px 80px;
    max-width: 700px;
}

.pillar-content {
    position: relative;
    z-index: 1;
}

.pillar-title {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.pillar-keywords {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-white);
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    padding: 10px 28px;
    border-radius: 100px;
    margin-bottom: 24px;
    text-shadow: none;
    box-shadow: 0 4px 20px rgba(156, 1, 75, 0.35);
}

.pillar-text {
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 300;
    max-width: 580px;
    margin: 0 auto 32px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

/* --- Contact --- */
.section-contact {
    background: var(--color-dark);
    color: var(--color-white);
    padding: var(--section-padding) 0;
}

.section-contact .section-title {
    color: var(--color-white);
}

.section-contact .section-lead {
    color: rgba(255, 255, 255, 0.7);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.7);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: var(--color-white);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: border-color var(--transition), background var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.12);
}

.form-group select option {
    background: var(--color-dark);
    color: var(--color-white);
}

.btn-submit {
    align-self: flex-start;
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.form-feedback {
    margin-top: 12px;
    font-size: 0.9rem;
    min-height: 1.4em;
}

.form-feedback.success {
    color: #4caf50;
}

.form-feedback.error {
    color: #ef5350;
}

.contact-info {
    display: flex;
    align-items: flex-start;
    padding-top: 8px;
}

.contact-card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 20px;
}

.contact-card p {
    margin-bottom: 20px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.8);
}

.contact-card a {
    color: var(--color-accent-light);
}

.contact-card a:hover {
    color: var(--color-accent);
}

/* --- Footer --- */
.footer {
    background: var(--color-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.5;
}

.footer-copy a {
    color: rgba(255, 255, 255, 0.6);
}

.footer-copy a:hover {
    color: var(--color-accent-light);
}

.footer-ftw-logo {
    height: 24px;
    opacity: 0.4;
    transition: opacity var(--transition);
}

.footer-ftw-logo:hover {
    opacity: 0.7;
}

/* --- Animations (fade in on scroll) --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Stagger reveal (pillar children + about) --- */
.stagger-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0s; }
.stagger-item:nth-child(2) { transition-delay: 0.12s; }
.stagger-item:nth-child(3) { transition-delay: 0.24s; }
.stagger-item:nth-child(4) { transition-delay: 0.36s; }
.stagger-item:nth-child(5) { transition-delay: 0.48s; }

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .about-image {
        order: -1;
    }

    .section-lead {
        margin-left: auto;
        margin-right: auto;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .section-pillar {
        background-attachment: scroll;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --section-padding: 60px;
    }

    .menu-toggle {
        display: block;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(26, 31, 35, 0.98);
        backdrop-filter: blur(20px);
        transition: right var(--transition);
        padding: var(--header-height) 32px 32px;
    }

    .nav.open {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .nav-link {
        display: block;
        padding: 16px 0;
        font-size: 1rem;
        color: var(--color-white);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav-link::after {
        display: none;
    }

    .cta-nav {
        margin-top: 16px;
        text-align: center;
    }

    .hero-logo {
        width: 216px;
    }

    .menu-toggle.active .hamburger,
    .menu-toggle.active .hamburger::before,
    .menu-toggle.active .hamburger::after {
        background: var(--color-white);
    }

    .pillar-card {
        padding: 0 24px 60px;
        margin: 0;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-brand {
        flex-direction: column;
        gap: 8px;
    }
}

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

    .fade-in,
    .stagger-item {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-logo {
        opacity: 1;
        transform: none;
        filter: none;
        animation: none;
    }

    .scroll-indicator {
        opacity: 1;
        animation: none;
    }

    .scroll-arrow {
        animation: none;
    }

    .section-light::before,
    .section-light::after {
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
