:root {
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.5);
  --secondary: #ec4899;
  --secondary-glow: rgba(236, 72, 153, 0.5);
  --bg-dark: #070b14;
  --bg-card: rgba(15, 23, 42, 0.6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body.no-scroll {
  overflow: hidden;
}

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

@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }
}

/* Premium Background */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
              radial-gradient(circle at 90% 90%, rgba(236, 72, 153, 0.1) 0%, transparent 40%);
}

.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Navigation */
nav {
  height: clamp(70px, 10vw, 90px);
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 1rem;
}

nav.scrolled {
  height: 70px;
  background: rgba(7, 11, 20, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  font-size: min(1.5rem, 5vw);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  background: var(--accent-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.02);
}

.logo img {
  height: 44px;
  filter: drop-shadow(0 0 12px var(--primary-glow));
  -webkit-text-fill-color: initial;
}

.nav-links {
  display: flex;
  gap: min(2.5rem, 3vw);
  list-style: none;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--text-main);
}

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

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 0 1rem;
}

.hero-bg-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-bg-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  filter: blur(4px);
}

.hero-bg-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, var(--bg-dark), transparent);
}

.hero h1 {
  font-size: clamp(2.75rem, 12vw, 6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
  background: linear-gradient(to bottom, #fff 40%, rgba(255,255,255,0.6));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.35rem;
  color: var(--text-muted);
  max-width: 700px;
  margin-bottom: 3.5rem;
  line-height: 1.6;
}

.btn {
  display: inline-block;
  padding: 1.25rem 3rem;
  border-radius: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 10px 25px -5px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px -10px var(--primary-glow);
}

.btn-outline {
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: var(--glass);
  border-color: var(--primary);
  transform: translateY(-4px);
}

/* Cards & Sections */
.section-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  padding: 3rem;
  border-radius: 32px;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-12px) scale(1.01);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
              0 0 20px -5px var(--primary-glow);
}

.card:hover::before {
  opacity: 1;
}

.icon-container, .icon-container-small {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary);
  border: 1px solid var(--glass-border);
  transition: all 0.4s ease;
}

.card:hover .icon-container,
.card:hover .icon-container-small {
  background: var(--accent-gradient);
  color: white;
  transform: scale(1.1) rotate(5deg);
}

/* Grids */
.about-grid, .features-grid, .news-grid {
  display: grid;
  gap: 2.5rem;
  margin-top: 4rem;
}

.features-grid { 
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 100%, 340px), 1fr)); 
}

.about-grid { 
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 100%, 320px), 1fr)); 
}

.news-grid { 
  grid-template-columns: repeat(auto-fit, minmax(clamp(320px, 100%, 500px), 1fr)); 
}

/* Animations */
.animate {
  opacity: 0;
  transform: translateY(40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }

/* Responsive Utilities & Typography */
h1 { font-size: clamp(2.5rem, 10vw, 6rem); }
.section-title { font-size: clamp(2.25rem, 8vw, 3.5rem); line-height: 1.2; }
p { font-size: clamp(1rem, 1.8vw, 1.25rem); }

/* Navigation Responsive & Mobile Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1100;
}

.menu-toggle svg {
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease;
}

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

/* Grids Adaptation */
.features-grid { 
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 100%, 340px), 1fr)); 
}

.about-grid { 
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 100%, 320px), 1fr)); 
}

.news-grid { 
  grid-template-columns: repeat(auto-fit, minmax(clamp(300px, 100%, 500px), 1fr)); 
}

/* Breakpoints */
@media (max-width: 1024px) {
  .container { padding: 0 4rem; }
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    height: 100vh;
    background: rgba(7, 11, 20, 0.98);
    backdrop-filter: blur(30px);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--glass-border);
    z-index: 1050;
    padding: 2rem;
  }
  
  .nav-links a {
    font-size: 1.5rem;
    width: 100%;
    text-align: center;
    padding: 1rem;
  }

  .nav-links.active {
    right: 0;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.8);
  }

  .menu-toggle {
    display: block;
  }

  .hero { text-align: center; align-items: center; padding-top: 5rem; }
  .hero p { margin-left: auto; margin-right: auto; }
  .btn-group { 
    display: flex;
    flex-direction: column; 
    gap: 1rem;
    width: 100%; 
    max-width: 320px;
    margin: 0 auto;
  }
  .btn { width: 100%; }
}

