* { /* variables and reset */
  --text-color : #C5C6C7;
  --text-highlight-color: #cc9767;
  --foreground-color : #212329;
  --background-color: #212329;
  --back-text-color : white;
  --projects-text-color : white;
  --projects-background-color : #001220;
  --projects-item-text-color : white; 
  --projects-item-background-color : black;
  --projects-highlight-color : #47e37b;
  --contact-text-color : white;
  --contact-background-color: #001220;
  --contact-highlight-color: #c403bf;
  --blog-text-color : white;
  --blog-background-color: #001220;
  --blog-highlight-color: #d99c00;
  --publications-background-color: #001220;
  font-family: sans-serif;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


html {
/* Font will never go below 16px, scale with viewport up to 18px */
  font-size: clamp(16px, 2.3vw, 18px); 
} 


/* Set height and overflow to prevent animations extending page height */
main {
  /* Let it grow with its content, but at least fill the screen */
  min-height: 100vh;
  /* Enable vertical scrolling when needed */
  overflow-y: auto;
}

body{
  background-color: var(--background-color);
}
/* global css */
header {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
  gap: 0.5rem;
  background-color: var(--projects-background-color);
  align-items: center;
  padding: 10px 30px;
  height: fit-content;
  width: fit-content;
  margin: 0 auto;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

@media screen and (max-width: 600px) {
  /* Only target the Publications page header */
  header {
    /* shrink-wrap to its contents */
    width: fit-content;
    /* center it in the viewport */
    margin: 0 auto;
    
    /* stack title above button */
    display: flex;            /* you already have this, but restating to be explicit */
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
  }
}

.back-home-button {
  display: inline-block;                /* shrink-wrap by default */
  padding: 1rem 1.5rem;                 /* nice tappable area */
  font-size: 1.25rem;                   /* easy to read */
  line-height: 1;                       /* keep it tight vertically */
  color: var(--back-text-color);             
  background-color: transparent;        
  border: 3px solid var(--projects-text-color);
  border-radius: 0.6rem;                
  text-decoration: none;                
  text-align: center;                   
  margin: 0.5rem;                       /* gutter between siblings */
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
}

.back-home-button:hover {
  background-color: var(--projects-text-color);
  color: var(--projects-background-color);
}

/* Animations */
@keyframes line-animate {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes fade-in {
  from {
    transform: scaleY(0.7);
    opacity: 0;
  }
  to{
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes expand {
  from{
    height: 100%;
    width: 100%;
  }
  to {
    height: 100%;
    width : 100%;
  }
  
}


@keyframes scale-page-down {
  from {
    transform: scaleY(1);

  }
  to {
    transform: scaleY(0);
  }
}

@keyframes move-page-up {
  from {
    transform: translateY(0%);
  }
  to {
    transform: translateY(-100%);
  }
}

@keyframes move-page-down {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(100%);
  }
  
}

@keyframes expand-down {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

/* Animations for homepage on load */
.fade-in-animate {
  animation: 0.6s ease-in-out 0s 1 forwards fade-in;
  transform-origin: top center;
  opacity: 0;
}
.fade-in-delay1-animate {
  animation: 0.6s ease-in-out 0.6s 1 forwards fade-in;
  transform-origin: top center;
  opacity: 0;
}

.fade-in-delay2-animate {
  animation: 0.6s ease-in-out 1.2s 1 forwards fade-in;
  transform-origin: top center;
  opacity: 0;
}
/* end of homepage on load animations */

/* Animations triggered by View projects Button, in order of delay*/

.foreground-close-animate {
  animation: 0.6s ease-in 0s 1 forwards scale-page-down;
  transform-origin: top center;
}

.homepage-close-animate{
  animation:  0.6s ease-in 0s 1 forwards scale-page-down; 
  transform-origin: top center;
}

.open-animate{
  animation:  0.6s ease-in 0s 1 move-page-up;
}
/* end of View projects animations */


/*Animations triggered by Back Home Buttom, in order of dely*/
.close-animate{
  animation:  0.6s ease-out 0s 1 move-page-down;
}

.homepage-open-animate{
  animation:  0.6s ease-in 0s 1 forwards reverse scale-page-down; 
  transform-origin: top center;
}


/* end of Back Home animations */

/* Homepage css */
i,strong{
  color: var(--text-highlight-color);
}


@keyframes background-slide {
  from {background-position: 0px 0px;}
  to {background-position: 0px -4000px;}
}

/* Desktop first: picture left, text right */
#introduction-container {
  display: flex;
  flex-direction: row wrap;
  align-items: center;
  margin-top: 60px;
  gap: 2rem;
  width: min(80vw, 800px);
}

#profile-pic {
  order: 1;
  margin-right: 1.5rem;
}

#text-section {
  order: 2;
  text-align: left;
}

/* Mobile fallback */
@media screen and (max-width: 600px) {
  #introduction-container {
    flex-direction: column;
    gap: 1.5rem;
  }
  nav {
    flex-direction: column;
    gap: 1rem;
  }
}

#profile-pic {
  border-radius: 50%;
  height: 250px;
  /* width: min(30vw, 250px); */
  border: 3px solid var(--text-highlight-color);
}

