/* ============================================ */
/* CUSTOM PROPERTIES                            */
/* ============================================ */
:root {
  --bg-primary: #0a090c;
  --bg-secondary: #0f0e12;
  --bg-card: #121116;
  --bg-card-hover: #18171c;
  --border: #1a191e;
  --border-hover: #2a292e;
  --text-primary: #f0edee;
  --text-secondary: #c5c0c3;
  --text-muted: #8a8588;
  --accent-primary: #07393c;
  --accent-secondary: #2c666e;
  --accent-light: #90ddf0;
  --gradient-hero: linear-gradient(135deg, #07393c, #2c666e);
  --gradient-card: linear-gradient(135deg, rgba(7, 57, 60, 0.12), rgba(44, 102, 110, 0.06));
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1100px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================ */
/* RESET & BASE                                 */
/* ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Full-site gradient atmosphere */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 600px 500px at 80% 15%, rgba(7, 57, 60, 0.15), transparent 70%),
    radial-gradient(ellipse 500px 400px at 15% 40%, rgba(44, 102, 110, 0.1), transparent 70%),
    radial-gradient(ellipse 400px 400px at 70% 65%, rgba(7, 57, 60, 0.1), transparent 70%),
    radial-gradient(ellipse 350px 350px at 25% 80%, rgba(44, 102, 110, 0.08), transparent 70%),
    radial-gradient(ellipse 450px 450px at 50% 50%, rgba(144, 221, 240, 0.03), transparent 70%),
    radial-gradient(circle, rgba(144, 221, 240, 0.04) 1px, transparent 1px);
  background-size: 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 48px 48px;
  background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  will-change: background-position;
}

/* Very subtle noise texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============================================ */
/* UTILITY                                      */
/* ============================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.section {
  padding: 100px 0;
}

.section__header {
  text-align: center;
  margin-bottom: 60px;
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f0edee, #90ddf0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section__divider {
  width: 48px;
  height: 4px;
  background: var(--gradient-hero);
  border-radius: 4px;
  margin: 16px auto 0;
  box-shadow: 0 0 12px rgba(7, 57, 60, 0.4);
}

/* ============================================ */
/* FADE-IN ANIMATION (Intersection Observer)    */
/* ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Staggered entrance for grid children */
.services__grid .fade-in:nth-child(1) { transition-delay: 0ms; }
.services__grid .fade-in:nth-child(2) { transition-delay: 120ms; }
.services__grid .fade-in:nth-child(3) { transition-delay: 240ms; }

.projects__grid .fade-in:nth-child(1) { transition-delay: 0ms; }
.projects__grid .fade-in:nth-child(2) { transition-delay: 120ms; }
.projects__grid .fade-in:nth-child(3) { transition-delay: 240ms; }

/* ============================================ */
/* HEADER / NAVIGATION                          */
/* ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10, 9, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: border-color var(--transition);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo__accent {
  color: var(--accent-light);
}

/* Nav */
.nav__list {
  display: flex;
  gap: 32px;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-hero);
  border-radius: 2px;
  transition: width var(--transition);
}

.nav__link:hover,
.nav__link.active {
  color: var(--text-primary);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.hamburger__line {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 300ms ease, opacity 300ms ease;
}

.hamburger.active .hamburger__line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger__line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================ */
/* HERO SECTION                                 */
/* ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--header-height);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 60px 0;
}

.hero__greeting {
  font-size: 1rem;
  font-weight: 500;
  color: #90ddf0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(144, 221, 240, 0.3);
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #07393c, #2c666e, #90ddf0, #2c666e, #07393c);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s ease-in-out infinite;
}

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

.hero__subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.hero__description {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Hero Code Card */
.hero__code-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 2;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: float 6s ease-in-out infinite;
  position: relative;
}

.hero__code-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(7, 57, 60, 0.3), rgba(144, 221, 240, 0.1), rgba(44, 102, 110, 0.3));
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition);
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.code-line { color: var(--text-secondary); }
.code-line.indent { padding-left: 20px; }
.code-keyword { color: var(--accent-light); }
.code-var { color: var(--accent-secondary); }
.code-prop { color: var(--accent-light); }
.code-string { color: var(--accent-light); }

/* Scroll Indicator */
.hero__scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, #90ddf0, transparent);
  animation: scrollPulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(144, 221, 240, 0.3);
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ============================================ */
/* BUTTONS                                      */
/* ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.btn--primary:hover {
  background: #062c2e;
  border-color: #062c2e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(7, 57, 60, 0.3), 0 0 20px rgba(44, 102, 110, 0.15);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn--outline:hover {
  border-color: var(--accent-light);
  color: var(--accent-light);
  transform: translateY(-2px);
}

.btn--small {
  font-size: 0.8rem;
  padding: 8px 18px;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn--full {
  width: 100%;
}

/* ============================================ */
/* ABOUT SECTION                                */
/* ============================================ */
.about__content {
  max-width: 720px;
  margin: 0 auto;
}

