@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
:root{
  --base-clr: #11121a;
  --line-clr: #42434a;
  --hover-clr: #222533;
  --text-clr: #e6e6ef;
  --accent-clr: #5e63ff;
  --secondary-text-clr: #b0b3c1;
}
*{
  margin: 0;
  padding: 0;
}
html{
  font-family: Poppins, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5rem;
}
body{
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--base-clr);
  color: var(--text-clr);
  display: grid;
  grid-template-columns: auto 1fr;
}
#sidebar{
  box-sizing: border-box;
  height: 100%;
  width: 250px;
  padding: 5px 1em;
  background-color: var(--base-clr);
  border-right: 1px solid var(--line-clr);

  position: sticky;
  top: 0;
  align-self: start;
  transition: 300ms ease-in-out;
  overflow: hidden;
  text-wrap: nowrap;
}
#sidebar.close{
  padding: 5px;
  width: 60px;
}
#sidebar ul{
  list-style: none;
}
#sidebar > ul > li:first-child{
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
  .logo{
    font-weight: 600;
  }
}
#sidebar ul li.active a{
  color: var(--accent-clr);

  svg{
    fill: var(--accent-clr);
  }
}

#sidebar a, #sidebar .dropdown-btn, #sidebar .logo{
  border-radius: .5em;
  padding: .85em;
  text-decoration: none;
  color: var(--text-clr);
  display: flex;
  align-items: center;
  gap: 1em;
}
.dropdown-btn{
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}
#sidebar svg{
  flex-shrink: 0;
  fill: var(--text-clr);
}
#sidebar a span, #sidebar .dropdown-btn span{
  flex-grow: 1;
}
#sidebar a:hover, #sidebar .dropdown-btn:hover{
  background-color: var(--hover-clr);
}
#sidebar .sub-menu{
  display: grid;
  grid-template-rows: 0fr;
  transition: 300ms ease-in-out;

  > div{
    overflow: hidden;
  }
}
#sidebar .sub-menu.show{
  grid-template-rows: 1fr;
}
.dropdown-btn svg{
  transition: 200ms ease;
}
.rotate svg:last-child{
  rotate: 180deg;
}
#sidebar .sub-menu a{
  padding-left: 2em;
}
#toggle-btn{
  margin-left: auto;
  padding: 1em;
  border: none;
  border-radius: .5em;
  background: none;
  cursor: pointer;

  svg{
    transition: rotate 150ms ease;
  }
}
#toggle-btn:hover{
  background-color: var(--hover-clr);
}
/*
main{
  padding: min(30px, 7%);
}
main p{
  color: var(--secondary-text-clr);
  margin-top: 5px;
  margin-bottom: 15px;
}
*/

.container{
  border: 1px solid var(--line-clr);
  border-radius: 1em;
  margin-bottom: 20px;
  padding: min(3em, 15%);

  h2, p { margin-top: 1em }
}

/* Desktop content styling */
#content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2em;
}

#content > div {
  text-align: center;
  max-width: 800px;
}

