/* ============================================================
   Project Access to Justice — Stylesheet
   Legal Technology | AI | Access to Justice
   ============================================================ */

/* ---------- Design Tokens (CSS Variables) — DARK THEME ---------- */
:root {
    --primary: #4f8cff;      /* Bright Blue (accents on dark) */
    --primary-deep: #0B3D91; /* Deep Blue */
    --secondary: #1E3A8A;    /* Indigo Blue */
    --accent: #F4B400;       /* Gold */
    --text: #e6ecf5;         /* Light text */
    --text-soft: #9fb0c9;    /* Muted light text */
    --white: #ffffff;

    /* Dark surface colors */
    --bg-deep: #060a1a;      /* Base background */
    --bg-panel: #0d1430;     /* Slightly lighter panel */
    --glass-bg: rgba(20, 30, 60, 0.45);
    --glass-border: rgba(120, 150, 220, 0.22);

    --radius: 18px;
    --radius-lg: 28px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 18px 45px rgba(0, 0, 0, 0.6);
    --transition: 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);

    --max-width: 1180px;
}

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

html {
    scroll-behavior: smooth;      /* Smooth scrolling for anchor links */
    scroll-padding-top: 90px;     /* Offset for fixed navbar */
}

body {
    font-family: "Poppins", system-ui, sans-serif;
    color: var(--text);
    line-height: 1.7;
    position: relative;
    /* Dark background with subtle blue/gold glow gradients */
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(244, 180, 0, 0.10), transparent 60%),
        radial-gradient(1000px 700px at -10% 10%, rgba(79, 140, 255, 0.14), transparent 55%),
        radial-gradient(900px 900px at 50% 120%, rgba(30, 58, 138, 0.22), transparent 60%),
        linear-gradient(180deg, #060a1a 0%, #0a1029 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ---------- AI + Law themed background pattern layer ----------
   A fixed, low-opacity SVG overlay combining circuit nodes (AI)
   and scales-of-justice motifs (law). Sits behind all content. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' viewBox='0 0 360 360'%3E%3Cg fill='none' stroke='%234f8cff' stroke-width='1.2' opacity='0.5'%3E%3C!-- circuit lines --%3E%3Cpath d='M20 40 h60 v40 h50'/%3E%3Cpath d='M300 60 v50 h-40'/%3E%3Cpath d='M60 300 h80 v-40'/%3E%3Cpath d='M240 320 v-60 h60'/%3E%3Ccircle cx='20' cy='40' r='3'/%3E%3Ccircle cx='130' cy='80' r='3'/%3E%3Ccircle cx='260' cy='110' r='3'/%3E%3Ccircle cx='140' cy='260' r='3'/%3E%3Ccircle cx='300' cy='260' r='3'/%3E%3C/g%3E%3Cg fill='none' stroke='%23F4B400' stroke-width='1.2' opacity='0.4' stroke-linecap='round' stroke-linejoin='round'%3E%3C!-- scales of justice motif --%3E%3Cpath d='M180 150 v70 M150 165 h60'/%3E%3Cpath d='M150 165 l-14 26 M150 165 l14 26 M136 191 a18 7 0 0 0 36 0'/%3E%3Cpath d='M210 165 l-14 26 M210 165 l14 26 M196 191 a18 7 0 0 0 36 0'/%3E%3Cpath d='M160 226 h40'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 360px 360px;
}

/* ---------- Headings ---------- */
h1, h2, h3 {
    font-family: "Merriweather", Georgia, serif;
    color: #dbe6ff;
    line-height: 1.25;
}

/* ---------- Reusable Glassmorphism Card (dark) ---------- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    will-change: transform;
}

.btn-primary {
    background: linear-gradient(135deg, #4f8cff, #1E3A8A);
    color: var(--white);
    box-shadow: 0 8px 24px rgba(79, 140, 255, 0.35);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 14px 34px rgba(79, 140, 255, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    transform: translateY(-4px) scale(1.03);
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 14px 30px rgba(244, 180, 0, 0.40);
}

/* ============================================================
   NAVIGATION BAR
============================================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
    padding: 18px 0;
}

/* Solid glass state applied via JS on scroll */
.navbar.scrolled {
    background: rgba(8, 13, 33, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 12px 0;
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "Merriweather", serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #dbe6ff;
    text-decoration: none;
}

.brand-mark { color: var(--accent); flex-shrink: 0; }

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    position: relative;
    transition: color var(--transition);
}
.nav-links a:not(.nav-cta):hover { color: #fff; }

/* Animated underline on hover */
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-links a:hover::after { width: 100%; }

.nav-cta {
    background: linear-gradient(135deg, #4f8cff, #1E3A8A);
    color: var(--white) !important;
    padding: 9px 22px;
    border-radius: 50px;
}
.nav-cta::after { display: none; }
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(11, 61, 145, 0.3); }

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: #dbe6ff;
    border-radius: 3px;
    transition: transform var(--transition), opacity var(--transition);
}
/* Animate hamburger into an X when open */
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   HERO SECTION
============================================================= */
.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 150px 24px 80px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 40px;
}

