/* Declare layers in order of priority */
@layer reset, base, navigation, components;

/* Reset and base styles */
@layer reset {
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        font-family: 'Inter', sans-serif;
    }

    html,
    body {
        width: 100%;
        overflow-x: hidden;
        font-size: 14px;
    }
}

/* Color variables */
@layer base {
    :root {
      --background-color: #f0f4f8;
      --text-color: #333;
      --primary-color: #007bff;
      --secondary-color: #6c757d;
      --light-bg: #ffffff;
      --dark-bg: #343a40;
      --light-text: #ffffff;
      --dark-text: #000000;
    }
  
    @media (prefers-color-scheme: dark) {
      :root {
        --background-color: #343a40;
        --text-color: #ffffff;
        --secondary-color: #adb5bd;
        --light-bg: #495057;
        --dark-bg: #000000;
      }
    }
  }

@layer base {
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        line-height: 1.6;
        background-color: var(--background-color);
        color: var(--text-color);
    }

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

@layer navigation {
  header {
    background: var(--dark-bg);
    color: var(--light-text);
    padding: 1rem 0;

    nav {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      max-width: calc(100% - 2rem);
      margin: auto;
      padding: 0 1rem;

      .logo {
        font-size: 1.5rem;
        font-weight: bold;
      }

      .menu-toggle {
        font-size: 2rem;

        @media (width > 768px) {
          display: none;
        }
      }

      .nav-links {
        display: none;
        background: var(--dark-bg);
        text-align: right;
        list-style: none;
        flex-direction: column;

        &.active {
          display: flex;
        }

        @media (width <= 768px) {
          top: 60px;
          right: 0;
          width: 100%;
          position: absolute;
        }

        @media (width > 768px) {
          display: flex;
          flex-direction: row;
        }

        li {
          margin: 0;

          @media (width > 768px) {
            margin-left: 1rem;
          }

          a {
            display: block;
            padding: 1rem;

            &:hover {
              @media (width <= 768px) {
                background: var(--secondary-color);
                color: var(--light-var);
              }
            }

            @media (width <= 768px) {
              border-bottom: 1px solid var(--secondary-color);
              transition: background 0.3s, color 0.3s;
            }

            @media (width > 768px) {
              padding: 0.5rem 1rem;
            }
          }
        }
      }
    }
  }
}

/* Page components */
@layer components {
  .hero {
    background: url('laptop.png') no-repeat center center/cover;
    color: var(--light-text);
    text-align: center;
    padding: calc(5rem + 2vh) 1rem;
    width: 100%;
    
    h1 {
      font-size: calc(2.5rem + 1vw);
      margin-bottom: 1rem;
    }

    p {
      font-size: calc(1.25rem + 0.5vw);
      margin-bottom: 2rem;
    }

    .cta-button {
      background: var(--primary-color);
      color: var(--light-text);
      padding: 0.75rem 1.5rem;
      border-radius: 5px;
      opacity: 0.9;
      transition: opacity 0.3s;

      &:hover {
        opacity: 1;
      }
    }
  }

  .features {
    padding: 3rem 1rem;
    background: var(--light-bg);
    text-align: center;
    width: 100%;
    container-type: inline-size;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;

    h2 {
      font-size: 2rem;
      margin-bottom: 2rem;
      flex-basis: 100%;
    }

    svg {
      fill: var(--primary-color);
    }

    .feature {
      @container (width >= 600px) {
        flex: 1;
        max-width: 300px;

        svg {
          margin-bottom: 1rem;
          width: 48px;
          height: 48px;
        }
      }

      margin-bottom: 1.5rem;
      h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
      }
    }

    &:has(.feature) {
      border: 1px solid var(--primary-color);
      padding: 2rem;
    }
  }
  
  .about {
    padding: 3rem 1rem;
    background: var(--background-color);
    text-align: center;
    width: 100%;

    h2 {
      font-size: 2rem;
      margin-bottom: 1rem;
    }

    p {
      max-width: 800px;
      margin: 0 auto;
      text-align: center;
    }
  }

  .contact {
    padding: 3rem 1rem;
    background: var(--light-bg);
    text-align: center;
    width: 100%;

    h2 {
      font-size: 2rem;
      margin-bottom: 1rem;
    }

    form {
      display: flex;
      flex-direction: column;
      align-items: center;

      label {
        margin-top: 1rem;
      }

      input, textarea {
        width: calc(100% - 2rem);
        max-width: 500px;
        padding: 0.5rem;
        margin-top: 0.5rem;
        border: 1px solid #ccc;
        border-radius: 5px;
      }

      button {
        margin-top: 1rem;
        padding: 0.75rem 1.5rem;
        border: none;
        background: var(--dark-bg);
        color: var(--light-text);
        border-radius: 5px;
        transition: background 0.3s;

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

      &:has(input:not(:placeholder-shown), input:focus, textarea:not(:placeholder-shown), textarea:focus) {
        button {
          background-color: var(--primary-color);
        }
      }
    }
  }

  footer {
    background: var(--dark-bg);
    color: var(--light-text);
    text-align: center;
    padding: 1rem;
    width: 100%;
    margin-top: auto;
  }
}








