:root {
  --bg: #0D1117;
  --bg2: #161B22;
  --text: #F5F5F5;
  --subtext: #E6EDF3;
  --accent: #00C2FF;
  --accent2: #4F9BFF;
  --radius: 8px;
  --spacing: 40em;
}

@media (max-width: 900px){
  :root {
    --spacing: 15em;
  }
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #1f1633; 
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(#a259ff, #f56eff); 
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(#8e44ad, #ff66cc);
}


html, body {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}
body {
    background-color: #0D1117;
}

h1{
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2rem, 5vw, 5rem);
    font-optical-sizing: auto;
    font-style: normal;
    color: var(--text);
    text-align: center;
}
h2 {
    font-size: clamp(2rem, 5vw, 5rem);
    margin-bottom: 30px;
    text-align: center;
    color: var(--text);
}
h3 {
    font-size: clamp(1.5rem, 2.2vw, 3rem);
    margin-top: 0.2em;
    font-weight: 600;
    color: var(--text);
    margin-top: 0;
    margin-bottom: 0;
}
p {
    font-size: clamp(1rem, 1.5vw, 2rem);
    margin-top: 0.2em;
    font-weight: 600;
    color: var(--text);
    margin-top: 0;
    margin-bottom: 0;
}


.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    height: 4em;
    background-color: var(--bg);
    padding: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 100px;
}
.navbar a {
  margin-right: clamp(0.4em, 1.7vw, 1em);
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
  font-size: clamp(0.4em, 1.7vw, 1em);
}
.navbar h2 {
    font-size: clamp(1em, 4vw, 3em);
    background: linear-gradient(to top right, #ffffff, #8baaff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 20px;
    margin-bottom: 20px;
}
.navbar nav a:hover {
  color: var(--accent);
}

#tsparticles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 250vh;
    z-index: -1;
    pointer-events: auto;
    will-change: transform;
}




#heroflex {
    color: var(--text);
    display: flex;
    flex-direction: column;
    position: relative;
    width: fit-content;
    z-index: 1;
    text-align: left;
    margin: auto;
    max-width: min(92vw, 72rem);
}
#hello_image {
    display: flex;
    flex-direction: row;
}
#herohello {
  margin: 0;
  font-size: clamp(1.15rem, 6vw, 3rem);
  line-height: 1.15;      
  margin: 0.2em 0 0.05em; 
  text-align: left;
}
#heroname {
    color: var(--accent2);
}
#wave-hand {
    width: 1.2em;
    height: 1.2em;
    margin-left: 0.2em;
    animation: wave 2s infinite;
    vertical-align: top;
}
#herointro {
  font-size: clamp(1.15rem, 6vw, 3rem);
  line-height: 1.15;      
  margin: 0.2em 0 0.05em; 
}
#heropara {
    color: var(--accent);
}
#herobody {
  font-size: clamp(0.7rem, 2vw, 2rem);
}


#chatbot {
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 80vw;
    width: fit-content;
    z-index: 1;
    text-align: left;
    margin: 10em auto;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1rem, 1.5vw, 2rem);
    font-optical-sizing: auto;
    font-style: normal;
    color: #E6EDF3;
}
#chatbot h3 {
    margin: 0;
    font-size: 1em;
}
#chatbot p {
    margin: 0;
    font-size: 0.5em;
}
#chatform {
    margin: 0;
    display: flex;
    flex-direction: row;
}
#chatform input {
    width: 100%;
    height: 1em;
    padding: 0.5em;
    font-size: 1em;
    border: none;
    border-radius: 4px;
    background: var(--bg2);
    color: var(--text);
}
#chatform button {
    position: absolute;
    bottom: 0.5em;
    transform: translateY(20%);
    right: 0.2em;
    background: linear-gradient(to right, var(--accent), var(--accent2));
    border: none;
    padding: 0.3em 0.8em;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1em;
}
#chatbot button:hover {
    transform: scale(1.05) translate(0%, 10%);
}





