:root {
  --fonts: "Georgia", "Times New Roman", serif, system-ui;
  --background-gradient: linear-gradient(135deg, #f9f9f9, #9caec2);
  --header-gradient: linear-gradient(180deg, rgba(0, 0, 0, 1.0), rgba(0, 0, 0, 0.0));
  --text: #333;
  --light-text: #555;
  --white: #fff;
  --black: #000;
  --primary-blue: #007BFF;
  --secondary-blue: #0056b3;
  --dark-blue: #0f0840;
  --heading-hover: #003366;
  --contact-background: #222;
  --border-color: #ddd;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 6px 8px rgba(0, 0, 0, 0.2);
  --glow: rgba(255, 255, 255, 0.4);
}

html {
    scroll-behavior: smooth;
}

/* General Styles */
body {
    font-family: var(--fonts);
    margin: 0;
    padding: 0;
    color: var(--text);
}

header {
    background-color: var(--black);
    color: var(--white);
    padding: 15px 20px;
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.6s ease-out;
    z-index: 500;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.header-container a {
    color: var(--white);
    text-decoration: none;
}

.homelink-container {
    display: flex;
}

.logo-image {
    height: 28px;
    padding-right: 0.5em;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    max-width: 100%;
}

.nav-links li {
    margin-left: 20px;
    white-space: nowrap;
}

.nav-links a {
    position: relative;
    color: var(--white);
    text-decoration: none;
    overflow: hidden;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--white);
    transition: width 0.4s ease, left 0.4s ease;
}

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

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: var(--secondary-blue);
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    background: url('images/Sleek_Objects_1.png') no-repeat center center;
    background-size: cover;
    color: var(--white);
    text-align: center;
    padding: 100px 20px;
}

.hero2 {
    background: url('images/Sleek_Objects_2.png') no-repeat center center;
    background-size: cover;
    color: var(--white);
    text-align: center;
    padding: 100px 20px;
}

.hero h2, .hero2 h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero p, .hero2 p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Services Section */
.services {
    padding: 40px 20px;
    background: var(--background-gradient);
    text-align: center;
}

.cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.service {
    background-color: var(--glow); /* Was White */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    width: 300px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.service h3 {
    font-size: 20px;
}

/* Consultation Section */
.consultation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 40px 20px;
    background-color: var(--dark-blue);
    color: var(--white);
}

.consultation-content {
    max-width: 80%;
    text-align: center;
}

.consultation-logo img {
    max-width: 100%;
    opacity: 0.7; /* Subtle effect */
    margin-left: 20px;
}

.consultation-logo img {
    box-shadow: 0 0 10px var(--glow);
}

.consultation h2 {
    margin-bottom: 20px;
}

.consultation .btn {
    margin: 10px auto;
    width: fit-content;
    text-align: center;
}

/* Contact Section */
.contact {
    background-color: var(--contact-background);
    color: var(--white);
    text-align: center;
    padding: 40px 20px;
}

.contact h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

.contact-container {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    padding: 20px;
}

.contact-item {
    text-align: left;
    max-width: 300px;
}

.contact-item h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--primary-blue);
}

.contact-item a {
    color: var(--white);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Attorneys Section */
.attorney-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px 0;
    background: var(--background-gradient);
}

.attorney-profile {
    background-color: var(--glow);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    width: 800px;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.attorney-profile:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-hover);
}

.attorney-photo {
    max-width: 100%;
    border-radius: 50%;
    margin-bottom: 10px;
}

.attorney-profile h4 {
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 20px;
    color: var(--secondary-blue);
    text-transform: uppercase;
    padding-bottom: 5px;
}

.attorney-profile h4:hover {
    color: var(--heading-hover);
    cursor: pointer;
}

.attorney-profile p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--light-text);
    margin-bottom: 15px;
}

.credentials p {
    font-size: 14px;
    line-height: 1.5;
}

/* Error Pages */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100vh;
    background: var(--background-gradient);
    padding: 20px;
}

