/* style.css */

/*
--- TABLE OF CONTENTS ---
1. CSS Variables
2. Base & Typography
3. Header & Navigation
4. Hero Section & Parallax
5. Section Styling & Curved Grids
6. Component Styles
   - Buttons
   - Forms
   - Cards
   - Modals
   - Carousel
7. Animations & Transitions
8. Footer
9. Utility & Misc
*/

/* 1. CSS Variables
-------------------------------------------------- */
:root {
    --color-primary: #3b82f6; /* Blue 500 */
    --color-primary-dark: #2563eb; /* Blue 600 */
    --color-secondary: #14b8a6; /* Teal 500 */
    --color-secondary-dark: #0d9488; /* Teal 600 */
    
    --color-bg-dark: #111827; /* Gray 900 */
    --color-bg-medium: #1f2937; /* Gray 800 */
    --color-bg-light: #374151; /* Gray 700 */

    --color-text-light: #f3f4f6; /* Gray 100 */
    --color-text-medium: #9ca3af; /* Gray 400 */
    --color-text-dark: #111827; /* Gray 900 */
    --color-white: #ffffff;

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Work Sans', sans-serif;

    --transition-fast: all 0.2s ease-in-out;
    --transition-medium: all 0.3s ease-in-out;
}

/* 2. Base & Typography
-------------------------------------------------- */
body {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-white);
}

p {
    line-height: 1.7;
    color: var(--color-text-medium);
}

a {
    transition: var(--transition-fast);
}

/* Page transition styles for Barba.js */
.barba-leave-active,
.barba-enter-active {
    transition: opacity 0.5s ease;
}
.barba-leave-to,
.barba-enter-from {
    opacity: 0;
}

/* Custom prose styles for legal pages */
.prose h2 {
    font-size: 1.5em;
    margin-top: 2em;
    margin-bottom: 1em;
}
.prose h3 {
    font-size: 1.25em;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

/* 3. Header & Navigation
-------------------------------------------------- */
header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header.header-scrolled {
    background-color: rgba(17, 24, 39, 0.95); /* Gray 900 with more opacity */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#mobile-menu.open {
    max-height: 500px; /* Adjust as needed */
}

/* 4. Hero Section & Parallax
-------------------------------------------------- */
.parallax-container {
    perspective: 1px;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.parallax-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    transform: translateZ(-1px) scale(1.5);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-text {
    color: var(--color-white);
}

/* 5. Section Styling & Curved Grids
-------------------------------------------------- */
.curved-section {
    position: relative;
    padding-top: 120px;
    padding-bottom: 120px;
    margin-top: -80px;
    background-color: var(--color-bg-medium);
    clip-path: polygon(0 80px, 100% 0, 100% calc(100% - 80px), 0% 100%);
}

.curved-section-reverse {
    position: relative;
    padding-top: 120px;
    padding-bottom: 120px;
    margin-top: -80px;
    background-color: var(--color-bg-medium);
    clip-path: polygon(0 0, 100% 80px, 100% 100%, 0 calc(100% - 80px));
}

@media (max-width: 768px) {
    .curved-section, .curved-section-reverse {
        clip-path: none;
        margin-top: 0;
        padding-top: 80px;
        padding-bottom: 80px;
    }
}

/* SVG Dividers for subtle curved effects without skewing content */
.curved-divider-top, .curved-divider-bottom-up {
    position: absolute;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.curved-divider-top {
    top: -1px; /* To overlap slightly and prevent gaps */
}

.curved-divider-top svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

.curved-divider-top .shape-fill {
    fill: var(--color-bg-dark);
}

/* 6. Component Styles
-------------------------------------------------- */
/* --- Buttons --- */
button, .btn {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border-radius: 0.5rem;
    padding: 0.75rem 1.75rem;
    border: none;
    transition: var(--transition-medium);
    transform-origin: center;
}

button:hover, .btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px -10px rgba(0,0,0,0.4);
}

button:active, .btn:active {
    transform: scale(0.98);
}

/* --- Forms --- */
.form-input, .form-textarea {
    background-color: var(--color-bg-light);
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-bg-dark);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

/* --- Cards --- */
.card {
    background-color: var(--color-bg-medium);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: var(--transition-medium);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

.card .card-image {
    width: 100%;
    overflow: hidden;
}

.card .card-image img {
    width: 100%;
    height: 224px; /* Fixed height for consistency */
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card .card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.resource-link h3 {
    color: var(--color-secondary);
}

/* --- Modals --- */
#careers-modal.hidden {
    display: none;
}

#careers-modal {
    display: flex; /* Tailwind applies 'hidden' which is display: none */
    animation: fadeIn 0.3s ease-out;
}

#careers-modal > div {
    animation: zoomIn 0.3s ease-out forwards;
}

/* --- Carousel --- */
/* This is a basic setup. A library like Swiper.js would be needed for full functionality. */
.content-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
}

.carousel-item {
    flex: 0 0 100%;
    scroll-snap-align: center;
}

@media (min-width: 768px) {
    .carousel-item {
        flex: 0 0 calc(50% - 0.75rem);
    }
}
@media (min-width: 1024px) {
    .carousel-item {
        flex: 0 0 calc(33.333% - 1rem);
    }
}


/* 7. Animations & Transitions
-------------------------------------------------- */
/* Initial state for elements to be animated on scroll */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll[data-animation="fade-in"] {
    transform: translateY(20px);
}
.animate-on-scroll[data-animation="fade-up"] {
    transform: translateY(40px);
}
.animate-on-scroll[data-animation="zoom-in"] {
    transform: scale(0.9);
}

/* Visible state triggered by JS */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Keyframes for modal animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Animated Checkmark on success page */
.animated-icon-container svg path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw 2s ease-out forwards 0.3s;
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* 8. Footer
-------------------------------------------------- */
footer {
    background-color: var(--color-bg-dark);
}

footer a {
    position: relative;
    padding-bottom: 2px;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-secondary);
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}


/* 9. Utility & Misc
-------------------------------------------------- */
[data-barba-namespace="success"] main {
    min-height: 100vh;
}

.parallax-element {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}