:root{
  --bg: #ffffff;
  --card: #f7f7fb;
  --muted: #6b7280;
  --accent: #0ea5a4;
  --text: #0f172a;

  /* helpers */
  --border: rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 6px 18px rgba(12,34,64,0.04);
  --transition: .25s ease-in-out;
}

[data-theme="dark"]{
  --bg: #071023;
  --card: #081428;
  --muted: #9aa4b2;
  --accent: #38bdf8;
  --text: #e6eef8;

  /* dark helpers */
  --border: rgba(255,255,255,0.07);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 6px 18px rgba(0,0,0,0.55);
}

/* ---------- Reset / Base ---------- */
*{box-sizing:border-box}

html,body{
  height:100%;
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui;
   -webkit-font-smoothing:antialiased;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  transition: background .3s ease, color .25s ease;
}

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

/* ---------- Header ---------- */
header{
  position:sticky;
  top:0;
  z-index:40;
  background:linear-gradient(180deg,rgba(255,255,255,0.5),transparent);
  backdrop-filter: blur(6px);
  transition: background .25s ease;
}

header .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0.75rem 1rem
}

.brand{
  display:flex;
  gap:0.75rem;
  align-items:center;
  text-decoration:none;
  color:inherit
}

.brand .dot{
  width:44px;
  height:44px;
  border-radius:10px;
  overflow:hidden;
  border:1px solid var(--border)
}

.brand .dot img{
  width:100%;
  object-fit:cover;
  display:block
}

/* ---------- Nav ---------- */
nav ul{
  display:flex;
  gap:.8rem;
  list-style:none;
  margin:0;
  padding:0;
  align-items:center
}

nav a{
  text-decoration:none;
  color:var(--muted);
  padding:.45rem .65rem;
  border-radius:8px;
  transition: all var(--transition);
  font-size:14px;
  font-weight:600;
}
nav a:hover{
  color:var(--text);
  background: rgba(255,255,255,0.04);
  transform: translateY(-2px);
}
[data-theme="dark"] nav a:hover{ 
  background: rgba(255,255,255,0.08); 
}

nav a.active{
  color:var(--accent);
  font-weight:700
}

/* ---------- Actions & Buttons ---------- */
.nav-actions{
  display:flex;
  gap:.6rem;
  align-items:center
}

.btn{
  display:inline-flex;
  gap:.5rem;
  align-items:center;
  text-decoration:none;
  padding:.45rem .8rem;
  border-radius:10px;
  border:0;
  cursor:pointer;
  background:var(--accent);color:white;
  box-shadow:var(--shadow-sm);
  font-weight:700;
  transition:transform var(--transition),box-shadow var(--transition);
}

.btn.secondary{
  background:transparent;
  color:var(--text);
  border:1px solid var(--border);
  font-weight:600
}

.btn:active{
  transform:translateY(1px)
}

.icon{
  width:18px;
  height:18px;
  display:inline-block
}

a:hover,button:hover{
  opacity:0.9;
  cursor:pointer;
  transition:0.15s ease
}


/* ---------- Hero ---------- */
.hero{
  display:grid;
  grid-template-columns:1fr;
  gap:1.2rem;
  align-items:center;
  padding:3rem 0
}

.hero-grid{
  display:grid;
  gap:1rem
}

.headline{
  font-size:clamp(1.6rem,3.6vw,2.4rem);
  line-height:1.05;
  margin:0
}

.cta{
  background:var(--accent);
  color:white;
  padding:0.5rem 0.8rem;
  border-radius:8px;
  text-decoration:none;
  font-weight:700
}

.sub{
  color:var(--muted);
  margin:0
}

.hero-actions{
  display:flex;
  gap:0.6rem;
  margin-top:1rem
}

/* ---------- Photo / Cards ---------- */
.photo{
  width:230px;
  border-radius:12px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--shadow-lg);
  border:1px solid var(--border)
}

.photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  display:block
}

/* ---------- Sections & Cards ---------- */
section{
  padding:2rem 0
}

h2{
  font-size:1.3rem;
  margin:0 0 1rem 0;
  font-weight:800
}

.card{
  background: var(--card);
  padding:1rem;
  border-radius:12px;
  box-shadow: var(--shadow-lg);
  border:1px solid var(--border);
  transition: background .25s ease, box-shadow .25s ease, border .25s ease;
}

/* ---------- Skills ---------- */
.skills{
  display:flex;
  flex-wrap:wrap;
  gap:0.5rem;
}

.skill{
  padding:0.45rem 0.6rem;
  border-radius:8px;
  background:transparent;
  border:1px dashed var(--border);
  font-weight:600;
  color:var(--muted)
}

/* ---------- Projects ---------- */
.projects-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1rem
}

.project{
  display:flex;
  flex-direction:column;
  gap:0.6rem; 
  padding: 0;
  border: none;
  cursor: pointer;
  transition:transform var(--transition)
}

.project .p-body{
  padding:0 .9rem;
}


.project img, .project video{
  border-radius:12px 12px 0 0;
  width:100%;
  height:200px;
  object-fit:cover;
  display:block;
  transition:transform var(--transition)
}

.project:hover, .project:hover{
  transform:scale(1.03)
}

.project h3{
  margin:0
}

.project .meta{
  font-size:0.9rem;
  color:var(--muted)
}

.project .tags{
  display:flex;
  gap:0.4rem;
  flex-wrap:wrap
}

.tag{
  font-size:0.8rem;
  padding:0.25rem 0.5rem;
  border-radius:6px;
  background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .tag{ 
  background: rgba(255,255,255,0.12) 
}

/* ---------- Contact ---------- */
.contact{
  margin-top: 2rem;
  padding:1.2rem;border-radius:12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.00), transparent);
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:1rem;
  align-items:center;
  transition:background var(--transition)
}

.contact .card { 
  background: var(--card); 
}

.contact:hover { 
  filter:brightness(1.02) 
}


.contacts {
  display: flex;
  gap: 0.8rem;
  justify-content: start;
  align-items: center;
}

/* inputs */
.input, textarea{
  padding:.65rem .8rem;
  border-radius:10px;
  background:var(--card);
  border:1px solid var(--border);
  color:var(--text);
  resize:vertical;
  transition:box-shadow var(--transition),transform var(--transition)
}

.input:focus, textarea:focus{
  outline:none;
  box-shadow:0 6px 24px rgba(79,70,229,0.08);
  transform:translateY(-2px)
}

/* ---------- Forms / Buttons ---------- */
form{
  display:grid;
  gap:0.6rem
}

input,textarea{
  padding:0.6rem;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text)
}

button{
  padding:0.6rem 0.9rem;
  border-radius:8px;
  border:none;
  background:var(--accent);
  color:white;
  font-weight:700
}

/* ---------- Footer ---------- */
footer{
  padding:0;
  text-align:center;
  color:var(--muted);
  background:transparent; 
  margin:0;
}

/* ---------- Responsive ---------- */


.mobile-menu{
  display:none
}

.nav-open{
  display:block;
  background:var(--card);
  padding:1rem;
  border-radius:8px;
  margin-top:0.5rem
}

.muted{
  color:var(--muted)
}

/* ---------- About tabs ---------- */
.about-tabs{
  margin-top:1.5rem;
  display:flex;
  gap:1rem;
  border-bottom:1px dashed var(--border);
  padding-bottom:0.6rem;
}

.tab-link{
  background:transparent;
  border:none;
  font-weight:600;
  color:var(--muted);
  cursor:pointer;
  padding:0.3rem 0.6rem;
  border-radius:6px
}

.tab-link.active{
  color:var(--accent);
  border-bottom:2px solid var(--accent)
}

.tab-content{
  display:none;
  margin-top:1rem
}

