/* --- Variables & Reset --- */
:root {
    --primary: #D90429;      
    --primary-dark: #8d0018;
    --dark: #0f0f11;         
    --dark-accent: #1a1a1e;
    --light: #f4f4f9;
    --text-muted: #888899;
    --font-head: 'Chakra Petch', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- Components --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Buttons with sharp tech aesthetic */
.btn {
    display: inline-block;
    padding: 12px 32px;
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Angled button shape */
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline {
    border-color: var(--dark);
    color: var(--dark);
}

.btn-outline:hover {
    background-color: var(--dark);
    color: white;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin-top: 5px;
}
.text-center { text-align: center; }
.text-center .section-title::after { margin: 5px auto 0; }
.section-title.white { color: white; }

/* --- Navbar (Fixed Alignment) --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-wrapper { display: block; line-height: 0; }
.brand-logo {
    height: 55px; /* Fixed height for consistency */
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
}

.nav-links a:hover { color: var(--primary); }

.btn-nav {
    background: var(--dark);
    color: white !important;
    padding: 10px 24px;
    /* Clip path button shape for nav button */
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background-color: #ffffff;
    overflow: hidden;
}

/* Accent Background shape */
.hero-bg-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: var(--dark);
    clip-path: polygon(30% 0%, 100% 0, 100% 100%, 0% 100%);
    z-index: 1;
    animation: pulse-bg 8s infinite alternate;
}

@keyframes pulse-bg {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.05); opacity: 0.8; }
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero h1 {
    font-size: 4.5rem;
    line-height: 1;
    color: var(--dark);
    margin-bottom: 1.5rem;
    max-width: 650px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
}

/* Angle Bottom style */
.angle-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--light); 
    clip-path: polygon(0 100%, 100% 100%, 100% 0);
    z-index: 5;
}

/* --- Glitch Effect --- */
.glitch { position: relative; color: var(--dark); }
.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white; 
}
.glitch::before {
    left: 2px; text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}
.glitch::after {
    left: -2px; text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
    0% { clip: rect(14px, 9999px, 86px, 0); }
    20% { clip: rect(66px, 9999px, 15px, 0); }
    40% { clip: rect(28px, 9999px, 83px, 0); }
    60% { clip: rect(5px, 9999px, 100px, 0); }
    80% { clip: rect(78px, 9999px, 22px, 0); }
    100% { clip: rect(44px, 9999px, 60px, 0); }
}

/* --- About Section --- */
.section { padding: 6rem 0; position: relative; }

.split-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.stats-grid {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item h3 { font-size: 3rem; color: var(--primary); margin-bottom: 0; line-height: 1; }
.stat-item span { font-size: 0.9rem; text-transform: uppercase; font-weight: 600; }

.visual-block { position: relative; height: 350px; }
.abstract-box {
    width: 100%; height: 100%;
    background: var(--dark);
    clip-path: polygon(0 0, 100% 0, 100% 80%, 80% 100%, 0 100%);
    position: relative;
}
.box-inner {
    position: absolute;
    top: 20px; left: 20px; right: 20px; bottom: 20px;
    border: 2px solid var(--primary);
    opacity: 0.5;
}

/* --- Services (Dark Mode) --- */
.dark-mode { background-color: var(--dark); color: white; }
.dark-mode .section-title { color: white; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--dark-accent);
    padding: 2.5rem;
    border-left: 3px solid var(--primary);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-10px);
    background: #222226;
    border-left-width: 6px;
    box-shadow: 0 10px 30px rgba(217, 4, 41, 0.15);
}

.service-card i { font-size: 2.5rem; color: var(--primary); margin-bottom: 1.5rem; }
.service-card h3 { font-size: 1.3rem; margin-bottom: 1rem; }
.service-card p { color: #aaa; font-size: 0.95rem; }

/* --- Portfolio Section (NEW) --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 250px 250px; /* Two rows for the right side stack */
    gap: 1.5rem;
    margin-top: 2rem;
}

.portfolio-card {
    position: relative;
    overflow: hidden;
    /* Angled corners to match theme */
    clip-path: polygon(0 0, 100% 0, 100% 85%, 90% 100%, 0 100%);
    background: var(--dark-accent);
    cursor: pointer;
}