.contact-input {
  --b: 2px;   /* border thickness */
  --s: .35em; /* corner size */
  --color: #ffffffb2;
  --trans-color: #0d6efd;

  width: 100%;
  padding: calc(.5em + var(--s)) calc(.7em + var(--s));
  color: var(--color);
  background: transparent;

  /* same conic-gradient border trick as button */
  background:
    conic-gradient(from 90deg at var(--b) var(--b), #0000 90deg, var(--color) 0)
    var(--_p, var(--s)) var(--_p, var(--s))
    / calc(100% - var(--b) - 2*var(--_p, var(--s)))
      calc(100% - var(--b) - 2*var(--_p, var(--s)));

  transition: .3s linear, color 0s, background-color 0s;
  outline: var(--b) solid #0000;
  outline-offset: .6em;
  border: 0;
  border-radius: 0; /* keep inputs flat like the button */

  font-size: 16px;
}

.contact-input::placeholder {
  color: #999;
}

.contact-input:hover,
.contact-input:focus {
  --_p: 0px;
  outline-color: var(--trans-color);
  outline-offset: .1em;
}

.contact-input:focus {
  color: #fff;
}

.contact-btn {
  --b: 3px;   /* border thickness */
  --s: .45em; /* size of the corner */
  --color: #ffffffb2;
  --trans-color: #0d6efd;
  padding: calc(.5em + var(--s)) calc(.9em + var(--s));
  color: var(--color);
  --_p: var(--s);
  background:
    conic-gradient(from 90deg at var(--b) var(--b),#0000 90deg,var(--color) 0)
    var(--_p) var(--_p)/calc(100% - var(--b) - 2*var(--_p)) calc(100% - var(--b) - 2*var(--_p));
  transition: .3s linear, color 0s, background-color 0s;
  outline: var(--b) solid #0000;
  outline-offset: .6em;
  font-size: 18px;

  border: 0;

  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  cursor: pointer
}

.contact-btn:hover,
.contact-btn:focus-visible{
  --_p: 0px;
  outline-color: var(--trans-color);
  outline-offset: .05em;
}

.contact-btn:active {
  background: var(--trans-color);
  color: #fff;
}

.topbar {
    top:0;
    height: 10%;
    width:100;
    
    background: #000;
    color: #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
  }

  .topbar ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
  }

  .topbar li {
    margin: 0 1rem;
    position: relative;
  }

  .topbar a, .topbar button {
    color: #e8eaed;
    text-decoration: none;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
  }

  .topbar .logo {
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 1rem;
  }

  .topbar .sub-menu {
    display: none;
    position: absolute;
    top: 2.5rem;
    left: 0;
    background: #111;
    padding: .5rem 0;
    border-radius: 4px;
  }

  .topbar .dropdown:hover .sub-menu {
    display: block;
  }

  .topbar .sub-menu li {
    padding: .3rem 1rem;
    white-space: nowrap;
  }

  .topbar .sub-menu a {
    color: #e8eaed;
  }

  .show-mobile {
    display: none !important;
  }



@media(max-width: 800px){
  body{
    grid-template-columns: 1fr;
  }
  main{
    padding: 2em 1em 60px 1em;
  }
  .container{
    border: none;
    padding: 0;
  }
  
  /* Mobile canvas adjustments */
  canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: -1 !important;
  }

  /* Center the entire form */
  .contact-form-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* center vertically */
    padding: 1rem;
  }

  .contact-form {
    width: 100%;
    max-width: 90%;  /* form shrinks on small screens */
    display: flex;
    flex-direction: column;
    gap: 1rem;       /* spacing between fields */
  }

  .contact-input {
    --b: 2px;   /* border thickness */
    --s: .35em; /* corner size */
    --color: #ffffffb2;
    --trans-color: #0d6efd;

    width: 100%;
    padding: calc(.5em + var(--s)) calc(.7em + var(--s));
    color: var(--color);
    background: transparent;

    /* animated border */
    background:
      conic-gradient(from 90deg at var(--b) var(--b), #0000 90deg, var(--color) 0)
      var(--_p, var(--s)) var(--_p, var(--s))
      / calc(100% - var(--b) - 2*var(--_p, var(--s)))
        calc(100% - var(--b) - 2*var(--_p, var(--s)));

    transition: .3s linear, color 0s, background-color 0s;
    outline: var(--b) solid #0000;
    outline-offset: .6em;
    border: 0;
    border-radius: 0;

    font-size: 16px;
  }

  .contact-input::placeholder {
    color: #999;
  }

  .contact-input:hover,
  .contact-input:focus {
    --_p: 0px;
    outline-color: var(--trans-color);
    outline-offset: .1em;
  }

  .contact-input:focus {
    color: #fff;
  }

  /* Contact Button Styling */
  .contact-btn {
    --b: 3px;   /* border thickness */
    --s: .45em; /* corner size */
    --color: #ffffffb2;
    --trans-color: #0d6efd;

    padding: calc(.5em + var(--s)) calc(.9em + var(--s));
    color: var(--color);
    background: transparent;

    /* animated border */
    background:
      conic-gradient(from 90deg at var(--b) var(--b), #0000 90deg, var(--color) 0)
      var(--_p, var(--s)) var(--_p, var(--s))
      / calc(100% - var(--b) - 2*var(--_p, var(--s)))
        calc(100% - var(--b) - 2*var(--_p, var(--s)));

    transition: .3s linear, color 0s, background-color 0s;
    outline: var(--b) solid #0000;
    outline-offset: .6em;
    border: 0;

    font-size: 18px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
  }

  .contact-btn:hover,
  .contact-btn:focus-visible {
    --_p: 0px;
    outline-color: var(--trans-color);
    outline-offset: .05em;
  }

  .contact-btn:active {
    background: var(--trans-color);
    color: #fff;
  }

  #content {

    position: relative;
    top: 50%;
    margin-top: -50px;
    margin-left: -50px;
    width: auto;
    height: auto;

    
    z-index: 1;
    
    border-radius: 1em;
    padding: 1em;
    margin: 1em;
    display: block; /* Override desktop flex */
    min-height: auto; /* Override desktop min-height */
    text-align: left; /* Override desktop text-align */
  }
  #content > div .contact-form-wrapper {
    max-width: 100% !important;
    padding: 0;
  }
  
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
    margin-top: 5%;
    margin-left: 5%;
  }

  #content > div {
    text-align: left; /* Override desktop centering */
    max-width: 90% /* Remove desktop max-width */
  }
  #sidebar{
    height: auto;
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--line-clr);
    padding: 0;
    position: fixed;
    top: unset;
    bottom: 0;
    z-index: 1000; /* Ensure sidebar is above canvas */

    > ul {
        padding: 0;
        display: grid;
        grid-auto-flow: column; /* still flows horizontally */
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        align-items: center;
        overflow-x: auto; /* still allows scrolling if too many items */
    }
    ul li{
      height: 100%;
    }
    ul a, 
      ul .dropdown-btn {
          width: 100%; /* let them fill the grid cell */
          height: 60px; /* keep height fixed if needed */
          padding: 0;
          border-radius: 0;
          justify-content: center;
          display: flex; /* keep center alignment working */
          align-items: center;
          text-align: center;
      }

    ul li span, ul li:first-child, .dropdown-btn svg:last-child{
      display: none;
    }

    ul li .sub-menu.show{
      position: fixed;
      bottom: 60px;
      left: 0;
      box-sizing: border-box;
      height: 60px;
      width: 100%;
      background-color: var(--hover-clr);
      border-top: 1px solid var(--line-clr);
      display: flex;
      justify-content: center;

      > div{
        overflow-x: auto;
      }
      li{
        display: inline-flex;
      }
      a{
        box-sizing: border-box;
        padding: 1em;
        width: auto;
        justify-content: center;
      }
    }
  }
}