#text-section {
  display: flex;
  flex-flow: column wrap;
  justify-content: center;
  align-items: center;
  /* gap: 1rem;  */
} 

#stars {
  background: var(--foreground-color) url('/assets/stars.png') repeat top center;
  background-size: auto 1000px;
  animation: 200s linear 0s infinite background-slide;
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#homepage,
#foreground,
#stars {
  min-height: 100vh;
  width: 100%;
}
#foreground {
  background: var(--foreground-color);
  box-sizing: border-box;
}

#foreground h1{
  text-align: center;
  color: var(--text-color);
  font-size: clamp(1.25rem, 6vw, 1.75rem);
}

#foreground h2{
  text-align: center;
  color: var(--text-color);
  font-size: clamp(1rem, 6vw, 1.25rem);
  max-width: 40ch;         /* ≈40 characters per line */
  margin: 0.5em auto;   
}
#foreground h1 svg {
  color : var(--text-color);
  display: inline-block;
  vertical-align: top;
  margin-left: 0.5rem;
}

.icon-container a {
  text-decoration: none;
}
.linkedin {
  color : var(--text-color);
  display: inline-block;
  vertical-align: top;
  margin-left: 0.5rem;
  font-size: 1.75rem;
}
.github{
  color : var(--text-color);
  display: inline-block;
  vertical-align: top;
  margin-left: 0.5rem;
  font-size: 2rem;
}
.github:hover, .linkedin:hover{ 
  color: var(--text-highlight-color);
}

#foreground p {
  text-align: center;
  color: var(--text-color);
  font-size: clamp(0.875rem, 3vw, 1.1rem);
  max-width: 40ch;         /* ≈40 characters per line */
  margin: 0.75em auto;     /* center it with some breathing room */
  line-height: 1.5;        /* improve readability */
}

.homepage-button {
  display: block;                /* shrink-wrap by default */
  padding: 1rem 1.5rem;                 /* nice tappable area */
  font-size: 1.25rem;                   /* easy to read */
  line-height: 1;                       /* keep it tight vertically */
  color: var(--text-color);             
  background-color: transparent;        
  border: 3px solid var(--text-highlight-color);
  border-radius: 0.6rem;                
  text-decoration: none;                
  text-align: center;
  min-width: 8rem;                /* minimum width */                  
  margin: 0.5rem;                       /* gutter between siblings */
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
} 

.homepage-button:hover{
  background-color: var(--text-highlight-color);
  color: var(--background-color);
}

#foreground nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  align-items: center;
  flex-flow: row wrap;
  width: 90%;
  padding-top: 20px;
}

#homepage{
  background-color: var(--background-color);
  display: flex;
  justify-content: center;
  align-items: center;
}

#nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: absolute;
  top: 1rem;
  left: 1rem;
  flex-direction: column;
  gap: 4px;
}
#nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-color);
}

