/*
  Global styles - minimal overrides for Tailwind-driven layout.
  Organized: reset, typography, layout, components, animations.
*/

:root {
    --brand: #e50914;
    --brand-light: #ff2d38;
    --brand-dark: #b3060f;
    --text: #1e293b;
    --muted: #64748b;
}

/* ------------------ Reset / Base ------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    margin: 0;
    padding: 0;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.site-header {
    height: 4rem;
    background: #fff !important;
    isolation: isolate;
    overflow: hidden;
}

.site-header > div {
    height: 4rem;
}

.site-header img {
    display: block;
    height: 2rem !important;
    width: auto;
}

#navToggle {
    flex: 0 0 auto;
}

#mainNav {
    flex: 0 0 auto;
}

#main {
    padding-top: 4rem;
}

@media (max-width: 767px) {
    #mainNav {
        position: absolute;
        width: 0;
        height: 0;
        overflow: visible;
    }
}

@media (min-width: 640px) {
    .site-header img {
        height: 2.5rem !important;
    }
}

@media (min-width: 768px) {
    #mainNav {
        position: static;
        width: auto;
        height: auto;
    }
}

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

/* ------------------ Utility ------------------ */
.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;
}

/* ------------------ Mobile Nav Overlay ------------------ */
.site-nav__backdrop {
    display: none;
}

.site-nav__backdrop.mobile-open {
    display: block;
    position: fixed;
    inset: 4rem 0 0 0;
    z-index: 44;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
}

.site-nav__list.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 4rem;
    right: 0;
    bottom: 0;
    width: 20rem;
    max-width: 86vw;
    background: white;
    padding: 1.25rem;
    gap: 0.5rem;
    z-index: 45;
    border-left: 1px solid #e2e8f0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
    font-size: 1rem;
    overflow-y: auto;
}

.site-nav__list.mobile-open a {
    display: block;
    border-radius: 8px;
    padding: 0.75rem 0.875rem;
}

.site-nav__list.mobile-open a:hover {
    background: #fef2f2;
}

/* ------------------ Feature Icon Colors ------------------ */
.feature-icon--users {
    color: #6366f1;
    background: #eef2ff;
}

.feature-icon--clipboard {
    color: #059669;
    background: #ecfdf5;
}

.feature-icon--user-check {
    color: #0891b2;
    background: #ecfeff;
}

.feature-icon--calendar {
    color: #d97706;
    background: #fffbeb;
}

.feature-icon--bar-chart {
    color: #7c3aed;
    background: #f5f3ff;
}

.feature-icon--video {
    color: #e11d48;
    background: #fff1f2;
}

.feature-icon--meter {
    color: #0f766e;
    background: #ccfbf1;
}

.feature-icon--default {
    color: #64748b;
    background: #f1f5f9;
}

/* ------------------ Role Badge Colors ------------------ */
.role-badge--administrator {
    color: #dc2626;
    background: #fef2f2;
}

.role-badge--distributor {
    color: #2563eb;
    background: #eff6ff;
}

.role-badge--client-manager {
    color: #059669;
    background: #ecfdf5;
}

.role-badge--candidate {
    color: #7c3aed;
    background: #f5f3ff;
}

/* ------------------ Hierarchy Tree Lines ------------------- */
.hierarchy-level {
    position: relative;
    padding-left: 1.5rem;
}

.hierarchy-level::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.hierarchy-level:last-child::before {
    bottom: 50%;
}

.hierarchy-node {
    position: relative;
    padding: 0.5rem 0;
}

.hierarchy-node::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    width: 0.75rem;
    height: 2px;
    background: #e2e8f0;
}

/* ------------------ Contributors Grid ------------------ */
.contributors-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .contributors-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

@media (min-width: 768px) {
    .contributors-grid {
        gap: 1rem;
    }
}

/* ------------------ Features Grid ------------------ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 480px) {
    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

/* ------------------ Scroll Reveal Animation ------------------ */
.reveal-ready {
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

/* ------------------ Accessibility ------------------ */
a:focus-visible {
    outline: 3px solid rgba(34, 139, 230, 0.4);
    outline-offset: 2px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .reveal-ready {
        transition: none;
    }
}
