/* ============================================
   FORPROCER - Base CSS
   "Liquid Glass" Design System
   Foundation: Tokens, Reset, Typography,
   Layout, Animations, Scrollbar, Utilities
   ============================================ */

/* --- Animatable custom properties --- */
@property --glow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@property --gradient-shift {
    syntax: '<percentage>';
    initial-value: 0%;
    inherits: false;
}

/* ===========================================
   1. CSS Custom Properties
   =========================================== */
:root {
    /* Brand Colors */
    --color-dark-teal: #347172;
    --color-medium-teal: #349084;
    --color-light-teal: #3caaaa;

    /* Brand RGB */
    --color-dark-teal-rgb: 52, 113, 114;
    --color-medium-teal-rgb: 52, 144, 132;
    --color-light-teal-rgb: 60, 170, 170;

    /* Accent */
    --color-accent: #56d4b4;
    --color-accent-rgb: 86, 212, 180;

    /* Neutrals */
    --color-white: #ffffff;
    --color-off-white: #f0f7f7;
    --color-gray-100: #e8f0f0;
    --color-gray-200: #d0dede;
    --color-gray-300: #a0b8b8;
    --color-gray-400: #708888;
    --color-gray-500: #506868;
    --color-gray-600: #3a5050;
    --color-gray-700: #2a3a3a;
    --color-gray-800: #1a2828;
    --color-gray-900: #0e1a1a;

    /* Text */
    --text-primary: #1a2828;
    --text-secondary: #506868;
    --text-muted: #708888;
    --text-inverse: #ffffff;

    /* Glass */
    --glass-white: rgba(255, 255, 255, 0.50);
    --glass-white-hover: rgba(255, 255, 255, 0.68);
    --glass-border: rgba(255, 255, 255, 0.28);
    --glass-border-hover: rgba(255, 255, 255, 0.48);
    --glass-teal: rgba(52, 113, 114, 0.07);
    --glass-teal-hover: rgba(52, 113, 114, 0.13);
    --glass-dark: rgba(52, 113, 114, 0.88);

    /* Blur */
    --blur-xs: 4px;
    --blur-sm: 8px;
    --blur-md: 16px;
    --blur-lg: 24px;
    --blur-xl: 40px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(52, 113, 114, 0.06);
    --shadow-md: 0 4px 20px rgba(52, 113, 114, 0.10);
    --shadow-lg: 0 8px 32px rgba(52, 113, 114, 0.14);
    --shadow-xl: 0 16px 48px rgba(52, 113, 114, 0.18);
    --shadow-glow: 0 0 30px rgba(60, 170, 170, 0.25);
    --shadow-glow-lg: 0 0 60px rgba(60, 170, 170, 0.18);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    --space-5xl: 8rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Fonts */
    --font-heading: 'Sora', sans-serif;
    --font-accent: 'Instrument Serif', serif;
    --font-body: 'DM Sans', sans-serif;

    /* Type Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3.25rem;
    --text-6xl: 4rem;
    --text-7xl: 5rem;

    /* Line Heights */
    --leading-tight: 1.1;
    --leading-snug: 1.3;
    --leading-normal: 1.65;

    /* Container */
    --container-max: 1200px;
    --container-padding: 1.25rem;

    /* Navbar */
    --navbar-height: 72px;
}


/* ===========================================
   2. Reset
   =========================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--color-off-white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* --- Animated mesh background blobs --- */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    will-change: transform;
}

body::before {
    width: 50vw;
    height: 50vw;
    max-width: 700px;
    max-height: 700px;
    top: -10%;
    left: -5%;
    background: radial-gradient(circle, rgba(var(--color-light-teal-rgb), 0.10) 0%, transparent 70%);
    animation: mesh-float-1 30s ease-in-out infinite;
}

body::after {
    width: 45vw;
    height: 45vw;
    max-width: 600px;
    max-height: 600px;
    bottom: 10%;
    right: -8%;
    background: radial-gradient(circle, rgba(var(--color-dark-teal-rgb), 0.07) 0%, transparent 70%);
    animation: mesh-float-2 25s ease-in-out infinite;
}

