/* ==========================================================================
   Brand System
   ========================================================================== */

@font-face {
    font-family: "Manrope";
    src: url("../assets/fonts/manrope/Manrope-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("../assets/fonts/manrope/Manrope-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("../assets/fonts/manrope/Manrope-ExtraBold.ttf") format("truetype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("../assets/fonts/jetbrains-mono/JetBrainsMono-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("../assets/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --cm-rust: #994127;
    --cm-spark: #d68b2a;
    --cm-cream: #fbf9f5;
    --cm-cream-soft: #f3f1ee;
    --cm-ink: #1b1c1a;
    --cm-muted: #56423d;
    --cm-line: rgba(153, 65, 39, 0.18);
    --cm-success: #1f8a5b;
    --cm-info: #1f6d8a;
    --cm-danger: #c0392b;
    --cm-warning: #c98018;
}

/* Brand spark (mustard) — plain CSS so static hosts need no build / Tailwind codegen */
.text-spark {
    color: var(--cm-spark);
}

.text-spark-70 {
    color: rgba(214, 139, 42, 0.7);
}

.bg-spark {
    background-color: var(--cm-spark);
}

.bg-spark-20 {
    background-color: rgba(214, 139, 42, 0.2);
}

.bg-spark-30 {
    background-color: rgba(214, 139, 42, 0.3);
}

.bg-spark-40 {
    background-color: rgba(214, 139, 42, 0.4);
}

.bg-spark-60 {
    background-color: rgba(214, 139, 42, 0.6);
}

.bg-spark-80 {
    background-color: rgba(214, 139, 42, 0.8);
}

.border-spark-20 {
    border-color: rgba(214, 139, 42, 0.2);
}

.border-spark-30 {
    border-color: rgba(214, 139, 42, 0.3);
}

.border-spark-40 {
    border-color: rgba(214, 139, 42, 0.4);
}

html {
    background: var(--cm-cream);
}

body {
    font-family: "Manrope", system-ui, sans-serif;
    font-weight: 300;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(rgba(251, 249, 245, 0.92), rgba(251, 249, 245, 0.92)),
        url("../assets/brand/pattern-cream.svg") center top / 1120px auto repeat;
}

.font-headline-display,
.font-headline-display-mobile,
.font-headline-lg,
.font-headline-md,
h1,
h2,
h3 {
    font-weight: 800;
    letter-spacing: 0;
}

.font-label-lg,
.font-label-sm,
button,
.nav-link {
    font-weight: 500;
    letter-spacing: 0;
}

.font-body-md,
.font-body-lg,
p,
li {
    font-weight: 300;
}

.font-mono-brand,
.text-label-sm,
[class*="tracking-wider"],
[class*="tracking-widest"] {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 0;
}

/* ==========================================================================
   Base Styles and Animations
   ========================================================================== */

.hidden {
    display: none !important;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.glass-panel {
    background: rgba(251, 249, 245, 0.84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ==========================================================================
   Brand Background
   ========================================================================== */

.bg-orb {
    display: none;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 5%) scale(1.1); }
    100% { transform: translate(-5%, 10%) scale(0.9); }
}

/* ==========================================================================
   iOS Style Language Switcher
   ========================================================================== */

.lang-switcher-wrapper {
    position: fixed;
    top: 80px; /* Below the main navbar */
    right: 24px;
    z-index: 1000;
}

@media (min-width: 768px) {
    .lang-switcher-wrapper {
        top: 24px;
        right: 250px; /* Moved to the left to avoid overlapping the Get Started button */
    }
}

.ios-toggle {
    background: rgba(243, 241, 238, 0.84);
    backdrop-filter: blur(8px);
    padding: 2px;
    border-radius: 8px;
    display: flex;
    position: relative;
    width: 90px;
    height: 36px;
    border: 1px solid var(--cm-line);
}

.toggle-slider {
    position: absolute;
    background: var(--cm-cream);
    width: 42px;
    height: 30px;
    top: 2px;
    left: 2px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(153, 65, 39, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.lang-btn {
    flex: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--cm-muted);
    z-index: 2;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn.active {
    color: var(--cm-ink);
}

.ios-toggle.en-active .toggle-slider {
    transform: translateX(44px);
}

/* ==========================================================================
   WhatsApp Floating Button
   ========================================================================== */

.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 10px 28px rgba(31, 138, 91, 0.24);
    z-index: 999;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background-color: #128c7e;
}

/* CSS Pattern for Advanced Analytics chart */
.chart-pattern-bar {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

[data-form-status][data-tone="error"] {
    color: var(--cm-danger);
    font-weight: 500;
}

[data-form-status][data-tone="neutral"] {
    color: var(--cm-muted);
}

[aria-invalid="true"] {
    border-color: var(--cm-danger);
}

/* ==========================================================================
   Brand Overrides for Tailwind Markup
   ========================================================================== */

.bg-surface,
.bg-background,
.bg-surface-bright {
    background-color: var(--cm-cream) !important;
}

.bg-primary,
.bg-surface-tint {
    background-color: var(--cm-rust) !important;
}

.bg-primary-container {
    background-color: var(--cm-rust) !important;
}

.bg-tertiary {
    background-color: var(--cm-info) !important;
}

.text-primary {
    color: var(--cm-rust) !important;
}

.text-tertiary {
    color: var(--cm-info) !important;
}

.text-on-surface {
    color: var(--cm-ink) !important;
}

.text-on-surface-variant {
    color: var(--cm-muted) !important;
}

.border-primary {
    border-color: var(--cm-rust) !important;
}

.border-surface-container-high,
.border-surface-container-high\/50 {
    border-color: var(--cm-line) !important;
}

.bg-surface-container-low,
.bg-surface-container-lowest,
.bg-surface-container-high {
    background-color: rgba(251, 249, 245, 0.88) !important;
}

.rounded-2xl,
.rounded-3xl,
.rounded-xl,
.rounded-lg {
    border-radius: 8px !important;
}

.rounded-full {
    border-radius: 9999px !important;
}

.shadow-sm,
.shadow-md,
.shadow-lg,
.shadow-xl,
.shadow-2xl {
    box-shadow: 0 14px 34px rgba(153, 65, 39, 0.1) !important;
}

#navbar {
    background: rgba(251, 249, 245, 0.94) !important;
    border-color: var(--cm-line) !important;
    box-shadow: 0 14px 34px rgba(153, 65, 39, 0.12) !important;
}

/* Avoid Tailwind `hidden sm:inline` — site `.hidden` uses !important and kills responsive show */
.nav-cta-short {
    display: inline;
}

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

@media (min-width: 640px) {
    .nav-cta-short {
        display: none;
    }

    .nav-cta-full {
        display: inline;
    }
}

#navbar img,
footer img[alt="CheMozo!"] {
    height: auto !important;
    max-height: 34px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 767px) {
    #navbar img {
        max-height: 28px;
    }
}

footer img[alt="CheMozo!"] {
    max-height: 38px;
}

section[id="hero"].hero-section {
    position: relative;
    display: flex;
    align-items: center;
    min-height: min(92vh, 900px);
    width: 100%;
    overflow: hidden;
    padding: 7.5rem 1rem 3rem;
}

@media (min-width: 768px) {
    section[id="hero"].hero-section {
        padding: 8rem 3rem 4rem;
    }
}

section[id="hero"] .hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

section[id="hero"] .hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(251, 249, 245, 0.96) 0%, rgba(251, 249, 245, 0.88) 38%, rgba(251, 249, 245, 0.45) 58%, rgba(251, 249, 245, 0.12) 78%, transparent 100%),
        linear-gradient(180deg, rgba(251, 249, 245, 0.55) 0%, transparent 24%, transparent 55%, rgba(251, 249, 245, 0.65) 78%, var(--cm-cream) 100%);
}

section[id="hero"] .hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top right;
}

section[id="hero"] .hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1280px;
    margin: 8rem auto 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

section[id="hero"] h1.hero-headline {
    max-width: none;
    text-transform: uppercase;
    line-height: 1;
}

section[id="hero"] .hero-line-top {
    display: block;
    margin-bottom: 0.35em;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 700;
    font-size: clamp(1.46rem, 3.12vw, 2.95rem);
    letter-spacing: 0.02em;
    color: var(--cm-spark);
}

section[id="hero"] .hero-line-bottom {
    display: block;
    font-family: "Manrope", system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(1.75rem, 4.2vw, 3.25rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--cm-rust);
}

section[id="hero"] .hero-line-bottom-row {
    display: block;
    white-space: nowrap;
}

@media (max-width: 767px) {
    section[id="hero"].hero-section {
        min-height: min(88vh, 760px);
        align-items: flex-end;
        padding-bottom: 2.5rem;
    }

    section[id="hero"] .hero-bg-img {
        object-position: 70% top;
    }

    section[id="hero"] .hero-bg::after {
        background:
            linear-gradient(180deg, rgba(251, 249, 245, 0.45) 0%, rgba(251, 249, 245, 0.62) 38%, rgba(251, 249, 245, 0.9) 68%, var(--cm-cream) 100%);
    }

    section[id="hero"] .hero-line-bottom-row {
        white-space: normal;
    }
}

/* CheMozo Design System stroke icons (see assets/icons/cm-icons.svg) */
.cm-icon {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    color: inherit;
}

.cm-icon use {
    pointer-events: none;
}
