/* ==========================================================================
   Recycle Pay — layout.css
   Page background, header, tab navigation, mobile menu, panels and footer.
   ========================================================================== */

/* ---------- Layered page background ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--paper);
}

.bg-tint {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      60vw 50vh at 8% 0%,
      rgba(196, 236, 216, 0.85),
      transparent 70%
    ),
    radial-gradient(
      50vw 45vh at 100% 18%,
      rgba(196, 222, 252, 0.8),
      transparent 70%
    ),
    radial-gradient(
      55vw 50vh at 38% 100%,
      rgba(255, 232, 168, 0.8),
      transparent 70%
    ),
    radial-gradient(
      40vw 40vh at 88% 88%,
      rgba(255, 200, 215, 0.7),
      transparent 70%
    );
}

/* Floating recycling icons */
.fl {
  position: absolute;
  bottom: -70px;
  font-size: 1.7rem;
  opacity: 0.26;
  animation: floatup 30s linear infinite;
}

.fl:nth-of-type(1) {
  left: 6%;
  color: #74c045;
  animation-duration: 28s;
  animation-delay: -4s;
}
.fl:nth-of-type(2) {
  left: 18%;
  color: #5a8ff0;
  animation-duration: 34s;
  animation-delay: -18s;
}
.fl:nth-of-type(3) {
  left: 31%;
  color: #ffab4d;
  animation-duration: 26s;
  animation-delay: -9s;
}
.fl:nth-of-type(4) {
  left: 44%;
  color: #f06aa0;
  animation-duration: 38s;
  animation-delay: -25s;
}
.fl:nth-of-type(5) {
  left: 57%;
  color: #3cb8a6;
  animation-duration: 30s;
  animation-delay: -13s;
}
.fl:nth-of-type(6) {
  left: 69%;
  color: #8f7bea;
  animation-duration: 36s;
  animation-delay: -2s;
}
.fl:nth-of-type(7) {
  left: 81%;
  color: #ff7a7a;
  animation-duration: 27s;
  animation-delay: -20s;
}
.fl:nth-of-type(8) {
  left: 92%;
  color: #5a8ff0;
  animation-duration: 33s;
  animation-delay: -11s;
}

/* Slow waves along the bottom */
.wave {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200%;
  height: 22vh;
  animation: slide 30s linear infinite;
}

.w1 {
  fill: rgba(116, 192, 69, 0.17);
}

.w2 {
  fill: rgba(90, 143, 240, 0.15);
  height: 16vh;
  animation-duration: 22s;
  animation-direction: reverse;
}

.w3 {
  fill: rgba(255, 171, 77, 0.17);
  height: 11vh;
  animation-duration: 40s;
}

/* ---------- Header ---------- */

.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: rgba(243, 248, 238, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
}

.bar .logo {
  flex: 0 0 auto;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

/* Header/footer logo: the round Recycle Pay mark followed by the name in text */
.logo-img {
  display: block;
  width: 46px;
  height: 46px;
}

.logo-name {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* "Pay" in brand green, as in the original logo */
.logo-name b {
  color: var(--brand);
  font-weight: 800;
}

/* ---------- Main navigation (links to each page; current one has aria-current="page") ---------- */

.tabs {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.2rem;
  padding: 0;
}

.tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.5em 0.8em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.tab svg {
  color: #8a95a3;
}

.tab:hover:not([aria-current="page"]) {
  background: #e8ede6;
  color: var(--ink);
}

.tab[aria-current="page"] {
  background: var(--tint);
  color: var(--brand-dark);
  font-weight: 700;
}

.tab[aria-current="page"] svg {
  color: var(--brand);
}

/* Tighter tabs so the whole menu fits on the logo row on smaller laptops */
@media (min-width: 1025px) and (max-width: 1180px) {
  .tab {
    gap: 0.35em;
    padding: 0.45em 0.6em;
    font-size: 0.88rem;
  }
}

/* ---------- Mobile menu ---------- */

.menu-btn {
  display: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #cfe4ff, #ddd2fb);
  color: var(--ink);
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.menu-btn:active {
  transform: scale(0.94);
}

.menu-btn .mi-close {
  display: none;
}

.menu-btn[aria-expanded="true"] .mi-open {
  display: none;
}

.menu-btn[aria-expanded="true"] .mi-close {
  display: inline;
}

/* Below laptop width the menu collapses behind the menu button */
@media (max-width: 1024px) {
  .menu-btn {
    display: grid;
  }

  .bar {
    flex-wrap: wrap;
    gap: 0 1rem;
  }

  .tabs {
    order: 3;
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.4rem;
    overflow: hidden;
    max-height: 0;
    padding: 0;
    opacity: 0;
    transition:
      max-height 0.4s ease,
      opacity 0.3s ease,
      padding 0.3s ease;
  }

  .tabs.open {
    max-height: 640px;
    padding: 0.4rem 0 1rem;
    opacity: 1;
  }

  .tab {
    justify-content: flex-start;
    padding: 0.75em 1em;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
  }
}

@media (max-width: 560px) {
  .logo-img {
    width: 40px;
    height: 40px;
  }

  .logo-name {
    font-size: 1.2rem;
  }
}

@media (max-width: 360px) {
  .tabs {
    grid-template-columns: 1fr;
  }
}

/* ---------- Panels (one per tab) ---------- */

.panel {
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 5rem);
}

.panel[hidden] {
  display: none;
}

.panel.home {
  padding-top: 0;
}

.head {
  margin-bottom: clamp(1.8rem, 3vw, 2.6rem);
}

.head h2 {
  display: inline;
}

.head h2 + p {
  margin-top: 1.1rem;
}

/* ---------- Footer ---------- */

footer {
  margin-top: 2rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--line);
}

.foot {
  display: grid;
  grid-template-columns: 1.1fr 2fr;
  gap: 2rem;
  align-items: start;
}

/* Footer brand block: as wide as its content, with the round mark centred
   above "Sort. Recycle. Earn." and the social icons */
.foot-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  text-align: center;
}

.foot-brand p {
  margin: 0.6rem 0;
  font-size: 0.92rem;
}

/* Footer shows the round mark only (no name) */
.foot-brand .logo-img {
  width: 64px;
  height: 64px;
}

.foot-brand .socials {
  margin: 0.8rem 0;
}


.foot-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.foot-cols h4 {
  margin: 0 0 0.7rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.foot-cols a {
  display: block;
  padding: 0.3rem 0;
  color: var(--ink);
  text-decoration: none;
}

.foot-cols a:hover {
  color: var(--brand-dark);
}

/* "Recycle Pay is an initiative of …" credit line under the footer */
.foot-note {
  max-width: none;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.foot-note a {
  color: var(--brand-dark);
  font-weight: 600;
}

@media (max-width: 900px) {
  .foot {
    grid-template-columns: 1fr;
  }

  .foot-cols {
    grid-template-columns: 1fr 1fr;
  }
}
