/* AEGIS BRIDGE | Master Stylesheet
   Version: 1.0
   Description: Complete styles for Landing Page and Privacy Policy.
*/

/* --- 1. FONT EMBEDDING --- */
@font-face {
    font-family: 'Felix Titling';
    src: url('../fonts/felixtitling.woff2') format('woff2'),
         url('../fonts/felixtitling.woff') format('woff'),
         url('../fonts/felixtitling.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Microsoft YaHei';
    src: url('../fonts/msyh.woff2') format('woff2'),
         url('../fonts/msyh.woff') format('woff'),
         url('../fonts/msyh.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- 2. BRAND COLOR VARIABLES (AEGIS PALETTE) --- */
:root {
    --primary-navy: #0A1B35;    /* Aegis Deep Navy */
    --accent-blue: #1B3D6B;     /* Aegis Accent Navy */
    --logo-yellow: #C9A961;     /* Aegis Warm Gold */
    --logo-gold-bright: #D9B978;/* Hover / highlight gold */
    --neutral-gray: #F4F6FA;    /* Section Background */
    --text-dark: #2A2A2A;       /* Primary Text */
    --white: #FFFFFF;
    --border-gray: #E0E0E0;
}

/* --- 3. GLOBAL RESET & BASE TYPOGRAPHY --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--white);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

h1, h2, h3, h4, .nav-links a, .hero-motto, .section-title, .policy-heading {
    font-family: 'Felix Titling', serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* --- 4. NAVIGATION HEADER --- */
header {
    background: var(--white);
    padding: 10px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

/* Hidden on desktop, shown on mobile */
.nav-toggle {
    display: none;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 18px;
}

.main-logo {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.partner-brand-logo {
    height: 40px;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links li {
    margin-left: 35px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-blue);
}

.nav-cta {
    border: 2px solid var(--primary-navy) !important;
    padding: 8px 18px !important;
    border-radius: 4px;
    transition: all 0.3s ease-in-out !important;
}

.nav-cta:hover {
    background: var(--logo-yellow) !important;
    border-color: var(--logo-yellow) !important;
    color: var(--primary-navy) !important;
}

/* --- 5. HERO SECTION --- */
.hero {
    background: linear-gradient(rgba(10, 27, 53, 0.72), rgba(10, 27, 53, 0.72)), url('images/image_1.png');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 160px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 25px;
    white-space: nowrap;
}

.hero-motto {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--logo-yellow);
    background: rgba(0,0,0,0.4);
    padding: 12px 35px;
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 40px;
    border-radius: 0;
}

/* === Hero motto typewriter animation ===
   JS appends one .char at a time to produce the typing effect.
   No CSS interpolation needed — each char takes its natural width
   the moment it's added to the DOM. */
.hero-motto.motto-anim .char {
    display: inline-block;
    white-space: pre;
}

/* Blinking gold caret */
.hero-motto.motto-anim .caret {
    display: inline-block;
    width: 0.08em;
    height: 0.85em;
    margin-left: 3px;
    background: var(--logo-yellow);
    vertical-align: baseline;
    animation: motto-caret-blink 0.55s steps(1, end) infinite;
}

/* Fade-out class added by JS once typing finishes */
.hero-motto.motto-anim .caret.caret-fading {
    animation: motto-caret-fade 0.5s ease forwards;
}

@keyframes motto-caret-blink {
    0%, 50%      { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

@keyframes motto-caret-fade {
    to { opacity: 0; }
}

/* Reduced motion: skip animation, hide caret */
@media (prefers-reduced-motion: reduce) {
    .hero-motto.motto-anim .caret { display: none; }
}

.btn-primary-transparent {
    background: rgba(10, 27, 53, 0.5);
    color: var(--white);
    padding: 15px 35px;
    text-decoration: none;
    font-family: 'Microsoft YaHei', sans-serif;
    font-weight: 600;
    border: 2px solid var(--logo-yellow);
    border-radius: 4px;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary-transparent:hover {
    background: var(--logo-yellow);
    color: var(--primary-navy);
    border-color: var(--logo-yellow);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary-navy);
    color: var(--white);
    padding: 15px 35px;
    border: 2px solid var(--primary-navy);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Felix Titling', serif;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--logo-yellow);
    color: var(--primary-navy);
    border-color: var(--logo-yellow);
}

/* --- 6. SERVICES GRID & ANIMATIONS --- */
.section-title {
    font-size: 2.5rem;
    color: var(--primary-navy);
    text-align: center;
    margin: 40px 0 20px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    position: relative;
    background: var(--neutral-gray);
    padding: 40px;
    border-top: 5px solid var(--logo-yellow);
    text-align: center;
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
    overflow: hidden;
}

/* Soft gold sheen sweeping across on hover */
.service-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
                transparent 0%,
                rgba(201, 169, 97, 0.10) 50%,
                transparent 100%);
    transform: translateX(-110%);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow:
        0 14px 32px rgba(10, 27, 53, 0.12),
        0 0 0 1px rgba(201, 169, 97, 0.35);
}

.service-card:hover::after {
    transform: translateX(110%);
}

.service-card:hover .service-icon-img {
    transform: scale(1.08);
}

.service-icon-img {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto 25px;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Tile entrance: staggered fade-up when grid scrolls into view.
   .tiles-anim is added by JS so users without JS see tiles immediately. */
.services-grid.tiles-anim .service-card {
    opacity: 0;
    transform: translateY(28px);
}

.services-grid.tiles-anim.in-view .service-card {
    opacity: 1;
    transform: none;
}

.services-grid.tiles-anim.in-view .service-card:nth-child(1) { transition-delay: 0.05s; }
.services-grid.tiles-anim.in-view .service-card:nth-child(2) { transition-delay: 0.15s; }
.services-grid.tiles-anim.in-view .service-card:nth-child(3) { transition-delay: 0.25s; }
.services-grid.tiles-anim.in-view .service-card:nth-child(4) { transition-delay: 0.35s; }
.services-grid.tiles-anim.in-view .service-card:nth-child(5) { transition-delay: 0.45s; }
.services-grid.tiles-anim.in-view .service-card:nth-child(6) { transition-delay: 0.55s; }

@media (prefers-reduced-motion: reduce) {
    .services-grid.tiles-anim .service-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .service-card::after { display: none; }
}

/* --- 7. PARTNERS & LOGO ANIMATIONS --- */
.partner-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px 60px;
    padding-bottom: 30px;
}

.partner-logo {
    width: 180px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.client-logo-img {
    max-width: 100%;
    max-height: 70px;
    filter: grayscale(100%) opacity(0.7);
    transition: all 0.3s ease;
}

.partner-logo:hover .client-logo-img {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.05);
}

/* --- 8. REGIONAL PRESENCE & MAP ANIMATIONS --- */
.regional-section {
    padding: 40px 0;
    text-align: center;
}

.map-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    transition: transform 0.5s ease;
}

.map-wrapper:hover {
    transform: scale(1.01);
}

.regional-map-img {
    display: block;
    width: 100%;
    height: auto;
}

.map-hotspot {
    position: absolute;
    z-index: 10;
    cursor: pointer;
}

.hotspot-point {
    width: 16px;
    height: 16px;
    background-color: var(--logo-yellow);
    border: 2px solid var(--primary-navy);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(201, 169, 97, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(201, 169, 97, 0); }
    100% { box-shadow: 0 0 0 0 rgba(201, 169, 97, 0); }
}

.hotspot-label {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 200px;
    background: var(--primary-navy);
    color: var(--white);
    padding: 12px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    text-align: left;
}

.map-hotspot:hover .hotspot-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- 9. SECURE REQUEST FORM --- */
.contact-section {
    padding: 40px 0;
}

.quote-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-navy);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    font-size: 16px;
}

.full-width {
    grid-column: span 2;
}

/* Honeypot field — visually hidden from real users */
.honeypot-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Inline form status message */
.form-status {
    padding: 0;
    font-size: 0.95rem;
    border-radius: 4px;
    min-height: 0;
    transition: all 0.3s ease;
}

.form-status.success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border: 1px solid #a5d6a7;
}

