/* =============================================================
   CORE GLOBAL OPTIMIZATIONS (Solves Chrome Missing H1/Dimensions)
   ============================================================= */
h1, h2, h3, h4, h5 { margin: 0; padding: 0; line-height: 1.2; }
.hero-title, h1 {
  font-size: clamp(34px, 5vw + 1rem, 64px) !important;
  font-weight: 700;
  margin-bottom: 0.25rem !important;
}

#home img, .profile-img, .w3-circle {
  border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; outline: 0 !important;
}

/* === THE ULTIMATE VERTICAL OFFSET LIFT === */
/* Liberating text block from vertical centering & shifting drastically upward natively */
.hero-copy { 
  position: absolute !important; 
  top: clamp(6%, 10vh, 15%) !important; /* Forces upward float perfectly proportioned across all monitors */
  left: 60px; /* Safe side margin desktop */
  cursor: default; 
  z-index: 10;
}
.hero-role { margin-bottom: 0; }
.hero-subrole {
  max-height: 0; opacity: 0; overflow: hidden; transform: translateY(-10px);
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, transform 0.4s ease-out, margin-top 0.4s ease;
  margin-top: 0; font-size: 0.95em; letter-spacing: 0.3px; color: #dfdfdf;
}
.hero-copy:hover .hero-subrole {
  max-height: 120px; opacity: 1; transform: translateY(0); margin-top: 10px;
}

/* =============================================================
   NAVIGATION BAR OVERRIDES & LINK COLOR LOCK (IRON CLAD LOCK)
   ============================================================= */
nav.w3-sidebar { background: #111 !important; z-index: 1000;}
nav.w3-sidebar .w3-bar-item {
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  color: #fff !important; 
  text-decoration: none !important;
}
nav.w3-sidebar a, nav a, header a, .main-nav a {
  color: #ffffff !important;
  text-decoration: none !important;
}
nav.w3-sidebar .w3-bar-item.sidebar-link { padding: 14px 8px !important; }

/* =============================================================
   SHOWREEL ANIMATION FIX (Prevent Memory OOM Exception Crash)
   ============================================================= */
.hero {
  position: relative; margin: 0 auto 34px auto; max-width: 1200px;
  min-height: clamp(340px, 45vh, 600px); border-radius: 12px; overflow: hidden; background: #000;
  display: block !important; /* Fallback architecture reset allowing the copy absolute lifting */
}
.hero-bg, .hero-media { position: absolute; inset: 0; overflow: hidden; }

#showreel .slide {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .45s ease-out; background: #000;
  transform: translateZ(0); pointer-events: none;
}
#showreel .slide.active, #showreel .slide:first-child { opacity: 1; z-index: 1;}

#showreel .slide[style*="background-image"] { background-position: center center; background-repeat: no-repeat; background-size: contain; }
#showreel video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #showreel .slide, * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* =============================================================
   PROJECTS SECTIONS HOME (Snip Responsive Matrix Tuning)
   ============================================================= */
.home-sections { margin-top: 28px; width: 100%; }
.hs-row { display: flex; gap: 34px; justify-content: center; align-items: stretch; flex-wrap: wrap; margin-top: 14px; }
.hs-card {
  position: relative; display: block; text-decoration: none;
  width: 340px; height: 240px; border-radius: 14px; overflow: hidden; background: #151515;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18); transition: transform 0.25s cubic-bezier(0.5,1,0.5,1), box-shadow 0.25s;
  flex: 1 1 300px; max-width: 420px; min-width: 280px; 
}
.hs-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 16px 40px rgba(0,0,0,0.4); }

.hs-card > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  filter: brightness(0.85) saturate(1.02); transition: filter 0.45s ease-out, transform 0.45s ease-out;
}
.hs-card:hover > img { transform: scale(1.04); filter: brightness(1.02) saturate(1.15); opacity: 0.82; }