.main-project {
    grid-row: 1 / -1; /* Spans both rows */
    /* Slightly distinct shape for the main item */
    clip-path: polygon(0 0, 100% 0, 100% 90%, 85% 100%, 0 100%);
}

.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.portfolio-card:hover img {
    transform: scale(1.1);
}

/* Portfolio Overlay */
.overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(15, 15, 17, 0.95), rgba(15, 15, 17, 0.1));
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-card:hover .overlay { opacity: 1; }

.overlay-text {
    transform: translateY(20px);
    transition: transform 0.4s ease;
    color: white;
}

.portfolio-card:hover .overlay-text { transform: translateY(0); }

.overlay-text .category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

.overlay-text h3 { font-size: 1.4rem; margin-bottom: 5px; }
.overlay-text p { font-size: 0.9rem; color: #ccc; }


/* --- Careers --- */
.career-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.career-card {
    background: white;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.career-card.featured { border: 2px solid var(--primary); }
.career-card .badge {
    position: absolute; top: 0; right: 0;
    background: var(--primary); color: white;
    padding: 5px 15px; font-size: 0.8rem; font-weight: bold;
}

.req-list { margin: 1.5rem 0; }
.req-list li { margin-bottom: 0.5rem; display: flex; align-items: center; gap: 10px; }
.req-list i { color: var(--primary); font-size: 0.8rem; }
.full-width { width: 100%; text-align: center; margin-top: auto; }
.desc-short { margin-bottom: 2rem; color: var(--text-muted); }

/* --- Contact & Footer --- */
.footer-section {
    background: var(--dark);
    color: white;
    position: relative;
    padding-top: 5rem;
    padding-bottom: 2rem;
    margin-top: 4rem;
}

.footer-divider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--light);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    z-index: 1;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

.info-item { display: flex; gap: 1.5rem; margin-bottom: 2rem; }
.info-item i { font-size: 1.5rem; color: var(--primary); margin-top: 5px; }

.contact-form {
    background: var(--dark-accent);
    padding: 2.5rem;
    border: 1px solid #333;
}

.form-group { margin-bottom: 1.5rem; }
input, select, textarea {
    width: 100%; padding: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid #444;
    color: white;
    font-family: var(--font-body);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(255,255,255,0.1);
}

.footer-bottom {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #222;
    color: #666;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}
.footer-bottom a { color: var(--primary); }

/* --- Mobile Responsiveness --- */
.burger { display: none; cursor: pointer; }

@media (max-width: 968px) {
    .hero h1 { font-size: 3.5rem; }
    .hero-bg-accent { width: 40%; }
}

@media (max-width: 768px) {
    /* Nav */
    .nav-links {
        position: absolute;
        right: 0px;
        top: 70px;
        background: white;
        flex-direction: column;
        width: 100%;
        padding: 2rem;
        transform: translateX(100%);
        transition: 0.4s ease-in-out;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }
    .nav-links.nav-active { transform: translateX(0%); }
    .burger { display: block; }
    .burger div { width: 25px; height: 3px; background: var(--dark); margin: 5px; transition: 0.3s; }
    
    /* Hero */
    .hero { height: auto; padding: 8rem 0 6rem; text-align: center; }
    .hero-bg-accent { width: 100%; height: 50%; top: auto; bottom: 0; opacity: 0.05; clip-path: none; }
    .hero h1 { font-size: 2.8rem; margin: 0 auto 1.5rem; }
    .hero p { margin: 0 auto 2rem; }
    
    /* Layouts */
    .split-layout, .career-wrapper, .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
    .visual-block { display: none; }
    .stats-grid { justify-content: center; }
    
    /* Portfolio Stack for Mobile */
    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .main-project { grid-row: auto; height: 300px; }
    .portfolio-card { height: 250px; }
    
    /* Footer */
    .footer-divider { height: 50px; }
}

/* --- Animation Classes --- */
.reveal-left, .reveal-right, .reveal-up, .fade-in {
    opacity: 0;
    transition: all 0.8s ease-out;
}
.reveal-left { transform: translateX(-30px); }
.reveal-right { transform: translateX(30px); }
.reveal-up { transform: translateY(30px); }

/* Active States */
.active { opacity: 1; transform: translate(0, 0); }
.fade-in { animation: fadeIn 1.2s forwards; }
.delay-1 { animation-delay: 0.4s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}