/* ─── AQUA MALACCA — Theme tokens & dark mode ─── */

:root {
    --amber: #D8831F;
    --amber-bright: #E8942A;
    --amber-soft: rgba(216, 131, 31, 0.55);
    --amber-glow: rgba(216, 131, 31, 0.18);

    --bg-base: #fcfbfa;
    --bg-surface: #ffffff;
    --bg-elevated: #f3efe8;
    --bg-section: #f7f4ef;
    --bg-muted: #ece8e2;
    --bg-inset: #eceae6;

    --text-primary: #2c302e;
    --text-strong: #1a1816;
    --text-secondary: rgba(44, 48, 46, 0.72);
    --text-muted: rgba(44, 48, 46, 0.45);
    --text-faint: #8a8580;
    --text-body: rgba(26, 24, 22, 0.55);
    --text-body-soft: rgba(26, 24, 22, 0.48);

    --border-subtle: rgba(44, 48, 46, 0.08);
    --border-soft: #f2efeb;
    --border-section: #e6e1da;

    --header-bg: rgba(252, 251, 250, 0.92);
    --header-text: rgba(44, 48, 46, 0.92);
    --header-nav: rgba(44, 48, 46, 0.72);
    --header-btn-bg: rgba(255, 255, 255, 0.72);
    --header-btn-border: rgba(44, 48, 46, 0.12);
    --header-btn-line: rgba(44, 48, 46, 0.82);

    --header-glass-bg: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.82) 0%,
        rgba(252, 251, 250, 0.58) 42%,
        rgba(255, 255, 255, 0.72) 100%
    );
    --header-glass-border: rgba(255, 255, 255, 0.72);
    --header-glass-neo-light: inset 0 1px 1px rgba(255, 255, 255, 0.98), inset 0 -1px 1px rgba(255, 255, 255, 0.42);
    --header-glass-neo-dark: inset 0 -2px 10px rgba(44, 48, 46, 0.05);
    --header-glass-ambient: 0 14px 44px rgba(44, 48, 46, 0.11), 0 4px 14px rgba(44, 48, 46, 0.06);
    --header-glass-accent: rgba(216, 131, 31, 0.38);

    --card-bg: rgba(255, 255, 255, 0.92);
    --card-border: rgba(255, 255, 255, 0.95);
    --card-shadow: rgba(44, 48, 46, 0.07);

    --contact-bg: linear-gradient(165deg, #f8f5f0 0%, #efe9e0 48%, #e8e2d8 100%);
    --dot-bg: #d4cfc7;

    --theme-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --toggle-track: rgba(44, 48, 46, 0.08);
    --toggle-thumb: #ffffff;
    --toggle-glow: rgba(216, 131, 31, 0.25);

    --product-badge-bg: rgba(255, 255, 255, 0.9);
    --product-badge-bg-active: rgba(255, 255, 255, 0.98);
    --product-badge-text: #8a8580;
    --product-badge-border: rgba(255, 255, 255, 0.6);
    --product-badge-icon: #8a8580;
    --product-btn-bg: rgba(236, 234, 230, 0.92);
    --product-btn-border: rgba(44, 48, 46, 0.08);
    --product-btn-color: #8a8580;

    --product-tag-bg: transparent;
    --product-tag-border: transparent;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --amber: #E8942A;
    --amber-bright: #F0A840;
    --amber-soft: rgba(232, 148, 42, 0.62);
    --amber-glow: rgba(232, 148, 42, 0.24);

    --bg-base: #0a0b0a;
    --bg-surface: #121411;
    --bg-elevated: #161715;
    --bg-section: #131412;
    --bg-muted: #1a1b19;
    --bg-inset: #1e201d;

    --text-primary: #eae6df;
    --text-strong: #f5f0ea;
    --text-secondary: rgba(234, 230, 223, 0.72);
    --text-muted: rgba(234, 230, 223, 0.45);
    --text-faint: rgba(234, 230, 223, 0.38);
    --text-body: rgba(234, 230, 223, 0.58);
    --text-body-soft: rgba(234, 230, 223, 0.46);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.06);
    --border-section: rgba(255, 255, 255, 0.07);

    --header-bg: rgba(10, 11, 10, 0.9);
    --header-text: rgba(245, 240, 234, 0.94);
    --header-nav: rgba(245, 240, 234, 0.68);
    --header-btn-bg: rgba(255, 255, 255, 0.06);
    --header-btn-border: rgba(255, 255, 255, 0.12);
    --header-btn-line: rgba(245, 240, 234, 0.88);

    --header-glass-bg: linear-gradient(
        145deg,
        rgba(34, 36, 33, 0.9) 0%,
        rgba(18, 20, 17, 0.74) 48%,
        rgba(28, 30, 27, 0.88) 100%
    );
    --header-glass-border: rgba(255, 255, 255, 0.11);
    --header-glass-neo-light: inset 0 1px 1px rgba(255, 255, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --header-glass-neo-dark: inset 0 -2px 14px rgba(0, 0, 0, 0.38);
    --header-glass-ambient: 0 18px 52px rgba(0, 0, 0, 0.48), 0 6px 20px rgba(0, 0, 0, 0.28);
    --header-glass-accent: rgba(232, 148, 42, 0.5);

    --card-bg: rgba(22, 23, 21, 0.94);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: rgba(0, 0, 0, 0.45);

    --contact-bg: linear-gradient(165deg, #121411 0%, #0e0f0e 48%, #0a0b0a 100%);
    --dot-bg: rgba(255, 255, 255, 0.16);

    --toggle-track: rgba(255, 255, 255, 0.1);
    --toggle-thumb: #f5f0ea;
    --toggle-glow: rgba(232, 148, 42, 0.45);

    --product-badge-bg: rgba(18, 20, 17, 0.92);
    --product-badge-bg-active: rgba(28, 30, 27, 0.96);
    --product-badge-text: rgba(245, 240, 234, 0.88);
    --product-badge-border: rgba(255, 255, 255, 0.14);
    --product-badge-icon: #E8942A;
    --product-btn-bg: rgba(255, 255, 255, 0.06);
    --product-btn-border: rgba(255, 255, 255, 0.16);
    --product-btn-color: #f5f0ea;

    --product-tag-bg: rgba(232, 148, 42, 0.12);
    --product-tag-border: rgba(232, 148, 42, 0.22);
}

/* Light, short transition — does NOT touch transform/opacity (GSAP-safe) */
html.theme-switching body {
    transition: background-color 0.35s var(--theme-ease), color 0.35s var(--theme-ease);
}

html.theme-switching .site-header,
html.theme-switching .site-header::before,
html.theme-switching .site-header::after,
html.theme-switching .site-header__lang-toggle,
html.theme-switching .site-header__lang-btn,
html.theme-switching .about,
html.theme-switching .products,
html.theme-switching .gallery,
html.theme-switching .contact,
html.theme-switching .products-card__inner {
    transition: background-color 0.35s var(--theme-ease), border-color 0.35s var(--theme-ease);
}

.theme-transition {
    display: none;
}

/* ─── Theme toggle ─── */
.site-header__theme-toggle {
    position: relative;
    width: 58px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--header-btn-border);
    border-radius: 999px;
    background: var(--header-btn-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: auto;
    transition: border-color 0.3s var(--theme-ease), box-shadow 0.3s var(--theme-ease), transform 0.3s var(--theme-ease);
}

.site-header__theme-toggle:hover {
    transform: scale(1.06);
    border-color: rgba(216, 131, 31, 0.45);
    box-shadow: 0 0 20px var(--toggle-glow);
}

.site-header__theme-toggle:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

.site-header__theme-track {
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    background: var(--toggle-track);
}

.site-header__theme-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--toggle-thumb) 0%, rgba(255, 255, 255, 0.88) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.45s var(--theme-ease), box-shadow 0.45s var(--theme-ease);
}

