/* ================================
   GALLAGHER LAB - CUSTOM STYLES
   ================================ */

/* Root Variables */
:root {
    --primary: #0A2540;
    --primary-soft: #12355A;
    --accent: #A3C1AD;
    --accent-dark: #7A9A85;
    /* Darker sage reserved for TEXT on light backgrounds — #7A9A85 is only
       ~2.9:1 against white and fails WCAG AA for body-size text */
    --accent-ink: #4E6B58;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    /* was #94a3b8 (2.9:1 on white, fails AA); slate-500 passes at 4.76:1 */
    --text-light: #64748b;
    --bg-light: #f1f5f9;
    --border-light: #e2e8f0;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ================================
   RESET & BASE STYLES
   ================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--white);
    color: var(--text-muted);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary);
}

h2 {
    font-size: clamp(1.875rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary);
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

p {
    margin-bottom: 1rem;
}

strong {
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* ================================
   LAYOUT UTILITIES
   ================================ */

.container {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-spacing {
    padding: 6rem 0;
}

@media (max-width: 768px) {
    .section-spacing {
        padding: 4rem 0;
    }
}

/* Flexbox utilities */
.flex-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.gap-12 {
    gap: 3rem;
}

.gap-20 {
    gap: 5rem;
}

/* Grid utilities */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Fluid step-down: 4 → 3 → 2 → 1 columns */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 360px) {
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

.gap-10 {
    gap: 2.5rem;
}

/* ================================
   NAVIGATION
   ================================ */

nav {
    background-color: rgba(255, 255, 255, 0.95);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);
    padding: 1.25rem 0;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    nav .container {
        flex-direction: row;
        gap: 0;
        /* Match the hero's wider breakout so the logo lines up with the
           hero headline (and the nav links with the hero image edge). */
        max-width: 70rem;
    }
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    nav ul {
        gap: 2rem;
    }
}

nav a {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--accent-ink);
}

/* Scroll-spy: underline the section the viewer is currently in */
nav ul a {
    position: relative;
    padding-bottom: 0.35rem;
}

nav ul a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background-color: var(--accent-dark);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

nav ul a.is-active {
    color: var(--primary);
    font-weight: 600;
}

nav ul a.is-active::after {
    transform: scaleX(1);
}

/* ================================
   HEADER / HERO
   ================================ */

.hero {
    background-color: var(--primary);
    background-image:
        radial-gradient(ellipse 80% 60% at 85% 10%, rgba(163, 193, 173, 0.14), transparent 60%),
        radial-gradient(ellipse 60% 50% at 10% 90%, rgba(18, 53, 90, 0.9), transparent 70%);
    padding: 2rem 0 3rem;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .hero {
        padding: 5.5rem 0;
    }

    /* Hero breaks out slightly wider than the 64rem body container so the
       team photo can be large without squeezing the headline column. */
    .hero > .container {
        max-width: 70rem;
    }

    .hero-grid {
        grid-template-columns: 0.85fr 1.15fr;
        gap: 2.5rem;
    }
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(163, 193, 173, 0.35);
    background-color: rgba(163, 193, 173, 0.08);
    border-radius: 9999px;
    padding: 0.375rem 1rem;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.125rem, 4.5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.025em;
    color: var(--white);
    margin-bottom: 1.25rem;
    text-wrap: balance;
}

.hero-highlight {
    background: linear-gradient(100deg, var(--accent) 0%, #d7e6dc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    max-width: 34rem;
    margin-bottom: 2.25rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.hero-media img {
    width: 100%;
    height: auto;
    border-radius: 1.25rem;
}

.hero-media {
    padding: 0.625rem;
    border-radius: 1.75rem;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.45);
}

/* ================================
   BUTTONS
   ================================ */

.btn {
    display: inline-block;
    font-weight: 500;
    padding: 0.875rem 2.25rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: #12355A;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-link {
    color: var(--primary);
    font-weight: 700;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.125rem;
}

.btn-link:hover {
    color: var(--accent-ink);
    border-bottom-color: var(--accent-dark);
}

/* Hero buttons: sit on the dark navy background */
.btn-hero {
    background-color: var(--accent);
    color: var(--primary);
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.btn-hero:hover {
    background-color: #b7d0c0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-ghost {
    background-color: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* ================================
   ACCESSIBILITY HELPERS
   ================================ */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background-color: var(--primary);
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 0.5rem 0;
}

.skip-link:focus {
    left: 0;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.form-input:focus-visible,
.form-textarea:focus-visible {
    outline: 3px solid var(--accent-dark);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ================================
   IMAGES & FIGURES
   ================================ */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-rounded {
    border-radius: 1rem;
}

.img-rounded-xl {
    border-radius: 1.5rem;
}

.img-shadow {
    box-shadow: var(--shadow-xl);
}

/* ================================
   CARDS
   ================================ */

.card {
    background-color: var(--bg-light);
    border-radius: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-6px);
}

.card-image {
    width: 100%;
    height: 16rem;
    object-fit: cover;
    background-color: var(--bg-light);
    transition: transform 0.3s ease;
}

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

.card-content {
    padding: 2rem;
}

@media (min-width: 768px) {
    .card-content {
        padding: 2.5rem;
    }
}

.card h3 {
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ================================
   SECTIONS
   ================================ */

section {
    border-bottom: 1px solid var(--border-light);
}

section:last-of-type {
    border-bottom: none;
}

/* Offset anchor jumps so section tops clear the sticky navbar.
   Mobile nav wraps to two rows (~114px), desktop is a single row (~72px). */
section[id] {
    scroll-margin-top: 8.5rem;
}

@media (min-width: 768px) {
    section[id] {
        scroll-margin-top: 5.5rem;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-light);
}

/* ================================
   ABOUT SECTION
   ================================ */

#about {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    #about {
        flex-direction: row;
        gap: 5rem;
    }
}

.about-image {
    width: 100%;
    max-width: 220px;
}

@media (min-width: 768px) {
    .about-image {
        max-width: 420px;
        flex: 1 1 0;
    }
}

.about-content {
    width: 100%;
}

@media (min-width: 768px) {
    .about-content {
        flex: 1 1 0;
    }
}

.about-content p {
    font-size: 1rem;
    line-height: 1.75;
}

.about-content p:first-of-type {
    font-size: 1.0625rem;
    font-weight: 400;
}

.stats {
    display: flex;
    gap: 2.5rem;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.stat {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.stat:hover .stat-value {
    color: var(--accent-ink);
}

.stat-value {
    font-weight: 700;
    font-size: 1.875rem;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ================================
   TEAM SECTION
   ================================ */

#team-grid {
    grid-gap: 2rem;
    gap: 2rem;
}

.team-card {
    background-color: var(--bg-light);
    border-radius: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.team-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
}

.team-card-image {
    position: relative;
    overflow: hidden;
    height: 16rem;
    background-color: var(--bg-light);
}

.team-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.team-card-content {
    padding: 1.5rem;
    text-align: center;
}

.team-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.team-card-role {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-ink);
    margin-bottom: 0;
}

.team-card p {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .team-card-image {
        height: 9rem;
    }

    .team-card-content {
        padding: 1rem;
    }

    .team-card h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .team-card-role,
    .team-card p {
        font-size: 0.75rem;
    }

    #team .grid {
        gap: 1rem;
    }
}

/* ================================
   PROJECTS SECTION
   ================================ */

#projects-grid {
    grid-gap: 3rem;
    gap: 3rem;
}

.project-card {
    background-color: var(--bg-light);
    border-radius: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

@media (max-width: 768px) {
    .project-card {
        grid-template-columns: 1fr;
    }
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-6px);
}

.project-card-image {
    width: 100%;
    height: 100%;
    min-height: 16rem;
    object-fit: cover;
    background-color: var(--bg-light);
    transition: transform 0.3s ease;
    order: -1;
}

@media (max-width: 768px) {
    .project-card-image {
        order: 0;
        min-height: 12rem;
    }
}

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

.project-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 768px) {
    .project-card-content {
        padding: 2.5rem;
    }
}

.project-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    overflow-wrap: break-word;
}

