/* Global CSS Custom Properties - Final Oasis Cream */
:root {
    --color-bg: #F5F1E0;
    /* Inner container background (Old Lace) */
    --color-outer-bg: #F0EAD2;
    /* Outer margin background (Vanilla Cream) */
    --color-text: #6C584C;
    /* Main text (Ash Brown) */
    --color-grid: #A98467;
    /* Grid lines color (Faded Copper) */
    --grid-spacing: 18px;

    /* Theme Palette Refactors */
    --color-light-sand: #FAF8F2;
    /* Input/Toast background */
    --color-placeholder: #b5a092;
    /* Lighter copper-sand placeholder */
    --color-cta: #A6192E;
    /* Vivid Cherry Red */
    --color-cta-hover: #C8102E;
    /* Bright Scarlet Red hover */
    --color-dot: #d2c4b5;
    /* Canvas physics dot */
    --color-checkered-1: #e5dec8;
    /* Checkered grid patterns */
    --color-checkered-2: #e8e4d3;
    --color-focus-bg: #FFFFFF;
    --color-grid-rgb: 169, 132, 103;
    /* RGB of #A98467 for opacity shadows */
}

/* Universal Box Sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--color-outer-bg);
    /* Use the Vanilla Cream background */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect width="2" height="2" fill="%23e5dec8" /><rect x="2" y="2" width="2" height="2" fill="%23e5dec8"/></svg>');
    overflow-y: auto;
    /* Enable vertical scroll fallback */
    overflow-x: hidden;
    /* Hide horizontal scrollbar */
    width: 100%;
}

#responsive-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    display: block;
}

.content-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 10;
}

.accent-block {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    pointer-events: auto;
}

.text-block {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-bg);
    border: 1px solid var(--color-text);
    box-sizing: border-box;
    overflow: hidden;
    /* Ensure image fits inside borders */
}

.text-block.transparent-mask {
    background-color: transparent;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
}

.headline {
    font-family: 'Young Serif', serif;
    font-weight: 400;
    font-size: 24px;
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 8px;
}

.body-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 11.5px;
    color: var(--color-text);
    /* Made darker (Ash Brown) to match readability requirements */
    letter-spacing: -0.015em;
}

.text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Centered horizontally */
    padding-left: 16px;
    padding-right: 16px;
    text-align: center;
    /* Centered text alignment */
    user-select: none;
    width: 100%;
    height: 100%;
}

.corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1.5px solid transparent;
}

.corner.tl {
    top: -0.75px;
    left: -0.75px;
    border-top-color: var(--color-text);
    border-left-color: var(--color-text);
}

.corner.tr {
    top: -0.75px;
    right: -0.75px;
    border-top-color: var(--color-text);
    border-right-color: var(--color-text);
}

.corner.bl {
    bottom: -0.75px;
    left: -0.75px;
    border-bottom-color: var(--color-text);
    border-left-color: var(--color-text);
}

.corner.br {
    bottom: -0.75px;
    right: -0.75px;
    border-bottom-color: var(--color-text);
    border-right-color: var(--color-text);
}

/* AI Query Box Styles */
.ai-box-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 24px;
    box-sizing: border-box;
    justify-content: center;
}

.ai-box-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-grid);
    /* Faded Copper */
    margin-bottom: 4px;
    text-align: left;
}

.ai-box-title {
    font-family: 'Young Serif', serif;
    font-size: 20px;
    /* Reduced from 20px to support longer vision statement */
    color: var(--color-text);
    /* Ash Brown */
    margin-bottom: 10px;
    /* Reduced from 16px */
    line-height: 1.35;
    text-align: left;
}

.ai-box-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Reduced from 12px */
    width: 100%;
    margin-bottom: 8px;
    /* Reduced from 12px */
}

#ai-query-input {
    width: 100%;
    height: 80px;
    /* Reduced from 108px to fit the 22-row card height */
    resize: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 12px 14px;
    /* Slightly tighter padding */
    border: 1px solid var(--color-text);
    background-color: var(--color-light-sand);
    color: var(--color-text);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#ai-query-input:focus {
    background-color: var(--color-focus-bg);
    border-color: var(--color-grid);
    box-shadow: 0 0 0 2px rgba(var(--color-grid-rgb), 0.15);
}

#ai-query-input::placeholder {
    color: var(--color-placeholder);
    font-weight: 400;
    opacity: 0.8;
}

#ai-query-submit {
    align-self: flex-start;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 24px;
    background-color: var(--color-cta);
    color: var(--color-bg);
    /* Old Lace */
    border: 1px solid var(--color-cta);
    cursor: pointer;
    transition: all 0.2s ease;
}

#ai-query-submit:hover {
    background-color: var(--color-cta-hover);
    border-color: var(--color-cta-hover);
}

#ai-query-submit:focus-visible {
    outline: 2px dashed var(--color-grid);
    outline-offset: 2px;
}

#ai-query-submit:active {
    transform: translateY(1px);
}

.ai-box-meta {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11.5px;
    /* Matched to body-text size */
    font-weight: 500;
    line-height: 1.45;
    color: var(--color-text);
    /* Matched to body-text Ash Brown for high contrast */
    text-align: left;
    letter-spacing: -0.015em;
}