html[data-theme="dark"] .site-header__theme-thumb {
    transform: translateX(28px);
    box-shadow: 0 2px 12px rgba(232, 148, 42, 0.35);
}

.site-header__theme-icons {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    pointer-events: none;
}

.site-header__theme-icon {
    width: 12px;
    height: 12px;
    color: var(--amber);
    opacity: 0.3;
    transition: opacity 0.35s var(--theme-ease), transform 0.35s var(--theme-ease);
}

.site-header__theme-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html:not([data-theme="dark"]) .site-header__theme-icon--sun,
html[data-theme="dark"] .site-header__theme-icon--moon {
    opacity: 1;
    transform: scale(1.08);
}

.site-header--overlay:not(.site-header--scrolled) .site-header__theme-toggle {
    border-color: rgba(42, 33, 24, 0.28);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.site-header--overlay:not(.site-header--scrolled) .site-header__theme-track {
    background: rgba(42, 33, 24, 0.08);
}

.site-header--overlay:not(.site-header--scrolled) .site-header__theme-icon {
    color: #2a2118;
}

/* ─── Dark mode: surfaces ─── */
html[data-theme="dark"] body {
    background-color: var(--bg-base);
    color: var(--text-primary);
}

html[data-theme="dark"] .panna-card {
    background: var(--bg-surface);
    border-color: var(--border-soft);
}

html[data-theme="dark"] body.has-site-header .site-header {
    background: transparent;
    border-bottom: none;
}

html[data-theme="dark"] .products {
    background-color: #101110;
    background-image:
        linear-gradient(180deg, rgba(10, 11, 10, 0.9) 0%, rgba(12, 13, 12, 0.82) 46%, rgba(10, 11, 10, 0.94) 100%),
        var(--products-photo);
}

html[data-theme="dark"] .products__subtitle,
html[data-theme="dark"] .products-card__desc {
    color: rgba(234, 230, 223, 0.68);
}

html[data-theme="dark"] .products-card__index {
    color: rgba(245, 240, 234, 0.16);
}

html[data-theme="dark"] .products-card--active .products-card__index {
    color: rgba(232, 148, 42, 0.42);
}

html[data-theme="dark"] .about {
    background: var(--bg-section);
    border-bottom-color: var(--border-section);
}

html[data-theme="dark"] .gallery {
    background: var(--bg-base);
    color: var(--text-primary);
}

html[data-theme="dark"] .contact {
    background: var(--bg-section);
}

html[data-theme="dark"] .products-card__inner {
    background:
        linear-gradient(165deg, rgba(22, 23, 21, 0.96) 0%, rgba(14, 15, 14, 0.92) 100%);
    border-color: var(--card-border);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 18px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .products-card--active .products-card__inner {
    border-color: rgba(232, 148, 42, 0.38);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 10px 22px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .products-card__tag {
    background: rgba(232, 148, 42, 0.1);
    border-color: rgba(232, 148, 42, 0.2);
}

html[data-theme="dark"] .products-card__media {
    background: var(--bg-muted);
}

html[data-theme="dark"] .products-card__badge {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .products-card--active .products-card__badge {
    box-shadow: 0 8px 28px rgba(232, 148, 42, 0.22);
}

html[data-theme="dark"] .products-card__btn {
    color: var(--text-strong);
    border-color: var(--border-subtle);
}

html[data-theme="dark"] .about__frame {
    background: var(--bg-muted);
}

html[data-theme="dark"] .about__quote {
    background: transparent;
    border-color: transparent;
}

html[data-theme="dark"] .about__stats {
    border-top-color: var(--border-subtle);
}

html[data-theme="dark"] .gallery__footer {
    border-top-color: var(--border-subtle);
}

html[data-theme="dark"] .gallery__nav-btn {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
}

html[data-theme="dark"] .gallery__tile-overlay {
    background: linear-gradient(to top, rgba(10, 11, 10, 0.92) 0%, transparent 100%);
}

html[data-theme="dark"] .contact__panel {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
}

html[data-theme="dark"] .products__dot,
html[data-theme="dark"] .gallery__dot {
    background: var(--dot-bg);
}

html[data-theme="dark"] .products__orb--2 {
    background: rgba(232, 148, 42, 0.08);
}
