:root {
    --bg: #0b0d14;
    --bg-alt: #12141f;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-border: rgba(255, 255, 255, 0.08);
    --text: #eef0f7;
    --text-muted: #9a9fb2;
    --accent: #7c5cff;
    --accent-2: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #7c5cff, #22d3ee);
    --radius: 16px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --max-width: 1160px;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: radial-gradient(circle at 20% -10%, #1a1330 0%, var(--bg) 45%);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.container-narrow { max-width: 760px; }

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

h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1.2rem; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    background: rgba(11, 13, 20, 0.7);
    border-bottom: 1px solid var(--surface-border);
}

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

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
}

.site-logo-img {
    display: block;
    height: auto;
    max-height: 44px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 780px) {
    .site-logo-img { max-height: 34px; max-width: 140px; }
}

.site-nav ul {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

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

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

.site-nav a.active::after {
    content: '';
    position: absolute;
    left: 0; bottom: -6px;
    width: 100%; height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

/* Sections */
.section { padding: 88px 0; }
.section:nth-of-type(even) { background: var(--bg-alt); }

/* Any section with an admin-set background photo gets a dark scrim so text
   stays readable regardless of which theme/text-color is active. */
.section.has-bg-image {
    position: relative;
    background-size: cover;
    background-position: center;
    color: #ffffff;
}
.section.has-bg-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.75));
    z-index: 0;
}
.section.has-bg-image > .container { position: relative; z-index: 1; }
.section.has-bg-image h1,
.section.has-bg-image h2,
.section.has-bg-image h3,
.section.has-bg-image p,
.section.has-bg-image .text-body { color: #ffffff; }
.section.has-bg-image .hero-sub { color: rgba(255,255,255,0.85); }

.hero-section {
    padding: 150px 0 130px;
    background-size: cover;
    background-position: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before, .hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}
.hero-section::before {
    width: 420px; height: 420px;
    background: var(--accent);
    top: -140px; left: 8%;
    animation: float-blob 12s ease-in-out infinite;
}
.hero-section::after {
    width: 360px; height: 360px;
    background: var(--accent-2);
    bottom: -160px; right: 10%;
    animation: float-blob 14s ease-in-out infinite reverse;
}
@keyframes float-blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.08); }
}
.hero-inner { position: relative; z-index: 1; }
.hero-sub { color: var(--text-muted); font-size: 1.2rem; max-width: 560px; margin: 16px auto 32px; }
.hero-kicker {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    color: var(--accent-2);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

@media (prefers-reduced-motion: reduce) {
    .hero-section::before, .hero-section::after { animation: none; }
}

.btn {
    display: inline-block;
    padding: 13px 28px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn-primary {
    background: var(--accent-gradient);
    color: #0b0d14;
    box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(124, 92, 255, 0.5); }
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--surface-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* Text block */
.text-body { color: var(--text-muted); max-width: 760px; }

/* Image grid / gallery */
.image-grid, .gallery-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 24px;
}
.gallery-strip { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.image-grid-item img, .gallery-item img {
    width: 100%; height: 220px; object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--surface-border);
}
.image-grid-item figcaption { color: var(--text-muted); font-size: 0.9rem; margin-top: 8px; }

/* Image block — single positioned photo */
.image-block-section .container { display: flex; flex-direction: column; }
.image-block { margin: 0; }
.image-block img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--surface-border);
}
.image-block figcaption { color: var(--text-muted); font-size: 0.9rem; margin-top: 10px; text-align: center; }
.image-block-small { max-width: 320px; }
.image-block-medium { max-width: 560px; }
.image-block-large { max-width: 860px; }
.image-block-full { max-width: 100%; }
.image-block-left { align-self: flex-start; }
.image-block-center { align-self: center; }
.image-block-right { align-self: flex-end; }

/* Code block */
.code-section pre {
    border-radius: var(--radius);
    border: 1px solid var(--surface-border);
    overflow-x: auto;
}

