/* ===========================================
   Alte — Shared Styles
   =========================================== */

/* Brand Palette */
:root {
    --background: #F8F9FA;
    --text-primary: #2A2A2A;
    --brand-primary: #3A4A74;
    --brand-primary-rgb: 58, 74, 116;
    --highlight-secondary: #A3B18A;
    --highlight-secondary-rgb: 163, 177, 138;
    --cta-action: #FFB545;
    --cta-action-hover: #ffc66d;
    --card-border: #e5e7eb;
    --white: #ffffff;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

h1, h2, h3, h4, h5, h6, .font-headline {
    font-family: 'Space Grotesk', sans-serif;
}

/* Utility colour classes */
.text-brand-primary { color: var(--brand-primary); }
.bg-brand-primary { background-color: var(--brand-primary); }
.text-highlight-secondary { color: var(--highlight-secondary); }

/* ===========================================
   Buttons
   =========================================== */
.cta-button {
    display: inline-block;
    background-color: var(--cta-action);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 181, 69, 0.3);
}

.secondary-button {
    display: inline-block;
    background-color: transparent;
    color: var(--brand-primary);
    border: 1.5px solid var(--brand-primary);
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}
.secondary-button:hover {
    background-color: var(--brand-primary);
    color: var(--white);
}

/* ===========================================
   Cards
   =========================================== */
.card {
    background-color: var(--white);
    border: 1.5px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgb(0 0 0 / 0.1), 0 4px 8px -2px rgb(0 0 0 / 0.06);
    border-color: var(--brand-primary);
}

/* Non-hoverable cards (case studies) */
.card-static {
    background-color: var(--white);
    border: 1.5px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    overflow: hidden;
}

/* ===========================================
   Navigation
   =========================================== */
.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}
.nav-link:hover {
    color: var(--brand-primary);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--brand-primary);
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--white);
    z-index: 60;
    transition: right 0.3s ease;
    padding: 5rem 2rem 2rem;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}
.mobile-menu.open {
    right: 0;
}
.mobile-menu a {
    display: block;
    padding: 0.75rem 0;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    border-bottom: 1px solid var(--card-border);
    transition: color 0.2s ease;
}
.mobile-menu a:hover {
    color: var(--brand-primary);
}
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    z-index: 70;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}
@media (max-width: 767px) {
    .hamburger { display: flex; }
}

/* ===========================================
   Hero Background Effects
   =========================================== */
.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(var(--brand-primary-rgb), 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.08;
    pointer-events: none;
}
.hero-shape-1 {
    width: 400px;
    height: 400px;
    background: var(--brand-primary);
    top: -100px;
    right: -100px;
    animation: float 80s ease-in-out infinite;
}
.hero-shape-2 {
    width: 300px;
    height: 300px;
    background: var(--highlight-secondary);
    bottom: -50px;
    left: -80px;
    animation: float 100s ease-in-out infinite reverse;
}

.grain-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ===========================================
   Animations
   =========================================== */
@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -20px) rotate(5deg); }
    50% { transform: translate(-20px, 20px) rotate(-3deg); }
    75% { transform: translate(15px, 10px) rotate(2deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animate-on-scroll elements */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
}
.animate-on-scroll.visible {
    animation: fadeInUp 0.6s ease-out forwards;
    animation-delay: var(--delay, 0ms);
}

/* Staggered children — add .stagger-children to parent */
.stagger-children > .animate-on-scroll:nth-child(1) { --delay: 0ms; }
.stagger-children > .animate-on-scroll:nth-child(2) { --delay: 100ms; }
.stagger-children > .animate-on-scroll:nth-child(3) { --delay: 200ms; }
.stagger-children > .animate-on-scroll:nth-child(4) { --delay: 300ms; }
.stagger-children > .animate-on-scroll:nth-child(5) { --delay: 400ms; }
.stagger-children > .animate-on-scroll:nth-child(6) { --delay: 500ms; }

/* Hero-specific stagger */
.hero-stagger > * {
    opacity: 0;
    animation: fadeInUp 0.7s ease-out forwards;
}
.hero-stagger > *:nth-child(1) { animation-delay: 100ms; }
.hero-stagger > *:nth-child(2) { animation-delay: 300ms; }
.hero-stagger > *:nth-child(3) { animation-delay: 500ms; }
.hero-stagger > *:nth-child(4) { animation-delay: 700ms; }

/* ===========================================
   Service Card Icons
   =========================================== */
.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--brand-primary), rgba(var(--brand-primary-rgb), 0.8));
    color: var(--white);
    flex-shrink: 0;
}
.service-icon svg {
    width: 24px;
    height: 24px;
}

/* ===========================================
   Case Study Image Hover
   =========================================== */
.case-study-img {
    overflow: hidden;
}
.case-study-img img {
    transition: transform 0.5s ease;
}
.case-study-img:hover img,
.card-static:hover .case-study-img img {
    transform: scale(1.05);
}

/* ===========================================
   Legal / Policy Pages
   =========================================== */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}
.legal-page h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}
.legal-page .legal-meta {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}
.legal-page h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}
.legal-page h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}
.legal-page h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.legal-page p {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 1rem;
}
.legal-page ul, .legal-page ol {
    color: #4b5563;
    line-height: 1.7;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.legal-page li {
    margin-bottom: 0.5rem;
}
.legal-page ul { list-style-type: disc; }
.legal-page ol { list-style-type: decimal; }
.legal-page a {
    color: var(--brand-primary);
    text-decoration: underline;
    text-decoration-color: rgba(var(--brand-primary-rgb), 0.3);
    transition: text-decoration-color 0.2s ease;
}
.legal-page a:hover {
    text-decoration-color: var(--brand-primary);
}
.legal-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.9rem;
}
.legal-page th, .legal-page td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--card-border);
    color: #4b5563;
}
.legal-page th {
    font-weight: 600;
    color: var(--text-primary);
    background-color: rgba(var(--brand-primary-rgb), 0.04);
}
.legal-page strong {
    color: var(--text-primary);
}
.legal-page hr {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 2rem 0;
}
.legal-page blockquote {
    border-left: 3px solid var(--highlight-secondary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6b7280;
    font-style: italic;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: gap 0.2s ease;
}
.back-link:hover {
    gap: 0.75rem;
}

/* ===========================================
   Contact Form
   =========================================== */
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--card-border);
    border-radius: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: var(--white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.1);
}
.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.form-success {
    background-color: rgba(var(--highlight-secondary-rgb), 0.1);
    border: 1px solid var(--highlight-secondary);
    border-radius: 0.5rem;
    padding: 1.25rem;
    color: #2a483d;
    text-align: center;
    animation: fadeInUp 0.4s ease-out;
}
.form-error {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 0.5rem;
    padding: 1.25rem;
    color: #991b1b;
    text-align: center;
    animation: fadeInUp 0.4s ease-out;
}

/* ===========================================
   Footer
   =========================================== */
.footer-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.75rem;
}
.footer-link {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
}
.footer-link:hover {
    color: var(--white);
}

/* ===========================================
   Section divider accent
   =========================================== */
.section-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--highlight-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Scroll indicator */
.scroll-indicator {
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}
