/* ===========================
   Google Font
=========================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Inter',sans-serif;
    scroll-behavior:smooth;
}

/* ===========================
   Root Variables
=========================== */
:root {
    --primary-color: #38bdf8;
    --secondary-color: #7c3aed;
    --tertiary-color: #06b6d4;
    --bg-dark: #0b1120;
    --bg-darker: #081018;
    --bg-card: #16213d;
    --text-primary: #fff;
    --text-secondary: #b8c2d4;
    --text-muted: #9ca3af;
    --transition: 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
}

body{
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

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

a{
    text-decoration: none;
    transition: var(--transition);
}

section{
    padding: 100px 10%;
    position: relative;
}

/* ===========================
   Navbar
=========================== */

header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background: rgba(11, 17, 32, 0.92);
    backdrop-filter: blur(12px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}

header.navbar-hide {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

header.navbar-show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.navbar {
    max-width: 1300px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 10%;
    gap: 20px;
}

.logo {
    font-size: 30px;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-primary);
    position: relative;
    font-weight: 500;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.btn {
    background: var(--primary-color);
    color: var(--bg-darker);
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}

.btn:hover {
    transform: translateY(-3px);
    background: #0ea5e9;
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 26px;
    border-radius: 8px;
    font-weight: 600;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--bg-darker);
}

.btn-outline:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===========================
   Mobile Menu Toggle
=========================== */

.menu-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-primary);
    background: none;
    border: none;
    padding: 10px;
    transition: color var(--transition);
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    color: var(--primary-color);
}

.menu-toggle:focus {
    outline: 2px solid var(--primary-color);
    border-radius: 4px;
}

.menu-toggle i {
    transition: transform var(--transition);
}

.menu-toggle.active i {
    transform: rotate(90deg);
}

/* ===========================
   Hero
=========================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-text,
.hero-image {
    position: relative;
    z-index: 2;
}

.hero-text {
    flex: 1;
}

.hero-text h3 {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.hero-text h1 {
    font-size: 65px;
    margin: 15px 0;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -2px;
}

.hero-text h2 {
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: 700;
    min-height: 45px;
}

.hero-text p {
    max-width: 600px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-top: 35px;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    width: 380px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid var(--primary-color);
    box-shadow:
        0 0 40px rgba(56, 189, 248, 0.35),
        0 0 80px rgba(56, 189, 248, 0.15);
}

/* ===========================
   About
=========================== */

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

.about-image img {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.about-text h2 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -1px;
}

.about-text p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    gap: 25px;
    margin-top: 35px;
}

.stats div {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    flex: 1;
    border: 1px solid rgba(56, 189, 248, 0.1);
    transition: var(--transition);
}

.stats div:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.stats h3 {
    color: var(--primary-color);
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
}

.stats p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===========================
   Skills
=========================== */

#skills h2,
#services h2,
#projects h2,
#contact h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
}

.skill {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid rgba(56, 189, 248, 0.1);
    cursor: pointer;
}

.skill:hover,
.skill:focus {
    transform: translateY(-8px);
    background: var(--primary-color);
    color: var(--bg-darker);
    border-color: var(--primary-color);
}

.skill:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===========================
   Services
=========================== */

.service-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.card {
    background: var(--bg-card);
    padding: 35px;
    border-radius: 18px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(56, 189, 248, 0.1);
}

.card i {
    font-size: 45px;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: block;
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

/* ===========================
   Projects
=========================== */

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project {
    background: var(--bg-card);
    border-radius: 18px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(56, 189, 248, 0.1);
}

.project img {
    height: 220px;
    width: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project h3 {
    padding: 20px;
    font-weight: 700;
    font-size: 1.1rem;
}

.project:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

.project:hover img {
    transform: scale(1.08);
}

/* ===========================
   Contact
=========================== */

form {
    max-width: 700px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

input,
textarea {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid rgba(56, 189, 248, 0.2);
    padding: 18px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

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

textarea {
    min-height: 180px;
    resize: vertical;
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

/* ===========================
   Footer
=========================== */

footer {
    padding: 50px 10%;
    text-align: center;
    background: var(--bg-darker);
    border-top: 1px solid rgba(56, 189, 248, 0.1);
    color: var(--text-muted);
}

.footer-content {
    max-width: 1300px;
    margin: auto;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* ===========================
   Back to Top Button
=========================== */

.top-button {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: var(--bg-darker);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    transition: var(--transition);
    z-index: 999;
}

.top-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.6);
}

.top-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.top-button.show {
    display: flex;
}

/* ===========================
   Background Circles
=========================== */

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
}

.circle-1 {
    width: 260px;
    height: 260px;
    background: var(--primary-color);
    top: 5%;
    left: -60px;
}

.circle-2 {
    width: 220px;
    height: 220px;
    background: var(--secondary-color);
    bottom: 5%;
    right: 5%;
}

.circle-3 {
    width: 180px;
    height: 180px;
    background: var(--tertiary-color);
    top: 40%;
    left: 45%;
}

/* ===========================
   Prefers Reduced Motion
=========================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
