@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  font-size: 10px;
  font-family: var(--font-primary);
}

:root {
  /* Colors */
  --color-light-gray: rgb(38, 38, 38);
  --color-dark-gray: rgb(2, 0, 57);
  --color-dark-blue: rgb(2, 4, 164);
  --color-light-blue: rgb(0, 24, 204);
  --color-light-green: rgb(51, 219, 219);
  --color-light: #fff;
  --color-placeholder: #a9a8a8;

  /* Font Sizes */
  --fs-xs: 1.3rem;
  --fs-sm: 1.5rem;
  --fs-md: 1.7rem;
  --fs-lg: 2.7rem;
  --fs-xl: 5.2rem;

  /* Font Families */
  --font-heading: gelica, "gelica Fallback", Georgia, serif;
  --font-primary: "Inter", sans-serif;

  /* spacing */
  --button-padding: 10px 12px;
  --footer-padding: 80px 0px;
  --input-padding: 15px 20px;

  /* shadows */
  --shadow: rgba(2, 0, 57, 0.19) 8px 8px 27px 0px, rgba(2, 0, 57, 0.12) 0px 4px 8px 0px;
}

ul { list-style: none; }
a { text-decoration: none; }

/* ================= Header ================= */
.header {
  width: 90%;
  margin: 0 auto;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  position: relative;
}

.header__logo { 
  height: 8rem; 
  max-width: 100%;
  object-fit: contain;
}

.header__nav-links {
  width: 35%;
  font-size: var(--fs-sm);
}

.header__nav-links .header__nav-list {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.header__nav-links .header__nav-link {
  color: var(--color-dark-gray);
  font-weight: 500;
  white-space: nowrap;
}

.header__nav-btns .header__nav-list {
  display: flex;
  gap: 20px;
  font-size: var(--fs-xs);
  align-items: center;
}

.header__nav-btns .header__nav-link {
  font-weight: 600;
  white-space: nowrap;
}

.header__nav-btns .header__nav-login {
  font-size: var(--fs-sm);
  color: var(--color-dark-gray);
}

.header__nav-btns .btn {
  border: 1px solid var(--color-dark-blue);
  padding: var(--button-padding);
  border-radius: 5px;
  display: inline-block;
}

.header__nav-btns .header__nav-free {
  background-color: var(--color-dark-blue);
  color: var(--color-light);
}

/* Hamburger Menu Button Styles */
.header__menu-toggle {
  display: none; /* Hidden by default, shown in media query */
  background: transparent;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 100;
}

.header__menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--color-dark-gray);
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.header__menu-toggle span:nth-child(1) { top: 0; }
.header__menu-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.header__menu-toggle span:nth-child(3) { bottom: 0; }

/* Hamburger to "X" animation */
.header.menu-open .header__menu-toggle span:nth-child(1) {
  transform: rotate(45deg);
  top: 50%;
}
.header.menu-open .header__menu-toggle span:nth-child(2) {
  opacity: 0;
}
.header.menu-open .header__menu-toggle span:nth-child(3) {
  transform: rotate(-45deg);
  top: 50%;
}

/* ================= Gallery ================= */
.gallery {
  width: 90%;
  margin: 130px auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(10, 100px);
  gap: 20px;
  max-width: 1400px;
}

.gallery__text {
  grid-column: 1 / 5;
  grid-row: 1 / 3;
}

.gallery__text h1 {
  font-size: var(--fs-xl);
  color: var(--color-dark-gray);
  font-family: var(--font-heading);
  line-height: 1;
}

.gallery__text button {
  background-color: var(--color-light-blue);
  color: var(--color-light);
  box-shadow: var(--shadow);
  border: none;
  padding: 1.5rem 4.5rem;
  border-radius: 5px;
  letter-spacing: .4px;
  font-weight: 600;
  margin-top: 4rem;
  cursor: pointer;
  font-size: var(--fs-sm);
}

.gallery__item img {
  height: 100%;
  width: 100%;
  box-shadow: var(--shadow);
  border-radius: 5px;
  object-fit: cover;
  display: block;
}

.gallery__item-1 { grid-row: 1 / 5; }
.gallery__item-2 { grid-row: 4 / 7; }
.gallery__item-3 { grid-row: 5 / 8; }
.gallery__item-4 { grid-row: 3 / 6; }
.gallery__item-5 { grid-row: 4 / 6; }
.gallery__item-6 { grid-row: 8 / -1; }
.gallery__item-7 { grid-row: 9 / -1; }
.gallery__item-8 { grid-row: 7 / -2; }
.gallery__item-9 { grid-row: 7 / span 2; }
.gallery__item-10 { grid-row: 6 / span 4; }

