/* =========================
   GOOGLE FONT & RESET
========================= */

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

:root {
  --primary: #5a2d3b;
  --secondary: #d89ca4;
  --accent: #e7d4a5;
  --background: #fff8f4;
  --white: #ffffff;
  --text: #2f2f2f;
  --shadow: 0 10px 25px rgba(90, 45, 59, 0.12);
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

/* =========================
   DECORATIVE BACKGROUND
========================= */

body::before {
  content: "";

  position: fixed;
  inset: 0;

  background-image: radial-gradient(
    rgba(216, 156, 164, 0.15) 1px,
    transparent 1px
  );

  background-size: 40px 40px;

  pointer-events: none;

  z-index: -1;
}

/* =========================
   NAVBAR
========================= */

.navbar {
  position: sticky;

  top: 0;

  width: 100%;

  padding: 18px 8%;

  background: rgba(255, 248, 244, 0.96);

  backdrop-filter: blur(10px);

  display: flex;

  justify-content: space-between;

  align-items: center;

  z-index: 1000;

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo {
  display: flex;

  align-items: center;

  gap: 10px;

  font-size: 1.4rem;

  font-weight: 700;

  color: var(--primary);
}

.logo img {
  width: 45px;

  height: 45px;

  object-fit: contain;
}

.nav-links {
  display: flex;

  list-style: none;

  gap: 30px;
}

.nav-links a {
  text-decoration: none;

  color: var(--text);

  font-weight: 500;

  transition: 0.3s;

  position: relative;
}

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

.nav-links a::after {
  content: "";

  position: absolute;

  left: 0;

  bottom: -6px;

  width: 0;

  height: 2px;

  background: var(--primary);

  transition: 0.3s;
}

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

.nav-links a.active {
  color: var(--primary);

  font-weight: 600;
}

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

/* =========================
   HERO
========================= */

.hero-level {
  padding: 140px 10% 90px;

  text-align: center;
}

.hero-level h1 {
  font-size: 3.5rem;

  color: var(--primary);

  margin-bottom: 20px;
}

.hero-level p {
  max-width: 750px;

  margin: auto;

  color: #666;

  font-size: 1.1rem;

  line-height: 1.8;
}

/* =========================
   SECTION
========================= */

.section {
  padding: 80px 8%;
}

.section-title {
  text-align: center;

  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2.5rem;

  color: var(--primary);

  margin-bottom: 10px;
}

.section-title p {
  color: #666;

  font-size: 1rem;
}

/* =========================
   CARD GRID
========================= */

.card-grid {
  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));

  gap: 30px;

  align-items: stretch;
}

/* =========================
   PROJECT CARD
========================= */

.card {
  background: var(--white);

  border-radius: 20px;

  overflow: hidden;

  box-shadow: var(--shadow);

  transition: 0.35s ease;

  display: flex;

  flex-direction: column;

  text-align: center;
}

.card:hover {
  transform: translateY(-10px);

  box-shadow: 0 15px 35px rgba(90, 45, 59, 0.18);
}

/* =========================
   CARD IMAGE
========================= */

.card img {
  width: 100%;

  height: 230px;

  object-fit: cover;

  transition: 0.4s;
}

.card:hover img {
  transform: scale(1.05);
}

/* =========================
   CARD CONTENT
========================= */

.card h3 {
  color: var(--primary);

  padding: 20px 20px 10px;

  font-size: 1.35rem;
}

.card p {
  padding: 0 20px;

  color: #555;

  line-height: 1.8;

  flex: 1;
}

/* =========================
   TRY THIS BUTTON
========================= */

.card-btn {
  display: inline-block;

  margin: 25px auto;

  padding: 12px 28px;

  background: var(--primary);

  color: white;

  text-decoration: none;

  border-radius: 30px;

  font-weight: 600;

  transition: 0.3s;
}

.card-btn:hover {
  background: var(--secondary);

  color: white;

  transform: translateY(-3px);
}

/* =========================
   DIFFICULTY BADGE
========================= */

.badge {
  display: inline-block;

  margin-top: 15px;

  padding: 6px 16px;

  border-radius: 20px;

  font-size: 0.85rem;

  font-weight: 600;

  color: white;
}

.easy {
  background: #6aa84f;
}

.intermediate {
  background: #f4b400;
}

.advanced {
  background: #c0392b;
}

/* =========================
   BACK BUTTON
========================= */

.back-home {
  text-align: center;

  padding: 20px 0 60px;
}

.back-home .card-btn {
  padding: 14px 35px;

  font-size: 1rem;
}

/* =========================
   SMALL ANIMATION
========================= */