.form-status.error {
    background: #fdecea;
    color: #c62828;
    padding: 12px 16px;
    border: 1px solid #f1998a;
}

/* Submit row — centres button and gives breathing room */
.form-submit-row {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.form-submit-row .btn-primary {
    padding: 16px 60px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    min-width: 280px;
    text-transform: uppercase;
}

/* --- 10. PRIVACY POLICY LAYOUT --- */
.policy-wrapper {
    background: var(--neutral-gray);
    padding: 60px 0 80px;
}

.policy-intro {
    max-width: 900px;
    margin: 0 auto 28px;
    padding: 0 4px;
}

.policy-heading {
    font-size: 2.2rem;
    color: var(--primary-navy);
    margin-bottom: 8px;
}

.policy-date {
    font-size: 0.875rem;
    color: #777;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Microsoft YaHei', sans-serif;
}

.policy-card {
    background: var(--white);
    padding: 56px 60px;
    max-width: 900px;
    margin: 0 auto;
    border-top: 6px solid var(--logo-yellow);
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.policy-section {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding-bottom: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-gray);
}

.policy-section--last {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary-navy);
    color: var(--logo-yellow);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Felix Titling', serif;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-top: 4px;
}

.policy-section-body {
    flex: 1;
}

.policy-section-body h2 {
    font-size: 1.1rem;
    color: var(--primary-navy);
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.policy-section-body p {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 14px;
}

.policy-section-body p:last-child {
    margin-bottom: 0;
}

.policy-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 18px;
}