/* mobile rules */
@media screen and (max-width: 600px) {
  /* show hamburger */
  #nav-toggle { display: flex; }

  /* hide nav by default */
  #foreground nav {
    display: none;
    flex-direction: column;
    gap: 1rem;
    background: var(--foreground-color);
    position: absolute;
    top: 3.5rem;      /* just below the toggle */
    right: 1rem;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  }

  /* when .menu-open on body, show it */
  body.menu-open #foreground nav {
    display: flex;
  }
  /* Target buttons only when the hamburger menu is open */
  body.menu-open .homepage-button {
    display: block;                    /* stack vertically */
    width: 90%;                        /* nearly full panel width */
    max-width: 300px;                  /* never too wide */
    margin: 0.75rem auto;              /* center + gutter between buttons */
    padding: 1rem 1.5rem;              /* bigger tap area */
    font-size: 1.25rem;                /* slightly larger text */
    
    /* a solid border gives more contrast in a dark panel */
    border: 3px solid var(--text-highlight-color);
    background-color: transparent;     /* keep your transparent look */
    border-radius: 0.6rem;             /* rounder corners */
    
    transition: background-color 0.2s, color 0.2s;
  }

  /* Optional: hover state inside the menu */
  body.menu-open .homepage-button:hover {
    background-color: var(--text-highlight-color);
    color: var(--background-color);
  }
}



/* projects css */

#projects h2 {
  text-align: center;
  font-size: 2.0rem;
}



@media screen and (min-width: 750px) {
  #projects {
    grid-template-rows: 200px 50px 420px;
    grid-template-columns: 1fr 650px 1fr;
  }
  #projects header {
    grid-row: 1 / 2;
    grid-column: 1 / 4;
  }
  #slider-counter {
    grid-row: 2 / 3;
    grid-column: 1 / 4;
  }
  #slider {
    grid-row: 3 / 4;
    grid-column: 2 / 3;
  }
  #left-button {
    justify-self: flex-end;
    align-self: center;
    grid-row: 3 / 4;
    grid-column: 1 / 2;
  }
  #right-button {
    justify-self: flex-start;
    align-self: center;
    grid-row: 3 / 4;
    grid-column: 3 / 4;
  }
}

@media screen and (max-width: 750px) {
  #projects {
    grid-template-rows: 200px 50px 420px;
    grid-template-columns: 1fr 1fr;
  }
  #projects header {
    grid-row: 1 / 2;
    grid-column: 1 / 3;
  }
  #slider-counter {
    grid-row: 2 / 3;
    grid-column: 1 / 3;
  }
  #slider {
    grid-row: 3 / 4;
    grid-column: 1 / 3;
  }
  #left-button {
    justify-self: center;
    align-self: center;
    grid-row: 2 / 3;
    grid-column: 1 / 2;
  }
  #right-button {
    justify-self: center;
    align-self: center;
    grid-row: 2 / 3;
    grid-column: 2 / 3;
  }
}

#projects {
  position: absolute;
  height : 100%;
  width: 100%;
  color: var(--projects-text-color);
  z-index: 0;
  background: url(/assets/green-waves.svg) repeat-x top center;
  background-size: 800px auto;
  display: grid;
}

#slider {
  display: flex;
  justify-content: space-evenly;
  align-items: flex-end;
  transform-style: preserve-3d;
}

#left-button, #right-button {
  cursor: pointer;
  background-color: transparent;
  color: var(--projects-highlight-color);
  border-radius: 50%;
  border: 4px double var(--projects-highlight-color);
  width: 3rem;
  height: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

#left-button:hover, #right-button:hover {
  filter: brightness(0.7);
}

#slider-counter {
  width : 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#slider-counter span {
  height: 15px;
  width: 15px;
  background-color: #033d32;
  margin-right: 5px;
  margin-left: 5px;
  border-radius: 50%;
  display: inline-block;
}

.selected {
  background-color: var(--projects-highlight-color)!important;
}

