/* Hamilton B. Barber - Sophisticated Authority */

/* Import professional fonts */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --dark: #1a1a1a;
    --darker: #0f0f0f;
    --light: #f8f8f8;
    --white: #ffffff;
    --gray: #666666;
    --accent: #2c5aa0;
    
    /* Typography */
    --font-serif: 'Crimson Text', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Accessibility: Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: var(--white);
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* Accessibility: Focus Indicators */
*:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
*:focus:not(:focus-visible) {
    outline: none;
}
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--dark);
    background: var(--white);
    font-weight: 400;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Header */
.header {
    padding: 30px 0;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid #eee;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
}

.brand:hover {
    color: var(--accent);
}

.header nav {
    display: flex;
    gap: 40px;
    list-style: none;
}

.header nav a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
    letter-spacing: 0.01em;
}

.header nav a:hover {
    color: var(--dark);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background: var(--dark);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

        linear-gradient(45deg, transparent 49%, rgba(44, 90, 160, 0.06) 49%, rgba(44, 90, 160, 0.06) 51%, transparent 51%),
        linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f5f7fa 100%);
    background-size: 50px 50px, 100%;
    position: relative;
}

/* Analytical depth overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(44, 90, 160, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 70% 70%, rgba(184, 134, 11, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    max-width: 1100px;
}

.hero-text {
    flex: 1;
}

.hero-photo {
    flex-basis: 40%;
    max-width: 400px;
}

.photo-container {
    position: relative;
    cursor: pointer;
    user-select: none;
    z-index: 150;
}

.photo-img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
}

.photo-container:hover .photo-img {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    background: white;
    border: 3px solid var(--accent);
    border-radius: 20px;
    padding: 16px 20px;
    min-width: 200px;
    max-width: 320px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    z-index: 1100;
    transition: all 0.3s ease;
}

.speech-bubble.active {
    opacity: 1;
}

.speech-bubble.left {
    left: -150px;
    top: 15%;
}

.speech-bubble.right {
    right: -150px;
    top: 15%;
}

.speech-bubble.top {
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
}

.bubble-content {
    font-size: 16px;
    color: var(--dark);
    font-weight: 500;
    line-height: 1.4;
}

.bubble-tail {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.speech-bubble.left .bubble-tail {
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 0 10px 15px;
    border-color: transparent transparent transparent white;
}

.speech-bubble.right .bubble-tail {
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 15px 10px 0;
    border-color: transparent white transparent transparent;
}

.speech-bubble.top .bubble-tail {
    bottom: -15px;
    left: 30%;
    border-width: 15px 10px 0 10px;
    border-color: white transparent transparent transparent;
}

/* Photo Animations */
@keyframes tilt-right {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(2deg) scale(1.05); }
}

@keyframes tilt-left {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-2deg) scale(1.05); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px) scale(1.05); }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    50% { 
        box-shadow: 0 15px 50px rgba(44, 90, 160, 0.4);
    }
}

@keyframes spin-subtle {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(5deg) scale(1.05); }
    75% { transform: rotate(-5deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1); }
}

.photo-img.tilt-right {
    animation: tilt-right 0.6s ease;
}

.photo-img.tilt-left {
    animation: tilt-left 0.6s ease;
}

.photo-img.bounce {
    animation: bounce 0.6s ease;
}

.photo-img.glow {
    animation: glow 0.8s ease;
}

.photo-img.spin {
    animation: spin-subtle 0.8s ease;
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent);
    position: absolute;
    animation: confetti-fall 1.5s ease-out forwards;
    z-index: 100;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(300px) rotate(360deg);
        opacity: 0;
    }
}

.hero h1 {
    font-size: 48px;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--dark);
    font-family: var(--font-serif);
}

.intro {
    font-size: 22px;
    color: var(--gray);
    margin-bottom: 30px;
    font-weight: 300;
    line-height: 1.6;
}

.certification-badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    max-width: 500px;
}