/* Project grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.project-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: rgba(124, 92, 255, 0.4);
}
.project-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.project-card-body { padding: 20px; }
.project-card-body h3 { margin: 0 0 8px; color: var(--text); }
.project-card-body p { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 12px; }

.tech-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.15);
    color: #b9a6ff;
    border: 1px solid rgba(124, 92, 255, 0.3);
}

/* Team */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
    margin-top: 24px;
}
.team-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.team-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--accent); }
.team-photo {
    width: 100px; height: 100px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--surface-border);
}
.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-photo-fallback { font-size: 2.4rem; font-weight: 800; color: #0b0d14; }
.team-card h3 { margin: 0 0 4px; color: var(--text); }
.team-role { color: var(--accent-2); font-size: 0.9rem; font-weight: 600; margin: 0 0 12px; }
.team-bio { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* Testimonials */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.testimonial-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.testimonial-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.testimonial-stars { color: #ffc857; font-size: 1rem; letter-spacing: 2px; }
.testimonial-quote { color: var(--text); font-size: 1.02rem; line-height: 1.7; flex: 1; margin: 0; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.testimonial-author strong { display: block; color: var(--text); font-size: 0.95rem; }
.testimonial-author span { display: block; color: var(--text-muted); font-size: 0.82rem; }

/* Features Grid (Why Us / Process / Values) */
.features-grid-sub { max-width: 640px; margin: -0.6rem 0 1.5rem; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.feature-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--accent); }
.feature-number {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent-2);
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.feature-card h3 { margin: 0 0 10px; color: var(--text); font-size: 1.1rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* Locations */
.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.location-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 24px;
    border-left: 3px solid var(--accent);
}
.location-card h3 { margin: 0 0 10px; color: var(--text); font-size: 1.1rem; }
.location-address { color: var(--text-muted); margin: 0 0 8px; }
.location-card a { color: var(--accent-2); font-weight: 600; }

/* CTA */
.cta-section { text-align: center; }
.cta-inner p { color: var(--text-muted); max-width: 500px; margin: 12px auto 28px; }

/* Contact form */
.contact-form {
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
}
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--text-muted); }
.contact-form input, .contact-form textarea {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Blog */
.post-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 24px; }
.post-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.post-card img { width: 100%; height: 180px; object-fit: cover; }
.post-card-body { padding: 20px; }
.post-card-body h2 { font-size: 1.2rem; color: var(--text); margin: 0 0 6px; }
.post-date { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 10px; }

.post-article .post-cover { width: 100%; border-radius: var(--radius); margin: 20px 0; }
.post-content { color: var(--text-muted); }
.post-content pre { border-radius: var(--radius); overflow-x: auto; }
.post-content img { max-width: 100%; border-radius: 10px; }

.project-links { display: flex; gap: 14px; margin: 24px 0; }

.download-list { margin: 32px 0; }
.download-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    margin-bottom: 10px;
    color: var(--text);
    transition: border-color 0.2s ease;
}
.download-item:hover { border-color: var(--accent); }
.download-size { color: var(--text-muted); font-size: 0.85rem; }

.empty-state { color: var(--text-muted); font-style: italic; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}
.pagination-info { color: var(--text-muted); font-size: 0.9rem; }
.pagination .btn-disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* Footer */
.site-footer {
    padding: 48px 0;
    color: var(--text-muted);
    border-top: 1px solid var(--surface-border);
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { color: var(--text); font-size: 1rem; }
.footer-contact a { color: var(--accent-2); font-weight: 600; }
.footer-copy { width: 100%; text-align: center; margin: 16px 0 0; font-size: 0.85rem; border-top: 1px solid var(--surface-border); padding-top: 16px; }

/* Responsive nav */
@media (max-width: 780px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute;
        top: 72px; left: 0; right: 0;
        background: var(--bg-alt);
        border-bottom: 1px solid var(--surface-border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    .site-nav.open { max-height: 400px; }
    .site-nav ul { flex-direction: column; gap: 0; padding: 12px 24px; }
    .site-nav li { border-bottom: 1px solid var(--surface-border); }
    .site-nav a { display: block; padding: 14px 0; }
    .section { padding: 56px 0; }
    .hero-section { padding: 90px 0; }
}