/* Css for projects item within slider */
projects-item {
  position: absolute;
  width: 40%;
  top : 0%;
  opacity: 1;
  transform: translate3d(0%, 0%, -200px) scale(0.8);
  transform-style: preserve-3d;
  transition: transform 0.55s ease;
  height : 400px;
}

/* Positions that handle moving slider  */
.position1 {
  box-shadow: 0 25px 50px rgba(0,0,0, 50%);
  opacity: 1;
  transform: translate3d(-55%, 0%, -120px) scale(0.8);
  color: lightgrey;
}

.position2 {
  box-shadow: 0 25px 50px rgba(0,0,0, 50%);
  opacity: 1;
  transform: translate3d(-25%, 0%, -60px) scale(0.9);
  color: lightgrey;


}

.position3 {
  box-shadow: 0 25px 50px rgba(0,0,0, 50%);
  opacity: 1;
  transform: translate3d(0%, 0%, 0px) scale(1.0);
}

.position4 {
  box-shadow: 0 25px 50px rgba(0,0,0, 50%);
  opacity: 1;
  transform: translate3d(25%, 0%, -60px) scale(0.9);
  color: lightgrey;

}

.position5 {
  box-shadow: 0 25px 50px rgba(0,0,0, 50%);
  opacity: 1;
  transform: translate3d(55%, 0%, -120px )  scale(0.8);
  color: lightgrey;

}

/** contact page css **/

#contact {
  position: absolute;
  height : 100%;
  width: 100%;
  color: var(--projects-text-color);
  z-index: 0;
  background: url(/assets/purple-waves.svg) repeat-x top center;
  background-size: 800px auto;
  display: flex;
  flex-flow: column nowrap;
  gap: 100px;
}

#contact-content {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-flow: column wrap;
  gap: 20px;
}

#contact-content p {
  text-align: center;
}
#contact-content form{
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-flow: column wrap;
  /* border: var(--contact-highlight-color) 3px solid; */
  /* padding : 12px 20px; */
  gap: 20px;
  border-radius: 8px;
  width: min(65vw, 600px);
}

#contact-content button{  
  padding : 0.8rem;
  font-size: 1rem;
  border: var(--contact-highlight-color) 8px double;
  border-radius: 8px;
  cursor: pointer;
  min-width: 8rem; 
  background-color: transparent;
  color: var(--projects-text-color);
}

#contact-content button:hover {
  filter: brightness(0.8);
}
#contact-content textarea {
  width: 100%;
  height: 150px;
  padding: 12px 20px;
  box-sizing: border-box;
  border: 2px solid #ccc;
  border-radius: 4px;
  background-color: #f8f8f8;
  resize: none;
}

#contact-content label {
  display: flex;
  flex-flow: column;
  text-decoration: solid underline var(--contact-highlight-color) 1px ;
  text-underline-offset : 5px;
  gap: 10px;
  width : 100%;
}

#contact-content fieldset{
  width: 100%;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  width: 100%;
  border: none;
}

#contact-content fieldset label {
  width: 45%;
}

#contact-content input{
  width: 100%;
  height: 2.3rem;
  padding: 10px;
}

/* Blog page css */
#blog, #blog-post {
  position: absolute;
  height : 100%;
  width: 100%;
  color: var(--blog-text-color);
  z-index: 0;
  background: url(/assets/yellow-waves.svg) repeat-x top center;
  background-size: 800px auto;
  display: flex;
  flex-flow: column nowrap;
  gap: 100px;
}


#blog-posts {
  width: 100%;
}

#blog-container {
  display: flex;
  align-items: flex-start;
  align-content: flex-start;
  flex-flow: row wrap;
  /* width: min(65vw, 600px); */
  margin-left: auto;
  margin-right: auto;
  color : var(--blog-text-color);
  text-decoration-color: var(--blog-highlight-color);
}

#blog-container h3 {
  text-decoration: solid underline var(--blog-highlight-color) 1px ;
  text-underline-offset : 5px;
  font-size: 2rem;
  margin-bottom: 20px;
  margin-left: 6px;
}

