/* =============================================
   AEC.Codes — Style Sheet
   Dark theme, developer-friendly
   ============================================= */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg:          #0F1419;
    --bg-card:     #1A1F2E;
    --accent:      #58A6FF;
    --accent-hover:#79B8FF;
    --accent-2:    #3FB950;
    --text:        #E6EDF3;
    --text-muted:  #8B949E;
    --border:      #30363D;
    --radius:      12px;
    --radius-sm:   8px;
    --transition:  0.3s ease;
    --font-body:   'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
    --max-width:   1120px;
    --header-h:    72px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

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

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: var(--bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(88, 166, 255, 0.3);
}

/* =============================================
   [A] HEADER
   ============================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background-color: rgba(15, 20, 25, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo img {
    height: 32px;
    width: auto;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
}

.main-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text);
}

.lang-switcher {
    display: flex;
    gap: 8px;
}

.lang-switcher a {
    font-size: 1.25rem;
    opacity: 0.5;
    transition: opacity var(--transition);
    text-decoration: none;
}

.lang-switcher a:hover,
.lang-switcher a.active {
    opacity: 1;
}

/* Hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    transition: all var(--transition);
    border-radius: 2px;
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before { top: -7px; }
.hamburger::after  { top: 7px; }

.menu-toggle[aria-expanded="true"] .hamburger {
    background-color: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* =============================================
   [B] HERO
   ============================================= */
.hero {
    padding-top: calc(var(--header-h) + 80px);
    padding-bottom: 100px;
    position: relative;
    overflow: hidden;
}

.hero-inner {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-content {
    flex: 1;
    max-width: 640px;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 540px;
}

.hero-graphic {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.geo-pattern {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 40%, rgba(88, 166, 255, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 70% 60%, rgba(63, 185, 80, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-card) 0%, var(--bg) 100%);
    border: 1px solid var(--border);
    position: relative;
}

.geo-pattern::before,
.geo-pattern::after {
    content: '';
    position: absolute;
    border: 1px solid var(--border);
    border-radius: 50%;
}

.geo-pattern::before {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
}

.geo-pattern::after {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border-color: rgba(88, 166, 255, 0.3);
}

/* =============================================
   [C] SERVICES
   ============================================= */
.services {
    padding: 100px 0;
    background-color: var(--bg-card);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.service-card {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.service-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(88, 166, 255, 0.08);
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 166, 255, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.service-icon img {
    width: 32px;
    height: 32px;
}

.service-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.service-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Accordion expanded */
.service-expanded {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    opacity: 0;
}

.service-card.open .service-expanded {
    max-height: 1200px;
    opacity: 1;
    margin-top: 20px;
}

.service-expanded p {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.75;
    margin-bottom: 12px;
}

.service-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 6px;
    padding: 4px 10px;
}

/* Toggle button */
.service-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 0;
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition);
}

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

.toggle-less {
    display: none;
}

.service-card.open .toggle-more {
    display: none;
}

.service-card.open .toggle-less {
    display: inline;
}

.toggle-icon {
    transition: transform var(--transition);
}

.service-card.open .toggle-icon {
    transform: rotate(180deg);
}

/* =============================================
   [D] ABOUT
   ============================================= */
.about {
    padding: 100px 0;
}

.about-text {
    max-width: 760px;
    margin: 0 auto;
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* =============================================
   [E] CONTACT
   ============================================= */
.contact {
    padding: 100px 0;
    background-color: var(--bg-card);
}

.contact-inner {
    text-align: center;
}

.contact-title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 16px;
}

.contact-label {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 28px;
}

.contact-cta {
    margin-bottom: 20px;
}

.contact-email {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =============================================
   [F] FOOTER
   ============================================= */
.site-footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color var(--transition);
}

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

.footer-link-label {
    color: var(--text-muted);
    opacity: 0.6;
}

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

/* Tablet */
@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        margin: 0 auto;
    }

    .geo-pattern {
        width: 240px;
        height: 240px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    :root {
        --header-h: 60px;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(15, 20, 25, 0.98);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition);
        z-index: 999;
    }

    .main-nav.open {
        opacity: 1;
        pointer-events: auto;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .main-nav a {
        font-size: 1.5rem;
        color: var(--text);
    }

    .lang-switcher {
        position: relative;
        z-index: 1001;
    }

    .hero {
        padding-top: calc(var(--header-h) + 48px);
        padding-bottom: 60px;
    }

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

    .hero-graphic {
        display: none;
    }

    .services,
    .about,
    .contact {
        padding: 64px 0;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 40px;
    }

    .service-card {
        padding: 28px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

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