.policy-list li {
    position: relative;
    padding: 10px 12px 10px 20px;
    border-left: 3px solid var(--logo-yellow);
    background: var(--neutral-gray);
    margin-bottom: 8px;
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.policy-list li:last-child {
    margin-bottom: 0;
}

.policy-link {
    color: var(--accent-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.policy-link:hover {
    color: var(--primary-navy);
}

.policy-footer-action {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--border-gray);
    flex-wrap: wrap;
}

.btn-policy-secondary {
    color: var(--primary-navy);
    text-decoration: none;
    font-family: 'Felix Titling', serif;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--logo-yellow);
    padding-bottom: 2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-policy-secondary:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* --- 11. FOOTER --- */
footer {
    background: var(--primary-navy);
    color: var(--white);
    padding: 50px 0;
    text-align: center;
    border-top: 3px solid var(--logo-yellow);
}

.footer-link {
    color: var(--white);
    text-decoration: none;
    margin-left: 20px;
}

.footer-link:hover {
    text-decoration: underline;
    color: var(--logo-yellow);
}

/* --- 11b. KEYBOARD FOCUS & ACCESSIBILITY --- */
.service-card:focus,
.map-hotspot:focus {
    outline: 3px solid var(--logo-yellow);
    outline-offset: 3px;
}

.service-card:focus-visible,
.map-hotspot:focus-visible {
    outline: 3px solid var(--logo-yellow);
    outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: 2px;
}

/* --- 12. MOBILE OPTIMISATION --- */

/* Tablet: 768px – 1024px */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2.1rem;
    }
}