#about-me {
  margin-top: var(--spacing);
}
#about-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(12px, 3vw, 24px);
  max-width: 80vw;
  margin: 0 auto;
  flex-wrap: wrap;
}
#about-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
#pfp {
  width:  clamp(96px, 22vw, 160px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(27, 89, 160, 0.911);
  margin-bottom: 15px;
  box-shadow: 0 0 25px 15px rgba(27, 89, 160, 0.8);
}
#tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.tag {
  padding: 6px 12px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
}
.tag-blue { background-color: #007BFF; }
.tag-green { background-color: #28a745; }
.tag-yellow { background-color: #ffc107; color: #222; }
.tag-red { background-color: #dc3545; }
#about-right {
  flex: 2;
  font-size: 1.1rem;
  line-height: 1.8;
  padding-top: 10px;
}
#about-right p {
  margin-bottom: 16px;
  font-size: clamp(0.4rem, 3.5vw, 1.8rem);
}
@media (max-width: 900px){
  #pfp {
    box-shadow: 0 0 10px 8px rgba(27, 89, 160, 0.8);
  }
}



#projects {
  text-align: center;
  position: relative;
  top: 8rem;
  margin-top: var(--spacing);
}
#project-title {
  position: sticky;
  top: 8rem;
}
/* ===== Projects layout upgrades ===== */
.project{
  position: sticky;
  top: 15rem;
  margin: 3.5em auto;
  width: min(85%, clamp(340px, 60vw, 980px));
  padding: clamp(16px, 2vw, 26px);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22,27,34,.88), rgba(13,17,23,.9));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  /* two-column card: text left, image right */
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  align-items: start;
  gap: clamp(14px, 2vw, 22px);
}
.project h3{
  color: var(--text);
  font-size: clamp(0.6rem, 1.7vw, 1.6rem);
  font-weight: 800;
  margin: 0 0 .5rem 0;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
}
.project h3::after{
  content:""; display:block; height:2px; margin-top:.55rem;
  width: clamp(120px, 30%, 240px);
  background: linear-gradient(to right, var(--accent), transparent);
  opacity: .7;
}
.project p{
  color: var(--subtext);
  font-size: clamp(.5rem, 1.1vw, 1.05rem);
  line-height: 1.6;
  margin: .25rem 0 1rem 0;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.project-cta{
  align-self: start;
  background: linear-gradient(to right, var(--accent), var(--accent2));
  color: #fff; 
  border: none; 
  padding: .6rem 1rem; 
  font-weight: 700; 
  cursor: pointer;
  transition: transform .15s ease;
  font-size: clamp(0.5rem, 1.7vw, 1.6rem);
}
.project-cta:hover{ 
  transform: translateY(-1px); 
}
/* right-side thumbnail */
.project-thumb{ 
  width:100%; 
  height:100%; 
}
.project-thumb img{
  width: 100%;
  border-radius: 12px;
  display:block;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
/* glow accents*/
.project::before{
  content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(900px 250px at 25% -10%, rgba(79,155,255,.18), transparent 60%),
    radial-gradient(700px 300px at 110% 120%, rgba(0,194,255,.14), transparent 60%);
}
/* staggered sticky offsets */
.proj1{ top:15em; background-color: #00ff95;} 
.proj2{ top:19em; background-color: #0084ff;} 
.proj3{ top:23em; background-color: #ea00ff;} 
.proj4{ top:27em; background-color: #ff0080;} 
.proj5{ top:31em; background-color: #ff0000;}


/* ===== Modal ===== */
/* Modal grows out of the clicked button and shrinks back on close */
.modal{
  position:fixed; inset:0; z-index:9999;
  pointer-events:none; /* let clicks pass when hidden */
}
.modal.show, .modal.open{ /* keep .open compatible if you used it */
  pointer-events:auto;
}
.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(10,12,18,.65); backdrop-filter: blur(4px);
  opacity:0; transition: opacity .25s ease;
}
.modal.show .modal-backdrop,
.modal.open .modal-backdrop{ opacity:1; }

/* Start at the button center using CSS vars, then expand to center */
/* Modal card larger to fit image + button */
.modal-card{
  position:absolute; left:0; top:0;
  transform: translate(var(--start-x, 50vw), var(--start-y, 50vh)) translate(-50%,-50%) scale(.05);
  opacity:0;
  width: min(96vw, 1100px);
  max-height: 86vh;
  overflow:auto;
  background: linear-gradient(180deg, #161B22, #0D1117);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  box-shadow: 0 30px 120px rgba(0,0,0,.6);
  padding: clamp(18px, 2.2vw, 32px);
  transition: transform .28s cubic-bezier(.2,.7,.2,1), opacity .2s ease;
  will-change: transform, opacity;
}
.modal.show .modal-card,
.modal.open .modal-card{
  transform: translate(50vw,50vh) translate(-50%,-50%) scale(1);
  opacity:1;
}
/* Modal media + repo button */
.modal-media{ margin: .6rem 0 1rem 0; }
.modal-media img{
  width:100%;
  height: clamp(220px, 38vh, 440px);
  object-fit: cover;
  border-radius: 12px;
  display:block;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.modal-actions{
  display:flex;
  justify-content:;
  gap:.6rem;
  margin-top: 1rem;
}
.btn-repo{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  background: linear-gradient(to right, var(--accent), var(--accent2));
  color:#fff;
  padding:.7rem 1.1rem;
  border-radius:12px;
  font-weight:800;
  text-decoration:none;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-repo:hover{ transform: translateY(-1px); }
.btn-repo:active{ transform: translateY(0) scale(.98); }






#education {
  text-align: center;
  position: relative;
  margin-top: calc(var(--spacing) + 12em);
  display: flex;
  flex-direction: row;
  flex-flow: wrap;
  justify-content: center;
  align-items: flex-start;
  height: fit-content;
}
#education h1{
  flex: 0 0 100%; /* take full row */
  border-radius: 10px;
  margin: 1rem;
}
#education h3 {
   font-size: clamp(1rem, 3vw, 2rem);
}
#education p {
    font-size: clamp(0.5rem, 1vw, 2rem);
    margin-top: 0.2em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0;
    color: rgb(211, 211, 211);
}
.side {
  margin: 40px;
  background-color: rgb(64, 64, 126);
  border-radius: 15px;
  text-align: left;
  padding: 20px;
}
.hs {
  width: auto;
  max-width: 40vw;
  justify-content: flex-end; 
}
.mid-bar {
  background-color: var(--accent);
  height: 500px;
  width: 7px;
  border-radius: 4px;
  position: relative;
  padding: 0;
}
#education .mid-bar img{
  position: absolute;
  width: clamp(3rem, 5vw, 6rem);;
  height: auto;
  left: 50%;
  transform: translateX(-50%);
}
#hs-img {
  top: 8%;
}
#uoft-img {
  bottom: 8%;
}
.uni {
  width: auto;
  max-width: 40vw;
  align-self: flex-end;
}
/* Flat horizontal bar at top */
.mid-bar::before {
  content: "";
  position: absolute;
  top: -1%;
  left: 50%;
  transform: translateX(-50%);
  width: 30px; 
  height: 10px;
  background-color: var(--accent);
  border-radius: 4px;
}
/* Arrow pointing down */
.mid-bar::after {
  content: "";
  position: absolute;
  top: 99%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 15px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 15px solid var(--accent);
}
/* small screens: rail on the right, both cards on the left */
@media (max-width: 900px){
  #education{
    display: grid;
  }
  #education h1 {
    grid-row: 1;
    grid-column: 1 / span 3;
  }
  .hs, .uni{ 
    grid-column: 1; 
  }
  .mid-bar{ 
    grid-column: 3; 
    grid-row: 2 / span 2;
    justify-self: end; 
    height: 50vh;
  }
}



