:root {
  --pill-height: 20vh; 
  --header-height: 60px;
  --bottom-nav-height: 64px;
}

@font-face {
  font-family: "Roboto", sans-serif;
}

h2{
  margin-left: 5%;
  font-size: clamp(1.8rem, 2.2vw, 29rem);
}

section {
  position: relative;
  height: 100vh;
}

/* Show/hide helpers */
.mobileOnly { display: none; }
.desktopOnly { display: block; }


/*——————————————————
  DESKTOP: Chapter nav (left side)
——————————————————*/
#chapterList {
  position: fixed;
  top: 25vh;
  left: 5vw;
  width: 25vw;
  height: 55vh;
  font-size: clamp(1rem, 1rem + 3vw, 20rem);
}

#chapterList ul {
  z-index: 50;
  position: relative;
  right: 0;
  margin: 0;
  padding: 0;
  list-style-type: none;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-weight: 500;
  line-height: 1;
}

#chapterPill {
  position: absolute;
  right: -25%;
  top: calc(0% + 0.5em - var(--pill-height)/2);
  width: 80vw;
  height: var(--pill-height);
  background-color: #FFC94B;
  border-radius: var(--pill-height);
  z-index: 0;
  transition: top 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#chapterList li {
  font-family: "Roboto", sans-serif;
  font-weight: 300;
  user-select: none;
  width: 100%;
  text-align: right;
  margin-bottom: 0;
  transition: font-weight 0.3s ease, color 0.3s ease;
  cursor: pointer;
  transform: translateX(-10%); 
  transition: all 0.3s ease-in-out 0s;
  white-space: nowrap; 
}

#chapterList li.chapterSelected {
  transform: translateX(0%); 
  font-weight: 800;
  position: relative;
  scale: 1.2;
}

#chapterList.normal-click li:hover {
  transform: translateX(0%); 
  font-weight: 400;
}


/*——————————————————
  DESKTOP: Side layout
——————————————————*/
#sideLayout {
  display: flex;
  flex-direction: column;
  align-content: space-around;
  margin-left: 37vw;
  margin-right: 0.5vw;
}

.centredContent {
  display: block;
} 


/*——————————————————
  About Me section
——————————————————*/
#aboutMe {
  position: relative;
  display: flex;
  gap: 2vh;
  padding-bottom: -10vh;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#myPicture {
  max-width: 38%;
  max-height: 35vh;
  aspect-ratio: 1 / 1;
  padding: 0;
  box-sizing: border-box;
  border-radius: 1rem;
  border-color: black;
  border-width: 0.1rem;
  border-style: solid;
  overflow: hidden;
  z-index: 2;
}

#myPicture img {
  position: relative;
  display: block;
  padding: 0;
  width: 100%;
}

#aboutMeBlurb {
  display: block;
  width: 90%;
  font-size: clamp(1.4rem, 1.2vw, 8rem);
  font-family: "Roboto", sans-serif;
  font-weight: 350;
  z-index: 2;
  text-align: justify;
}

.shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}


/*——————————————————
  Highlighted Projects (desktop grid)
——————————————————*/
#highlightedProjects {
  height: 100vh;  
  display: grid;
  gap: 2%;
  column-gap: 3%;
  grid-template-columns: 6fr 4fr;
  grid-template-rows: 1fr 1fr;
  box-sizing: border-box;
}

#VULTURCard,
#TVCard,
#CrowdCard {
  display: flex;
  min-height: 100%;
  overflow: visible;
}

#VULTURCard { 
  grid-column: 1; 
  grid-row: 1 / -1; 
  justify-content: center;
  align-items: end;
  flex-direction: column;
}

#TVCard     { 
  grid-column: 2; 
  grid-row: 1; 
  align-items: end;
  justify-content: start;
}

#CrowdCard  { 
  grid-column: 2; 
  grid-row: 2; 
  align-items: start;
  justify-content: start;
}

#cardStack {
  display: flex;
  flex-direction: column;
  align-items: end;
  justify-content: center;
  gap: 1.4rem;
  height: 90%;
  max-width: 100%;
}

