/* ==========================================================================
   1. CSS VARIABLES & THEME SYSTEM
   ========================================================================== */
:root {
    --color-bg-main: #0a0a0c;
    --color-bg-secondary: #121216;
    --color-bg-card: #17171e;
    --color-accent: #0066ff;
    --color-accent-hover: #0052cc;
    --color-text-main: #ffffff;
    --color-text-muted: #94a3b8;
    --color-border: #27273a;
    --radius-main: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   3. TYPOGRAPHY & SECTIONS
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.25rem; }

.section-header {
    margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.section-subtitle {
    display: block;
    color: var(--color-accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.section-title {
    color: var(--color-text-main);
}

/* ==========================================================================
   4. COMPONENTS (Buttons, Cards, Forms)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-main);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn--primary {
    background-color: var(--color-accent);
    color: #ffffff;
}

.btn--primary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn--secondary {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text-main);
}

.btn--secondary:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--color-text-muted);
}

/* Card base structure */
.card, .compact-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-main);
    padding: 32px;
    transition: var(--transition-smooth);
}

.card:hover, .compact-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 102, 255, 0.4);
}

/* ==========================================================================
   5. HEADER & NAVIGATION
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition-smooth);
}

.header.scrolled {
    background-color: rgba(10, 10, 12, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;
}

.logo__text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: -0.03em;
}

.logo__dot {
    color: var(--color-accent);
}

.nav {
    display: none; /* Mobile first logic */
}

.nav__list {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 24px;
}

.nav__link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav__link:hover, .nav__link.active {
    color: var(--color-text-main);
}

.burger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-text-main);
    transition: var(--transition-smooth);
}

.burger-btn--active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger-btn--active span:nth-child(2) { opacity: 0; }
.burger-btn--active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.header__cta {
    display: none;
}

/* ==========================================================================
   6. SECTIONS LAYOUTS & STYLES
   ========================================================================== */
section {
    padding: clamp(4rem, 10vw, 7.5rem) 0;
}

/* Hero Section */
.hero {
    padding-top: 140px;
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at top right, rgba(0, 102, 255, 0.05), transparent 45%);
}

.hero__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
}

.hero__badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0, 102, 255, 0.1);
    border: 1px solid rgba(0, 102, 255, 0.2);
    color: var(--color-accent);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.hero__description {
    color: var(--color-text-muted);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    margin-top: 24px;
    margin-bottom: 40px;
    max-width: 580px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.hero__visual {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
}

.digital-composition {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-main);
    overflow: hidden;
}

.comp-card {
    position: absolute;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-main);
    padding: 16px;
}

.comp-card--1 {
    top: 20%;
    left: 15%;
    width: 45%;
}

.comp-card__header {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.comp-card__header .dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-border);
    border-radius: 50%;
}

.comp-card__line {
    height: 4px;
    background-color: var(--color-border);
    margin-bottom: 8px;
    border-radius: 2px;
}

.comp-card--2 {
    bottom: 25%;
    right: 15%;
    width: 40%;
    border-left: 3px solid var(--color-accent);
}

.comp-card__metrics {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.comp-card__bar {
    height: 6px;
    background-color: var(--color-accent);
    width: 75%;
    border-radius: 3px;
}

.comp-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* About Section */
.about { background-color: var(--color-bg-secondary); }
.about__grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
.about__text p { color: var(--color-text-muted); font-size: 1.1rem; margin-bottom: 24px; }
.about__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.stat-card {
    background-color: var(--color-bg-main);
    border: 1px solid var(--color-border);
    padding: 24px;
    border-radius: var(--radius-main);
}

.stat-card__num { font-size: 2rem; font-weight: 700; color: var(--color-accent); margin-bottom: 8px; }
.stat-card__txt { font-size: 0.9rem; color: var(--color-text-muted); }

/* Services Section */
.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
}

.card__icon {
    color: var(--color-accent);
    margin-bottom: 24px;
}

.card__title {
    margin-bottom: 12px;
}

.card__desc {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Why Choose Us Section */
.why-us { background-color: var(--color-bg-secondary); }
.why-us__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}
.why-us__grid h4 { margin-bottom: 12px; }
.why-us__grid p { color: var(--color-text-muted); font-size: 0.95rem; }