#contact-anchor {
  position: relative;
  bottom: 0;
  width: 0;
  height: 0; /* Small height to avoid scroll issues */
}
#contact {
  background-color: var(--bg);
  color: var(--text);
  padding: 1rem 1rem 1rem 1rem;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  margin-top: var(--spacing);
  display: flex;
  flex-direction: column;
}
#contact h2 {
  flex: 0 0 100%; 
  margin-bottom: 2rem;
}
.contact-container {
  width: 50vw;
  max-height: 50vh;
  height: fit-content;
  margin: auto;
  background-color: var(--bg2);
  border-radius: 15px;
  padding: 1rem 3rem 4rem 3rem;
  box-shadow: 0 0 30px rgba(0, 194, 255, 0.15);
}
.input-group {
  margin-bottom: 1rem;
  text-align: left;
}
.input-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.input-group input,
.input-group textarea {
  width: 100%;
  padding: 1rem;
  background: #1F2233;
  color: var(--text);
  border: none;
  border-radius: 8px;
  resize: none;
  overflow-y: auto;
}
.input-group input::placeholder,
.input-group textarea::placeholder {
  color: rgba(245,245,245,0.5);
}
.g-recaptcha {
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
}
.contact-status {
  text-align: center;
  font-size: 0.95rem;
  color: var(--subtext);
  min-height: 1.2em; 
  margin: 6px 0 0;
}
button {
  background: linear-gradient(to right, var(--accent), var(--accent2));
  color: white;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: none;
}
button:hover {
  transform: scale(1.05);
}
#contact-links {
  margin-top: 2em;
}
#contact-links img {
  height: 3em;
  width: 3em;
  margin: 0 2em;
}
#contact-links a {
  display: inline-block;
}
@media (max-width: 420px) {
  .contact-container {
    padding: 0 3rem 9rem 2rem;
    margin-bottom: 0rem;
  }
  #contact h2 {
    margin: 0;
  }
  .g-recaptcha {
    transform: scale(0.6);
    transform-origin: left top;
  }
  #contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;      /* center the icon row */
    gap: clamp(8px, 4vw, 16px);   /* controls spacing between icons */
    text-align: center;
    margin-top: 0;
  }
  #contact-links h3{
    flex: 0 0 100%;               /* keep the heading on its own line */
    margin: 0 0 0 .5rem;
    font-size: clamp(1rem, 4.5vw, 1.25rem);
  }
  #contact-links a{
    display: inline-flex;         /* ensures the img box sizes cleanly */
  }
  #contact-links img{
    width:  clamp(36px, 10vw, 56px);
    height: clamp(36px, 10vw, 56px);
    margin: 0 0.2em;                    /* margins handled by gap above */
    padding: 0;                   /* remove extra padding on mobile */
  }
}