a {
  width: 92%;
}

#cardStack button {
  width: 100%;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  box-sizing: border-box;
  box-shadow: 0.3rem 0.3rem 0.9rem -0.4rem;
  color: black;
  background-color: white;
  cursor: pointer;
  border-width: 0;
  border-radius: 1rem;
  text-transform: uppercase;
  font-size: clamp(0.7rem, 1.2vw, 10rem);
  padding: 0.7rem;
  transition: all 0.3s ease-out 0s;
}

#cardStack button:hover {
  border-color: transparent;
  padding-top: 1rem;
  padding-bottom: 1rem;
  transform: scale(1.05);
  margin-top: -0.3rem;
  margin-bottom: -0.3rem;
  font-weight: 800;
}

#cardStack .ProjectCard {
  max-width: 92%;
  max-height: 92%;
}

.ProjectCard {
  text-decoration: none;
  color: inherit;
  aspect-ratio: 1/1.4;
  max-width: 70%;
  max-height: 92%;
  width: auto;
  height: auto;  
  padding: 0.5rem 0.5rem 0.2rem 0.5rem;
  border-radius: 1rem;
  border-width: 0rem;
  box-sizing: border-box;
  box-shadow: 0.3rem 0.3rem 0.9rem -0.4rem;
  background-color: white;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease-out 0s;
}

.ProjectCard:hover {
  transform: scale(1.05);
  z-index: 10;
}

.ProjectCard h1 {
  margin: 0;
  margin-left: 1%;
  margin-top: 1%;
  font-size: clamp(0.1rem, 1.4rem, 10rem);
}

.ProjectCard .CardBlurb {
  user-select: none;
  margin: 0;
  width: 98%;
  max-height: 22%;
  font-size: clamp(0.7rem, 1rem, 10rem);
  margin-left: 1%;
  margin-top: 1%;
  margin-bottom: 100%;
  scrollbar-width: thin; 
  overflow-y: auto;
}

.ProjectCard p {
  margin: 0;
}

.CardImage {
  width: 99%;
  height: 65%;
  border-radius: 0.8rem;
  box-sizing: border-box;
  border-width: 0rem;
  border-style: solid;
  margin: auto;
  background: gray;
  overflow: hidden;
}

.CardImage img {
  width: 100%;
}

#VULTURCard .ProjectCard h1 {
  font-size: clamp(1rem, 2.3rem, 30rem);
}

#VULTURCard .ProjectCard p {
  font-size: clamp(0.3rem, 0.6vh + 0.6vw + 0.3rem, 2rem);
}

/* Hide mobile-only view all on desktop */
#mobileViewAllBtn {
  display: none;
}


/*——————————————————
  Work Experience
——————————————————*/
#workExperience {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3vh;
}

#universityExperience {
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 1vw;
  background-color: white;
  width: 86%;
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease-out 0s;
}

#universityExperience:hover {
  transform: scale(1.05);
  position: relative;
  z-index: 10;
}

#uniLogoFrame {
  aspect-ratio: 1/1;
  min-width: 20%;
  max-width: 20%;
  margin: auto;
  padding: 1rem;
  padding-right: 0;
  overflow: hidden;
  user-select: none;
}

#uniLogoFrame img {
  width: 100%;
}

#uniText {
  padding: 1rem;
  margin: auto;
}

#uniText h3 {
  font-size: clamp(1.3rem, 1.8vw, 1.5rem);
  font-weight: 600;
  margin: 0;
}

#uniText h4 {
  display: inline-block;
  margin: 0;
  margin-bottom: 1%;
  text-transform: uppercase;
  font-style: italic;
  font-size: clamp(0.3rem, 1vw + 0.3rem, 1.2rem);
  font-weight: 400;
}

#uniText p {
  align-self: start;
  font-size: clamp(0.4rem, 0.8vw + 0.4rem, 3rem);
  user-select: none;
}

