/* --------------------------------------------------
   Isocell Morocco — Utility styles
   Variables, reset, base styles, and utility classes
   -------------------------------------------------- */

/* ── Design tokens ─────────────────────────────────────────── */

:root {
    /* Brand colours */
    --primary:        #1a5f3f;
    --primary-dark:   #124a30;
    --primary-light:  #2d8a5e;
    --accent:         #c9a84c;
    --accent-light:   #e0c878;

    /* Neutrals */
    --dark:        #0f172a;
    --dark-light:  #1e293b;
    --text:        #334155;
    --text-light:  #64748b;
    --bg:          #f8fafc;
    --white:       #ffffff;
    --border:      #e2e8f0;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:     0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-md:  0 10px 25px -8px rgba(0,0,0,.10), 0 4px 10px -4px rgba(0,0,0,.05);
    --shadow-lg:  0 20px 30px -10px rgba(0,0,0,.12), 0 8px 15px -8px rgba(0,0,0,.06);
    --shadow-xl:  0 35px 60px -15px rgba(0,0,0,.20);
    --shadow-glow: 0 0 30px rgba(26,95,63,0.12);

    /* Easings */
    --ease-out-expo:      cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-quart:  cubic-bezier(0.76, 0, 0.24, 1);
    --spring:             cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-cubic:     cubic-bezier(0.33, 1, 0.68, 1);

    /* Layout */
    --nav-height: 78px;
    --max-width:  1400px;
    --radius-sm:  10px;
    --radius-md:  16px;
    --radius-lg:  24px;
    --radius-xl:  32px;
}

/* ── Reset ─────────────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
    /* Prevent layout shift from scrollbar appearing */
    scrollbar-gutter: stable;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Improve text rendering on all platforms */
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
}

img {
    display: block;
    max-width: 100%;
    /* Prevent alt-text layout shift */
    height: auto;
}

img,
video {
    -webkit-user-drag: none;
}

a {
    color: inherit;
}

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

/* ── Layout utilities ──────────────────────────────────────── */

.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 10000;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--accent);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

/* ── Section label ─────────────────────────────────────────── */

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
}

.section-label::before,
.section-label::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1.5px;
    background: currentColor;
    opacity: 0.5;
}

.section-label--accent {
    color: var(--accent);
}

/* ── Miscellaneous helpers ─────────────────────────────────── */

.image-card {
    overflow: hidden;
}

.heart-icon {
    color: var(--accent);
}

/* .footer-brand__logo unused - removed */

/* ── Entrance animations ───────────────────────────────────── */

/* Base hidden state */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s var(--ease-out-expo),
        transform 0.8s var(--ease-out-expo);
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Automatic sibling stagger — elegant staggered reveal */
.fade-in:nth-child(1) { transition-delay: 0.00s; }
.fade-in:nth-child(2) { transition-delay: 0.08s; }
.fade-in:nth-child(3) { transition-delay: 0.16s; }
.fade-in:nth-child(4) { transition-delay: 0.24s; }
.fade-in:nth-child(5) { transition-delay: 0.32s; }
.fade-in:nth-child(6) { transition-delay: 0.40s; }

/* Directional variants */
.fade-in--left  { transform: translateX(-40px); }
.fade-in--right { transform: translateX( 40px); }
.fade-in--left.visible,
.fade-in--right.visible { transform: translateX(0); }
.fade-in--scale { transform: translateY(20px) scale(0.97); }
.fade-in--scale.visible { transform: translateY(0) scale(1); }

/* ── Keyframe animations ───────────────────────────────────── */

@keyframes float {
    0%, 100% { transform: translateY(0px);   }
    50%      { transform: translateY(-10px); }
}

@keyframes float-rotate {
    0%, 100% { transform: translateY(0px)   rotate(0deg);    }
    33%      { transform: translateY(-8px)  rotate(0.8deg);  }
    66%      { transform: translateY(-4px)  rotate(-0.4deg); }
}

@keyframes pulse-ring {
    0%   { transform: scale(1);   opacity: 0.4; }
    100% { transform: scale(1.5); opacity: 0;   }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50%      { opacity: 0.65; transform: scale(1.05); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

@keyframes gradient-shift {
    0%   { background-position:   0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position:   0% 50%; }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0);    }
}

@keyframes fade-in-blur {
    from { opacity: 0; filter: blur(6px); }
    to   { opacity: 1; filter: blur(0);   }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1);    }
}

@keyframes counter-spin {
    from { transform: rotate(0deg);   }
    to   { transform: rotate(360deg); }
}

/* ── Scroll indicator ──────────────────────────────────────── */

.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fade-in-blur 1.5s ease 1.2s both;
    z-index: 5;
    text-decoration: none;
}

.scroll-mouse {
    width: 22px;
    height: 36px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 11px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.scroll-dot {
    width: 3px;
    height: 6px;
    background: rgba(255,255,255,0.6);
    border-radius: 3px;
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%      { transform: translateY(7px); opacity: 0.35; }
}

/* ── Section number watermark ──────────────────────────────── */

.section-number {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 7rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: rgba(26,95,63,0.05);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

@keyframes ripple-expand {
    to { width: 300px; height: 300px; opacity: 0; }
}

/* ── Custom scrollbar ──────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary-light), var(--primary-dark));
    border-radius: 6px;
}

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

/* ── Selection colour ──────────────────────────────────────── */

::selection {
    background: rgba(26, 95, 63, 0.18);
    color: var(--primary-dark);
}

/* ── Focus-visible ring (accessibility) ───────────────────── */

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

.text-on-dark,
.text-on-dark h2 {
    color: var(--white) !important;
}

.text-on-dark p {
    color: rgba(255,255,255,0.55) !important;
}
