/* =========================================================
   MAISON COROMANDEL — app.css
   ========================================================= */

@font-face {
    font-family: 'Montserrat';
    src: url('/fonts/Montserrat-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --gold:         #C4993A;
    --white:        #F5F0E8;
    --white-dim:    rgba(245, 240, 232, 0.72);
    --white-faint:  rgba(245, 240, 232, 0.36);
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-utility: 'Montserrat', 'Helvetica Neue', sans-serif;
    --app-h:        100vh; /* overridden by JS to real innerHeight */
}

html, body {
    width: 100%;
    height: var(--app-h);
    overflow: hidden;
    background: #3a3028;
    font-family: var(--font-utility);
    -webkit-font-smoothing: antialiased;
}

/* ── Scene ───────────────────────────────────────────────── */
.scene {
    position: relative;
    width: 100%;
    height: var(--app-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

/* ── Background ──────────────────────────────────────────── */
.bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('/images/bg.png');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
}

.bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 30%, rgba(20,15,10,0.25) 100%);
}

/* ── Stage (centre content) ──────────────────────────────── */
.stage {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px;
    margin-top: -40px; /* pull slightly above true centre on desktop */
    animation: fadeIn 1.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.25s;
}

/* ── Palm icon ───────────────────────────────────────────── */
.logomark { margin-bottom: 28px; }

.palm-icon {
    width: 146px;
    height: 146px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(196,153,58,0.3));
    transition: filter 0.4s ease;
}
.palm-icon:hover {
    filter: drop-shadow(0 0 16px rgba(196,153,58,0.55));
}

/* ── Brand name ──────────────────────────────────────────── */
.brand-name {
    font-family: var(--font-utility);
    font-weight: 300;
    font-size: clamp(1.6rem, 5vw, 2.8rem);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1;
}

.trademark {
    font-size: 0.45em;
    vertical-align: super;
    letter-spacing: 0;
    opacity: 0.75;
}

/* ── Tagline ─────────────────────────────────────────────── */
.tagline {
    font-family: var(--font-utility);
    font-weight: 200;
    font-size: clamp(0.62rem, 1.8vw, 0.70rem);
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--white-dim);
    line-height: 2;
    margin-bottom: 36px;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
    width: 1px;
    height: 48px;
    background: var(--white-faint);
    margin: 0 auto 32px;
}

/* ── Launch label ────────────────────────────────────────── */
.launch-label {
    font-family: var(--font-utility);
    font-weight: 200;
    font-size: clamp(0.69rem, 1.84vw, 0.76rem);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--white-dim);
}

/* ── Sound toggle ────────────────────────────────────────── */
.sound-toggle {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 10;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 15, 10, 0.25);
    border: 1px solid rgba(245, 240, 232, 0.22);
    border-radius: 50%;
    color: var(--white-dim);
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.sound-toggle:hover,
.sound-toggle:focus-visible {
    opacity: 1;
    color: var(--white);
    border-color: rgba(196, 153, 58, 0.55);
}
.sound-toggle:focus-visible { outline: none; }

.sound-icon {
    width: 17px;
    height: 17px;
}
.sound-icon--on { display: none; }
.sound-toggle.is-on { opacity: 0.85; }
.sound-toggle.is-on .sound-icon--off { display: none; }
.sound-toggle.is-on .sound-icon--on { display: block; }

@media (max-width: 600px) {
    .sound-toggle {
        top: 16px;
        right: 16px;
        width: 34px;
        height: 34px;
    }
    .sound-icon { width: 15px; height: 15px; }
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    margin-top: 36px;
    animation: fadeIn 1.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.75s;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 0;
}

.footer-location,
.footer-link,
.footer-link--btn {
    font-family: var(--font-utility);
    font-weight: 200;
    font-size: clamp(0.67rem, 1.38vw, 0.69rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--white-dim);
    padding: 4px 24px;
}