/* Mobile: up to 768px */
@media (max-width: 768px) {

    .container {
        padding: 0 20px;
    }

    .header-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        position: relative;
    }

    .logo-wrapper {
        flex: 0 0 auto;
        gap: 10px;
    }

    .main-logo {
        height: 44px;
        width: auto;
    }

    .partner-brand-logo {
        height: 28px;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
        z-index: 1001;
    }

    .nav-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--primary-navy);
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    header.nav-open .nav-toggle span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    header.nav-open .nav-toggle span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    header.nav-open .nav-toggle span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
        border-top: 1px solid var(--border-gray);
        padding: 0;
        list-style: none;
        order: 3;
    }

    header.nav-open .nav-links {
        max-height: 400px;
        padding: 8px 0 12px;
    }

    .nav-links li {
        margin: 0;
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 12px 4px;
        font-size: 0.85rem;
        letter-spacing: 0.5px;
        border-bottom: 1px solid var(--neutral-gray);
        white-space: normal;
        text-align: left;
    }

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

    .nav-cta {
        display: block !important;
        text-align: center !important;
        margin-top: 8px !important;
        padding: 10px 16px !important;
        font-size: 0.85rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .hero {
        padding: 80px 0 60px;
    }

    .hero h1 {
        font-size: 1.55rem;
        line-height: 1.3;
        margin-bottom: 16px;
        white-space: normal;
    }

    .hero-subtext {
        font-size: 0.95rem;
        padding: 0 8px;
        line-height: 1.7;
    }

    .hero-motto {
        font-size: 1rem;
        padding: 10px 16px;
        width: auto;
        max-width: 90%;
        display: inline-block;
        margin: 0 auto 28px;
    }

    .btn-primary-transparent {
        padding: 12px 28px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.6rem;
        margin: 30px 0 16px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .service-card {
        padding: 24px 20px;
        border-top: none;
        border-left: 5px solid var(--logo-yellow);
        text-align: left;
        display: flex;
        align-items: flex-start;
        gap: 16px;
    }

    .service-icon-img {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        margin: 0;
    }

    .service-card-text {
        flex: 1;
    }

    .service-card h3 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .service-card p {
        font-size: 0.875rem;
        line-height: 1.5;
        margin: 0;
    }

    .partner-grid {
        gap: 16px 24px;
    }

    .partner-logo {
        width: 120px;
        height: 70px;
    }

    .client-logo-img {
        filter: grayscale(0%) opacity(1);
    }

    .map-wrapper {
        transform: none !important;
        overflow: visible;
    }

    .regional-map-img {
        width: 100%;
        min-width: 0;
    }

    .hotspot-point {
        width: 18px;
        height: 18px;
    }

    .hotspot-label {
        width: 160px;
        font-size: 0.8rem;
        padding: 10px;
        left: 0;
        transform: translateX(0) translateY(10px);
        bottom: 26px;
    }

    .map-hotspot:hover .hotspot-label,
    .map-hotspot.label-visible .hotspot-label {
        transform: translateX(0) translateY(0);
    }

    .map-hotspot[data-location="United Kingdom"] { top: 34% !important; left: 34% !important; }
    .map-hotspot[data-location="Poland"]          { top: 37% !important; left: 55% !important; }
    .map-hotspot[data-location="Ukraine"]         { top: 40% !important; left: 67% !important; }

    .quote-form {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 0 0 48px;
        padding: 0;
    }

    .full-width {
        grid-column: span 1;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        padding: 14px 12px;
    }

    .form-submit-row {
        padding-top: 4px;
    }

    .form-submit-row .btn-primary {
        width: 100%;
        min-width: 0;
        padding: 16px;
        font-size: 0.95rem;
        letter-spacing: 1.5px;
        display: block;
        min-height: 52px;
    }

    .policy-wrapper {
        padding: 32px 0 48px;
    }

    .policy-intro {
        padding: 0;
        margin-bottom: 20px;
    }

    .policy-heading {
        font-size: 1.5rem;
    }

    .policy-card {
        padding: 28px 20px;
        box-shadow: none;
    }

    .policy-section {
        flex-direction: column;
        gap: 16px;
        padding-bottom: 28px;
        margin-bottom: 28px;
    }

    .section-number {
        width: 40px;
        height: 40px;
        font-size: 0.75rem;
    }

    .policy-section-body h2 {
        font-size: 1rem;
    }

    .policy-footer-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-top: 32px;
        padding-top: 28px;
    }

    .policy-footer-action .btn-primary {
        width: 100%;
        text-align: center;
        padding: 16px;
        min-height: 52px;
        display: block;
        box-sizing: border-box;
    }

    footer {
        padding: 32px 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
    }

    .footer-link {
        margin-left: 0;
        display: inline-block;
        margin-top: 8px;
    }
}

/* Very small phones: 360px and below */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.55rem;
    }

    .hero-motto {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.4rem;
    }
}

/* === TOUCH DEVICE OVERRIDES === */
@media (hover: none) {
    .service-card:hover {
        transform: none;
        box-shadow: none;
    }

    .service-card:active {
        background: #e8ecf0;
    }

    .client-logo-img {
        filter: grayscale(0%) opacity(1);
    }

    .map-wrapper:hover {
        transform: none;
    }

    .hotspot-point {
        width: 22px;
        height: 22px;
    }
}
