/* ==========================================================================
   KAIROS SEARCH | Completely Isolated Multi-Device Stylesheet
   ========================================================================== */

/* ==========================================================================
   GLOBAL VARIABLES (Shared Across All Devices)
   ========================================================================== */
:root {
    /* Brand Colors (Kairos Orange Set) */
    --color-primary: #e65c00;          /* Brand Orange */
    --color-primary-dark: #c44e00;    /* Hover State Deep Orange */
    --color-accent: var(--color-primary);
    
    /* Global Neutral tones based on Kairos 'Search' Typography */
    --color-charcoal: #2b2b2b;        /* Professional gray for headings and strong text */
    --color-grey: #5c5c5c;            /* Balanced mid-gray for body copy text */
    --color-light-grey: #f9fafb;      /* Section-break background tint */
    --color-border: #e5e7eb;
    --color-white: #ffffff;

    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --container-width: 1200px;
    --header-height: 80px;

    /* Standardization values */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 12px;
    --shadow-sm: 0 4px 20px rgba(43, 43, 43, 0.04);
    --shadow-md: 0 12px 30px rgba(43, 43, 43, 0.08);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   GLOBAL RESETS & BASE STRUCTURE (Shared Baseline)
   ========================================================================== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--color-charcoal);
    background: var(--color-white);
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    font-style: italic;
    vertical-align: middle;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

ul, ol {
    list-style: none;
}

button {
    font: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

section {
    scroll-margin-top: calc(var(--header-height) + 20px);
}

.container {
    width: min(100% - 3rem, var(--container-width));
    margin-inline: auto;
}

.section {
    padding: 6rem 0;
}

.section-alt {
    background: var(--color-light-grey);
}

/* ==========================================================================
   TYPOGRAPHY STANDARDIZATION
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-charcoal);
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.3rem; margin-bottom: .85rem; }

p {
    margin-bottom: 1.25rem;
    color: var(--color-grey);
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
    max-width: 750px;
    margin-inline: auto;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--color-grey);
}

.eyebrow {
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: .9rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 54px;
    padding: 0 2.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.button-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

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

.button-secondary {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
}

.button-secondary:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ==========================================================================
   GRID, CARDS & COMPONENT LAYOUTS (Shared Layout Framework)
   ========================================================================== */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2.5rem;
}

.card {
    background: var(--color-white);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--color-primary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--color-charcoal);
}

.card p { margin-bottom: 0; }
.card p + p { margin-top: 0.75rem; }

#expertise .card {
    text-align: center;
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

#expertise h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
}

.contact-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.contact-list li {
    padding: 2.5rem;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
    transition: var(--transition);
}

.contact-list li:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.contact-list strong {
    font-size: 1.2rem;
    color: var(--color-charcoal);
    display: inline-block;
    margin-bottom: 0.5rem;
}

.contact-list a {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
}

.contact-list a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.site-footer {
    background: var(--color-charcoal);
    color: white;
    text-align: center;
    padding: 4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.site-footer p {
    color: rgba(255, 255, 255, .7);
    margin-bottom: .75rem;
    font-size: 0.95rem;
}

.site-footer p:last-child { margin-bottom: 0; }

.skip-link {
    position: absolute;
    top: -9999px;
    left: -9999px;
    padding: 1rem;
    background: var(--color-primary);
    color: white;
    z-index: 10000;
}

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

/* Shared Intermediate Layout Rules */
@media (min-width: 768px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .contact-list { grid-template-columns: repeat(2, 1fr); }
}


/* ==========================================================================
   📱 ISOLATED MOBILE & TABLET ONLY ENVIRONMENT (Screens Under 1024px)
   ========================================================================== */
@media (max-width: 1023px) {
    /* Header & Navigation Fixes */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 999;
        background: rgba(255, 255, 255, .98);
        border-bottom: 1px solid var(--color-border);
    }

    .navbar {
        min-height: var(--header-height);
        display: flex;
        align-items: center;
    }

    .navbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        position: relative;
    }

    .logo img {
        width: 130px; /* Scaled down perfectly for mobile view */
        height: auto;
    }

    .nav-toggle {
        display: block;
        font-size: 1.6rem;
        color: var(--color-charcoal);
        padding: 0.5rem;
        cursor: pointer;
        z-index: 1001;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: -1.5rem;
        width: calc(100% + 3rem);
        background: var(--color-white);
        border-bottom: 3px solid var(--color-primary);
        box-shadow: var(--shadow-md);
        padding: 1rem 0;
        z-index: 1000; /* Pulled in front of Hero elements */
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 1rem 2rem;
        font-weight: 500;
        font-size: 1.1rem;
        color: var(--color-charcoal);
    }

    .nav-menu a:hover {
        background-color: var(--color-light-grey);
        color: var(--color-primary);
    }

    /* Hero Section Mobile Framing */
    .hero {
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 85vh; /* Gives text copy vertical breathing room */
        overflow: hidden;
        background-image: url("../images/hero.jpg");
        background-size: cover;
        background-position: 25% center; /* Shifts focus to highlight landmarks around text */
        background-repeat: no-repeat;
        padding: 5rem 0 3rem 0;
    }

    /* Multi-stop gradient blend overlay for mobile legibility */
    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
        z-index: 1;
    }

    .hero-container {
        position: relative;
        z-index: 2;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .hero-text-block {
        width: 100%;
        z-index: 3;
    }

    .hero-text-block h1 {
        font-family: "Playfair Display", "Georgia", serif;
        font-size: 1.85rem; /* Reduced to sit beautifully on phone width screens */
        font-weight: 700;
        line-height: 1.3;
        color: #1a2e40;
        margin-bottom: 1rem;
    }

    .hero-divider {
        width: 60px;
        height: 3px;
        background-color: var(--color-primary);
        margin-bottom: 1.25rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.6;
        color: #1e293b; /* High contrast charcoal slate */
        margin-bottom: 1.5rem;
    }

    .hero-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap; /* Wraps action buttons cleanly if display viewport is thin */
        gap: 1rem;
        width: 100%;
        z-index: 4;
    }

    .hero-actions .button {
        flex: 1;
        min-width: 135px;
        min-height: 48px;
        padding: 0 1rem;
        font-size: 0.95rem;
    }

    .scroll-indicator {
        display: none; /* Disabled on touchscreen devices */
    }
}