.error-container {
    max-width: 600px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    margin: 0 auto;
    transition: transform 0.3s, box-shadow 0.3s;
}

.error-container:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.error-logo {
    max-width: 200px;
    margin-bottom: 20px;
}

.error-container h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

.error-container p {
    font-size: 16px;
    color: var(--light-text);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.back-to-top a {
    text-decoration: none;
    color: white;
    font-weight: bold;
}

.back-to-top:hover {
    background-color: var(--secondary-blue);
    transform: scale(1.05);
}

/* Show Back to Top Button */
body.scrolled .back-to-top {
    opacity: 1;
    visibility: visible;
}

/* Show Faded & Pinned Nav Header */
body.scrolled header {
    background: var(--header-gradient);
}

/* Attorney Cards Section */
.attorney-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 40px 20px;
    background: var(--background-gradient);
}

.attorney-card {
    background-color: var(--glow);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    width: 300px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.attorney-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.attorney-card-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.attorney-card h3 {
    font-size: 20px;
    margin: 10px 0;
    color: var(--secondary-blue);
}

.attorney-card p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--light-text);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links li {
        margin-left: 15px;
    }
}

@media (max-width: 600px) {
    
    /* Mobile Nav */
    header {
        position: fixed;
        transition: top 0.3s ease-in-out;
    }

    body.scrolled header {
        top: 0;
        padding: 0;
    }

    /* Mobile Default Header Layout: Logo centered, followed by H1 then nav */
    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        transition: all 0.3s ease-in-out;
    }

    .homelink-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .logo-image {
        width: 60px; /* Initial size */
        height: auto;
        display: none;
    }

    .logo {
        font-size: 20px;
        margin-top: 10px;
    }

    .nav-links {
        display: flex;
        flex-direction: row;
        gap: 5px;
    }

    .nav-links li {
        margin-top: 5px;
        margin-left: 5px;
        margin-right: 5px;
    }

    /* Mobile Scrolled (Pinned Header) */
    body.scrolled .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 10px 20px;
    }

    body.scrolled .homelink-container {
        flex-direction: row;
        align-items: center;
    }

    body.scrolled .logo-image {
        width: 40px; /* Shrinks */
        height: auto;
        display: block;
    }

    body.scrolled .logo {
        display: none; /* Hides H1 */
    }

    body.scrolled .nav-links {
        flex-direction: row;
        gap: 8px;
    }

    /* Mobile Modified Styles */
    .hero {
        padding: 200px 20px 200px 20px;
    }

    .hero2 {
        padding: 150px 20px 100px 20px;
    }

    .hero h2, .hero2 h2 {
        font-size: 28px;
    }

    .contact h2, .services h2, .consultation h2 {
        font-size: 24px;
    }

    .cards {
        flex-direction: column;
    }

    .service {
        width: 90%;
    }

    .consultation {
        display: block;
        position: relative;
        text-align: center;
        padding: 40px 20px;
        background-color: var(--dark-blue);
        color: var(--white);
    }

    .consultation::before {
        content: "";
        position: absolute;
        top: 0px;
        right: 0px;
        bottom: 0px;
        left: 0px;
        background-color: rgba(15, 8, 64, 0.9);
        transition: opacity 0.3s ease-in-out;
    }
    
    .consultation-content {
        max-width: 100%;
        position: relative;
        padding: 20px;
    }

    .consultation-logo img {
        display: none;
    }

    .consultation .btn {
       margin: 20px auto;
    }

    .contact-container {
        flex-direction: column;
        align-items: center;
    }

    .contact-item {
        width: 80%;
        margin-bottom: 20px;
    }

    .attorney-grid {
        flex-direction: column;
        gap: 20px;
    }

    .attorney-profile {
        width: 90%;
    }

    .attorney-profile h4 {
        font-size: 18px;
    }

    .attorney-cards {
        flex-direction: column;
        align-items: center;
    }

    .attorney-card {
        width: 90%;
        max-width: 300px;
    }

    .attorney-card-photo {
        width: 150px;
        height: 150px;
    }
}