* { box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* Background “network” feel without images */
.bg{
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 70% 20%, rgba(79,182,176,0.14), transparent 55%),
    radial-gradient(900px 600px at 25% 15%, rgba(120,170,255,0.10), transparent 55%),
    radial-gradient(800px 500px at 60% 80%, rgba(79,182,176,0.08), transparent 60%),
    linear-gradient(180deg, #0a1016 0%, #070c11 100%);
  z-index: -2;
}

.stars{
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.10) 0 1px, transparent 2px),
    radial-gradient(circle at 30% 60%, rgba(255,255,255,0.08) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 30%, rgba(255,255,255,0.07) 0 1px, transparent 2px),
    radial-gradient(circle at 85% 75%, rgba(255,255,255,0.06) 0 1px, transparent 2px);
  background-size: 320px 240px;
  opacity: 0.55;
  z-index: -1;
  filter: blur(0.2px);
}

body > main{
  max-width: var(--max);
  margin: 18px auto 64px;
  padding: 16px;

  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: rgba(6,10,14,0.20);
  box-shadow: var(--shadow);
  overflow: hidden;
}

body > main > header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(10, 16, 22, 0.55);
  backdrop-filter: blur(10px);

  .brand{
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;

    .logo{
      width: 44px;
      height: 44px;
      border-radius: 999px;
      overflow: hidden;
      flex: 0 0 auto;
      box-shadow: 0 10px 30px rgba(0,0,0,0.35);
      border: 1px solid rgba(255,255,255,0.10);
      background: rgba(255,255,255,0.04);
      display: grid;
      place-items: center;
    }

    .site{
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;

      .name{
        font-weight: 650;
        letter-spacing: 0.2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .tag{
        font-size: 12px;
        color: var(--muted-alt);
      }
    }
  }

  .actions{
    display: flex;
    align-items: center;
    gap: 10px;

    .active-section{
      padding: 7px 12px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.12);
      background: rgba(255,255,255,0.05);
      color: rgba(245,250,255,0.9);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.35px;
      text-transform: uppercase;
      line-height: 1.1;
      white-space: nowrap;
    }

    .print-action{
      width: 34px;
      height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 10px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.04);
      color: rgba(245,250,255,0.88);
      cursor: pointer;
      transition: background 160ms ease, border-color 160ms ease, color 160ms ease;

      &:hover{
        background: rgba(255,255,255,0.09);
        border-color: rgba(255,255,255,0.16);
      }

      &:focus-visible{
        outline: 2px solid rgba(79,182,176,0.55);
        outline-offset: 2px;
      }

      svg{
        width: 18px;
        height: 18px;
      }
    }

    details{
      position: relative;
      flex: 0 0 auto;

      summary{
        list-style: none;
        user-select: none;
        cursor: pointer;

        &::-webkit-details-marker{ display: none; }
      }

      /* Hamburger -> X animation */
      svg.hamburger{
        width: 18px;
        height: 18px;
        display: block;

        .h-line{
          fill: none;
          stroke: rgba(245,250,255,0.85);
          stroke-width: 2;
          stroke-linecap: round;
          transform-origin: 12px 12px;
          transition: transform 180ms ease, opacity 160ms ease;
        }
      }

      &[open]{
        svg.hamburger{
          .h-top{ transform: translateY(5px) rotate(45deg); }
          .h-mid{ opacity: 0; }
          .h-bot{ transform: translateY(-5px) rotate(-45deg); }
        }
      }

      nav{
        position: absolute;
        right: 0;
        top: calc(100% + 10px);
        min-width: 220px;
        max-width: min(260px, 72vw);
        padding: 10px;
        border-radius: 14px;
        border: 1px solid var(--stroke);
        background: rgba(10, 16, 22, 0.78);
        backdrop-filter: blur(12px);
        box-shadow: 0 18px 60px rgba(0,0,0,0.55);
        z-index: 30;

        display: grid;
        gap: 6px;

        /* Shared item layout for links and active div */
        & > a,
        & > div{
          display: flex;
          align-items: center;
          gap: 10px;
          padding: 10px 10px;
          border-radius: 12px;
          text-decoration: none;

          transition:
            background 160ms ease,
            border-color 160ms ease,
            box-shadow 160ms ease,
            transform 160ms ease;

          span{
            font-weight: 650;
            letter-spacing: 0.1px;
            font-size: 14px;
            color: rgba(245,250,255,0.90);
          }

          svg{
            width: 18px;
            height: 18px;
            color: rgba(245,250,255,0.85);
            opacity: 0.95;
          }
        }

        /* Normal links */
        & > a{
          border: 1px solid rgba(255,255,255,0.06);
          background: rgba(255,255,255,0.03);

          &:hover{
            background: rgba(255,255,255,0.06);
            border-color: rgba(255,255,255,0.12);
          }
        }

        /* ACTIVE item (you use div instead of a)
           Use <div class="active"> ... </div> */
        & > div {
          position: relative; /* needed for ::before bar */
          padding-left: 18px;

          background: linear-gradient(
            180deg,
            rgba(79,182,176,0.22),
            rgba(255,255,255,0.08)
          );

          border: 1px solid rgba(79,182,176,0.45);
          box-shadow:
            0 10px 30px rgba(79,182,176,0.18),
            inset 0 0 0 1px rgba(255,255,255,0.06);

          transform: translateY(-1px);

          &::before{
            content: "";
            position: absolute;
            left: 8px;
            top: 10px;
            bottom: 10px;
            width: 3px;
            border-radius: 99px;
            background: rgba(79,182,176,0.85);
            box-shadow: 0 0 0 4px rgba(79,182,176,0.12);
          }

          span{ color: rgba(255,255,255,0.98); }

          svg{
            color: rgba(79,182,176,1);
            opacity: 1;
            filter: drop-shadow(0 6px 18px rgba(79,182,176,0.25));
          }
        }

        /* Focus ring (scoped to dropdown) */
        :where(summary, a):focus-visible{
          outline: 2px solid rgba(79,182,176,0.55);
          outline-offset: 2px;
          border-radius: 12px;
        }
      }
    }
  }
}

