/* ============ Reset / Vars ============ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  text-underline-offset: 20%;
  text-decoration-color: var(--soft-teal);
  scroll-margin-top: 96px;
}

:root {
  --max-page-width: 1920px;
  --page-padding: 96px;
  --off-white: #f9f9f9;
  --off-black: #333;
  --grey: #c0c0c0;
  --dark-grey: #898989;
  --darker-grey: #4a4a4a;
  --soft-teal: #4bc7b9;
  --darker-teal: #2c5e6971;
  --background: #1e1f24;
  --bp-mobile: 768px;
  --bp-desktop: 1280px;
}

html {
  scroll-behavior: smooth; /* keep smooth for anchor jumps normally */
}

html.no-smooth {
  scroll-behavior: auto !important;
}

img {
  max-width: 100%;
}

body {
  font-family: "Fira Code", monospace;
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.5;
  font-style: normal;
  padding: 160px var(--page-padding) 0 var(--page-padding);
  background-color: var(--background);
  color: var(--off-white);
  display: flex;
  flex-direction: column;
  gap: 96px;
  align-items: center;
  width: 100%;
}

/* --- Scroll-lock helpers --- */
html,
body {
  /* prevents overscroll bounce from leaking while menu is open */
  overscroll-behavior: none;
}

/* JS toggles this class; also using position:fixed in JS to freeze */
body.no-scroll {
  overflow: hidden;
}

section {
  width: 100%;
}

a {
  text-decoration: none;
  color: var(--off-white);
}

ul {
  list-style: none;
}

.hashtag {
  color: var(--soft-teal);
  padding: 0 4px 0 0;
}

h1 {
  font-weight: 800;
  font-size: 48px;
  line-height: 1;
}

h2 {
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
}

h3 {
  font-weight: 500;
  font-size: 24px;
  line-height: 1;
}

h4 {
  font-weight: 500;
}

.btn {
  border: 2px solid var(--soft-teal);
  padding: 8px 16px;
  text-decoration-color: var(--soft-teal);
  transition: all 200ms ease;
}

.btn:hover {
  background-color: var(--darker-teal);
  text-decoration: underline;
  text-decoration-color: var(--soft-teal);
}

/* ===== NAVBAR ===== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 300; /* above everything else */
  background-color: var(--background);
  transition: box-shadow 0.2s ease;
}

.navbar.scrolled {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--page-padding);
}

.brand-name {
  font-weight: 600;
}

.navbar ul {
  display: flex;
  gap: 32px;
}

.navbar ul .socials {
  display: none;
  gap: 48px;
}

.navbar ul .socials a {
  width: 64px;
  aspect-ratio: 1/1;
}

.navbar ul .socials a img {
  width: 100%;
}

.menu-btn {
  color: var(--dark-grey);
  font-weight: 500;
}

.menu-btn[aria-current="page"],
.menu-btn[aria-current="true"] {
  color: var(--off-white);
}

.menu-btn:hover {
  color: var(--off-white);
}

.menu-toggle {
  display: none;
  border: 2px solid var(--soft-teal);
  background: transparent;
  color: var(--off-white);
  padding: 8px 12px;
  line-height: 1;
  cursor: pointer;
}

/* === LEFT SOCIALS === */
.permanent-socials {
  position: fixed;
  top: 0;
  left: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.permanent-socials .line {
  background-color: var(--grey);
  width: 2px;
  height: 112px;
  border-radius: 0 0 32px 32px;
  margin: 0 0 8px 0;
}

.permanent-socials .social {
  aspect-ratio: 1/1;
  height: 32px;
  padding: 0;
}

.social img {
  width: 100%;
}

/* ===== HERO ===== */

.hero .container {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  justify-content: stretch;
  gap: 64px;
}

.hero .container .content {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: flex-start;
  gap: 32px;
}

.hero .container .graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0px;
  width: 100%;
  max-width: 425px;
}

.hero .container .content span {
  color: var(--grey);
}

.hero .container .graphic img {
  max-width: 95%;
}

.status {
  display: flex;
  align-items: center;
  border: 2px solid var(--grey);
  color: var(--grey);
  padding: 12px 16px;
  gap: 8px;
  text-wrap: nowrap;
  min-width: 100%;
}

.status .highlight {
  color: var(--off-white);
}

.status .icon {
  aspect-ratio: 1/1;
  width: 16px;
  background-color: var(--soft-teal);
}

/* === QUOTE === */
.quote {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: auto;
  font-size: 24px;
}

.quote span {
  position: relative;
  display: inline-block;
  padding: 32px;
  border: 2px solid var(--dark-grey);
}

.quote .author {
  padding: 16px;
  color: var(--grey);
  border-top: none;
}

.quote-open {
  position: absolute;
  top: -14.5px;
  left: 12px;
}