#experiences {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4vh;
  cursor: ns-resize;
  box-sizing: border-box;
  width: 86%;
  min-height: 5rem;
  max-height: 50%;
  overflow: -moz-scrollbars-vertical; 
  overflow-y: scroll;
  background-color: white;
  border-radius: 1rem;
  border-width: 2px;
  box-shadow: 0 -10vh 10vh -15vh black inset;
  padding: 3%;
}

.experience {
  display: grid;
  grid-template-areas: 
  "JobTitle JobTitle Company"
  "Blurb    Blurb    Blurb";
}

#experiences h3 {
  user-select: none;
  grid-area: JobTitle;
  align-self: end;
  text-transform: uppercase;
  font-size: clamp(1.3rem, 1.8vw, 1.5rem);
  font-weight: 600;
  margin: 0;
  font-style: italic;
}

#experiences h4 {
  align-self: end;
  justify-self: end;
  grid-area: Company;
  display: inline-block;
  margin: 0;
  margin-bottom: 1%;
  text-transform: uppercase;
  font-size: clamp(0.4rem, 1vw + 0.4rem, 1.2rem);
  font-weight: 600;
}

#experiences p {
  user-select: none;
  grid-area: Blurb;
  margin: 1%;
  margin-right: 0;
  align-self: start;
  font-size: clamp(0.4rem, 0.8vw + 0.4rem, 3rem);
}

@media (max-width: 1200px) {
  .experience {
    grid-template-areas: 
    "JobTitle"
    "Company"
    "Blurb";
  }

  #experiences h4 {
    align-self: start;
    justify-self: start;
    grid-area: Company;
    display: inline-block;
    margin: 0;
    margin-bottom: 1%;
  }
}