/* Shell state while Ferdia's project text is pending */
.project-card-placeholder {
    font-style: italic;
    color: var(--text-light);
}

/* ================================
   CONTACT SECTION
   ================================ */

#contact {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

@media (min-width: 768px) {
    #contact {
        flex-direction: row;
        gap: 5rem;
    }
}

.contact-info {
    width: 100%;
}

@media (min-width: 768px) {
    .contact-info {
        flex: 1 1 0;
    }
}

.contact-info p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.contact-link {
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.125rem;
    transition: all 0.2s ease;
}

.contact-link:hover {
    color: var(--accent-ink);
    border-bottom-color: var(--accent-dark);
}

/* ================================
   FORM
   ================================ */

.contact-form {
    width: 100%;
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 1.5rem;
}

@media (min-width: 768px) {
    .contact-form {
        flex: 1 1 0;
        padding: 3.5rem;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    background-color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-textarea {
    resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-disclosure {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.form-disclosure a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.form-disclosure a:hover {
    color: var(--accent-ink);
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-alert {
    padding: 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.form-alert--success {
    background-color: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.form-alert--error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* ================================
   MODAL
   ================================ */

.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1.5rem;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--white);
    border-radius: 1.5rem;
    max-width: 42rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    position: sticky;
    top: 0;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 2rem;
}

.modal-header-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.modal-photo {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.modal-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-ink);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ================================
   FOOTER
   ================================ */

footer {
    background-color: var(--primary);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
    font-size: 0.875rem;
}

footer .container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

footer p {
    opacity: 0.85;
}

footer a {
    color: var(--accent);
    font-weight: 500;
    transition: text-decoration 0.2s ease;
}

footer a:hover {
    text-decoration: underline;
}

footer .credit {
    /* explicit light tone: --text-light is tuned for white backgrounds and
       would fail contrast on the navy footer */
    color: rgba(255, 255, 255, 0.75);
}

footer .credit a {
    color: var(--accent);
}

/* ================================
   RESPONSIVE ADJUSTMENTS
   ================================ */

@media (max-width: 640px) {
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .section-spacing {
        padding: 3rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.w-full {
    width: 100%;
}

.max-w-2xl {
    max-width: 42rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-10 {
    margin-top: 2.5rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.object-cover {
    object-fit: cover;
}

.text-primary {
    color: var(--primary);
}

.font-semibold {
    font-weight: 600;
}

.transition-colors {
    transition: color 0.2s ease;
}

.hover\:text-accent-dark:hover {
    color: var(--accent-ink);
}

/* ================================
   PASSWORD GATE (pre-launch)
   ================================ */

.gate-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: var(--bg-light);
}

.gate-card {
    width: 100%;
    max-width: 24rem;
    background-color: var(--white);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    text-align: center;
}

.gate-card p {
    color: var(--text-muted);
}

.gate-card .form-group {
    text-align: left;
}

.gate-card p.gate-error {
    color: #991B1B;
    font-weight: 500;
}