img.avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  padding: 4px;
  margin: 4px;
  display: inline-block;
  vertical-align: middle;
}


/* -----------------------------
  Sections / layout
----------------------------- */
.content{
  padding: 18px 16px 30px;
}
.grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  /* align-items: start; */
  /* Mobile order */
  grid-template-areas: "aside" "main";

  main  { grid-area: main; }
  aside { grid-area: aside; }
}
.panel{
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  overflow: hidden;
}
.panel-header{
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.06);
}
.panel-header h2{
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.panel-body{
  padding: 14px 16px 16px;
}

a.panel-link{
  text-decoration: none;;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-alt);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);

  svg { width: 16px; height: 16px; opacity: 0.9; }
}
a.panel-link:hover{
  color: rgba(245,250,255,0.85);
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}

footer{
  padding: 18px 16px 22px;
  color: var(--muted-alt);
  font-size: 12px;
  clear: both;
  border-top: 1px solid var(--stroke);
  display: grid;
  gap: 14px;

  .footer-grid{
    display: grid;
    gap: 12px;
  }

  .footer-contact,
  .footer-social,
  .footer-address{
    display: grid;
    gap: 8px;
  }

  .footer-contact a,
  .footer-social a{
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(245,250,255,0.82);
    width: fit-content;

    svg{
      width: 16px;
      height: 16px;
      color: var(--accent);
      opacity: 0.95;
    }

    span{
      font-size: 13px;
      letter-spacing: 0.1px;
    }

    &:hover span{
      color: rgba(245,250,255,0.98);
    }
  }

  .footer-address{
    color: rgba(245,250,255,0.82);

    div{
      font-size: 13px;
      letter-spacing: 0.1px;
      line-height: 1.45;
    }
  }

  .footer-copy{
    text-align: center;
    color: var(--muted-alt);
    font-size: 12px;
    clear: both;
  }
}

@media (min-width: 980px){
  body > main{ padding: 24px; }
  .hero{ padding: 76px 24px 34px; }
  .content{ padding: 22px 24px 42px; }

  .grid{
    grid-template-columns: 1.5fr 0.9fr;
    /* Desktop order */
    grid-template-areas: "main aside";
  }
  footer .footer-grid{
    grid-template-columns: 1fr auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    column-gap: 24px;
  }

  footer .footer-social{
    justify-items: start;
  }

  footer .footer-address{
    justify-items: end;
    text-align: right;
  }
}
