@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  --navy-dark: #010813;
  --navy-bg: #020813;
  --navy-light: #112240;
  --purple-glow: #3c1e70;
  --blue-glow: #1a3a6e;
  --silver-light: #f1f7ff;
  --silver-dim: #8892b0;
  --silver-text: #ccd6f6;
  --accent-silver: #a8b2d1;
  --glass-bg: rgba(17, 34, 64, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  --font-main: 'Space Grotesk', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

/* Custom Scrollbar - Much lighter/brighter as requested */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--navy-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--silver-dim); /* Brighter base */
  border-radius: 10px;
  border: 2px solid var(--navy-dark);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--silver-light); /* Even brighter on hover */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none !important; /* Hide default cursor for custom one */
}

/* Custom Cursor */
.cursor-outer {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent-silver);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, background-color 0.3s;
  z-index: 9999;
  mix-blend-mode: difference;
}

.cursor-inner {
  position: fixed;
  width: 6px;
  height: 6px;
  background-color: var(--silver-light);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.cursor-hover {
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--navy-bg);
  color: var(--silver-text);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Texture Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    url("https://grainy-gradients.vercel.app/noise.svg");
  background-size: 40px 40px, auto;
  opacity: 0.15;
  pointer-events: none;
  z-index: 100;
  filter: contrast(150%) brightness(120%);
}

/* Background elements for glow effect - RESTORED STATIC VERSION */
.bg-glow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: 
    radial-gradient(50vmax circle at 80% 10%, rgba(42, 82, 152, 0.4) 0%, transparent 60%),
    radial-gradient(60vmax circle at 15% 90%, rgba(91, 33, 182, 0.35) 0%, transparent 60%),
    radial-gradient(40vmax circle at 50% 50%, rgba(14, 165, 233, 0.15) 0%, transparent 60%),
    #010813;
}

/* Sticky Navbar */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 25px 0;
  z-index: 1000;
  transition: padding 0.4s ease, background 0.4s ease, backdrop-filter 0.4s ease, border 0.4s ease;
  background: transparent;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: rgba(2, 8, 19, 0.85); /* Darker and more visible */
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--silver-light);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-link {
  color: var(--silver-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--silver-light);
}

/* Typography */
h1, h2, h3 {
  color: var(--silver-light);
  font-weight: 700;
  font-family: var(--font-heading);
}

.animated-text {
  background: linear-gradient(
    to right, 
    var(--silver-light) 20%, 
    var(--accent-silver) 40%, 
    var(--silver-dim) 60%, 
    var(--silver-light) 80%
  );
  background-size: 200% auto;
  color: #000;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 5s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

p {
  color: var(--silver-dim);
}

/* Glass Utility */
.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 25px 80px -20px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

/* Animated Border Effect */
.animated-border-box {
  position: relative;
}

.animated-border-box::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.animated-border-box:hover::after {
  opacity: 1;
  animation: border-rotate 3s linear infinite;
}

@keyframes border-rotate {
  from { filter: hue-rotate(0deg); transform: rotate(0deg); }
  to { filter: hue-rotate(360deg); transform: rotate(360deg); }
}

/* Container */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Header */
header {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 5%;
}

.hero-subtitle {
  color: var(--accent-silver);
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 20px;
  text-transform: uppercase;
  display: block;
}

header h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.9rem); /* Perfectly balanced middle ground */
  line-height: 1.2;
  margin-bottom: 25px;
  max-width: 850px;
}

header p {
  max-width: 540px;
  font-size: 1.2rem;
  margin-bottom: 40px;
}

.btn {
  display: inline-block;
  padding: 18px 34px;
  background: transparent;
  color: var(--silver-light);
  border: 1.5px solid var(--accent-silver);
  border-radius: 8px; /* Slightly more rounded */
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: rgba(168, 178, 209, 0.05);
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -10px rgba(168, 178, 209, 0.2);
}