@media (max-width: 768px) {
  .container { padding: 0 1.5rem; }
  section { margin-top: 6rem !important; }
  .section-title { text-align: center; }
  .card { padding: 2rem; border-radius: 24px; }
  
  .news-grid { gap: 1.5rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: clamp(2.5rem, 15vw, 4rem); }
  .btn { width: 100%; text-align: center; }
}

/* News Detail & Interactions */
.article-content {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-main);
}

.article-content p {
  margin-bottom: 2rem;
}

.interaction-bar {
  display: flex;
  gap: 1.5rem;
  margin: 3.5rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.action-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 0.85rem 1.75rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-family: inherit;
}

.action-btn:hover {
  background: var(--glass-border);
  transform: translateY(-3px);
  border-color: var(--primary);
}

.action-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 10px 20px -5px var(--primary-glow);
}

.comments-section {
  margin-top: 6rem;
}

.comment-card {
  padding: 2.5rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  transition: transform 0.3s ease;
}

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

/* Portfolio Bento Redesign */
.portfolio-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto;
  gap: 2rem;
  margin-top: 4rem;
}

.portfolio-card {
  position: relative;
  border-radius: 40px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

/* Featured Large Card (Project 1) */
.portfolio-card.item-large {
  grid-column: span 8;
  height: 600px;
}

.portfolio-card.item-medium {
  grid-column: span 4;
  height: 600px;
}

.portfolio-card.item-full {
  grid-column: span 12;
  height: 450px;
  flex-direction: row;
}

.portfolio-card:hover {
  transform: translateY(-15px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 30px 60px -15px rgba(0,0,0,0.6), 0 0 20px -5px var(--primary-glow);
}

.project-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.portfolio-card:hover .project-media img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 11, 20, 0.98) 0%, rgba(7, 11, 20, 0.6) 50%, transparent 100%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.5rem, 5vw, 3.5rem);
}

.project-info {
  z-index: 2;
  transform: translateY(20px);
  transition: transform 0.5s ease;
}

.portfolio-card:hover .project-info {
  transform: translateY(0);
}

.project-category {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: block;
}

.project-title-link {
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  margin-bottom: 1rem;
  display: block;
  line-height: 1.2;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.project-desc-short {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  max-width: 80%;
  margin-bottom: 2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.portfolio-card:hover .project-desc-short {
  opacity: 1;
}

@media (max-width: 1024px) {
  .portfolio-bento {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .portfolio-card.item-large, .portfolio-card.item-medium, .portfolio-card.item-full {
    grid-column: span 1;
    height: 450px;
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .project-overlay { padding: 2rem; }
  .project-title-link { font-size: 1.75rem; }
  .project-desc-short { display: none; }
}

/* Portfolio Action Buttons */
.project-actions {
  display: flex;
  gap: 0.85rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.project-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  backdrop-filter: blur(10px);
}

.project-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
  color: #fff;
}

.project-action-btn.btn-download {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 10px 20px -10px var(--primary-glow);
}

.project-action-btn.btn-download:hover {
  background: var(--primary);
  filter: brightness(1.2);
  box-shadow: 0 15px 30px -10px var(--primary-glow);
}

@media (max-width: 768px) {
  .project-actions {
    margin-top: 1rem;
  }
  .project-action-btn {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
  }
}

/* News Elite Horizontal Design */
.news-elite-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 4rem;
}

.news-card-elite {
  display: grid;
  grid-template-columns: 350px 1fr;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 35px;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  min-height: 280px;
}

.news-card-elite:hover {
  transform: translateX(15px) scale(1.01);
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.04);
}

.news-card-media {
  position: relative;
  overflow: hidden;
}

.news-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s ease;
}

.news-card-elite:hover .news-card-media img {
  transform: scale(1.1);
}

.news-card-content {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-date-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1rem;
}

.news-card-title {
  font-size: clamp(1.25rem, 4vw, 1.85rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.news-card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 90%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
}

.news-card-footer span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 1024px) {
  .news-card-elite {
    grid-template-columns: 280px 1fr;
  }
}

@media (max-width: 768px) {
  .news-elite-container { gap: 1.5rem; }
  .news-card-elite {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .news-card-media {
    height: 220px;
  }
  .news-card-content {
    padding: 1.5rem;
  }
  .news-card-title {
    font-size: 1.35rem;
  }
}

/* Interaction fixes for touch */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: none;
  }
  .card::before {
    display: none;
  }
}