@keyframes fadeUp {
  from {
    opacity: 0;

    transform: translateY(25px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

.card {
  animation: fadeUp 0.8s ease;
}

/* =========================
   POPUP MODAL
========================= */

.modal {
  display: none;

  position: fixed;

  left: 0;
  top: 0;

  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.55);

  z-index: 9999;

  overflow: auto;
  padding: 30px;

  animation: fadeIn 0.3s;
}

/* =========================
   MODAL CONTENT
========================= */

.modal-content {
  background: var(--white);

  width: 90%;
  max-width: 900px;
  height: 90vh;
  overflow-y: auto;
  margin: 20px auto;

  padding: 35px;

  border-radius: 25px;

  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);

  position: relative;

  animation: popup 0.35s ease;
}

/* =========================
   CLOSE BUTTON
========================= */

.close {
  position: absolute;

  top: 18px;
  right: 25px;

  font-size: 34px;

  color: var(--primary);

  cursor: pointer;

  transition: 0.3s;
}

.close:hover {
  transform: rotate(90deg);

  color: #d64545;
}

/* =========================
   MODAL TITLE
========================= */

#patternTitle {
  color: var(--primary);

  text-align: center;

  margin-bottom: 10px;

  font-size: 2rem;
}

#patternDifficulty {
  text-align: center;

  color: #777;

  margin-bottom: 30px;

  font-weight: 600;
}

/* =========================
   INFORMATION BOXES
========================= */

.section-box {
  background: #fff8f4;

  border-left: 5px solid var(--primary);

  border-radius: 15px;

  padding: 20px;

  margin-bottom: 22px;
}

.section-box h3 {
  color: var(--primary);

  margin-bottom: 15px;
}

.section-box p {
  color: #555;

  line-height: 1.8;
}

.section-box ul {
  padding-left: 25px;
}

.section-box li {
  margin-bottom: 10px;

  color: #444;
}

/* =========================
   PATTERN STEPS
========================= */

#patternSteps {
  display: flex;

  flex-direction: column;

  gap: 12px;
}

.step {
  background: white;

  border-radius: 12px;

  padding: 15px 18px;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);

  line-height: 1.8;
}

/* =========================
   FOOTER
========================= */

footer {
  background: var(--primary);
  color: white;
  padding: 50px 20px 20px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: auto;
  gap: 30px;
}

.footer-col {
  flex: 1;
  min-width: 200px;
}

.footer-col h3,
.footer-col h4 {
  margin-bottom: 12px;
}

.footer-col p {
  opacity: 0.9;
  line-height: 1.5;
}

/* Links */
.footer-col a {
  display: block;
  text-decoration: none;
  color: white;
  margin: 6px 0;
  opacity: 0.85;
  transition: 0.3s;
}

.footer-col a:hover {
  opacity: 1;
  transform: translateX(5px);
}

/* Bottom section */
.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 14px;
  opacity: 0.9;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;

  background-image: radial-gradient(
    rgba(216, 156, 164, 0.15) 1px,
    transparent 1px
  );

  background-size: 40px 40px;
  pointer-events: none;
  z-index: -1;
}
/* =========================
   ANIMATIONS
========================= */

@keyframes popup {
  from {
    transform: translateY(-30px) scale(0.95);

    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);

    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* =========================
   RESPONSIVE DESIGN
========================= */

@media (max-width: 992px) {
  .hero-level h1 {
    font-size: 3rem;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;

    gap: 15px;

    padding: 20px;
  }

  .nav-links {
    flex-wrap: wrap;

    justify-content: center;

    gap: 18px;
  }

  .hero-level {
    padding: 120px 8% 70px;
  }

  .hero-level h1 {
    font-size: 2.4rem;
  }

  .hero-level p {
    font-size: 1rem;
  }

  .section {
    padding: 60px 6%;
  }

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

  .card img {
    height: 220px;
  }

  .modal-content {
    width: 95%;

    margin: 30px auto;

    padding: 25px;
  }

  #patternTitle {
    font-size: 1.7rem;
  }
}

@media (max-width: 480px) {
  .hero-level h1 {
    font-size: 2rem;
  }

  .hero-level p {
    font-size: 0.95rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .logo img {
    width: 40px;

    height: 40px;
  }

  .card {
    border-radius: 15px;
  }

  .card h3 {
    font-size: 1.2rem;
  }

  .card-btn {
    width: 85%;

    text-align: center;
  }
}

/* =========================
   SCROLLBAR
========================= */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f5ece8;
}

::-webkit-scrollbar-thumb {
  background: var(--secondary);

  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* =========================
   TEXT SELECTION
========================= */

::selection {
  background: var(--secondary);

  color: white;
}

/* =========================
   SMOOTH TRANSITIONS
========================= */

a,
button,
.card,
.card img,
.card-btn,
.close {
  transition: 0.3s ease;
}

/* =========================
   END OF FILE
========================= */