/* ================= Footer ================= */
.footer {
  background-color: var(--color-dark-gray);
  color: var(--color-light);
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.footer__heading {
  font-size: var(--fs-lg);
  font-family: var(--font-heading);
  text-align: center;
}

.footer__form {
  width: 80%;
  max-width: 600px;
  display: flex;
  justify-content: center;
}

.footer__form input {
  padding: var(--input-padding);
  border-radius: 5px 0 0 5px;
  border: none;
  width: 70%;
  font-size: var(--fs-sm);
}

.footer__form input::placeholder {
  font-size: var(--fs-sm);
  color: var(--color-placeholder);
  font-weight: 500;
}

.footer__form button {
  background-color: var(--color-dark-blue);
  padding: 1.5rem;
  width: 30%;
  color: #fff;
  border: none;
  border-radius: 0 5px 5px 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.footer__text { 
  font-size: 1.5rem; 
  text-align: center;
}
.footer__text a { color: var(--color-light-green); }

/* ================= Responsive Design ================= */

@media (max-width: 1100px) {
  .header {
    flex-wrap: wrap;
  }

  .header__menu-toggle {
    display: block;
    order: 3;
  }

  .header__nav-links,
  .header__nav-btns {
    display: none;
    order: 4;
    width: 100%;
    text-align: center;
  }

  .header.menu-open .header__nav-links,
  .header.menu-open .header__nav-btns {
    display: block;
  }
  
  .header__nav-links .header__nav-list,
  .header__nav-btns .header__nav-list {
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
  }
}

@media (max-width: 930px) {
  :root {
    --fs-xl: 4.2rem; 
  }

  .gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(15, 70px);
    gap: 15px;
  }

  .gallery__text {
    grid-column: 1 / -1;
    grid-row: 1 / 3;
    text-align: center;
  }

  /* Adjust grid items for 4 columns */
  .gallery__item-1 { grid-column: 1; grid-row: 3 / 7; }
  .gallery__item-2 { grid-column: 2; grid-row: 3 / 6; }
  .gallery__item-3 { grid-column: 3; grid-row: 3 / 7; }
  .gallery__item-4 { grid-column: 4; grid-row: 3 / 6; }
  .gallery__item-5 { grid-column: 1; grid-row: 7 / 10; }
  .gallery__item-6 { grid-column: 2; grid-row: 6 / 10; }
  .gallery__item-7 { grid-column: 3; grid-row: 7 / 11; }
  .gallery__item-8 { grid-column: 4; grid-row: 6 / 9; }
  .gallery__item-9 { grid-column: 1 / 3; grid-row: 10 / 13; }
  .gallery__item-10 { grid-column: 3 / 5; grid-row: 11 / 15; }
}

@media (max-width: 930px) {
  :root {
    --fs-xl: 3.8rem; 
    --fs-lg: 2.4rem;
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(18, 60px);
    margin: 100px auto;
  }

  .gallery__text {
    grid-column: 1 / -1;
    grid-row: 1 / 4;
  }

  /* Adjust grid items for 3 columns */
  .gallery__item-1 { grid-column: 1; grid-row: 4 / 8; }
  .gallery__item-2 { grid-column: 2; grid-row: 4 / 7; }
  .gallery__item-3 { grid-column: 3; grid-row: 4 / 8; }
  .gallery__item-4 { grid-column: 1; grid-row: 8 / 11; }
  .gallery__item-5 { grid-column: 2; grid-row: 7 / 10; }
  .gallery__item-6 { grid-column: 3; grid-row: 8 / 12; }
  .gallery__item-7 { grid-column: 1; grid-row: 11 / 14; }
  .gallery__item-8 { grid-column: 2; grid-row: 10 / 14; }
  .gallery__item-9 { grid-column: 3; grid-row: 12 / 15; }
  .gallery__item-10 { grid-column: 1 / 3; grid-row: 14 / 18; }

  .footer__form {
    width: 90%;
  }
}

@media (max-width: 640px) {
  :root {
    --fs-xl: 3rem; 
    --fs-lg: 2.2rem;
    --fs-sm: 1.4rem;
  }

  .header {
    width: 95%;
  }

  .header__logo {
    height: 6rem;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(22, 50px);
    gap: 12px;
    margin: 80px auto;
  }

  .gallery__text {
    grid-column: 1 / -1;
    grid-row: 1 / 4;
  }

  .gallery__text button {
    padding: 1.2rem 3rem;
    margin-top: 2rem;
  }

  /* Adjust grid items for 2 columns */
  .gallery__item-1 { grid-column: 1; grid-row: 4 / 8; }
  .gallery__item-2 { grid-column: 2; grid-row: 4 / 7; }
  .gallery__item-3 { grid-column: 1; grid-row: 8 / 12; }
  .gallery__item-4 { grid-column: 2; grid-row: 7 / 10; }
  .gallery__item-5 { grid-column: 1; grid-row: 12 / 15; }
  .gallery__item-6 { grid-column: 2; grid-row: 10 / 14; }
  .gallery__item-7 { grid-column: 1; grid-row: 15 / 18; }
  .gallery__item-8 { grid-column: 2; grid-row: 14 / 18; }
  .gallery__item-9 { grid-column: 1; grid-row: 18 / 21; }
  .gallery__item-10 { grid-column: 2; grid-row: 18 / 22; }

  .footer__form {
    width: 95%;
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .footer__form input,
  .footer__form button {
    width: 100%;
    border-radius: 5px;
  }

  .footer {
    padding: 60px 15px;
  }
}

@media (max-width: 400px) {
  :root {
    --fs-xl: 2.6rem; 
    --fs-lg: 2rem;
  }

  .gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 15px;
  }

  .gallery__text {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-bottom: 20px;
  }

  .gallery__text h1 br {
    display: none;
  }

  /* Single column layout for very small screens */
  .gallery__item {
    grid-column: 1 !important;
    grid-row: auto !important;
    height: 250px;
  }

  .gallery__item img {
    height: 100%;
    width: 100%;
  }
}

/* Hover effects for better interactivity */
@media (hover: hover) {
  .header__nav-link:hover {
    opacity: 0.7;
    transition: opacity 0.3s ease;
  }

  .gallery__text button:hover,
  .footer__form button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow), 0 5px 15px rgba(0, 24, 204, 0.3);
    transition: all 0.3s ease;
  }

  .gallery__item img:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
  }
}

/* Print styles */
@media print {
  .header, .footer {
      display: none;
  }
  
  body {
      margin: 0;
      color: #000;
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px auto;
  }
  
  .gallery__text {
      display: none;
  }
  
  .gallery__item {
      box-shadow: none;
      border: 1px solid #ccc;
  }
}