.hero-badge {
    display: inline-block;
    background: rgba(244, 180, 0, 0.15);
    color: #ffd766;
    border: 1px solid rgba(244, 180, 0, 0.3);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 7px 16px;
    border-radius: 50px;
    margin-bottom: 22px;
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 900;
    background: linear-gradient(120deg, #7ea8ff, #cdb4ff 60%, #F4B400);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    font-weight: 600;
    color: var(--accent);
    margin: 14px 0 22px;
}

.hero-intro {
    color: var(--text-soft);
    font-size: 1.02rem;
    max-width: 620px;
    margin-bottom: 32px;
    text-align: justify;
}

.hero-buttons {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

/* Hero illustration + floating animation */
.hero-illustration { display: flex; justify-content: center; }
.float-wrap {
    width: min(100%, 420px);
    animation: float 6s ease-in-out infinite;
}

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

/* Subtle pulse on the AI brain */
.ai-brain { animation: pulse 4s ease-in-out infinite; transform-origin: 200px 100px; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.65; }
}

/* ============================================================
   SECTION HEADINGS (shared)
============================================================= */
.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 50px;
}
.section-head h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 12px;
}
.section-head p { color: var(--text-soft); }

/* ============================================================
   FEATURES SECTION
============================================================= */
.features {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.card {
    padding: 40px 30px;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 18px;
    display: inline-block;
    transition: transform var(--transition);
}
.card:hover .card-icon { transform: scale(1.15) rotate(-6deg); }

.card h3 { font-size: 1.35rem; margin-bottom: 12px; }
.card p { color: var(--text-soft); }

/* ============================================================
   ABOUT SECTION
============================================================= */
.about {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px;
}
.about-inner {
    padding: 56px 48px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}
.about-inner h2 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin-bottom: 20px;
}
.about-inner p {
    color: var(--text-soft);
    font-size: 1.05rem;
    text-align: justify;
}

/* ============================================================
   STATISTICS SECTION
============================================================= */
.stats {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 70px 24px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    max-width: 720px;
    margin: 0 auto;
}
.stat {
    text-align: center;
    padding: 40px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.10), rgba(244, 180, 0, 0.08));
    border: 1px solid rgba(120, 150, 220, 0.2);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat:hover { transform: translateY(-6px); box-shadow: var(--shadow-soft); }

.stat-number {
    display: block;
    font-family: "Merriweather", serif;
    font-size: clamp(2.5rem, 5vw, 3.4rem);
    font-weight: 900;
    color: #7ea8ff;
    line-height: 1;
}
.stat-label {
    display: block;
    margin-top: 12px;
    color: var(--text-soft);
    font-weight: 500;
}

/* ============================================================
   CONTACT SECTION
============================================================= */
.contact {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 100px;
}
.contact-inner {
    padding: 60px 40px;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}
.contact-inner h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 14px; }
.contact-inner p { color: var(--text-soft); margin-bottom: 30px; }

/* Contact detail list (email / phone / WhatsApp) */
.contact-details {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}
.contact-details li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 500;
}
.contact-ic { font-size: 1.25rem; }
.contact-details a {
    color: #7ea8ff;
    text-decoration: none;
    transition: color var(--transition);
}
.contact-details a:hover { color: var(--accent); }

/* Action buttons row */
.contact-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   FOOTER
============================================================= */
.footer {
    background: linear-gradient(135deg, #0a1440, #05091c);
    border-top: 1px solid var(--glass-border);
    color: #c7d3ea;
    text-align: center;
    padding: 50px 24px 30px;
}
.footer-launch {
    max-width: 760px;
    margin: 0 auto 26px;
    background: rgba(244, 180, 0, 0.15);
    border: 1px solid rgba(244, 180, 0, 0.5);
    color: #fff;
    padding: 20px 26px;
    border-radius: var(--radius);
    font-weight: 500;
    line-height: 1.6;
}
/* Footer contact links */
.footer-contact {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px 30px;
    margin-bottom: 22px;
}
.footer-contact a {
    color: #c7d3ea;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}
.footer-contact a:hover { color: var(--accent); }

.footer-copy {
    font-size: 0.9rem;
    opacity: 0.85;
    letter-spacing: 0.3px;
}

/* ============================================================
   SCROLL REVEAL ANIMATION
   Elements start hidden and fade/slide in when .visible is added.
============================================================= */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE DESIGN
============================================================= */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 130px;
    }
    .hero-intro { margin-left: auto; margin-right: auto; }
    .hero-buttons { justify-content: center; }
    .hero-illustration { order: -1; }       /* Illustration above text on tablet/mobile */
    .float-wrap { width: min(80%, 320px); }

    .cards,
    .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    /* Mobile navigation drawer */
    .nav-toggle { display: flex; }

    .nav-links {
        position: absolute;
        top: 100%;
        right: 16px;
        left: 16px;
        flex-direction: column;
        gap: 18px;
        padding: 24px;
        background: rgba(13, 20, 48, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-soft);
        /* Hidden by default */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    }
    .nav-links.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(8px);
    }

    .about-inner,
    .contact-inner { padding: 40px 24px; }
}

/* ---------- Accessibility: honor reduced-motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}
