/* ============================================================
   GLOBAL.CSS — Design System Foundation
   ResQplus IoT Product Website
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
    /* --- Color Palette --- */
    --bg-primary: #fffffff6;
    --bg-secondary: #f7f5f2;
    --bg-elevated: #ffffff;
    --bg-surface: #ffffff;

    --text-primary: #1f1411;
    --text-secondary: #3e2723;
    --text-muted: #5d4037;
    --text-inverse: #ffffff;

    --accent-primary: #ebae12a1;
    --accent-hover: #d49b0e;
    --accent-glow: rgba(235, 172, 18, 0.15);
    --accent-secondary: #f5c64c;
    --accent-gradient: linear-gradient(135deg, rgb(177, 127, 0), #fabc20a1);
    --accent-gradient-h: linear-gradient(90deg, #fcad0fd6, #f3a01bde);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --border-subtle: rgba(31, 20, 17, 0.08);
    --border-light: rgba(31, 20, 17, 0.12);
    --border-accent: rgba(235, 172, 18, 0.3);

    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(31, 20, 17, 0.08);
    --glass-shadow: 0 8px 32px rgba(31, 20, 17, 0.05);

    /* --- Typography --- */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --fs-display: clamp(2.5rem, 5vw, 4.5rem);
    --fs-h1: clamp(2rem, 4vw, 3rem);
    --fs-h2: clamp(1.75rem, 3vw, 2.25rem);
    --fs-h3: clamp(1.25rem, 2vw, 1.75rem);
    --fs-h4: clamp(1.1rem, 1.5vw, 1.25rem);
    --fs-body: 1rem;
    --fs-body-lg: 1.125rem;
    --fs-small: 0.875rem;
    --fs-xs: 0.8125rem;
    --fs-button: 0.9375rem;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;

    --lh-tight: 1.2;
    --lh-normal: 1.6;
    --lh-relaxed: 1.8;

    --ls-tight: -0.02em;
    --ls-normal: 0;
    --ls-wide: 0.05em;
    --ls-wider: 0.1em;

    /* --- Spacing --- */
    --space-2xs: 0.25rem;
    /* 4px  */
    --space-xs: 0.5rem;
    /* 8px  */
    --space-sm: 0.75rem;
    /* 12px */
    --space-md: 1rem;
    /* 16px */
    --space-lg: 1.5rem;
    /* 24px */
    --space-xl: 2rem;
    /* 32px */
    --space-2xl: 3rem;
    /* 48px */
    --space-3xl: 4rem;
    /* 64px */
    --space-4xl: 6rem;
    /* 96px */
    --space-5xl: 8rem;
    /* 128px */

    /* --- Borders & Radius --- */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* --- Shadows --- */
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.15);
    --shadow-xl: 0 16px 48px rgba(15, 23, 42, 0.2);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --shadow-glow-sm: 0 0 15px var(--accent-glow);

    /* --- Transitions --- */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 800ms;

    /* --- Z-Index Stack --- */
    --z-behind: -1;
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;

    /* --- Layout --- */
    --container-max: 1280px;
    --container-narrow: 960px;
    --container-wide: 1440px;
    --nav-height: 80px;
    --section-padding: var(--space-4xl) 0;
}


/* ============================================================
   CSS RESET
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Remove default list styles */
ul,
ol {
    list-style: none;
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
}

/* Make images responsive */
img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Remove default button styles */
button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Form elements inherit font */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Remove textarea resize */
textarea {
    resize: vertical;
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Focus outline */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background: var(--accent-primary);
    color: var(--text-primary);
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--text-primary);
}

.display {
    font-size: var(--fs-display);
    font-weight: var(--fw-extrabold);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

h1,
.h1 {
    font-size: var(--fs-h1);
}

h2,
.h2 {
    font-size: var(--fs-h2);
}

h3,
.h3 {
    font-size: var(--fs-h3);
}

h4,
.h4 {
    font-size: var(--fs-h4);
}

p {
    color: var(--text-secondary);
    line-height: var(--lh-normal);
    max-width: 70ch;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--accent-primary);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--accent-primary);
}


/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

.section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header .label {
    display: inline-block;
    margin-bottom: var(--space-sm);
}

.section-header h2 {
    margin-bottom: var(--space-md);
}

.section-header p {
    margin: 0 auto;
    max-width: 600px;
    font-size: var(--fs-body-lg);
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-xs {
    gap: var(--space-xs);
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.gap-xl {
    gap: var(--space-xl);
}

.gap-2xl {
    gap: var(--space-2xl);
}

/* Grid utilities */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration-slow) var(--ease-out),
        transform var(--duration-slow) var(--ease-out);
}

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

.reveal-delay-1 {
    transition-delay: 100ms;
}

.reveal-delay-2 {
    transition-delay: 200ms;
}

.reveal-delay-3 {
    transition-delay: 300ms;
}

.reveal-delay-4 {
    transition-delay: 400ms;
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity var(--duration-slow) var(--ease-out),
        transform var(--duration-slow) var(--ease-out);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity var(--duration-slow) var(--ease-out),
        transform var(--duration-slow) var(--ease-out);
}

.reveal-left.revealed,
.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity var(--duration-slow) var(--ease-out),
        transform var(--duration-slow) var(--ease-out);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}


/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}


/* ============================================================
   GLOBAL BACKGROUND PATTERNS
   ============================================================ */
.bg-grid {
    position: relative;
}

.bg-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-subtle) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

.bg-radial-glow {
    position: relative;
}

.bg-radial-glow::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}


/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
        --section-padding: var(--space-3xl) 0;
    }

    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .container {
        padding: 0 var(--space-md);
    }
}