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

:root {
    --bg:       #090c14;
    --surface:  #111827;
    --border:   #1e2a3a;
    --text:     #f1f5f9;
    --muted:    #6b7a99;
    --accent:   #6366f1;
    --accent2:  #4f9cf9;
    --success:  #4ade80;
    --radius:   12px;
    --nav-h:    64px;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); }
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 0.8rem 1.8rem; font-size: 1rem; }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
    transition: background 0.3s, box-shadow 0.3s;
}
.nav.scrolled {
    background: rgba(9,12,20,.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--border);
}
.nav-logo {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.nav-logo span { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta {
    background: var(--accent);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 7px;
    font-weight: 600;
}
.nav-links .nav-cta:hover { background: #4f46e5; color: #fff; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: var(--nav-h) 2rem 4rem;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 70% 40%, rgba(99,102,241,.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 20% 70%, rgba(79,156,249,.12) 0%, transparent 60%);
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
}
.hero-label {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(99,102,241,.35);
    background: rgba(99,102,241,.08);
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}
.hero-content h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 1.25rem;
}
.dot { color: var(--accent); }
.hero-content p {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 520px;
    margin-bottom: 2rem;
    line-height: 1.7;
}
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.35;
}
.orb1 {
    width: 500px; height: 500px;
    background: var(--accent);
    right: -100px; top: -100px;
}
.orb2 {
    width: 350px; height: 350px;
    background: var(--accent2);
    right: 300px; bottom: -80px;
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
.section { padding: 6rem 0; }
.section-dark { background: var(--surface); }

.section-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 3rem;
}
.section-sub {
    color: var(--muted);
    font-size: 1rem;
    margin-top: -2rem;
    margin-bottom: 3rem;
}

/* ── Services ─────────────────────────────────────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: border-color 0.25s, transform 0.25s;
}
.service-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.service-card.featured {
    border-color: var(--accent);
    background: linear-gradient(145deg, rgba(99,102,241,.08), var(--surface));
}
.service-icon { font-size: 2rem; margin-bottom: 1rem; }
.service-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.6rem; }
.service-card p  { font-size: 0.9rem; color: var(--muted); line-height: 1.65; margin-bottom: 1.25rem; }

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
}
.service-tags li {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    background: rgba(99,102,241,.1);
    border: 1px solid rgba(99,102,241,.25);
    border-radius: 5px;
    color: var(--accent2);
}

/* ── Skills ───────────────────────────────────────────────────────────────── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}
.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s, transform 0.2s;
}
.skill-item:hover { border-color: var(--accent); transform: translateY(-3px); }
.skill-icon { font-size: 1.6rem; }

/* ── Portfolio ────────────────────────────────────────────────────────────── */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.portfolio-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.25s, transform 0.25s;
}
.portfolio-card:hover { border-color: var(--accent2); transform: translateY(-4px); }
.portfolio-card.cta-card { border-color: rgba(99,102,241,.4); }
.portfolio-meta {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent2);
}
.portfolio-card h3 { font-size: 1.1rem; font-weight: 700; }
.portfolio-card p  { font-size: 0.88rem; color: var(--muted); line-height: 1.65; flex: 1; }
.portfolio-actions { margin-top: 0.75rem; }

/* ── Hosting CTA ──────────────────────────────────────────────────────────── */
.hosting-cta {
    background: linear-gradient(135deg, rgba(99,102,241,.12) 0%, rgba(79,156,249,.08) 100%);
    border-top: 1px solid rgba(99,102,241,.2);
    border-bottom: 1px solid rgba(99,102,241,.2);
}
.hosting-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.hosting-cta-text h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin-bottom: 0.6rem;
}
.hosting-cta-text p { font-size: 0.95rem; color: var(--muted); max-width: 500px; }
.hosting-cta-text strong { color: var(--text); }
.hosting-cta-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Contact ──────────────────────────────────────────────────────────────── */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: border-color 0.25s, transform 0.25s;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.contact-icon { font-size: 2rem; }
.contact-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.contact-value { font-size: 0.9rem; font-weight: 600; color: var(--accent2); word-break: break-all; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-logo { font-size: 1.1rem; font-weight: 800; }
.footer-logo span { color: var(--accent); }
.footer-copy { font-size: 0.82rem; color: var(--muted); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.85rem; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* ── Scroll reveal animations ─────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.6s cubic-bezier(.22,1,.36,1), transform 0.6s cubic-bezier(.22,1,.36,1);
}
.reveal.visible { opacity: 1; transform: none; }

/* stagger delays for grid children */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }

/* hero entrance */
.hero-label  { animation: fadeUp 0.7s cubic-bezier(.22,1,.36,1) both; }
.hero-content h1 { animation: fadeUp 0.7s 0.1s cubic-bezier(.22,1,.36,1) both; }
.hero-content p  { animation: fadeUp 0.7s 0.2s cubic-bezier(.22,1,.36,1) both; }
.hero-btns       { animation: fadeUp 0.7s 0.3s cubic-bezier(.22,1,.36,1) both; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: none; }
}

/* floating orbs */
.orb1 { animation: float 8s ease-in-out infinite; }
.orb2 { animation: float 6s 2s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-30px) scale(1.05); }
}

/* hero gradient shift */
.hero-bg {
    animation: gradShift 10s ease-in-out infinite alternate;
}
@keyframes gradShift {
    0%   { opacity: 1; }
    100% { opacity: 0.6; filter: hue-rotate(20deg); }
}

/* section label pop */
.section-label {
    animation: none;
}
.section .section-label {
    display: inline-block;
}

/* skill item hover pulse */
.skill-item:hover .skill-icon {
    animation: pop 0.3s cubic-bezier(.22,1,.36,1);
}
@keyframes pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* card border glow on hover */
.service-card, .portfolio-card, .contact-card {
    position: relative;
}
.service-card::after, .portfolio-card::after, .contact-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: calc(var(--radius) + 1px);
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}
.service-card:hover::after, .portfolio-card:hover::after, .contact-card:hover::after {
    opacity: 0.5;
}

/* active nav link indicator on scroll (via JS class) */
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
    content: '';
    display: block;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 2px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .services-grid  { grid-template-columns: 1fr; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .contact-grid   { grid-template-columns: 1fr; }
    .hosting-cta-inner { flex-direction: column; align-items: flex-start; }
    .orb1 { width: 300px; height: 300px; }
    .orb2 { display: none; }
}

@media (max-width: 700px) {
    .nav { padding: 0 1rem; }
    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-h);
        left: 0; right: 0;
        background: rgba(9,12,20,.97);
        backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 1rem 0 2rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.9rem 2rem; width: 100%; text-align: center; font-size: 1rem; }
    .nav-links .nav-cta { margin: 0.5rem auto 0; border-radius: 7px; max-width: 200px; }
    .nav-toggle { display: flex; }

    .hero { padding: var(--nav-h) 1.25rem 3rem; min-height: 100svh; }
    .hero-content h1 { font-size: 2.2rem; letter-spacing: -1px; }
    .hero-content p { font-size: 1rem; }
    .hero-btns { flex-direction: column; }
    .hero-btns .btn { width: 100%; justify-content: center; }

    .section { padding: 4rem 0; }
    .section-title { margin-bottom: 2rem; }

    .skills-grid { grid-template-columns: repeat(3, 1fr); }

    .hosting-cta-actions { width: 100%; }
    .hosting-cta-actions .btn { flex: 1; justify-content: center; }

    .footer-inner { flex-direction: column; align-items: center; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (max-width: 400px) {
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
}
