/* ========================================
   Greyline Technologies — Stylesheet
   ======================================== */

/* --- Variables --- */
:root {
    --bg-dark: #0a0a0f;
    --bg-section: #0e0e14;
    --bg-card: #14141e;
    --bg-card-hover: #1a1a28;
    --border: #1e1e2e;
    --border-light: #2a2a3e;
    --text-primary: #e8e8ef;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent: #00d4ff;
    --accent-dim: #00a8cc;
    --accent-glow: rgba(0, 212, 255, 0.15);
    --accent-glow-strong: rgba(0, 212, 255, 0.3);
    --white: #ffffff;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

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

/* --- Typography --- */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: 1.25rem; }

.section-tag {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}

.section-title {
    margin-bottom: 16px;
}

.section-sub {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 48px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-main);
}

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

.btn-primary:hover {
    background: var(--accent-dim);
    box-shadow: 0 0 30px var(--accent-glow-strong);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-full {
    width: 100%;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo-grey { color: var(--text-primary); }
.logo-line { color: var(--accent); }

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

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

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

.btn-nav {
    padding: 10px 24px !important;
    background: var(--accent) !important;
    color: var(--bg-dark) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
}

.btn-nav:hover {
    background: var(--accent-dim) !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 70%);
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-tag {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 20px;
}

.hero h1 {
    margin-bottom: 24px;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 620px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 64px;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-suffix {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-divider {
    width: 1px;
    height: 48px;
    background: var(--border-light);
}

/* --- Services --- */
.services {
    padding: 120px 0;
    background: var(--bg-section);
}

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

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

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: var(--accent);
}

.service-icon svg {
    width: 24px;
    height: 24px;
}

.service-card h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* --- Portfolio --- */
.portfolio {
    padding: 120px 0;
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-main);
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    color: var(--bg-dark);
    border-color: var(--accent);
}

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

.portfolio-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.portfolio-card.hidden {
    display: none;
}

.portfolio-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.portfolio-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-image-real {
    background: var(--bg-dark);
}

.portfolio-image-real img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.portfolio-placeholder {
    width: 56px;
    height: 56px;
    color: rgba(255, 255, 255, 0.25);
}

.portfolio-placeholder svg {
    width: 100%;
    height: 100%;
}

.portfolio-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
}

.portfolio-category-tag {
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.portfolio-info {
    padding: 24px;
}

.portfolio-info h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.portfolio-info p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 16px;
}

.portfolio-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.portfolio-tech span {
    padding: 4px 10px;
    background: var(--accent-glow);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.02em;
}

/* --- About --- */
.about {
    padding: 120px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.feature-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Terminal --- */
.terminal {
    background: #0d0d14;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: #111118;
    border-bottom: 1px solid var(--border);
}

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

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
    margin-left: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.terminal-body {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
}

.terminal-line {
    opacity: 0;
    animation: terminalFadeIn 0.3s forwards;
}

.terminal-line:nth-child(1) { animation-delay: 0.3s; }
.terminal-line:nth-child(2) { animation-delay: 0.8s; }
.terminal-line:nth-child(3) { animation-delay: 1.3s; }
.terminal-line:nth-child(4) { animation-delay: 1.8s; }
.terminal-line:nth-child(5) { animation-delay: 2.5s; }
.terminal-line:nth-child(6) { animation-delay: 3.0s; }
.terminal-line:nth-child(7) { animation-delay: 3.5s; }
.terminal-line:nth-child(8) { animation-delay: 4.0s; }
.terminal-line:nth-child(9) { animation-delay: 4.5s; }
.terminal-line:nth-child(10) { animation-delay: 5.2s; }

@keyframes terminalFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text-primary); }
.t-arg { color: #a78bfa; }
.t-output { color: var(--text-muted); }
.t-success { color: #34d399; }

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Process --- */
.process {
    padding: 120px 0;
    background: var(--bg-section);
}

.process-grid {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.process-step {
    flex: 1;
    text-align: center;
    padding: 0 20px;
}

.step-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    opacity: 0.2;
    line-height: 1;
    margin-bottom: 20px;
}

.process-step h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.process-step p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

.process-connector {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--border), var(--accent), var(--border));
    margin-top: 28px;
    flex-shrink: 0;
    opacity: 0.4;
}

/* --- Contact --- */
.contact {
    padding: 120px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.contact-item svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
}

.contact-item a {
    transition: var(--transition);
}

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

/* --- Form --- */
.contact-form-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-main);
    transition: var(--transition);
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-success {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.form-success.show {
    display: block;
}

.form-success h3 {
    color: #34d399;
    margin-bottom: 8px;
}

.form-success p {
    color: var(--text-secondary);
}

/* --- Footer --- */
.footer {
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    padding: 64px 0 0;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 16px;
    line-height: 1.6;
}

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

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

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

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

.footer-bottom {
    padding: 24px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* --- Scroll Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

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

    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .process-grid {
        flex-wrap: wrap;
        justify-content: center;
    }

    .process-step {
        flex: 0 0 calc(50% - 20px);
        margin-bottom: 40px;
    }

    .process-connector {
        display: none;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: var(--bg-card);
        border-left: 1px solid var(--border);
        padding: 80px 32px 32px;
        gap: 24px;
        transition: right 0.3s ease;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: 1rem;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

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

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-image {
        height: 180px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-divider {
        display: none;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .process-step {
        flex: 0 0 100%;
    }

    .footer-top {
        flex-direction: column;
        gap: 40px;
    }

    .footer-links {
        gap: 40px;
    }

    h1 { font-size: clamp(2rem, 7vw, 3rem); }
}
