/* CSS RESET & ROOT VARIABLES */
:root {
  --bg-color: #121212;
  --bg-gradient: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  --primary-text-color: #fafafa;
  --secondary-text-color: #a0a0a0;
  --accent-color: #e50914;
  --accent-glow: rgba(229, 9, 20, 0.5);
  --card-bg-color: #1d1d1d;
  --border-color: #333333;
  --success-color: #28a745;
  --error-color: #dc3545;
  --font-family-main: "Poppins", sans-serif;
  --font-family-heading: "Oswald", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  background-image: var(--bg-gradient);
  color: var(--primary-text-color);
  font-family: var(--font-family-main);
  overflow-x: hidden;
  cursor: none;
}

/* PRELOADER */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.75s ease, visibility 0.75s ease;
}
.preloader-hidden {
  opacity: 0;
  visibility: hidden;
}
.preloader-logo {
  font-family: var(--font-family-heading);
  font-size: 3rem;
  color: var(--accent-color);
  animation: pulse 1.5s infinite ease-in-out;
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
}

/* CUSTOM CURSOR */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
  transition: all 0.1s ease-out;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
}
.cursor-outline {
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent-color);
  mix-blend-mode: difference;
}
.cursor-outline.hover {
  transform: translate(-50%, -50%) scale(1.5);
  background-color: rgba(229, 9, 20, 0.2);
}

/* UTILITY & GENERAL STYLES */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
section {
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}

h2.section-title {
  font-family: var(--font-family-heading);
  font-size: 3rem;
  margin-bottom: 60px;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: inline-block;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 10px;
  box-shadow: 0 5px 15px -5px var(--accent-glow);
}

p {
  color: var(--secondary-text-color);
  line-height: 1.7;
}
a {
  color: var(--primary-text-color);
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: none;
}

/* ANIMATION ON SCROLL STYLES */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* OUTLINE BACKGROUND LETTER */
.section-bg-letter {
  position: absolute;
  font-family: var(--font-family-heading);
  font-size: 25rem;
  font-weight: 700;
  z-index: -1;
  top: 1px;
  left: 2vw;
  transform: translateY(-50%);
  user-select: none;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.308);
  color: transparent;
  transition: transform 0.5s ease-out;
}

/* HEADER */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  background-color: rgba(18, 18, 18, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
}
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-family-heading);
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 40px;
  list-style: none;
}
.nav-link {
  font-weight: 500;
}
.nav-contact {
  padding: 8px 20px;
  border: 1px solid var(--primary-text-color);
  border-radius: 5px;
}
.nav-contact:hover {
  background-color: var(--primary-text-color);
  color: var(--bg-color);
}
.hamburger {
  display: none;
  cursor: none;
  font-size: 1.5rem;
}

/* HERO SECTION */
.hero {
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
}
.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.hero-socials {
  display: flex;
  flex-direction: column;
  gap: 25px;
  font-size: 1.5rem;
}
.hero-text {
  flex-grow: 1;
  padding: 0 50px;
}
.hero-line {
  overflow: hidden;
}
.hero-line h1 {
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1.2;
  font-family: var(--font-family-heading);
  transform: translateY(110%);
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}
.hero-line.visible h1 {
  transform: translateY(0);
}
.hero-text h1 span {
  color: var(--accent-color);
}
.hero-buttons {
  margin-top: 40px;
  display: flex;
  gap: 20px;
  opacity: 0;
  transition: opacity 0.8s ease 0.6s;
}
.hero-buttons.visible {
  opacity: 1;
}

.btn {
  position: relative;
  display: inline-block;
  padding: 12px 30px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.4s ease-in-out;
  z-index: 1;
  cursor: none;
}
.btn:hover {
  transform: translateY(-3px);
}
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--accent-color);
  border-radius: 5px;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease-in-out;
}
.btn:hover::before {
  transform: scaleX(1);
}
.btn-primary {
  background-color: var(--accent-color);
  color: white;
  border: 2px solid var(--accent-color);
}
.btn-primary:hover {
  color: var(--primary-text-color);
}
.btn-secondary {
  background-color: transparent;
  color: var(--primary-text-color);
  border: 2px solid var(--primary-text-color);
}
.btn-secondary:hover {
  color: var(--bg-color);
}
.btn-secondary::before {
  background: var(--primary-text-color);
}

