/* ─── Theme tokens ─────────────────────────────────────────── */
:root {
  --bg:          #333446;
  --bg-card:     #333446;
  --text:        #EAEFEF;
  --text-sub:    rgba(234,239,239,0.7);
  --accent:      #7886C7;
  --accent2:     #6C5B7B;
  --input-bg:    #EAEFEF;
  --input-color: #333446;
  --btn-bg:      #EAEFEF;
  --border-foot: rgba(234,239,239,0.1);
  --scrollbar-track: #333446;
}

[data-theme="light"] {
  --bg:          #F4F6FB;
  --bg-card:     #FFFFFF;
  --text:        #1e1e2e;
  --text-sub:    rgba(30,30,46,0.65);
  --accent:      #5567c0;
  --accent2:     #8a6fa8;
  --input-bg:    #FFFFFF;
  --input-color: #1e1e2e;
  --btn-bg:      #1e1e2e;
  --border-foot: rgba(30,30,46,0.12);
  --scrollbar-track: #dde2f0;
}

/* ─── Base reset ────────────────────────────────────────────── */
* {
  scroll-behavior: smooth;
  font-family: 'Poppins', 'popins', sans-serif;
  color: var(--text);
}
html, body {
  background-color: var(--bg);
  transition: background-color 0.35s ease, color 0.35s ease;
}
.header{
    position: relative;
    display:flex;
    justify-content: space-between;
    align-items: center;
}
nav ul li {
    list-style: none;
    display: inline-block;
    margin-left: 30px;
   
}
nav ul li a{
   display: flex;
   justify-content: space-between;
  text-decoration: none;
  font-size: 19px;
  transition: 0.3s;
}
.header nav ul li a:hover {
    color: var(--accent);
}
.links{
    margin-right: 10%;
}
.links ul li {
    
    display: inline-block;
    padding-left: 10px;
    list-style: none;
    font-size:large;
}
/*
  section{
    min-height: 100vh;
   display: flex;
    justify-content: center;
    align-items: center;
   
  }
    */
.home {
    text-align: center;
    margin-top: 12%;
    min-height: 100vh;
}
.about{
    min-height: 100vh;
    margin-left: 15%;
    margin-right: 15%;
    padding: 20px 20px;
}
.about .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home h1{
    font-size: 65px;
    
}
.home h1 strong {
    color: var(--accent);
}
.home h2 {
   color: var(--text-sub);
   font-size: 33px;
}
.home p{
    margin-bottom: 10px;
    line-height: 160%;
    font-size: 19px;
}
.about .section2{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  
}
.about .image {
    max-width: 350px;
    width: 100%;
    margin: 0 auto;
    border-radius: 10%;
    background-color: var(--input-bg);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.about-i h1{
margin-left: 16%;
margin-bottom: 10%;
font-size: 36px;
 
}
.about-me{
    font-size: 29x;
    line-height: 115%;
}

.preview-section {
    padding: 60px 15%;
}
.preview-text h1{
    font-size: 36px;
    margin-bottom: 40px;
}
.preview-slider {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 30px;
}
.preview-slider::-webkit-scrollbar {
    height: 10px;
}
.preview-slider::-webkit-scrollbar-thumb {
    background: var(--accent2);
    border-radius: 10px;
}
.preview-slider::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
.preview-item {
    position: relative;
    min-width: 320px;
    height: 220px;
    background: var(--bg-card);
    border-radius: 19px;
    overflow: hidden;
    scroll-snap-align: center;
    transition: transform 0.4s ease, background 0.35s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}
.preview-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.4s ease;
    z-index: 1;
}
.preview-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(33, 15, 55, 0.9), transparent);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    text-align: left;
}

.preview-item:hover {
    transform: translateY(-10px);
}
.preview-item:hover .preview-img {
    opacity: 1;
}
.preview-content h3 {
    font-size: 24px;
    margin-bottom: 5px;
    color: #EAEFEF;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}
.preview-content p {
    font-size: 14px;
    color: #EAEFEF;
    opacity: 0.9;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.project-text h1{
  margin-left: 16%;
margin-bottom: 10%;
font-size: 36px;
}
.services .project-grid{
    margin-left: 10%;
    margin-right: 10%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows:  repeat(auto-fit, minmax(200px, 1fr));
    row-gap: 40px;
    column-gap: 5%;
}
.grid-project1 {
    padding: 8% 5%;
    border: 2px solid var(--accent2);
    border-radius: 19px;
    background-color: var(--bg-card);
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.35s ease;
}
.grid-project1:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
}
.git-folder{
    display: flex;
    justify-content: space-between;
}
/* ─── Achievements ──────────────────────────────────────────── */
.achivements {
    padding: 60px 15%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}
.achivements h1 {
    width: 100%;
    font-size: 36px;
    margin-bottom: 10px;
}
.achiv {
    background: var(--bg-card);
    border: 2px solid var(--accent2);
    border-radius: 19px;
    padding: 20px;
    width: calc(50% - 15px); /* Two columns layout */
    box-sizing: border-box;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.achiv:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
}
.achiv img {
    width: 100%;
    max-width: 450px;
    height: auto;
    border-radius: 11px;
    margin-bottom: 15px;
    object-fit: cover;
}
.achiv p {
    font-size: 16px;
    line-height: 1.5;
}

.contact{
      margin-top: 12%;
    min-height: 100vh;
}
.contact-text{
    margin-left: 16%;
margin-bottom: 10%;
font-size: 25px; 
}
.text-place {
    display: block;
    margin: 0 auto;
    padding: 30px;
    width: 40%;
    background-color: var(--input-bg);
    color: var(--input-color);
    border-radius: 11px;
    font-size: 16px;
    resize: vertical;
    border: 1px solid var(--accent2);
    transition: background-color 0.35s ease, color 0.35s ease;
}
.send button {
    display: block;
    margin: 0 auto;
    margin-top: 5%;
    padding: 12px 20px;
    border-radius: 11px;
    color: var(--bg);
    background-color: var(--btn-bg);
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: 0.5s ease-in-out;
}
.send button:hover {
    background-color: var(--accent);
    color: #fff;
    transform: scale(1.05);
}
/* Style for active menu link */
nav ul li a.active {
  color: var(--accent);
  font-weight: bold;
}

.footer {
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    font-size: 16px;
    letter-spacing: 1px;
    opacity: 0.7;
    border-top: 1px solid var(--border-foot);
    background-color: transparent;
}

/* ─── Theme Toggle Button ───────────────────────────────────── */
#theme-toggle {
    background: transparent;
    border: 2px solid var(--accent2);
    border-radius: 50px;
    cursor: pointer;
    width: 48px;
    height: 28px;
    padding: 0;
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 12px;
    transition: border-color 0.3s ease;
    flex-shrink: 0;
}
#theme-toggle:hover {
    border-color: var(--accent);
}
#theme-toggle .toggle-icon {
    position: absolute;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
    color: #fff;
}
[data-theme="light"] #theme-toggle .toggle-icon {
    transform: translateX(20px);
    background: var(--accent);
}