.branding-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    user-select: none;
    cursor: pointer;
    /* Clickable */
    transition: left 0.3s cubic-bezier(0.05, 0.7, 0.1, 1), top 0.3s cubic-bezier(0.05, 0.7, 0.1, 1);
    outline: none;
}

.branding-container:focus-visible {
    outline: 2px dashed var(--color-grid);
    outline-offset: 4px;
}

.branding-container:hover .branding-text {
    color: var(--color-grid);
    /* Change logo to Faded Copper on hover */
}

.branding-text {
    font-family: 'Young Serif', serif;
    font-size: 24px;
    color: var(--color-text);
    /* Ash Brown */
    letter-spacing: -0.02em;
    line-height: 1.1;
    transition: color 0.2s ease;
}

.branding-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    /* Increased from 11.5px to 12px */
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--color-text);
    /* Ash Brown */
    margin-top: 4px;
    margin-left: 5px;
    /* Shifted right by 5px */
}

#qayam-block .body-text {
    font-size: 14px;
    /* Increased to 14px */
}

.email-link {
    text-decoration: none;
    color: var(--color-text);
    /* Explicitly set to match branding slogan */
    cursor: pointer;
    transition: color 0.2s ease;
    outline: none;
}

.email-link:hover {
    color: var(--color-grid);
    /* Hover changes to Faded Copper */
    text-decoration: underline;
}

.email-link:focus-visible {
    outline: 2px dashed var(--color-grid);
    outline-offset: 2px;
}

/* Partner Logos Layout */
/* Detail Block 3-Section Layout */
.detail-container {
    width: 100%;
    height: 100%;
    padding: 16px 32px 32px 32px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-section.summary-section {
    gap: 10px;
}

.detail-section.track-record-section {
    align-items: center;
    text-align: center;
    gap: 12px;
}

.detail-headline {
    font-size: 20px;
    text-align: left;
    margin: 0;
    font-family: 'Young Serif', serif;
    color: var(--color-text);
}

.detail-body-text {
    font-size: 14.5px;
    line-height: 1.6;
    text-align: left;
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--color-text);
    font-weight: 500;
}

.detail-divider {
    width: 100%;
    border-top: 1px solid var(--color-grid);
    opacity: 0.35;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-grid);
    /* Faded Copper */
    margin-bottom: 6px;
    text-align: left;
}

.track-record-section .section-title {
    text-align: center;
    width: 100%;
}

.logo-horizontal-row {
    display: flex;
    flex-direction: row;
    gap: 48px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.qualifications-columns {
    display: flex;
    flex-direction: row;
    gap: 40px;
    width: 100%;
}

.qual-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qual-list {
    margin: 0;
    padding-left: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text);
    font-weight: 500;
    list-style-type: square;
}

.qual-list li {
    margin-bottom: 4px;
    text-align: left;
}

.qual-list li strong {
    font-weight: 700;
}

.partner-logo-item {
    display: flex;
    align-items: center;
    color: var(--color-text);
    /* Ash Brown */
    opacity: 0.85;
    /* Increased from 0.65 to ensure excellent legibility */
    transition: opacity 0.2s ease, color 0.2s ease;
}

.partner-logo-item:hover {
    opacity: 1;
    color: var(--color-grid);
    /* Glow to Faded Copper on hover */
}

.partner-logo-svg {
    height: 16px;
    /* Enforces uniform height across all brand assets */
    width: auto;
    /* Scales width dynamically to preserve brand aspect ratios */
    fill: currentColor;
    display: block;
}

/* Toast Notification Styling */
.toast-card {
    position: fixed;
    bottom: -80px;
    /* Initially hidden below screen */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-light-sand);
    border: 1px solid var(--color-text);
    /* Ash Brown border */
    box-shadow: 3px 3px 0px var(--color-text);
    /* Brutalist offset shadow */
    padding: 12px 24px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    z-index: 1000;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1), top 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-card.show {
    bottom: 24px;
    /* Slide up into view */
    opacity: 1;
}

/* Top Position Modifier */
.toast-card.toast-top {
    bottom: auto;
    top: -80px;
    /* Initially hidden above screen */
}

.toast-card.toast-top.show {
    top: 24px;
    /* Slide down into view */
    opacity: 1;
}

.toast-check {
    color: var(--color-grid);
    /* Faded Copper checkmark */
    flex-shrink: 0;
}

@media (max-width: 1260px) {
    .qualifications-columns {
        flex-direction: column;
        gap: 20px;
    }

    .logo-horizontal-row {
        gap: 22px;
    }

    .detail-split-container {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }

    .detail-logo-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--color-grid);
        padding-left: 0;
        padding-top: 16px;
        height: auto;
        align-items: flex-start;
    }

    .logo-sidebar-title {
        margin-bottom: 12px;
    }

    .logo-vertical-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px 24px;
        justify-content: flex-start;
    }

    .ai-box-form {
        flex-direction: column;
    }

    #ai-query-submit {
        width: 100%;
    }

    .ai-box-container {
        padding: 16px;
    }

    .ai-box-title {
        font-size: 17px;
        margin-bottom: 12px;
    }
}

@media (max-width: 767px) {
    .headline {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .body-text {
        font-size: 11px;
    }

    .text-wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }

    .ai-box-container {
        padding: 12px;
    }

    .ai-box-title {
        font-size: 15px;
        margin-bottom: 8px;
    }
}