/* HERO SVG DOODLE */
.hero-doodle-container {
  width: 350px;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-svg {
  overflow: visible;
}
.svg-bracket {
  fill: none;
  stroke: var(--secondary-text-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.3s ease;
}
.hero-doodle-container:hover .svg-bracket {
  stroke: var(--accent-color);
  transform: scale(1.1) translateX(-5px) translateY(-5px);
}
.hero-doodle-container:hover .svg-bracket:last-child {
  transform: scale(1.1) translateX(5px) translateY(-5px);
}

/* TICKER */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background-color: var(--primary-text-color);
  color: var(--bg-color);
  padding: 15px 0;
  transform: rotate(-2deg);
  margin-top: -50px;
  z-index: 5;
  position: relative;
}
.ticker {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 30s linear infinite;
}
.ticker:hover {
  animation-play-state: paused;
}
.ticker-item {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 40px;
  font-family: var(--font-family-heading);
}
.ticker-item::before {
  content: "●";
  color: var(--accent-color);
  margin-right: 20px;
}
@keyframes ticker-scroll {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ABOUT ME */
#about .about-content {
  max-width: 700px;
}
#about h3 {
  font-size: 2rem;
  margin-bottom: 20px;
  font-family: var(--font-family-heading);
}
#about p {
  font-size: 1.1rem;
  margin-bottom: 30px;
}

/* CARDS (Services, Projects, Articles, Work) */
.card-grid {
  display: grid;
  gap: 30px;
}
.services-grid,
.projects-grid,
.articles-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* FEATURED WORK SECTION */
.work-grid {
  grid-template-columns: 1fr;
  max-width: 800px;
  margin: 0 auto;
}

.card {
  background-color: var(--card-bg-color);
  padding: 40px 30px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  transform-style: preserve-3d;
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: var(--accent-color);
}
.card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  font-family: var(--font-family-heading);
  letter-spacing: 1px;
}
.project-links a,
.article-card a {
  margin-right: 20px;
  font-weight: 500;
  color: var(--secondary-text-color);
  text-decoration: underline;
}
.project-links a:hover,
.article-card a:hover {
  color: var(--accent-color);
}

/* EXPERIENCE */
.experience-item {
  display: flex;
  gap: 40px;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
}
.experience-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.experience-item h3 {
  font-size: 1.8rem;
  margin-bottom: 5px;
  font-family: var(--font-family-heading);
}
.experience-meta {
  color: var(--secondary-text-color);
  margin-bottom: 15px;
}

/* SKILLS */
.skills-categories {
  margin-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.skill-category-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--secondary-text-color);
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
}
.skill-category-btn:hover,
.skill-category-btn.active {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.skill-tag {
  background-color: var(--card-bg-color);
  padding: 10px 25px;
  border-radius: 5px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.skill-tag.hidden {
  transform: scale(0.5);
  opacity: 0;
  width: 0;
  padding: 10px 0;
  margin: 0;
  pointer-events: none;
}

/* CONTACT FORM */
.contact-form {
  max-width: 800px;
  margin: 0 auto;
}
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.form-input,
.form-textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: 5px;
  color: var(--primary-text-color);
  font-size: 1rem;
  font-family: var(--font-family-main);
}
.form-textarea {
  resize: vertical;
  min-height: 150px;
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}
.contact-form .btn-primary {
  width: auto;
  display: table;
  margin: 20px auto 0;
}
.form-message {
  text-align: center;
  margin-top: 20px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.form-message.visible {
  opacity: 1;
}
.form-message.success {
  color: var(--success-color);
}
.form-message.error {
  color: var(--error-color);
}

/* FOOTER */
.footer {
  padding: 50px 0;
  text-align: center;
}
.back-to-top {
  display: inline-block;
  margin-bottom: 30px;
  font-family: var(--font-family-heading);
}
.back-to-top i {
  display: block;
  margin-bottom: 5px;
}
.footer-socials {
  display: flex;
  justify-content: center;
  gap: 25px;
  font-size: 1.5rem;
  margin-bottom: 30px;
}
.copyright {
  color: var(--secondary-text-color);
  font-size: 0.9rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
  .cursor-dot,
  .cursor-outline {
    display: none;
  }
  body,
  a,
  .btn,
  .hamburger {
    cursor: auto;
  }
  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    gap: 60px;
  }
  .hero-socials {
    flex-direction: row;
  }
}

@media (max-width: 768px) {
  .section-bg-letter {
    display: none;
  } /* HIDE BG letters on mobile */
  .hero-doodle-container {
    display: none;
  } /* HIDE hero doodle on mobile */

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background-color: var(--card-bg-color);
    flex-direction: column;
    justify-content: center;
    gap: 50px;
    transition: right 0.4s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  }
  .nav-menu.active {
    right: 0;
  }
  .hamburger {
    display: block;
    z-index: 1001;
  }
  .hamburger.active i::before {
    content: "\f00d";
  }
  .hero-text h1 {
    font-size: 3rem;
  }
  .form-row {
    flex-direction: column;
  }
  .experience-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