/* ==========================================================================
   💻 ISOLATED DESKTOP ONLY ENVIRONMENT (Screens 1024px and Wider)
   ========================================================================== */
@media (min-width: 1024px) {
    .site-header {
        position: sticky;
        top: 0;
        z-index: 999;
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--color-border);
    }

    .navbar {
        min-height: var(--header-height);
    }

    .navbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-right: 1.5rem;
    }

    .logo img {
        width: 180px;
        height: auto;
        display: block;
    }

    .nav-toggle {
        display: none; /* Hides burger toggle on desktop monitors */
    }

    /* Horizontal Desktop Inline Directory Links */
    .nav-menu {
        display: flex;
        position: static;
        width: auto;
        border: none;
        gap: 2.5rem;
        box-shadow: none;
        background: transparent;
        padding: 0;
        margin-left: auto;
    }

    .nav-menu li {
        border: none;
    }

    .nav-menu a {
        padding: 0;
        font-weight: 500;
        transition: var(--transition);
    }

    .nav-menu a:hover {
        background: transparent;
        color: var(--color-primary);
    }

    /* Hero Section Desktop Widescreen Layout Settings */
    .hero {
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        min-height: auto; 
        aspect-ratio: 16 / 9; /* Perfect crop-free canvas framing alignment */
        overflow: hidden;
        background-image: url("../images/hero.jpg");
        background-size: 100% 100%; /* Spans full image edge-to-edge natively */
        background-position: center center;
        background-repeat: no-repeat;
    }

    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, 0.15);
        z-index: 1;
    }

    .hero-container {
        position: relative;
        z-index: 2;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end; /* Splits layout text to right-hand half */
        gap: 2.5rem;
    }

    .hero-text-block {
        width: 100%;
        max-width: 600px;
        text-align: left;
        margin-left: auto;
        margin-right: 0;
        z-index: 3;
    }

    .hero-text-block h1 {
        font-family: "Playfair Display", "Georgia", serif;
        font-size: 3.5rem; /* Restores large presentation title sizes */
        font-weight: 700;
        line-height: 1.25;
        color: #1a2e40;
        margin-bottom: 1rem;
    }

    .hero-divider {
        width: 60px;
        height: 3px;
        background-color: var(--color-primary);
        margin-right: auto;
        margin-left: 0;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
        line-height: 1.65;
        color: #334155;
        margin-bottom: 1.5rem;
    }

    .hero-actions {
        display: flex;
        flex-direction: row;
        gap: 1.25rem;
        width: auto;
        max-width: none;
        margin-right: auto;
        margin-left: 0;
        z-index: 4;
    }

    .scroll-indicator {
        position: absolute;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
        height: 50px;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        z-index: 5;
    }

    .scroll-indicator span {
        width: 2px;
        height: 16px;
        background: #1e293b;
        border-radius: 2px;
        animation: scrollDown 1.8s infinite;
    }

    @keyframes scrollDown {
        0% { opacity: 0; transform: translateY(0); }
        50% { opacity: 1; }
        100% { opacity: 0; transform: translateY(16px); }
    }

    /* Grid layout expansion rules specific to desktop spaces */
    .grid { grid-template-columns: repeat(4, 1fr); }
    #industries .grid { grid-template-columns: repeat(3, 1fr); }
}