.tab-content.active{
  display:block
}

/* ---------- Project Modal (New Modern Style) ---------- */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    z-index: 200;
    padding: 1.2rem;
    animation: fadeBg .25s ease;
}

.modal.active {
    display: grid;
}

@keyframes fadeBg {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    width: min(900px, 95%);
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--card), rgba(255,255,255,0.04));
    border-radius: 16px;
    padding: 1.4rem;
    box-shadow: var(--shadow-md);
    animation: popUp .35s var(--transition);
    border: 1px solid var(--border);
}

@keyframes popUp {
    from {
        transform: translateY(18px) scale(.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-card img {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

/* Modal Title */
#modal-title {
    margin-top: .4rem;
    font-size: 1.4rem;
    font-weight: 800;
}

/* Meta & Description */
#modal-meta {
    font-size: .9rem;
    color: var(--muted);
    margin: .2rem 0 .8rem 0;
}

#modal-desc {
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 1.1rem;
}

/* Tags */
#modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

#modal-tags .tag {
    background: linear-gradient(180deg, rgba(0,0,0,0.05), transparent);
    padding: .3rem .6rem;
    border-radius: 8px;
    font-size: .8rem;
}

/* Buttons */
.modal-links {
    display: flex;
    gap: .6rem;
    margin-top: 1rem;
}

#modal-live, #modal-code {
    padding: .6rem .9rem;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
}

#modal-live {
    background: var(--accent);
    color: white;
}

#modal-code {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

#modal-close {
    float: right;
    margin-bottom: .8rem;
    border-radius: 8px;
}



@media(min-width:900px){
  .hero{
    grid-template-columns:1fr 320px;
  }

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


/* ---------------- MOBILE RESPONSIVE FIXES ---------------- */

/* For screens smaller than 720px (iPhone SE, small Android) */
/* --- MOBILE HERO FIX (iPhone SE and small screens) --- */

@media(max-width: 720px){
  nav {
    display: none;
  }

  /* Force proper stacking for hero layout */
  .hero{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding-top: 2rem;
  }

  /* Right side (photo) will come first */
  aside, 
  .hero-side {
    order: -1 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  /* Hero text section comes second */
  .hero-grid{
    order: 2;
    text-align: center;
    width: 100%;
     max-width: 600px;
  }

  /* Resize text */
  .headline{
    font-size: 1.6rem;
    line-height: 1.25;
  }

  /* Buttons center */
  .hero-actions{
    justify-content: center;
    flex-wrap: wrap;
  }

  .card .muted {
    text-align: start;
  }

  /* Photo smaller */
  .photo{
    width: 160px;
  }

  .projects-grid{
    grid-template-columns:1fr
  }

  .card .p-body {
    padding: 0.8rem 1.2rem;
  }

  .contact{
    grid-template-columns: 1fr !important;
    text-align: center;
    padding: 1.5rem 1rem;
  }

  /* Button group centered */
  .contact .contacts{
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  /* Form takes full width */
  .contact form{
    width: 100%;
  }

  /* Inputs full width */
  .contact input,
  .contact textarea{
    width: 100%;
    font-size: 1rem;
  }

  /* Contact buttons stretch on small mobile */
  .contact button{
    width: auto;
  }

  .contact .btn.secondary{
    width: auto;
  }
}


@media(max-width: 400px){

  /* Brand adjustments */
  .brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .nav-actions a {
    font-size: 12px;
    padding: 8px;
  }

  .headline{
    font-size: 1.35rem;
  }

  .photo{
    width: 150px;
  }

  .sub{
    font-size: 0.88rem;
  }

  .hero-actions a{
    width: 100%;
  }

  .contact{
    padding: 1.2rem .5rem;
  }

  .contact input,
  .contact textarea{
    font-size: 0.9rem;
  }

  .contacts .btn{
    width: 100%;
    justify-content: center;
  }
}
