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

:root {
    /* Colors - Dark Tech Theme */
    --bg-color: #0d1117;
    /* Very dark blue/black */
    --surface-color: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    /* Blue */
    --accent-glow: rgba(88, 166, 255, 0.4);
    --success-color: #238636;
    --border-color: #30363d;

    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-heading);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.text-gradient {
    background: linear-gradient(120deg, var(--accent-color), #bc8cff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
    border: 1px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: #409eff;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    margin-left: 1rem;
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background-color: var(--surface-color);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    /* reduced from 2rem to accommadate subtitle */
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem auto;
    line-height: 1.6;
}

/* Header */
.header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
}

.cursor {
    color: var(--accent-color);
    animation: blink 1s step-end infinite;
}

.nav-list {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Hero */
.hero {
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 6rem;
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
}

/* Background grid effect */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(22, 27, 34, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 27, 34, 0.5) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

/* Terminal Visual */
.terminal-window {
    background-color: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.3s ease;
}

.terminal-window:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.terminal-header {
    background-color: #21262d;
    padding: 10px 15px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background-color: #ff5f56;
}

.dot.yellow {
    background-color: #ffbd2e;
}

.dot.green {
    background-color: #27c93f;
}

.terminal-body {
    padding: 20px;
    color: var(--text-secondary);
}

.terminal-body p {
    margin-bottom: 8px;
}

.prompt {
    color: var(--accent-color);
    margin-right: 8px;
}

.output {
    color: var(--text-primary);
}

.output.success {
    color: var(--success-color);
}

.cursor-blink {
    background-color: var(--text-secondary);
    color: var(--text-secondary);
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Services */
.services {
    padding: 6rem 0;
}

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

.service-card {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.service-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.service-card p {
    color: var(--text-secondary);
}

/* About */
.about {
    padding: 8rem 0;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background-image: radial-gradient(circle at 50% 50%, rgba(88, 166, 255, 0.05) 0%, transparent 50%);
}

.about-card {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(13, 17, 23, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-color), #bc8cff);
}

.about-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.about-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 2px solid var(--accent-color);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
}

.about-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* "Website friendly" styling: Grayscale + Contrast to hide background/lighting issues */
    filter: grayscale(100%) contrast(1.1);
    transition: filter 0.3s ease;
}

.about-avatar:hover img {
    filter: grayscale(0%) contrast(1);
}

.about-identity h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.about-role {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.about-body p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.about-quote {
    margin-top: 2rem;
    padding-left: 1.5rem;
    border-left: 3px solid var(--accent-color);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    font-style: italic;
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.1) 0%, transparent 100%);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

/* Contact */
.contact {
    padding: 8rem 0;
    text-align: center;
}

.contact-card {
    background: linear-gradient(180deg, var(--surface-color) 0%, rgba(22, 27, 34, 0) 100%);
    padding: 4rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.btn.large {
    font-size: 1.25rem;
    padding: 1rem 2.5rem;
    margin-top: 2rem;
}

/* Footer */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .btn-secondary {
        margin-left: 0;
    }

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

    .nav-list {
        display: none;
        /* simple hide for V1 on mobile, or could implement hamburger */
    }

    .terminal-window {
        margin-top: 2rem;
    }
}

/* Technologies Section */
.technologies {
    padding: 6rem 0;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 3rem;
    align-items: center;
    justify-items: center;
    margin-top: 3rem;
    opacity: 0.8;
}

.tech-item {
    text-align: center;
    transition: all 0.3s ease;
}

.tech-item:hover {
    opacity: 1;
    transform: translateY(-5px);
}

.tech-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    /* Fixed height for consistency */
    margin-bottom: 0.8rem;
}

.tech-icon img {
    max-height: 100%;
    width: auto;
    max-width: 60px;
}

.tech-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Update Header Logo */
.header-logo-img {
    height: 48px;
    vertical-align: middle;
}

/* How We Work */
.how-we-work {
    padding: 6rem 0;
}

.work-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.work-step {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
    height: 100%;
}

.work-step:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.work-step h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.work-joke {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: block;
}

.work-step p:not(.work-joke) {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* AI Step Special Styling */
.work-step-ai {
    border-color: rgba(188, 140, 255, 0.3);
    background: linear-gradient(180deg, var(--surface-color) 0%, rgba(188, 140, 255, 0.05) 100%);
}

.work-step-ai:hover {
    border-color: #bc8cff;
    box-shadow: 0 0 20px rgba(188, 140, 255, 0.1);
}

.work-step-ai h3 {
    background: linear-gradient(120deg, #fff, #bc8cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.work-footnote {
    margin-top: 1rem;
    opacity: 0.6;
    font-style: italic;
    font-size: 0.85rem;
}

/* Footer Extras */
.footer-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.footer-info .separator {
    margin: 0 0.5rem;
    color: var(--border-color);
}

/* Mobile Fixes */
@media (max-width: 600px) {
    .btn.large {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 1rem;
        overflow-wrap: break-word;
        height: auto;
    }

    .contact-card {
        padding: 3rem 1.5rem;
    }
}