.quote-close {
  position: absolute;
  bottom: -14.5px;
  right: 12px;
  transform: rotateX(180deg) rotateY(180deg);
}

/* ===== PROJECTS ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 48px 0;
}

.header .title {
  display: flex;
  align-items: center;
  text-transform: lowercase;
  text-wrap: nowrap;
  gap: 24px;
  width: 100%;
}

.header .title h2 {
  display: flex;
  align-items: center;
  width: 100%;
}

.header .title h2::after {
  content: "";
  flex: 1;
  height: 2px;
  background-color: var(--soft-teal);
  min-width: 48px;
  max-width: 45%;
  margin: 0px 32px;
}

.header .btn {
  border: none;
  width: auto;
  text-wrap: nowrap;
  align-items: center;
}

.header .btn i {
  padding: 0 0 0 8px;
}

.header .btn:hover i {
  text-decoration: none;
}

.header .btn:hover {
  background-color: transparent;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  gap: 16px;
}

.project-list .entry {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--grey);
}

.project-list .entry .skills {
  padding: 16px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  line-height: 1;
  color: var(--dark-grey);
  border-top: 2px solid var(--grey);
  border-bottom: 2px solid var(--grey);
}

.project-list .entry .info {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

.project-list .entry .info span {
  color: var(--grey);
}

.project-list .entry .info .buttons {
  display: flex;
  gap: 16px;
  width: 100%;
}

.project-list .entry img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: center;
  background-color: #4bc7b9;
}

/* ===== SKILLS ===== */

.skills .header .title h2::after {
  max-width: none;
}

.skills .content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.skill-section {
  flex: 0 0 250px;
  min-width: 275px;
  border: 2px solid var(--dark-grey);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.skill-section .header {
  font-weight: 500;
  border-bottom: 2px solid var(--dark-grey);
  padding: 8px;
}

.skill-section ul {
  padding: 8px;
  display: flex;
  flex-direction: column;
  color: var(--dark-grey);
  gap: 8px;
}

/* ===== CONTACT ===== */

.contact .header .title h2::after {
  max-width: 65%;
}

.contact .content {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.contact .content .text {
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: baseline;
  gap: 32px;
  max-width: 40vw;
  color: var(--dark-grey);
}

.contact .content .message-info {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--grey);
  gap: 16px;
  padding: 16px;
}

.contact .content .message-info a {
  display: flex;
  gap: 8px;
  color: var(--dark-grey);
  align-items: center;
}

.contact .content .message-info a:hover {
  color: var(--off-white);
  text-decoration: underline;
}

/* ===== FOOTER ===== */

.footer {
  padding: 0 0 32px 0;
  text-align: center;
  font-weight: 200;
  color: var(--dark-grey);
}

/* ===== RESPONSIVENESS ===== */

@media (max-width: 1440px) {
  .project-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1080px) {
  :root {
    --page-padding: 64px;
  }

  .hero .container {
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    align-items: center;
    gap: 64px;
  }

  .hero .container .graphic {
    border: 2px solid var(--grey);
  }

  .hero .container .status {
    border: none;
    border-top: 2px solid var(--grey);
  }

  .body {
    gap: 64px;
  }

  .project-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* under 780px → mobile layout */
@media (max-width: 780px) {
  :root {
    --page-padding: 48px;
  }

  .permanent-socials {
    display: none;
  }

  .project-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  h1 {
    font-size: 36px;
  }
  h2 {
    font-size: 28px;
  }
  h3 {
    font-size: 18px;
  }
  h4 {
    font-size: 16px;
  }

  .header .btn {
    display: none;
  }

  .header .title h2::after,
  .contact .header .title h2::after,
  .skills .header .title h2::after {
    max-width: none;
    margin-right: 0px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .navbar .container {
    background-color: var(--background);
  }

  /* Mobile slide-down menu targets #primary-menu to match JS */
  #primary-menu {
    position: fixed;
    top: var(--nav-h, 70px); /* will match JS-set navbar height */
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding: 48px;

    font-size: 32px;

    -webkit-overflow-scrolling: touch;
    overflow-y: auto;

    transform: translateY(-120%); /* hidden by default */
    transition: transform 200ms ease;
    z-index: -1;
  }

  .navbar.open #primary-menu {
    transform: translateY(0);
  }

  /* socials inside the slide-down panel */
  #primary-menu .socials {
    display: flex;
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    align-items: center;
    justify-content: center;
    gap: 48px;
  }
}

@media (max-width: 480px) {
  :root {
    --page-padding: 24px;
  }

  .line {
    display: none;
  }

  .status .not-highlighted {
    display: none;
  }

  .contact .content {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 32px;
  }

  .contact .content .text {
    max-width: none;
  }
}