.cert-badge {
    width: 100%;
    height: auto;
    max-width: 120px;
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cert-badge:hover {
    opacity: 1;
    transform: scale(1.05);
}

.credentials-preview span {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 8px 0;
    position: relative;
}

.credentials-preview span:not(:last-child)::after {
    content: "•";
    position: absolute;
    right: -18px;
    color: #ccc;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section.dark {
    background: var(--dark);
    color: var(--white);
}

.section.dark h2,
.section.dark h3 {
    color: var(--white);
}

.section.dark p {
    color: #ccc;
}

.section-intro {
    max-width: 700px;
    margin: 0 auto 70px;
    text-align: center;
}

.section h2 {
    font-size: 42px;
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.2;
    font-family: var(--font-serif);
}

.section-intro p {
    font-size: 20px;
    color: var(--gray);
    font-weight: 300;
}

/* Expertise */
.expertise-areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 60px;
}

.area {
    text-align: center;
}

.area-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    color: var(--accent);
}

.area h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark);
}

.area p {
    color: var(--gray);
    font-size: 16px;
    line-height: 1.7;
}

/* Background */
.background-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 90px;
    align-items: start;
}

.background-text h2 {
    margin-bottom: 35px;
}

.background-text p {
    margin-bottom: 28px;
    font-size: 16px;
    line-height: 1.7;
}

.recognition {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-left: 3px solid var(--gold);
    margin-top: 35px;
    font-size: 14px;
}

.recognition a {
    color: var(--gold);
}

.background-details {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.detail-group h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-group ul {
    list-style: none;
}

.detail-group li {
    color: #bbb;
    font-size: 14px;
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.detail-group li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--gold);
}

/* Projects */
.projects-intro {
    color: var(--gray);
    font-size: 16px;
    margin-bottom: 60px;
    max-width: 700px;
}

.projects {
    display: grid;
    gap: 50px;
    max-width: 800px;
}

.project {
    border-left: 3px solid #eee;
    padding-left: 35px;
    transition: border-color 0.3s ease;
}

.project.featured {
    border-left-color: var(--accent);
}

.project:hover {
    border-left-color: var(--accent);
}

/* When a non-featured project is hovered, hide the featured project's border */
.projects:has(.project:not(.featured):hover) .project.featured {
    border-left-color: #eee;
}

.project h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 18px;
}

.project p {
    color: var(--gray);
    margin-bottom: 25px;
    line-height: 1.7;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-link:hover {
    text-decoration: underline;
}

.project-status {
    color: var(--accent);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Contact */
.contact-content {
    max-width: 600px;
}

.contact-content h2 {
    margin-bottom: 20px;
}

.contact-content p {
    margin-bottom: 40px;
    font-size: 16px;
}

.contact-buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.contact-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.contact-button:hover {
    background: var(--dark);
}

/* Footer */
.footer {
    padding: 40px 0;
    background: var(--light);
    text-align: center;
}

.footer p {
    color: var(--gray);
    font-size: 13px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Add sophisticated analytical background patterns */

/* Strategic grid pattern - analytical aesthetic */
.hero {
    padding: 100px 0 120px;
    background: 
        linear-gradient(45deg, transparent 49%, rgba(44, 90, 160, 0.06) 49%, rgba(44, 90, 160, 0.06) 51%, transparent 51%),
        linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f5f7fa 100%);
    background-size: 50px 50px, 100%;
    position: relative;
}

/* Strategic depth for dark sections */
.section.dark {
    background: var(--dark);
    position: relative;
}

.section.dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(30deg, transparent 49%, rgba(184, 134, 11, 0.08) 49%, rgba(184, 134, 11, 0.08) 51%, transparent 51%),
        radial-gradient(circle at 70% 30%, rgba(44, 90, 160, 0.12) 0%, transparent 40%);
    background-size: 70px 70px, 600px 600px;
    pointer-events: none;
}

/* Ensure content stays above background patterns */
.hero-content,
.section .container {
    position: relative;
    z-index: 2;
}

/* Adjust padding for expertise section after title removal */
#expertise {
    padding-top: 40px;
    padding-bottom: 40px;
}