/* Process Section */
.process__list { display: flex; flex-direction: column; gap: 32px; position: relative; }
.process__step { display: flex; gap: 32px; align-items: flex-start; }
.process__num { font-size: 1.8rem; font-weight: 800; color: var(--color-border); line-height: 1; }
.process__content h3 { margin-bottom: 8px; }
.process__content p { color: var(--color-text-muted); max-width: 680px; }

/* Projects Section & Dynamic Visual Mockups */
.projects { background-color: var(--color-bg-secondary); }
.projects__grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.project-card { display: flex; flex-direction: column; background-color: var(--color-bg-card); border: 1px solid var(--color-border); border-radius: var(--radius-main); overflow: hidden; }
.project-card__img-wrapper { width: 100%; aspect-ratio: 16/10; position: relative; }

.project-visual-engine {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Abstract Tech Gradients for Cases */
.bg-gradient-blue { background: radial-gradient(circle at 50% 50%, #111a2e 0%, #08080c 100%); }
.bg-gradient-green { background: radial-gradient(circle at 50% 50%, #0f2419 0%, #08080c 100%); }
.bg-gradient-red { background: radial-gradient(circle at 50% 50%, #261217 0%, #08080c 100%); }
.bg-gradient-purple { background: radial-gradient(circle at 50% 50%, #1f112d 0%, #08080c 100%); }
.bg-gradient-slate { background: radial-gradient(circle at 50% 50%, #1e2530 0%, #08080c 100%); }
.bg-gradient-dark { background: radial-gradient(circle at 50% 50%, #141419 0%, #08080c 100%); }

/* SVG and HTML Tech nodes mimicking custom UI components */
.visual-node-net { position: absolute; inset: 0; width: 100%; height: 100%; }
.visual-node-net svg { width: 100%; height: 100%; }
.node-dot { position: absolute; width: 6px; height: 6px; background-color: var(--color-accent); border-radius: 50%; box-shadow: 0 0 12px var(--color-accent); }

.visual-grid-ui { display: flex; flex-direction: column; gap: 10px; width: 60%; }
.grid-line-bar { height: 6px; background: rgba(255, 255, 255, 0.05); border-radius: 3px; position: relative; overflow: hidden; }
.grid-line-bar::after { content: ''; position: absolute; top:0; left:0; height:100%; width: 40%; background: var(--color-accent); opacity: 0.6; }

.visual-chart-bars { display: flex; align-items: flex-end; gap: 12px; height: 40%; }
.chart-column { width: 16px; background: rgba(255,255,255,0.04); border-radius: 4px 4px 0 0; position: relative; }
.chart-column::after { content:''; position: absolute; bottom:0; left:0; width:100%; height: 50%; background: var(--color-accent); border-radius: inherit; opacity: 0.7; }

.project-card__img-tag { position: absolute; bottom: 16px; left: 16px; color: rgba(255, 255, 255, 0.35); font-size: 0.75rem; font-family: monospace; letter-spacing: 0.05em; border: 1px solid rgba(255, 255, 255, 0.08); padding: 6px 12px; border-radius: 4px; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); }
.project-card__body { padding: 32px; display: flex; flex-direction: column; flex-grow: 1; }
.project-card__meta { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: var(--color-accent); margin-bottom: 8px; letter-spacing: 0.05em; }
.project-card__title { margin-bottom: 12px; }
.project-card__desc { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 24px; line-height: 1.6; }
.project-card__tech { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.project-card__tech span { background-color: var(--color-bg-main); border: 1px solid var(--color-border); font-size: 0.8rem; padding: 4px 12px; border-radius: 4px; color: var(--color-text-muted); }

/* Technologies Section */
.technologies__wrapper { display: grid; grid-template-columns: 1fr; gap: 40px; }
.tech-group h3 { font-size: 1.1rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; }
.tech-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tech-item { background-color: var(--color-bg-secondary); border: 1px solid var(--color-border); padding: 18px; border-radius: var(--radius-main); text-align: center; transition: var(--transition-smooth); }
.tech-item:hover { border-color: var(--color-accent); transform: scale(1.02); }
.tech-item span { font-size: 1.05rem; font-weight: 600; }

/* Education Section */
.education { background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-main) 100%); }
.education__card { background-color: var(--color-bg-card); border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent); padding: clamp(2rem, 5vw, 4rem); border-radius: var(--radius-main); display: flex; flex-direction: column; gap: 32px; justify-content: space-between; align-items: flex-start; }
.education__badge { display: inline-block; background-color: rgba(0, 102, 255, 0.1); color: var(--color-accent); font-size: 0.8rem; font-weight: 600; padding: 6px 14px; border-radius: 50px; margin-bottom: 16px; text-transform: uppercase; }
.education__content h3 { margin-bottom: 12px; }
.education__content p { color: var(--color-text-muted); font-size: 1.05rem; max-width: 780px; }

/* Contact Section */
.contact { background-color: var(--color-bg-secondary); }
.contact__container { display: grid; grid-template-columns: 1fr; gap: 56px; }
.contact__text { color: var(--color-text-muted); font-size: 1.1rem; margin-bottom: 32px; }
.contact__details { display: flex; flex-direction: column; gap: 16px; }
.contact__link { color: var(--color-text-main); text-decoration: none; font-size: 1.1rem; font-weight: 500; transition: var(--transition-smooth); width: max-content; }
.contact__link:hover { color: var(--color-accent); }

/* Form Elements */
.form { display: flex; flex-direction: column; gap: 20px; }
.form__group { display: flex; flex-direction: column; gap: 8px; position: relative; }
.form__label { font-size: 0.85rem; font-weight: 500; color: var(--color-text-muted); }
.form__input { background-color: var(--color-bg-main); border: 1px solid var(--color-border); color: var(--color-text-main); padding: 14px 16px; border-radius: var(--radius-main); font-family: inherit; width: 100%; transition: var(--transition-smooth); font-size: 1rem; }
.form__input:focus { outline: none; border-color: var(--color-accent); }
.form__input--textarea { resize: vertical; min-height: 120px; }
.form__error { color: #ff4a4a; font-size: 0.8rem; margin-top: 4px; display: none; }
.form__input--invalid { border-color: #ff4a4a; }
.form__submit { margin-top: 12px; width: 100%; }
.form__success-msg { background-color: rgba(0, 200, 100, 0.1); border: 1px solid #00c864; color: #00c864; padding: 16px; border-radius: var(--radius-main); text-align: center; display: none; margin-top: 16px; }

/* Footer Section */
.footer { background-color: var(--color-bg-main); border-top: 1px solid var(--color-border); padding: 48px 0; }
.footer__container { display: grid; grid-template-columns: 1fr; gap: 32px; }
.footer__brand p { color: var(--color-text-muted); font-size: 0.95rem; margin-top: 12px; max-width: 320px; }
.footer__nav { list-style: none; display: flex; flex-wrap: wrap; gap: 20px 32px; }
.footer__nav a { color: var(--color-text-muted); text-decoration: none; font-size: 0.95rem; transition: var(--transition-smooth); }
.footer__nav a:hover { color: var(--color-text-main); }
.footer__copy { color: var(--color-text-muted); font-size: 0.85rem; border-top: 1px solid var(--color-border); padding-top: 24px; }

/* ==========================================================================
   7. ANIMATIONS (Scroll triggered)
   ========================================================================== */
.animate-hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   8. RESPONSIVE MEDIA QUERIES (Laptop & Desktop adaptation)
   ========================================================================== */
@media (min-width: 768px) {
    .nav { display: block; }
    .nav__list { flex-direction: row; gap: 32px; }
    .burger-btn { display: none; }
    .header__cta { display: inline-flex; }
    .tech-grid { grid-template-columns: repeat(4, 1fr); }
    .contact__container { grid-template-columns: 1fr 1fr; gap: 48px; }
    .form__submit { width: max-content; }
}

@media (min-width: 1024px) {
    .hero__container { grid-template-columns: 1.2fr 0.8fr; gap: 64px; }
    .about__grid { grid-template-columns: 1.2fr 0.8fr; gap: 64px; }
    .about__stats { grid-template-columns: 1fr 1fr; }
    .projects__grid { grid-template-columns: repeat(2, 1fr); gap: 40px; }
    .project-card { flex-direction: column; }
    .technologies__wrapper { grid-template-columns: repeat(2, 1fr); }
    .education__card { flex-direction: row; align-items: center; }
    .footer__container { grid-template-columns: 2fr 1fr; }
    .footer__copy { grid-column: span 2; }
}