/* ===== Contact Bottom Sheet ===== */
#contact-sheet{ 
  position:fixed; 
  inset:0; 
  z-index:1; 
  pointer-events:none; }
#contact-sheet.visible{ 
  pointer-events:auto;
}
.contact-sheet-backdrop{
  position:absolute; 
  inset: 0; 
  background:rgba(10,12,18,.55);
  backdrop-filter:blur(6px);
  opacity:0;
  transition:opacity .25s ease;
}
#contact-sheet.visible .contact-sheet-backdrop{ 
  opacity:1; 
}
.contact-sheet{
  position:absolute; 
  left:50%; 
  bottom:0;
  transform:translateX(-50%) translateY(110%);
  width:min(92vw, 720px); 
  max-height:42vh; 
  overflow:hidden;
  background:linear-gradient(180deg, var(--bg2), var(--bg));
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px 16px 0 0;
  box-shadow:0 -20px 60px rgba(0,0,0,.45);
  padding: clamp(14px, 2vw, 20px);
  transition: transform .28s cubic-bezier(.2,.7,.2,1), opacity .2s ease;
}
#contact-sheet.visible .contact-sheet{ 
  transform:translateX(-50%) translateY(0); 
}
.contact-sheet-header{ 
  display: flex; 
  align-items: flex-start; 
  gap: 12px; 
}
#contact-sheet-icon{ 
  width:42px; 
  height:42px; 
  border-radius:10px; 
  object-fit:cover; 
  flex: 0 0 42px;
  box-shadow:0 6px 18px rgba(0,0,0,.35); 
}
.contact-sheet-meta h4{ 
  margin:0; 
  font-size:clamp(1rem,1.5vw,1.2rem); 
  color:var(--text); 
}
#contact-sheet-title, .contact-sheet-meta {
  text-align: start;
}
#contact-sheet-link{ 
  display:inline-block; 
  margin-top:4px; 
  color:var(--accent); 
  text-decoration:none;
  word-break:break-all; 
}
.contact-sheet-actions{ 
  display:flex; 
  gap:.6rem; 
  margin-top:14px; 
}
#contact-sheet-copy, #contact-sheet-open{
  display:inline-flex; 
  align-items:center; 
  justify-content:center;
  background:linear-gradient(to right, var(--accent), var(--accent2));
  color:#fff; 
  padding:.7rem 1.1rem;
  border:none; 
  border-radius:12px;
  font-weight:800; 
  text-decoration:none; 
  cursor:pointer;
  box-shadow:0 8px 24px rgba(0,0,0,.25);
}
.contact-sheet-close{ 
  position:absolute; 
  right:10px; 
  top:8px; 
  background:transparent;
  border:none; 
  color:var(--text); 
  font-size:1.4rem; 
  cursor:pointer; 
}