/* ─── Hamburger button (hidden on desktop) ──────────────────── */
#menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    flex-shrink: 0;
}
#menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
#menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-toggle.open span:nth-child(2) { opacity: 0; }
#menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Tablet (≤ 1024px) ─────────────────────────────────────── */
@media (max-width: 1024px) {
    .home h1  { font-size: 50px; }
    .home h2  { font-size: 26px; }
    .home p   { font-size: 17px; padding: 0 5%; }

    .about { margin-left: 6%; margin-right: 6%; }
    .about-i h1 { margin-left: 0; }

    .preview-section { padding: 60px 6%; }

    .project-text h1 { margin-left: 6%; }
    .services .project-grid { margin-left: 6%; margin-right: 6%; }

    .contact-text { margin-left: 6%; }
    .text-place   { width: 60%; }

    .achivements { padding: 60px 6%; }
}

/* ─── Mobile (≤ 768px) ──────────────────────────────────────── */
@media (max-width: 768px) {

    /* ── Header layout ── */
    .header {
        flex-wrap: wrap;
        align-items: center;
        padding: 12px 20px;
        gap: 0;
        position: relative;
    }

    /* Hamburger visible on mobile */
    #menu-toggle { display: flex; }

    /* Nav collapses off-screen; opens on .nav-open */
    .header nav {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        order: 3;
    }
    .header.nav-open nav { max-height: 300px; }

    nav ul {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 10px 0 14px;
        margin: 0;
    }
    nav ul li { margin-left: 0; }
    nav ul li a { font-size: 16px; padding: 4px 0; }

    /* Push toggle + hamburger to the right */
    #theme-toggle  { margin-left: auto; margin-right: 10px; }
    #menu-toggle   { margin-left: 0; }

    /* Social links: smaller, no right margin */
    .links { margin-right: 0; order: 2; width: 100%; padding: 4px 0 0; }
    .links ul { padding: 0; margin: 0; }
    .links ul li { padding-left: 0; padding-right: 12px; }

    /* ── Home ── */
    .home { margin-top: 28%; padding: 0 20px; }
    .home h1 { font-size: 34px; }
    .home h2 { font-size: 19px; }
    .home p  { font-size: 15px; line-height: 150%; }

    /* ── About ── */
    .about { margin-left: 5%; margin-right: 5%; padding: 20px 10px; }
    .about-i h1 { margin-left: 0; font-size: 28px; margin-bottom: 6%; }
    .about .section2 { grid-template-columns: 1fr; }
    .about .image { max-width: 260px; }

    /* ── Project Preview ── */
    .preview-section { padding: 40px 5%; }
    .preview-text h1 { font-size: 28px; margin-bottom: 20px; }
    .preview-item    { min-width: 260px; height: 190px; }
    .preview-content h3 { font-size: 18px; }
    .preview-content p  { font-size: 12px; }

    /* ── Projects grid: single column ── */
    .project-text h1 { margin-left: 5%; font-size: 28px; margin-bottom: 6%; }
    .services .project-grid {
        grid-template-columns: 1fr;
        margin-left: 5%;
        margin-right: 5%;
        row-gap: 24px;
    }
    .grid-project1 { padding: 6% 5%; }

    /* ── Contact ── */
    .contact { margin-top: 20%; }
    .contact-text { margin-left: 5%; font-size: 20px; margin-bottom: 6%; }
    .text-place   { width: 84%; padding: 20px; font-size: 15px; }
    .send button  { margin-top: 8%; }

    /* ── Footer ── */
    .footer { font-size: 14px; padding: 20px; }

    /* ── Achievements ── */
    .achivements { padding: 40px 5%; }
    .achivements h1 { font-size: 28px; margin-bottom: 20px; }
    .achiv { width: 100%; }
}

/* ─── Very small phones (≤ 420px) ──────────────────────────── */
@media (max-width: 420px) {
    .home h1 { font-size: 28px; }
    .home h2 { font-size: 16px; }
    .preview-item { min-width: 220px; height: 160px; }
    .text-place { width: 92%; }
}