/* Sections - Reduced by half again */
section {
  padding: 30px 0;
}

.section-title {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin-bottom: 50px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.section-title::after {
  content: "";
  display: block;
  width: 200px;
  height: 1px;
  background-color: var(--navy-light);
  margin-left: 20px;
}

/* Bento Grid (8 items) */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 280px; /* Increased to fit text better */
  gap: 24px;
}

.portfolio-card:nth-child(1) { grid-column: span 3; grid-row: span 2; }
.portfolio-card:nth-child(2) { grid-column: span 3; grid-row: span 2; }
.portfolio-card:nth-child(3) { grid-column: span 2; grid-row: span 1; }
.portfolio-card:nth-child(4) { grid-column: span 2; grid-row: span 1; }
.portfolio-card:nth-child(5) { grid-column: span 2; grid-row: span 1; }
.portfolio-card:nth-child(6) { grid-column: span 3; grid-row: span 1; }
.portfolio-card:nth-child(7) { grid-column: span 3; grid-row: span 1; }

@media (max-width: 992px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }
  .portfolio-card:nth-child(n) { grid-column: span 1; grid-row: span 1; }
}

.portfolio-card {
  padding: 0;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Restored original glass effect directly on cards */
.portfolio-card.glass {
  height: 100%;
}

.card-content h3 {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.card-content p {
  color: var(--silver-dim);
  font-size: 0.95rem;
  line-height: 1.5;
}

.card-image {
  flex-grow: 1; /* Image takes up all available space */
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.portfolio-card:nth-child(1) .card-image,
.portfolio-card:nth-child(2) .card-image {
  height: 480px; /* Filling the double-row height for large cards */
}

.card-image img {
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 2s ease-in-out, filter 0.5s ease;
}

.portfolio-card:hover .card-image img {
  transform: translateY(calc(-100% + 300px)); /* Small card safety margin */
  filter: brightness(1.05);
}

.portfolio-card:nth-child(1):hover .card-image img,
.portfolio-card:nth-child(2):hover .card-image img {
  transform: translateY(calc(-100% + 500px)); /* Large card safety margin */
}

.card-content {
  padding: 20px;
  flex-grow: 0; /* Content only takes as much as it needs */
  background: rgba(10, 25, 47, 0.4);
  backdrop-filter: blur(5px);
}

.card-content h3 {
  margin-bottom: 0;
  font-size: 0.95rem; /* Reduced from 1.1rem */
  font-weight: 500;
  color: var(--accent-silver);
}

.portfolio-card p {
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.card-links {
  display: flex;
  gap: 20px;
  margin-top: auto; /* Push down */
}

.card-link {
  color: var(--silver-light);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: 0.3s;
}

.card-link:hover {
  color: var(--accent-silver);
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
}

.pricing-card {
  padding: 40px 30px;
  text-align: center;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pricing-card:hover {
  transform: translateY(-10px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.pricing-icon {
  margin: 0 auto 20px auto;
  color: var(--accent-silver);
  width: 40px;
  height: 40px;
}

.pricing-card h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--silver-light);
}

.pricing-card .price {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(to right, var(--silver-light), var(--accent-silver));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.pricing-card .price span {
  font-size: 0.9rem; /* Smaller span */
  font-weight: 400;
  -webkit-text-fill-color: var(--silver-dim);
}

.pricing-card p {
  font-size: 0.95rem;
  color: var(--silver-dim);
}

/* Contact Section */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
}

.contact-info h3 {
  margin-bottom: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
  color: var(--silver-dim);
}

.contact-info .contact-item:first-of-type {
  margin-top: 30px !important; /* FORCED FIX for the overlap */
}

.contact-item i {
  color: var(--accent-silver);
  font-size: 1.2rem;
}

.contact-form {
  padding: 40px;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--silver-light);
}

.form-group input, 
.form-group textarea {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--glass-border);
  padding: 15px;
  border-radius: 8px;
  color: var(--silver-text);
  font-family: var(--font-main);
  transition: var(--transition);
}

.form-group input:focus, 
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-silver);
  box-shadow: 0 0 10px rgba(168, 178, 209, 0.1);
}

.form-group input:invalid:focus,
.form-group textarea:invalid:focus {
  border-color: rgba(220, 38, 38, 0.5);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.1);
}