.hs-title {
  position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 20px);
  background: rgba(15,15,15,0.65); color: #fff; font-size: clamp(20px, 2.5vw, 24px); 
  font-weight: 700; padding: 12px 28px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease, transform 0.35s ease, background 0.3s;
  white-space: nowrap; backdrop-filter: blur(4px);
}
.hs-card:hover .hs-title { opacity: 1; transform: translate(-50%, 0); background: rgba(30,30,30,0.92); }

/* =============================================================
   PROJECT INTERNAL ARCHITECTURE GRID 
   ============================================================= */
.projects-grid-disabled-disabled { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; width: 100%; }
.project-card-disabled-disabled { display: block; text-decoration: none; border-radius: 12px; overflow: hidden; background: #111; transition: transform 0.25s ease, box-shadow 0.25s ease; flex-direction: column; }
.project-card-disabled-disabled:hover { transform: scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,.4); }

.project-thumb { position: relative; aspect-ratio: 16/9; background: #0b0b0b; overflow: hidden; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; display: block; }
.project-card-disabled-disabled:hover .project-thumb img { transform: scale(1.05); }
.project-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; background: rgba(0,0,0,.65); transition: opacity 0.35s ease; }
.project-card-disabled-disabled:hover .project-overlay { opacity: 1; }

.view-more-btn {
  padding: 10px 24px; background: transparent; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.7); font-size: 13px; font-weight: 500; letter-spacing: 1.5px;
  text-transform: uppercase; border-radius: 4px; margin: 0; transform: translateY(20px); opacity: 0; transition: all 0.35s ease; pointer-events: none;
}
.project-card-disabled-disabled:hover .view-more-btn { opacity: 1; transform: translateY(0); pointer-events: auto; }
.view-more-btn:hover { background: #fff; color: #000; box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2); border: 1px solid #fff;}

.project-meta { padding: 16px 20px; }
.project-title { font-family: "Montserrat", Arial, sans-serif; font-size: 20px; font-weight: 600; color: #efefef; line-height: 1.35; margin: 0; }

/* =============================================================
   TOOLS LIST (Software Environment Compatibility Matrix)
   ============================================================= */
#tools { margin-top: 50px; }
#tools h2 { font-size: clamp(26px, 4vw, 32px); font-weight: 600; letter-spacing: 0.2px; margin-bottom: 8px; }
.tools-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin:0; padding:0; list-style: none;}
.tools-list li { display: flex; align-items: center; gap: 12px; background: #141414; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 12px; transition: transform 0.25s, box-shadow 0.25s;}
.tools-list li:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.18);}
.tools-list img, .tools-list i.tool-fallback { width: 22px; height: 22px; display: inline-block; flex-shrink: 0; object-fit: contain;}
.tools-list span { font-size: 14px; font-weight: 500; line-height: 1.3; color: #d0d0d0; }

/* =============================================================
   DEVICE SCREEN BREAKPOINTS (100% Scalable Cross Device Matrix)
   ============================================================= */
@media screen and (max-width: 900px) {
  .hero { min-height: 50vw; border-radius: 8px; }
  .tools-list { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .tools-list span { font-size: 12.5px; }
}
@media screen and (max-width: 768px) {
  .projects-grid-disabled-disabled { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;}
  a:contains("Archive"), .w3-bar a:contains("Archive"), [data-nav="Archive"] { display: none !important; }
}
@media (max-width: 640px) {
  /* Extreme high elevation push dedicated just for dense mobile spaces! */
  .hero-copy { top: 5% !important; left: 16px !important;}
  .hs-row { display: flex; flex-direction: column; align-items: stretch;}
  .hs-card { width: 100%; min-width: unset; height: 260px;}
  #myNavbar .w3-bar-item { width: 33.33%; padding-left: 0; padding-right: 0; text-align: center; } 
  .social-icons a { font-size: 26px !important; margin: 0 8px; } 
  .footer-grid { display: flex; flex-direction: column; gap: 36px; text-align: center; align-items: center;}
  .contact-list { display:flex; flex-direction: column; align-items:center; }
}