@media (max-width:640px){ 
  .contact-sheet{ max-height:38vh; } 
}



#chatbox-wrapper {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 4em;
  left: 0;
  width: 100vw;
  height: 100vh;
  border-radius: 12px;
  z-index: 2;
  transform: scale(0);
  transform-origin: bottom center;
  transition: transform 0.3s ease-in-out;
}
#chatbox-wrapper.visible {
  transform: scale(1);
}
#chatbox-header {
  background: #a259ff;
  padding: 12px;
  font-weight: bold;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#close-chat {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: white;
  cursor: pointer;
}
#chat-messages {
  flex: 1;
  padding: 1em;
  overflow-y: auto;
  height: calc(100vh - 14em);
  background: #2c2047;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  margin-bottom: 20px;
}
.message {
  padding: 10px;
  border-radius: 10px;
  max-width: 45%;
  line-height: 1.4;
  font-size: 0.9rem;
  word-wrap: break-word;
}
.message.bot {
  background-color: #444;
  align-self: flex-start;
  margin-left: 1em;
}
.message.user {
  background-color: #a259ff;
  align-self: flex-end;
  margin-right: 1em;
}
#chat-input-area {
  word-wrap: break-word;
  position: absolute;
  bottom: 4em;
  height: 3em;
  width: 100vw;
  display: flex;
  border-top: 1px solid #555;
  background: #1f1633;
}
#chat-user-input {
  flex: 1;
  border: none;
  padding: 1em;
  background: transparent;
  color: white;
  font-size: 1rem;
}
#chat-user-input:focus {
  outline: none;
}
#send-chat {
  border: none;
  padding: 0 1em;
  background: transparent;
  color: #a259ff;
  font-size: 1.2rem;
  cursor: pointer;
}
#chatbox-wrapper #charCount2 {
    color: #c9c9c9;
    font-weight: 100;
    position: absolute;
    margin: 0;
    font-size: 1em;
    bottom: 7em;
    padding: 0 0 0.1em 0.2em;
}



@keyframes wave {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(0deg); }
}