/*===============
  Global styles
===============*/

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  line-height: 1.5;
  color: var(--clr-fg);
  background-color: var(--clr-bg);
}

/* Make media fluid by default */
img,
video {
  max-width: 100%;
  height: auto;
}

/* Theme tokens */
.light {
  --clr-bg: #fcfcfc;
  --clr-bg-alt: #fff;
  --clr-fg: #555;
  --clr-fg-alt: #444;
  --clr-primary: #2978b5;
  --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.dark {
  --clr-bg: #23283e;
  --clr-bg-alt: #2a2f4c;
  --clr-fg: #bdbddd;
  --clr-fg-alt: #cdcdff;
  --clr-primary: #90a0d9;
  --shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px,
    rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
}

::selection {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  color: var(--clr-fg-alt);
}

h1 {
  font-size: clamp(2.2rem, 4vw + 1rem, 4rem);
}

h2 {
  font-size: clamp(1.6rem, 2vw + 1rem, 2rem);
}

h3 {
  font-size: clamp(1.2rem, 1.2vw + 1rem, 1.5rem);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

/*===================
  Accessibility
===================*/

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--clr-bg-alt);
  box-shadow: var(--shadow);
  z-index: 9999;
}

.skip-link:focus {
  left: 1rem;
}

/* Make anchor jumps land nicer */
section[id] {
  scroll-margin-top: 1.5rem;
}

/*===================
  Buttons and links
===================*/

.link {
  color: var(--clr-primary);
  padding-bottom: 0.3em;
  position: relative;
}

.link::before {
  content: "";
  width: 0%;
  height: 0.2em;
  position: absolute;
  left: 0;
  bottom: 0;
  background-color: var(--clr-primary);
  transition: width 0.2s ease-in;
}

.link:hover::before,
.link:focus-visible::before {
  width: 100%;
}

/* Make icon/toggle targets finger-friendly (48dp recommended) */
.link--icon,
.btn--icon {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.link--icon {
  color: var(--clr-fg);
  font-size: 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8em 1.4em;
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: lowercase;
  transition: transform 0.2s ease-in-out;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.btn--outline {
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn--outline:focus-visible,
.btn--outline:hover {
  color: var(--clr-bg);
}

.btn--outline::before {
  content: "";
  position: absolute;
  background-color: var(--clr-primary);
  right: 100%;
  bottom: 0;
  left: 0;
  top: 0;
  z-index: -1;
  transition: right 0.2s ease-in-out;
}

.btn--outline:hover::before,
.btn--outline:focus-visible::before {
  right: 0;
}

.btn--plain {
  text-transform: initial;
  background-color: var(--clr-bg-alt);
  box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 3px 0px;
}

.btn--plain:hover {
  transform: translateY(-4px);
}

.btn--icon {
  padding: 0;
  font-size: 1.2rem;
  color: var(--clr-fg);

}

.btn--icon svg,
.btn--icon i {
  color: inherit;
}

.btn--icon:hover,
.btn--icon:focus-visible {
  color: var(--clr-primary);
}

/*===================
  Layout
===================*/

.layout {
  width: min(1100px, 92vw);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 3rem;
}

.sidebar,
.content {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


.sidebar__name {
  font-size: 2.2rem;
  line-height: 1.1;
  
}

.sidebar__role {
  margin-top: 0.75rem;
  font-weight: 500;
}

.sidebar__tagline {
  margin-top: 1rem;
  max-width: 28ch;
  opacity: 0.9;
}

.sidebar__nav-toggle {
  display: none;
  margin-top: 1.5rem;
  width: 100%;
  justify-content: space-between;
  text-transform: none;
}

.sidebar__nav {
  margin-top: 2rem;
}

.sidebar__nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar__nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--clr-fg);
  opacity: 0.85;
  font-weight: 500;
  text-transform: lowercase;
  transition: opacity 0.2s ease-in-out;
}

.sidebar__nav-link::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--clr-fg);
  opacity: 0.35;
  transition: width 0.2s ease-in-out, opacity 0.2s ease-in-out,
    background-color 0.2s ease-in-out;
}

.sidebar__nav-link:hover,
.sidebar__nav-link:focus-visible {
  opacity: 1;
}

.sidebar__nav-link.is-active {
  opacity: 1;
  color: var(--clr-fg-alt);
}

.sidebar__nav-link.is-active::before {
  width: 3rem;
  opacity: 1;
  background: var(--clr-primary);
}

.sidebar__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

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

.content {
  padding: 4rem 0;
}

.section {
  margin-top: 4.5rem;
}

.section__title {
  text-align: center;
  margin-bottom: 1em;
  text-transform: uppercase;
}

.fa-github {
  margin-top: 5px;
}

/*===================
  About
===================*/

.about__desc {
  max-width: 70ch;
}

/*===================
  Projects
===================*/

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18em, 1fr));
  gap: 2em;
}

.project {
  padding: 2em;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s linear;
}

.project:hover {
  transform: translateY(-7px);
}

.project__description {
  margin-top: 1em;
}

.project__stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.2em 0;
  gap: 0.5rem;
}

.project__stack-item {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--clr-fg-alt);
}

/*===================
  Skills
===================*/

.skills__subtitle {
  margin: 1.5rem 0 0.75rem;
  color: var(--clr-fg-alt);
  text-align: center;
}

.skills__list {
  
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/*===================
  Contact + footer
===================*/

.center {
  display: flex;
  align-items: center;
}

.contact {
  flex-direction: column;
}

.contact__description {
  max-width: 60ch;
  text-align: center;
}

.footer {
  padding: 3em 0;
  margin-top: 4em;
  text-align: center;
}

.footer__link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--clr-fg);
}

/*===================
  Scroll-to-top
===================*/

.scroll-top {
  display: none;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background-color: var(--clr-bg-alt);
  box-shadow: var(--shadow);
  color: var(--clr-fg);
  border-radius: 999px;
  z-index: 999;
}

.scroll-top:hover,
.scroll-top:focus-visible {
  color: var(--clr-primary);
}

/*===================
  Responsive tweaks
===================*/

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 2rem 0 0;
  }

  .content {
    padding: 0 0 2rem;
  }

  .sidebar__nav-toggle {
    display: inline-flex;
  }

  /* Collapse nav by default on mobile; JS toggles .is-open */
  .sidebar__nav {
    display: none;
    margin-top: 1rem;
  }

  .sidebar__nav.is-open {
    display: block;
  }

  .sidebar__nav-list {
    gap: 0.4rem;
  }

  /* Improve tap targets on mobile */
  .sidebar__nav-link {
    min-height: 48px;
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    background-color: var(--clr-bg-alt);
  }

  .sidebar__nav-link::before {
    display: none;
  }

  .section {
    margin-top: 3.75rem;
  }
}

@media (max-width: 600px) {
  .project {
    padding: 1.25em;
  }

  .projects__grid {
    gap: 1.25em;
  }
}