@keyframes mesh-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(8vw, 12vh) scale(1.1); }
    50% { transform: translate(3vw, 25vh) scale(0.95); }
    75% { transform: translate(-5vw, 10vh) scale(1.05); }
}

@keyframes mesh-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-6vw, -10vh) scale(1.08); }
    66% { transform: translate(4vw, -18vh) scale(0.92); }
}

/* --- Micro dot texture --- */
.body-texture {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        repeating-conic-gradient(
            rgba(var(--color-dark-teal-rgb), 0.015) 0% 25%,
            transparent 0% 50%
        );
    background-size: 3px 3px;
}

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

a {
    color: var(--color-dark-teal);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

ul, ol { list-style: none; }

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}


/* ===========================================
   3. Typography
   =========================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-4xl); letter-spacing: -0.015em; }
h3 { font-size: var(--text-3xl); letter-spacing: -0.01em; }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-md); }

.text-gradient {
    background: linear-gradient(135deg, var(--color-dark-teal), var(--color-medium-teal), var(--color-light-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-accent {
    font-family: var(--font-accent);
    font-style: italic;
}

.section-label {
    display: inline-block;
    text-transform: uppercase;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--color-light-teal);
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 1.5rem;
}

.section-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-dark-teal), var(--color-light-teal));
    box-shadow: 0 0 8px rgba(var(--color-light-teal-rgb), 0.4);
}

/* --- Selection --- */
::selection {
    background: rgba(var(--color-light-teal-rgb), 0.22);
    color: var(--color-dark-teal);
}


/* ===========================================
   4. Custom Scrollbar
   =========================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-off-white);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-dark-teal), var(--color-light-teal));
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-medium-teal), var(--color-light-teal));
}

html {
    scrollbar-color: var(--color-dark-teal) var(--color-off-white);
    scrollbar-width: thin;
}


/* ===========================================
   5. Layout
   =========================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--space-5xl) 0;
    position: relative;
}

.section--alt {
    background: rgba(var(--color-light-teal-rgb), 0.025);
}

.section-header {
    text-align: center;
    max-width: 660px;
    margin: 0 auto var(--space-3xl);
}

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

.section-header p {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    line-height: var(--leading-normal);
}

main {
    padding-top: var(--navbar-height);
}


/* ===========================================
   6. Grid
   =========================================== */
.grid        { display: grid; gap: 1.5rem; }
.grid--2     { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.grid--3     { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.grid--4     { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }

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

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


/* ===========================================
   7. Scroll Reveal Animations
   =========================================== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.15, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.15, 1);
}

.reveal--left {
    opacity: 0;
    transform: translateX(-32px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.15, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.15, 1);
}

.reveal--right {
    opacity: 0;
    transform: translateX(32px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.15, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.15, 1);
}

.reveal--scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.15, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.15, 1);
}

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

/* Staggered delays */
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }


/* ===========================================
   8. Animated Glow Border (for cards)
   =========================================== */
@keyframes glow-spin {
    to { --glow-angle: 360deg; }
}


/* ===========================================
   9. Page Loader
   =========================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    pointer-events: none;
}

.page-loader__bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--color-dark-teal), var(--color-light-teal), var(--color-accent));
    animation: page-load 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow: 0 0 12px rgba(var(--color-light-teal-rgb), 0.5);
}

@keyframes page-load {
    0% { width: 0; }
    60% { width: 85%; }
    100% { width: 100%; opacity: 0; }
}

/* --- Scroll progress --- */
.scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--color-dark-teal), var(--color-light-teal));
    transition: none;
    z-index: 1;
}


/* ===========================================
   10. Utilities
   =========================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

.mt-0  { margin-top: 0; }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-0  { margin-bottom: 0; }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }


/* ===========================================
   11. Reduced motion
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal, .reveal--left, .reveal--right, .reveal--scale {
        opacity: 1;
        transform: none;
    }
    html { scroll-behavior: auto; }
}