/* Custom Select Styling */
.custom-select-wrapper {
  position: relative;
  user-select: none;
  width: 100%;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: var(--navy-light);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--silver-text);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.custom-select-trigger:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.custom-select-trigger span {
  font-size: 0.95rem;
  opacity: 0.8;
  pointer-events: none;
}

.custom-select.open .custom-select-trigger {
  border-color: var(--accent-silver);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.custom-select-trigger i {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
  pointer-events: none;
}

.custom-select.open .custom-select-trigger i {
  transform: rotate(180deg);
}

.custom-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0a192f;
  border: 1px solid var(--accent-silver);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.5);
  display: none !important; /* Forces hiding unless .open is present */
  z-index: 1000;
  max-height: 250px;
  overflow-y: auto;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.custom-select.open .custom-options {
  display: block !important;
}

.custom-option {
  padding: 12px 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  color: var(--silver-text);
}

.custom-option:hover {
  background: rgba(168, 178, 209, 0.1);
  color: var(--silver-light);
  padding-left: 20px;
}

.custom-option.selected {
  background: rgba(168, 178, 209, 0.2);
  color: var(--silver-light);
}

/* Custom Scrollbar for Dropdown */
.custom-options::-webkit-scrollbar {
  width: 5px;
}
.custom-options::-webkit-scrollbar-thumb {
  background: var(--silver-dim);
  border-radius: 5px;
}

.btn-submit {
  width: 100%;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--navy-light);
}

footer p {
  font-size: 0.85rem;
}

/* --- FINAL MOBILE REFINEMENTS (V6.1.2) --- */
@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 0 10px;
  }

  section {
    padding: 40px 0;
  }

  .nav-links {
    display: flex; /* Back to life */
    gap: 12px;
  }

  .nav-link {
    font-size: 0.8rem !important; /* Smaller for mobile */
    padding: 5px 8px;
  }

  .section-title {
    font-size: 1.5rem !important;
    margin-bottom: 30px;
    word-wrap: break-word;
  }

  /* Fixed overlap for Hero - RE-RESTORED */
  .hero-header {
    padding-top: 180px !important; 
    padding-bottom: 60px !important;
    height: auto !important;
    text-align: center;
    display: block !important;
  }

  .hero-header h1 {
    font-size: 1.95rem !important;
    line-height: 1.25;
    margin-bottom: 20px;
  }

  .hero-header p {
    font-size: 0.95rem;
    margin-bottom: 30px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
    grid-auto-rows: auto;
  }

  .portfolio-card {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    margin-bottom: 15px;
  }

  .portfolio-card .card-image {
    height: 220px !important;
  }

  .portfolio-card:hover .card-image img {
    transform: translateY(calc(-100% + 220px)) !important;
  }

  .card-content h3 {
    font-size: 0.9rem !important;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Form and Success state refinements */
  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .p-40 {
    padding: 20px !important;
  }
}

/* --- FORM SUCCESS STATE (GLOBAL) --- */
.form-success-container {
  display: none; /* Hide by default */
  text-align: center;
  padding: 80px 40px !important;
  margin: 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeInSuccess 0.5s ease-out;
}

.success-icon {
  color: #10b981 !important;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.success-icon svg {
  width: 80px;
  height: 80px;
}

.success-content {
  text-align: center;
  width: 100%;
}

.success-content h3 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--silver-light);
}

.success-content p {
  color: var(--silver-dim);
  margin-bottom: 30px;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

@keyframes fadeInSuccess {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