/*══════════════════════════════════════════
  MOBILE STYLES  (≤ 768px)
══════════════════════════════════════════*/
@media (max-width: 768px) {

  /* Show/hide helpers */
  .mobileOnly { display: block; }
  .desktopOnly { display: none; }

  /*——— Layout ———*/
  #sideLayout {
    margin-left: 0;
    margin-right: 0;
    padding: 0;
  }

  /* Sections keep full-viewport height so JS centering scroll still works */
  section {
    height: calc(100dvh - var(--bottom-nav-height));
    overflow: hidden;
    padding-top: 0;
    box-sizing: border-box;
  }

  /*——— Chapter nav → bottom bar ———*/
  #chapterList {
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    width: 100%;
    height: var(--bottom-nav-height);
    padding: 0;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
    font-size: 1rem;
    /* pill is absolute inside this fixed container */
    overflow: hidden;
    box-shadow: 0 0 2rem -1.7rem black; 
  }

  #chapterList ul {
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    height: 100%;
    padding: 0;
    gap: 0;
    /* sit above the pill */
    position: relative;
    z-index: 1;
  }

  #chapterList li {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* kill desktop transform behaviours */
    transform: none !important;
    scale: none !important;
    white-space: nowrap;
    font-size: clamp(0.65rem, 3.2vw, 0.9rem);
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 0 0.5rem;
    transition: font-weight 0.3s ease, color 0.3s ease;
    cursor: pointer;
  }

  /* Selected: bold + amber text; pill provides the background */
  #chapterList li.chapterSelected {
    font-weight: 800;
    color: #8a6800;
    transform: none !important;
    scale: none !important;
  }

  #chapterList.normal-click li:hover {
    transform: none !important;
    font-weight: 600;
  }

  /*
   * Repurpose the pill as a horizontal sliding highlight
   * that glides behind whichever tab is active.
   * JS sets `left` instead of `top` on mobile.
   */
  #chapterPill {
    display: block;
    position: absolute;
    top: 0;
    left: 0;           /* JS overrides this per-tab */
    right: auto;
    width: 33.333%;
    height: 100%;
    border-radius: 0;
    background-color: rgba(255, 201, 75, 0.28);
    border-bottom: 3px solid #FFC94B;
    /* slide horizontally instead of vertically */
    transition: left 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 0;
  }


  /*——— About Me ———*/
  #aboutMe {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 80px 1.5rem 1rem;
    box-sizing: border-box;
    /* height comes from `section` rule above */
  }

  #myPicture {
    max-width: 55%;
    max-height: 40vh;
  }

  #aboutMeBlurb {
    font-size: clamp(1rem, 4vw, 1.6rem);
    width: 100%;
    text-align: left;
  }

  .shape {
    scale: 130%;
  }


  /*——— Highlighted Projects → horizontal scroll ———*/
  #highlightedProjects {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    overflow-y: visible;
    gap: 4vw;
    padding: 1.5rem 5vw;
    align-items: center;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* match the section height exactly */
    height: calc(100dvh - var(--bottom-nav-height)) !important;
    box-sizing: border-box;
    scrollbar-width: none;
  }

  #highlightedProjects::-webkit-scrollbar {
    display: none;
  }

  /* Each card wrapper becomes a fixed-width snap point */
  #VULTURCard,
  #TVCard,
  #CrowdCard {
    flex: 0 0 72vw;
    min-height: 0;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    overflow: visible;
  }

  #cardStack {
    display: contents;
  }

  #VULTURCard .ProjectCard,
  #TVCard .ProjectCard,
  #CrowdCard .ProjectCard {
    max-width: 100%;
    max-height: 70vh;
    width: 68vw;
    height: auto;
    aspect-ratio: 1 / 1.4;
  }

  #VULTURCard .ProjectCard h1 {
    font-size: clamp(1rem, 5vw, 2.5rem);
  }

  #VULTURCard .ProjectCard p {
    font-size: clamp(0.75rem, 3vw, 2rem);
  }

  .ProjectCard h1 {
    font-size: clamp(1rem, 5vw, 2.5rem);
  }

  .ProjectCard .CardBlurb {
    font-size: clamp(0.75rem, 3vw, 2rem);
    max-height: 28%;
  }

  /* "View All" card at end of horizontal scroll */
  #mobileViewAllBtn {
    display: flex !important;
    flex: 0 0 55vw;
    scroll-snap-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    width: 55vw;
  }

  #mobileViewAllBtn button {
    width: 100%;
    background: white;
    border-radius: 1.2rem;
    padding: 3.5rem 1.5rem;
    font-size: clamp(1rem, 4.5vw, 1.4rem);
    box-shadow: 0.3rem 0.3rem 0.9rem -0.4rem rgba(0,0,0,0.3);
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: black;
    transition: all 0.2s ease;
    line-height: 1.4;
  }

  #mobileViewAllBtn button:hover,
  #mobileViewAllBtn button:active {
    background: #FFC94B;
    transform: scale(1.04);
  }


  /*——— Work Experience ———*/
  #workExperience {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 3vh;
    margin-bottom: 10vh;
    box-sizing: border-box;
    /* height comes from `section` rule above */
    height: 80vh;
  }

  #universityExperience {
    width: 80%;
    height: 10vh;
    flex-direction: column;
    gap: 0.5rem;
  }

  #uniLogoFrame {
    min-width: 15%;
    max-width: 30%;
    padding: 1rem 1rem 0 1rem;
    margin: 0 auto;
  }

  #uniText {
    padding: 0.3rem 1rem 1rem;
  }

  #uniText h3 {
    font-size: clamp(1.1rem, 4.5vw, 1.4rem);
  }

  #uniText h4 {
    font-size: clamp(0.75rem, 3.2vw, 1rem);
  }

  #uniText p {
    font-size: clamp(0.8rem, 3.2vw, 1rem);
  }

  #experiences {
    width: 80%;
    max-height: 45vh;
    box-sizing: border-box;
    gap: 2.5vh;
  }

  #experiences h3 {
    font-size: clamp(1rem, 4.5vw, 1.3rem);
  }

  #experiences h4 {
    font-size: clamp(0.75rem, 3.2vw, 1rem);
  }

  #experiences p {
    font-size: clamp(0.8rem, 3.2vw, 1rem);
  }

  .experience {
    grid-template-areas: 
    "JobTitle"
    "Company"
    "Blurb";
  }

  #experiences h4 {
    align-self: start;
    justify-self: start;
  }
}