#blog-posts a {
  width:100%;
  background-color: #252b2f;
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
  padding: 12px 20px;
  margin-bottom: 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--blog-text-color);
  text-decoration: none;
}

@keyframes underline-animate {
  from{

  }
}
#blog-posts a:hover{
  /* text-decoration: solid underline var(--blog-highlight-color) 1px;
  text-underline-offset: 3px; */
  /* color: var(--blog-highlight-color); */
  background-color: #323a40;
}

/* #reading-list-container{ */
  /* padding-left: 2rem;
  padding-top: 5px;
  padding-bottom: 10px;
  padding-right: 5px;
}

#reading-list-container h3{
  text-decoration: solid underline var(--blog-highlight-color) 1px ;
  text-underline-offset : 5px;
  font-size: 1.7rem;
}

#reading-list-container p{
  font-size: 1rem;
}

#reading-list-container ol {
  margin-top: 20px;
  margin-left: 2rem;
  font-size: 1rem;
  max-width: 226px;
}

#reading-list-container li {
  margin-bottom: 8px;
} */
 

/* ────────────────────────────────────────────────────────────────────────── */
/* Markdown blog post styles */
.markdown-body {
  /* constrain line-length & center */
  max-width: 80ch;
  margin: 2rem 0 auto;
  padding: 0 1rem;

  /* comfortable reading size */
  font-size: clamp(0.75rem, 2.5vw, 1rem);
  line-height: 1.7;
  color: var(--blog-text-color);
}

/* Headings with a touch of your Playfair font & highlight color */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-family: 'Playfair Display', serif;
  color: var(--blog-text-color-color);
  text-decoration: underline;
  text-decoration-color: var(--blog-highlight-color);
  text-underline-offset: 10px;
  margin: 1.5rem 0 1.5rem;
  line-height: 1.2;
}

.markdown-body h1 { font-size: clamp(2rem, 5vw, 2.5rem); }
.markdown-body h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
.markdown-body h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

/* Paragraph spacing */
.markdown-body p {
  margin: 1rem 0;
}

/* Links */
.markdown-body a {
  color: var(--blog-highlight-color);
  text-decoration: underline;
}

/* Inline code */
.markdown-body code {
  background-color: rgba(255,255,255,0.1);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: monospace;
}

/* Code blocks */
.markdown-body pre {
  background-color: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

/* Blockquotes */
.markdown-body blockquote {
  border-left: 4px solid var(--blog-highlight-color);
  padding-left: 1rem;
  color: #bbb;
  margin: 1.5rem 0;
  font-style: italic;
}

/* Lists */
.markdown-body ul,
.markdown-body ol {
  margin: 1rem 0 1rem 1.5rem;
}

/* Images */
.markdown-body img {
  max-width: 100%;
  display: block;
  margin: 1.5rem auto;
  border-radius: 4px;
}

/* ── Utterances Overrides ── */
.utterances {
  position: relative !important;
  overflow: visible !important;
}

.utterances-frame {
  position: relative !important;
  width: 100% !important;
  height: auto !important;     /* let it size to its contents */
  min-height: 400px !important;/* reserve enough room for the widget */
}

/* ────────────────────────────────────────────────────────────────────────── */


/* publications page css */
#publications {
  position: absolute;
  height : 100%;
  width: 100%;
  color: var(--projects-text-color);
  z-index: 0;
  background: url(/assets/blue-waves.svg) repeat-x top center;
  background-size: 800px auto;
  display: flex;
  flex-flow: column wrap;
  gap: 100px;
}

#publications-container {
  display: flex;
  align-items: flex-start;
  align-content: flex-start;
  flex-flow: row wrap;
  width: min(65vw, 600px);
  margin-left: auto;
  margin-right: auto;
}

#publications-list {
  width: 100%;
  font-size: 1rem;
}
/* 
#publications-list li {
  flex-direction: row;
  display: flex;
  align-items: flex-start;
  gap:10px;
} */

#publications-list b {
  color : var(--text-highlight-color);
}
/*
#publications-list i {
  color: lightpink;
} */