/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
a { text-decoration: none; color: inherit; display: inline; }
li { list-style: none; display: block; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; border: none; background: none; cursor: pointer; }
input, textarea { font: inherit; border: none; outline: none; background: none; width: 100%; display: block; }
html { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }

/* ===== ROOT ===== */
:root {
  --bg-primary: #0d1b2a;
  --bg-secondary: #1b4965;
  --accent: #1a56db;
  --cyan: #5ce1e6;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #cbd5e1;
  --glass-bg: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.1);
  --glass-bg-hover: rgba(255,255,255,0.08);
  --font-main: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.3s ease;
  --shadow-glow: 0 0 20px rgba(92, 225, 230, 0.3);
}

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0f2a3f 25%, var(--bg-secondary) 50%, #162d50 75%, var(--bg-primary) 100%);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  color: var(--text-primary);
  overflow-x: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== GLASS UTILITIES ===== */
.glass-card {
  background: rgba(13, 27, 42, 0.85);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

@supports not ((-webkit-backdrop-filter: blur(20px)) or (backdrop-filter: blur(20px))) {
  .glass-card {
    background: rgba(13, 27, 42, 0.92);
  }
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
  background: var(--glass-bg-hover);
}

/* ===== NAVBAR ===== */
.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(13, 27, 42, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  -webkit-transform: translateY(-100%);
  transform: translateY(-100%);
  -webkit-transition: transform 0.4s ease;
  transition: transform 0.4s ease;
  display: block;
}

.glass-nav.visible {
  -webkit-transform: translateY(0);
  transform: translateY(0);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: center;
  align-items: center;
  height: 64px;
}

.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: #5ce1e6;
  display: inline-block;
}

.nav-links {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.nav-links li {
  display: inline-block;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  -webkit-transition: color 0.3s ease;
  transition: color 0.3s ease;
  position: relative;
  display: inline-block;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--cyan);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 20px;
}

.hero-content {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 600px;
}

.hero-avatar {
  position: relative;
  width: 150px;
  height: 150px;
  min-width: 150px;
  min-height: 150px;
  max-width: 150px;
  max-height: 150px;
  overflow: hidden;
  border-radius: 50%;
}

.hero-avatar img {
  width: 150px;
  height: 150px;
  min-width: 150px;
  min-height: 150px;
  max-width: 150px;
  max-height: 150px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  border: 3px solid rgba(92, 225, 230, 0.5);
}

.avatar-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--accent));
  opacity: 0.4;
  filter: blur(15px);
  animation: glowPulse 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

.hero-name {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff, #5ce1e6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-typed {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  color: #5ce1e6;
  min-height: 2rem;
}

.hero-typed .typed-cursor {
  color: #5ce1e6;
}

.hero-socials {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  gap: 20px;
  margin-top: 10px;
}

.hero-socials a {
  font-size: 1.5rem;
  color: var(--text-secondary);
  transition: color var(--transition), transform var(--transition);
}

.hero-socials a:hover {
  color: var(--cyan);
  transform: translateY(-3px);
}

.scroll-indicator {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

.scroll-indicator ion-icon {
  font-size: 1.2rem;
}

/* ===== SECTIONS COMMON ===== */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 20px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 50px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(to right, var(--cyan), var(--accent));
  border-radius: 3px;
}

/* ===== ABOUT ===== */
.about-text {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 50px;
}

.about-text p {
  margin-bottom: 16px;
}

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

.service-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.service-card .service-icon {
  font-size: 2rem;
  color: var(--cyan);
  flex-shrink: 0;
}

.service-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.service-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== EXPERIENCE ===== */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--cyan), var(--accent), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan), 0 0 20px rgba(92, 225, 230, 0.3);
}

.timeline-item .glass-card {
  padding: 24px;
}

.timeline-item h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-item .timeline-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  margin-bottom: 8px;
}

.timeline-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.timeline-subtitle {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 60px;
  margin-bottom: 30px;
  color: var(--text-muted);
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 60px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.skill-header h3 {
  font-size: 0.95rem;
  font-weight: 500;
}

.skill-header span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
}

.skill-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  width: 0;
  background: linear-gradient(to right, var(--cyan), var(--accent));
  border-radius: 10px;
  transition: width 1.2s ease-in-out;
  box-shadow: 0 0 10px rgba(92, 225, 230, 0.3);
}

.companies-section {
  text-align: center;
}

.companies-section > h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.companies-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.companies-scroll::-webkit-scrollbar {
  display: none;
}

.company-card {
  flex: 0 0 auto;
  width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 24px !important;
  scroll-snap-align: start;
  cursor: default;
  text-align: center;
}

.company-card:hover {
  transform: translateY(-5px);
}

.company-card .company-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  flex-shrink: 0;
  filter: none;
  opacity: 1;
}

.company-info {
  text-align: center;
  min-width: 0;
}

.company-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.company-info span {
  font-size: 0.8rem;
  color: var(--cyan);
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .companies-scroll {
    gap: 14px;
  }

  .company-card {
    width: 220px;
    padding: 24px 20px !important;
  }

  .company-card .company-logo {
    width: 56px;
    height: 56px;
  }
}

@media (min-width: 769px) {
  .companies-scroll {
    justify-content: center;
    overflow-x: visible;
    flex-wrap: wrap;
  }
}

/* ===== PORTFOLIO ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(92, 225, 230, 0.15);
  color: var(--cyan);
  border-color: rgba(92, 225, 230, 0.3);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.project-card {
  overflow: hidden;
  padding: 0;
}

.project-card .project-img {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.project-card .project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.project-card .project-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,27,42,0.8), transparent);
}

.project-info {
  padding: 20px;
}

.project-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.project-info span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== CONTACT ===== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.contact-form-card {
  padding: 30px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

.form-input:focus {
  border-color: var(--cyan);
}

textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

.form-btn {
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--cyan), var(--accent));
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
  width: 100%;
}

.form-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(92, 225, 230, 0.3);
}

.form-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-btn ion-icon {
  font-size: 1.1rem;
}

.contact-info-card {
  padding: 30px;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-info-item .icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(92, 225, 230, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-info-item .info-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.contact-info-item .info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.contact-info-item .info-value a {
  color: var(--text-primary);
  transition: color var(--transition);
}

.contact-info-item .info-value a:hover {
  color: var(--cyan);
}

.map-box {
  margin-top: 24px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  height: 200px;
}

.map-box iframe {
  width: 100%;
  height: 100%;
  border: none;
  filter: brightness(0.7) contrast(1.1);
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--glass-border);
}

/* ===== ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.fade-in:nth-child(1) { transition-delay: 0s; }
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }
.fade-in:nth-child(5) { transition-delay: 0.4s; }
.fade-in:nth-child(6) { transition-delay: 0.5s; }
.fade-in:nth-child(7) { transition-delay: 0.6s; }

::selection {
  background: rgba(92, 225, 230, 0.3);
  color: var(--text-primary);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .contact-wrapper {
    grid-template-columns: 1fr 1fr;
  }

  .project-card .project-img {
    height: 220px;
  }
}

@media (min-width: 1024px) {
  .hero-name {
    font-size: 4rem;
  }

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

  .project-card .project-img {
    height: 240px;
  }

  section {
    padding: 120px 20px;
  }
}

@media (max-width: 768px) {
  .hero-name {
    font-size: 2.2rem;
  }

  .hero-typed {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .nav-logo {
    font-size: 1rem;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 0.75rem;
  }

  .glass-card {
    padding: 20px;
  }

  .timeline {
    padding-left: 30px;
  }

  .timeline-item::before {
    left: -26px;
    width: 10px;
    height: 10px;
  }
}