.footer-link,
.footer-link--btn {
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.footer-link--btn {
    background: none;
    border: none;
    cursor: pointer;
}

.footer-link::after,
.footer-link--btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.footer-link:hover,
.footer-link--btn:hover { color: var(--white); }
.footer-link:hover::after,
.footer-link--btn:hover::after { transform: scaleX(1); }

.footer-sep {
    display: inline-block;
    width: 1px;
    height: 12px;
    background: var(--white-faint);
    flex-shrink: 0;
}

/* ── Modal overlay ───────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(20, 14, 8, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal card ──────────────────────────────────────────── */
.modal {
    position: relative;
    background: #2a221a;
    border: 1px solid rgba(196, 153, 58, 0.25);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 52px 48px 44px;
    transform: translateY(20px);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-overlay.is-open .modal { transform: translateY(0); }

.modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    color: var(--white-dim);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.25s;
}
.modal-close:hover { color: var(--white); }

.modal-title {
    font-family: var(--font-utility);
    font-weight: 300;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 28px;
}

/* ── Form ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-family: var(--font-utility);
    font-weight: 200;
    font-size: 0.60rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--white-dim);
    margin-bottom: 8px;
}

.req { color: var(--gold); font-style: normal; }

.form-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(196, 153, 58, 0.2);
    border-radius: 0;
    color: var(--white);
    font-family: var(--font-utility);
    font-weight: 200;
    font-size: 1rem;
    padding: 11px 14px;
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.25s;
}
.form-input:focus { border-color: rgba(196,153,58,0.65); }
.form-input::placeholder { color: rgba(245,240,232,0.2); }
.form-textarea { resize: vertical; min-height: 90px; }

.form-error {
    font-family: var(--font-utility);
    font-size: 0.62rem;
    color: #c47a5a;
    margin-bottom: 12px;
    min-height: 1em;
}

.cf-turnstile {
    margin-bottom: 14px;
}

.form-submit {
    width: 100%;
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 0;
    color: var(--gold);
    font-family: var(--font-utility);
    font-weight: 200;
    font-size: 0.60rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    padding: 15px;
    cursor: pointer;
    -webkit-appearance: none;
    transition: background 0.3s, color 0.3s;
    margin-top: 4px;
}
.form-submit:hover:not(:disabled) { background: var(--gold); color: #2a221a; }
.form-submit:disabled { opacity: 0.5; cursor: default; }

/* ── Success state ───────────────────────────────────────── */
.modal-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    color: var(--white-dim);
    font-family: var(--font-utility);
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.8;
}

/* ── Copyright ───────────────────────────────────────────── */
.footer-copy {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-utility);
    font-weight: 200;
    font-size: clamp(0.67rem, 1.38vw, 0.69rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--white-dim);
}

/* ── Animation ───────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .stage, .footer { animation: none; }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .stage {
        margin-top: 0;
        padding: 0 24px;
    }
    .bg {
        background-size: cover;
        background-position: 30% center;
    }

    .brand-name {
        font-size: 5.8vw;
        letter-spacing: 0.18em;
        margin-bottom: 14px;
    }
    .tagline {
        font-size: 2.6vw;
        letter-spacing: 0.16em;
        margin-bottom: 24px;
    }
    .launch-label {
        font-size: 2.76vw;
        letter-spacing: 0.22em;
    }

    .divider { height: 36px; margin-bottom: 22px; }
    .palm-icon { width: 106px; height: 106px; }
    .logomark { margin-bottom: 18px; }

    .footer { margin-top: 24px; }
    .footer-sep { display: inline-block; }
    .footer-location,
    .footer-link,
    .footer-link--btn {
        font-size: 2.53vw;
        letter-spacing: 0.14em;
        padding: 4px 10px;
    }

    .modal-overlay { align-items: flex-end; }
    .modal {
        width: 100%;
        max-width: 100%;
        min-height: 280px;
        max-height: 85vh;
        padding: 36px 20px 32px;
        border-left: none;
        border-right: none;
        border-bottom: none;
        transform: translateY(100%);
        display: flex;
        flex-direction: column;
    }
    .modal-overlay.is-open .modal { transform: translateY(0); }
    .modal-title { font-size: 1.4rem; }
    .modal-sub { margin-bottom: 24px; }
    .modal-success { flex: 1; }
    .form-group { margin-bottom: 14px; }
    .g-recaptcha { transform: scale(0.87); transform-origin: 0 0; }
}
