@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..600&display=swap');
/*
  Architecture: @layer cascade control
  
  base       → resets, tokens, typography
  layout     → page grid, structural zones
  components → sidebar, header, cards, forms, filters
  utilities  → helpers that override everything
  ============================================================
*/
@layer base, layout, components, utilities;

@layer base {
  :root {
    --color-primary: #6c3ae1;
    --color-primary-hover: #5a2bc7;
    --color-bg: #ffffff;
    --color-bg-dark: #0b0d17;
    --color-text: #1a1a2e;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;

    /* 
      NAV HEIGHT jako zmienna — używamy jej w kilku miejscach
      (padding menu, top offset). Zmiana w jednym miejscu
      aktualizuje wszystko.
    */
    --nav-height: 64px;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
  }

  body {
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  button {
    color: inherit;
    font: inherit;
    background: none;
    border: none;
    cursor: pointer;
  }
}

@layer components {
  .nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
  }

  .nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
  }

  .logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .logo-icon {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 0.4em;
    background-color: var(--color-primary);
  }

  .logo-text {
    font-size: 1.125rem;
    font-weight: 600;
  }

  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;

    &:hover {
      background-color: var(--color-border);
    }
  }

  .hamRotate.active {
    transform: rotate(45deg);
  }
  .hamRotate180.active {
    transform: rotate(180deg);
  }

  .line {
    fill: none;
    transition:
      stroke-dasharray 400ms,
      stroke-dashoffset 400ms;
    stroke: #000;
    stroke-width: 5.5;
    stroke-linecap: round;
  }

  .ham {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 400ms;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  .ham1 .top {
    stroke-dasharray: 40 139;
  }
  .ham1 .bottom {
    stroke-dasharray: 40 180;
  }
  .ham1.active .top {
    stroke-dashoffset: -98px;
  }
  .ham1.active .bottom {
    stroke-dashoffset: -138px;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    transition: max-height 0.3s ease;

    &.open {
      max-height: 250px;
    }
  }

  .nav-link {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: color 0.15s ease;

    &:hover {
      color: var(--color-text);
    }

    &.nav-cta {
      margin: 0.5rem 1.5rem 1rem;
      padding: 0.6rem 1.25rem;
      color: var(--color-bg);
      font-weight: 600;
      font-size: 0.9rem;
      text-align: center;
      border-radius: 100px;
      transition: background-color 0.15s ease;
      background-color: var(--color-primary);

      &:hover {
        background-color: var(--color-primary-hover);
      }
    }
  }

  .main {
    min-height: 200vh;
    background: linear-gradient(var(--color-bg), var(--color-border));
    padding: 2rem;
  }

  .main-text {
    text-align: center;
    padding-top: 4rem;
    color: var(--color-text-muted);
  }

  @media (min-width: 768px) {
    .hamburger-btn {
      display: none;
    }

    .nav-links {
      position: static;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: 0.25rem;
      max-height: none;
      overflow: visible;
      border-bottom: none;
      background: none;
      transition: none;
      flex: 1;
    }

    .nav-link {
      padding: 0.5rem 0.75rem;
      border-radius: 6px;

      &:first-child {
        margin-left: auto;
      }

      &:nth-child(3) {
        margin-right: auto;
      }

      &.nav-cta {
        margin: 0;
      }
    }
  }
}
