/* =========================================================
   Oufk Marketing Agency — base.css
   Variables, reset, typography, theme tokens
   ========================================================= */

:root {
    /* Brand palette (locked from reference file) */
    --chartreuse: #C0D328;
    --chartreuse-soft: rgba(192, 211, 40, 0.12);
    --chartreuse-glow: rgba(192, 211, 40, 0.35);
    --black: #101010;
    --charcoal: #454A3B;
    --white: #FFFFFF;
    --cloud: #D0D0D0;

    /* Typography */
    --font-head: 'Montserrat', 'IBM Plex Sans Arabic', system-ui, sans-serif;
    --font-body: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;

    /* Motion */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --t-fast: 0.2s;
    --t-med: 0.4s;
    --t-slow: 0.8s;

    /* Layout */
    --container: 1400px;
    --nav-h: 80px;
    --section-pad: clamp(80px, 10vw, 140px) 5%;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-pill: 100px;
}

/* Light theme (default) */
html[data-theme="light"] {
    --bg: var(--white);
    --bg-elev: #FAFAFA;
    --bg-dark: var(--black);
    --text: var(--black);
    --text-mute: var(--charcoal);
    --text-invert: var(--white);
    --border: rgba(208, 208, 208, 0.5);
    --border-strong: rgba(16, 16, 16, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --card-bg: var(--white);
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.08);
    --input-border: var(--cloud);
    --placeholder: #9ca3af;
}

/* Dark theme */
html[data-theme="dark"] {
    --bg: #0B0B0B;
    --bg-elev: #161616;
    --bg-dark: #050505;
    --text: #F4F4F4;
    --text-mute: #A3A3A3;
    --text-invert: var(--black);
    --border: #262626;
    --border-strong: #333;
    --nav-bg: rgba(22, 22, 22, 0.75);
    --card-bg: #161616;
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.6);
    --input-border: #333;
    --placeholder: #666;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: var(--bg);
    color-scheme: light dark;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html[lang="ar"] body {
    font-family: 'IBM Plex Sans Arabic', var(--font-body);
}

main {
    flex: 1;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t-fast) var(--ease);
}

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

input,
textarea,
select {
    font: inherit;
    color: inherit;
}

::selection {
    background: var(--chartreuse);
    color: var(--black);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 900;
    color: var(--text);
    line-height: 1.08;
    letter-spacing: -0.025em;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6 {
    letter-spacing: 0;
    line-height: 1.3;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
}

h2 {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
}

h3 {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
}

h4 {
    font-size: 1.15rem;
}

p {
    color: var(--text-mute);
    font-weight: 300;
}

html[data-theme="dark"] p {
    font-weight: 400;
}

/* Utility */
.container {
    max-width: var(--container);
    margin: 0 auto;
    width: 100%;
    padding: 0 clamp(20px, 5vw, 40px);
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    font-weight: 500;
    color: var(--text-mute);
    margin-bottom: 24px;
}

.section-tag::before {
    content: '';
    width: 24px;
    height: 2px;
    background: var(--chartreuse);
}

html[lang="ar"] .section-tag {
    letter-spacing: 0;
    font-size: 0.85rem;
}

section {
    padding: var(--section-pad);
    position: relative;
}

.highlight {
    display: inline-block;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.highlight::before {
    content: '';
    position: absolute;
    bottom: 12%;
    left: -2%;
    width: 104%;
    height: 28%;
    background-color: var(--chartreuse);
    z-index: -1;
    transform: rotate(-1deg);
    transition: background-color var(--t-med) var(--ease);
}

/* Reveal animation (scroll-in) */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
    will-change: opacity, transform;
}

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

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    * {
        animation-duration: 0.001s !important;
        transition-duration: 0.001s !important;
    }
}

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