.about__content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 20px;
}

.about__content p:last-child {
  margin-bottom: 0;
}

/* ============================================ */
/* SERVICES SECTION                             */
/* ============================================ */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-secondary);
  transform: translateY(-6px);
  box-shadow: 0 0 30px rgba(44, 102, 110, 0.15), 0 12px 40px rgba(7, 57, 60, 0.15);
}

.service-card__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-card);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  color: var(--accent-light);
}

.service-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.service-card__description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  flex: 1;
}

.service-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-card__tags span {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  background: rgba(7, 57, 60, 0.15);
  color: #90ddf0;
  border-radius: 100px;
}

/* ============================================ */
/* PROJECTS SECTION                             */
/* ============================================ */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 0 30px rgba(44, 102, 110, 0.1), 0 12px 40px rgba(0, 0, 0, 0.3);
}

.project-card__image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
}

.project-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-card__description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-card__tags span {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 10px;
  background: rgba(44, 102, 110, 0.15);
  color: #90ddf0;
  border-radius: 100px;
}

.project-card__links {
  display: flex;
  gap: 10px;
}

/* ============================================ */
/* SKILLS SECTION                               */
/* ============================================ */
.skills__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 700px;
  margin: 0 auto;
}

.skills__grid .skill-badge:nth-child(1) { transition-delay: 0ms; }
.skills__grid .skill-badge:nth-child(2) { transition-delay: 60ms; }
.skills__grid .skill-badge:nth-child(3) { transition-delay: 120ms; }
.skills__grid .skill-badge:nth-child(4) { transition-delay: 180ms; }
.skills__grid .skill-badge:nth-child(5) { transition-delay: 240ms; }
.skills__grid .skill-badge:nth-child(6) { transition-delay: 300ms; }
.skills__grid .skill-badge:nth-child(7) { transition-delay: 360ms; }
.skills__grid .skill-badge:nth-child(8) { transition-delay: 420ms; }
.skills__grid .skill-badge:nth-child(9) { transition-delay: 480ms; }
.skills__grid .skill-badge:nth-child(10) { transition-delay: 540ms; }
.skills__grid .skill-badge:nth-child(11) { transition-delay: 600ms; }
.skills__grid .skill-badge:nth-child(12) { transition-delay: 660ms; }
.skills__grid .skill-badge:nth-child(13) { transition-delay: 720ms; }
.skills__grid .skill-badge:nth-child(14) { transition-delay: 780ms; }
.skills__grid .skill-badge:nth-child(15) { transition-delay: 840ms; }

.skill-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 18px 8px 8px;
  transition: all var(--transition);
}

.skill-badge:hover {
  border-color: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(44, 102, 110, 0.15);
}

.skill-badge__icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.skill-badge__name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ============================================ */
/* CONTACT SECTION                              */
/* ============================================ */
.contact__grid {
  max-width: 560px;
  margin: 0 auto;
}

.contact__links--centered {
  text-align: center;
}

.contact__profiles--row {
  flex-direction: row !important;
  justify-content: center;
  gap: 32px;
}

/* Contact Links */
.contact__description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 32px;
}

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

.contact__profile {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: var(--text-secondary);
  transition: all var(--transition);
  font-size: 0.95rem;
  font-weight: 500;
}

.contact__profile:hover {
  color: var(--accent-light);
  transform: translateY(-2px);
}

.contact__profile:hover svg {
  transform: scale(1.15);
}

.contact__profile svg {
  transition: transform var(--transition);
}

/* ============================================ */
/* FOOTER                                       */
/* ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

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

.footer__copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer__top {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer__top:hover {
  color: var(--accent-light);
}

/* ============================================ */
/* RESPONSIVE — TABLET                         */
/* ============================================ */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero__description {
    margin: 0 auto 32px;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__code-card {
    max-width: 460px;
    margin: 0 auto;
  }

  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

/* ============================================ */
/* RESPONSIVE — MOBILE                         */
/* ============================================ */
@media (max-width: 640px) {
  .section {
    padding: 64px 0;
  }

  .section__header {
    margin-bottom: 40px;
  }

  /* Mobile nav */
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(10, 9, 12, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 24px;
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 350ms ease, opacity 350ms ease;
    pointer-events: none;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__list {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }

  .nav__link {
    font-size: 1rem;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding-bottom: 60px;
  }

  .hero__code-card {
    font-size: 0.75rem;
    padding: 20px 24px;
  }

  .hero__scroll-indicator {
    display: none;
  }

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

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

  .skills__grid {
    gap: 10px;
  }

  .skill-badge {
    padding: 6px 14px 6px 6px;
  }

  .skill-badge__name {
    font-size: 0.8rem;
  }

  .footer__inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
