/* ============================================================
   GENERAL
   ============================================================ */

/* Imports the Poppins font family from Google Fonts with different weights */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

:root {
  --header-height: 3rem;

  /* ========== Colors ========== */
  --black-color: #000000;
  --black-color-lighter: #DCD6FF;
  --red-color: #FF0000;
  --blue-color: #0000FF;
  --grey-color: #333333;
  --grey-color-lighter: #949494;
  --grey-color-lighter2: #8a8a8a;

  /* Backgrounds */
  --background-white-color: #FFFFFF;

  /* ========== Font and typography ========== */
  --body-font: 'Poppins', sans-serif;
  --big-font-size: 2rem;
  --h1-font-size: 1.5rem;
  --h2-font-size: 1.25rem;
  --h3-font-size: 1.125rem;
  --normal-font-size: .938rem;
  --small-font-size: .813rem;
  --smaller-font-size: .75rem;

  /* ========== Font weight ========== */
  --font-medium: 500;
  --font-semi-bold: 600;

  /* ========== Margins bottom ========== */
  --mb-0-25: .25rem;
  --mb-0-5: .5rem;
  --mb-0-75: .75rem;
  --mb-1: 1rem;
  --mb-1-5: 1.5rem;
  --mb-2: 2rem;
  --mb-2-5: 2.5rem;
  --mb-3: 3rem;

  /* ========== z-index ========== */
  --z-tooltip: 10;
  --z-fixed: 100;
  --z-modal: 1000;

  /* Projects carousel defaults (desktop-first) */
  --projects-card-width: 380px;
  --projects-gap: 2rem;
  --projects-peek-fade: 0.20;
}


/* ============================================================
   BASE / RESET
   ============================================================ */

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html { scroll-behavior: smooth; }

body {
  margin: 0 0 var(--header-height) 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--background-white-color);
  color: var(--grey-color);
}

h1, h2, h3, h4 {
  color: var(--black-color);
  font-weight: var(--font-semi-bold);
}

ul { list-style: none; }
a { text-decoration: none; }

a, .btn { transition: all 300ms ease; }


/* ============================================================
   REUSABLE CLASSES
   ============================================================ */

.section {
  padding: 2rem 0 4rem;
}

.section__title {
  font-size: var(--h1-font-size);
  color: var(--black-color);
}

.section__subtitle {
  display: block;
  font-size: var(--small-font-size);
  margin-bottom: var(--mb-3);
}

.section__title,
.section__subtitle {
  text-align: center;
}


/* ============================================================
   LAYOUT HELPERS
   ============================================================ */

.container {
  max-width: 768px;
  margin-left: var(--mb-1-5);
  margin-right: var(--mb-1-5);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

header, nav, section, footer {
  position: relative;
  z-index: 1;
}

/* Desktop default section horizontal margin */
section {
  height: auto;
  margin: 0 10rem;
  box-sizing: border-box;
  min-height: fit-content;
}

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


/* ============================================================
   BOTTOM MOBILE NAV (Unicons nav)
   ============================================================ */

.header {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: var(--z-fixed);
  background-color: var(--background-white-color);
}

.nav {
  max-width: 100%;
  height: var(--header-height);
  display: none; /* shown in mediaqueries.css */
  justify-content: space-between;
  align-items: center;
}

.nav__logo,
.nav__toggle {
  transition: .3s;
  color: var(--black-color);
  font-weight: var(--font-medium);
}

.nav__logo:hover,
.nav__toggle:hover {
  color: var(--grey-color-lighter);
}

.nav__toggle {
  font-size: 1.1rem;
  cursor: pointer;
}

/* Slide-up menu */
.nav__menu {
  display: block;
  position: fixed;
  bottom: -100%;
  left: 0;
  width: 100%;
  background-color: var(--background-white-color);
  padding: 2rem 1.5rem 4rem;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.15);
  border-radius: 1.5rem 1.5rem 0 0;
  transition: 0.5s;
}

.nav__list {
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.nav__link {
  transition: .5s;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--small-font-size);
  color: var(--black-color);
  font-weight: var(--font-medium);
}

.nav__link:hover { color: var(--grey-color-lighter); }

.nav__icon { font-size: 1.8rem; }

.nav__close {
  position: absolute;
  right: 1.3rem;
  bottom: .5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--black-color);
}

.nav__close:hover { color: var(--grey-color-lighter); }

.show-menu { bottom: 0; }

.active-link { color: var(--grey-color-lighter2); }

.scroll-header {
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.15);
}


/* ============================================================
   BACKGROUND LAYERS (Canvas + Hero)
   ============================================================ */

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 80vh;
  z-index: -1;
  pointer-events: auto;
  overflow: hidden;
  background: transparent;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
}

.hero-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.00) 0%,
    rgba(255,255,255,0.05) 20%,
    rgba(255,255,255,0.15) 35%,
    rgba(255,255,255,0.30) 50%,
    rgba(255,255,255,0.55) 65%,
    rgba(255,255,255,0.80) 80%,
    rgba(255,255,255,0.95) 90%,
    rgba(255,255,255,1.00) 100%
  );
}


/* ============================================================
   DESKTOP NAV + HAMBURGER NAV (base)
   ============================================================ */

nav, .nav-links { display: flex; }

nav {
  justify-content: space-around;
  align-items: center;
  height: 17vh;
}

.nav-links {
  gap: 3rem;
  list-style: none;
  font-size: 1.5rem;
}

#desktop-nav a {
  position: relative;
  display: inline-block;
  color: white;
  text-decoration: none;
  text-decoration-color: white;
}

#desktop-nav a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.88);
  width: 135%;
  height: 125%;
  border: 2px solid rgb(255, 255, 255);
  background-color: transparent;
  border-radius: 1.5rem;
  z-index: -1;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
}

#desktop-nav a:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.logo {
  font-size: 2rem;
  color: white;
}

.logo:hover { cursor: default; }

#hamburger-nav { display: none; }

.hamburger-menu {
  position: relative;
  display: inline-block;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
  width: 30px;
  cursor: pointer;
}

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background-color: rgb(255, 255, 255);
  transition: all 0.3s ease-in-out;
}

.menu-links {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: transparent;
  width: fit-content;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

.menu-links a {
  display: block;
  padding: 10px;
  text-align: center;
  font-size: 1.5rem;
  color: rgb(255, 255, 255);
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.menu-links a:hover {
  color: var(--grey-color-lighter);
  text-decoration: underline;
  text-underline-offset: 0.25rem;
  text-decoration-color: rgb(181, 181, 181);
}

.menu-links li { list-style: none; }

.menu-links.open { max-height: 300px; }

.hamburger-icon.open span:first-child {
  transform: rotate(45deg) translate(10px, 5px);
}

.hamburger-icon.open span:nth-child(2) { opacity: 0; }

.hamburger-icon.open span:last-child {
  transform: rotate(-45deg) translate(10px, -5px);
}


/* ============================================================
   PROFILE SECTION
   ============================================================ */

#profile {
  padding-top: 0;
  display: flex;
  justify-content: center;
  gap: 5rem;
}

.section__main_pic-container {
  display: flex;
  height: 400px;
  width: 400px;
  margin: auto 0;
  position: relative;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.section__main_pic-container .image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 42%;
  border-radius: 50%;
  display: block;

  /* zoom + move image inside the circle */
  transform: translateY(98px) scale(1.55);
  transform-origin: 62% 46%;
}

.section__text {
  align-self: center;
  text-align: center;
  flex: 0 1 520px;
  max-width: 520px;
}

.section__text p { font-weight: 600; }

.section__text__p1 {
  text-align: center;
  font-size: 1.3rem;
}

.section__text__p2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.title {
  font-size: 3rem;
  text-align: center;
}

#socials-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

#socials-container .icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#socials-container .icon-action {
  width: 2.2rem;
  height: 2.2rem;
}

#socials-container .icon:hover {
  transform: scale(1.12);
  opacity: 0.85;
}

.icon { cursor: pointer; height: 2rem; }

.icon-wrapper {
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0.9;
}

.icon-wrapper:hover { transform: scale(1.1); transition: transform 0.2s ease; }
.icon-wrapper:hover img { opacity: 1; }


/* ============================================================
   BUTTONS
   ============================================================ */

.btn-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  font-weight: 600;
  transition: all 300ms ease;
  padding: 1rem;
  width: 8rem;
  border-radius: 2rem;
}

.btn-color-1,
.btn-color-2 { border: rgb(53, 53, 53) 0.1rem solid; }

.btn-color-1:hover,
.btn-color-2:hover { cursor: pointer; }

.btn-color-1,
.btn-color-2:hover {
  background: #e9e9e9;       /* light grey */
  border-color: #bdbdbd;     /* soft border */
  color: #111;               /* readable text */
}

.btn-color-1:hover { background: rgb(0, 0, 0); }

.btn-color-2 { background: none; }
.btn-color-2:hover { border: rgb(255, 255, 255) 0.1rem solid; }


/* ============================================================
   ABOUT SECTION
   ============================================================ */

#about {
  position: relative;
  padding-bottom: 4rem;
  padding-left: 5rem;
  padding-right: 5rem;
}

.about-containers {
  gap: 2rem;
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.about-details-container {
  justify-content: center;
  flex-direction: column;
}

.about-containers,
.about-details-container { display: flex; }

.about-pic { border-radius: 2rem; }

.about-me-paragraph {
  text-align: justify;
  color: var(--grey-color);
}

.details-container {
  padding: 1.5rem;
  flex: 1;
  background: white;
  border-radius: 2rem;
  border: rgb(53, 53, 53) 0.1rem solid;
  border-color: rgb(163, 163, 163);
  text-align: center;
}

.section-container {
  gap: 4rem;
  padding-top: 2rem;
}

.section__about_pic-container {
  display: flex;
  height: 400px;
  width: 400px;
  margin: auto 0;
  filter: drop-shadow(5px 5px 10px #535353);
}


/* ============================================================
   EXPERIENCE SECTION
   ============================================================ */

#experience { position: relative; padding-top: 2.5rem; }

.experience-sub-title {
  color: rgb(85, 85, 85);
  font-weight: 600;
  font-size: 1.75rem;
  margin-bottom: 2rem;
}

.experience-details-container {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.article-container {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 2.5rem;
  justify-content: space-around;
}

#experience article {
  display: flex;
  width: 10rem;
  justify-content: space-around;
  gap: 0.5rem;
}


article .icon { cursor: default; }


/* ============================================================
   EXPERIENCE TIMELINE (base mobile-first timeline)
   ============================================================ */

.cd-container {
  width: 90%;
  max-width: 1200px;
  margin: 3rem auto 0;
  position: relative;
}

.cd-timeline {
  position: relative;
  padding: 2rem 0;
  margin: 2rem auto;
}

.cd-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  height: 100%;
  width: 4px;
  background: rgba(0, 0, 0, 0.12);
}

.cd-timeline-block {
  position: relative;
  margin: 2rem 0;
}

.cd-timeline-block::after {
  content: "";
  display: table;
  clear: both;
}

.cd-timeline-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 4px #fff,
    inset 0 2px 0 rgba(0,0,0,0.08),
    0 3px 0 4px rgba(0,0,0,0.05);
  display: block;
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.cd-timeline-block:hover .cd-timeline-img {
  transform: scale(1.12);
  box-shadow:
    0 0 0 4px #fff,
    inset 0 2px 0 rgba(0,0,0,0.08),
    0 6px 20px rgba(0, 0, 0, 0.20);
}

.cd-timeline-img > img{
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.cd-timeline-img.cd-picture { background: #75ce66; }
.cd-timeline-img.cd-movie   { background: #c03b44; }
.cd-timeline-img.cd-location{ background: #f0ca45; }

.cd-timeline-content {
  position: relative;
  margin-left: 60px;
  background: rgba(255, 255, 255, 0.88);
  border: 0.1rem solid rgb(163, 163, 163);
  border-radius: 1.5rem;
  padding: 1.4rem 1.5rem 1.2rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.06);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.cd-timeline-content {
  position: relative;
  margin-left: 60px;
  background: rgba(255, 255, 255, 0.88);
  border: 0.1rem solid rgb(163, 163, 163);
  border-radius: 1.5rem;
  padding: 1.4rem 1.5rem 1.2rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.06);
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 260ms ease,
    border-color 260ms ease,
    background 260ms ease;
  transform-origin: center;
  will-change: transform;
}

.cd-timeline-content:hover {
  transform: translateY(-10px) scale(1.08);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
  border-color: rgba(80, 80, 80, 0.35);
  background: rgba(255, 255, 255, 0.96);
  z-index: 5;
}

.cd-timeline-content::before {
  content: "";
  display: none;
  position: absolute;
  top: 16px;
  right: 100%;
  height: 0;
  width: 0;
  border: 7px solid transparent;
  border-right-color: rgba(255, 255, 255, 0.88);
}

.cd-timeline-content h2 {
  margin: 0 0 0.5rem 0;
  color: var(--black-color);
  font-size: 1.25rem;
  font-family: var(--body-font);
}

.cd-timeline-content p {
  margin: 0.5rem 0;
  line-height: 1.6;
  color: var(--grey-color);
}

.cd-date {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--grey-color-lighter2);
  opacity: 0.9;
}

.experience-subtitle{
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 2rem;
  color: var(--grey-color-lighter2);
  font-size: 1.05rem;
}

.exp-tabs{
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 1.5rem auto 2.2rem;
  flex-wrap: wrap;
}

.exp-tab{
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--body-font);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--grey-color-lighter2);
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.5rem;
  transition: transform 180ms ease, color 180ms ease;
}

.exp-tab:hover{
  transform: translateY(-1px);
  color: var(--black-color);
}

.exp-tab.is-active{ color: rgb(0, 0, 0); }

.exp-tab-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-right: 0.4rem;
}

.exp-tab-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.exp-panel{ max-width: 1100px; margin: 0 auto; }
.exp-panel[hidden]{ display: none !important; }


/* ============================================================
   TIMELINE ENTRANCE ANIMATIONS
   ============================================================ */

/* Hidden state — used by retriggerRevealAnimations() before replaying bounce-in */
.is-hidden { opacity: 0 !important; }

/* Icon dot: scale pop */
@keyframes cd-dot-pop {
  0%   { opacity: 0; transform: scale(0.2); }
  65%  { transform: scale(1.18); }
  100% { opacity: 1; transform: scale(1); }
}

.cd-timeline-img.bounce-in {
  animation: cd-dot-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Content: slide up + fade (mobile default) */
@keyframes cd-slide-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cd-timeline-content.bounce-in {
  animation: cd-slide-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}


/* ============================================================
   PROJECTS SECTION (base)
   ============================================================ */

#projects { 
  position: relative; 
  padding-bottom: 1rem; 
}

#projects .title{
  margin-bottom: 2.5rem;         /* title -> carousel spacing */
}

#projects .experience-details-container{
  margin-top: 1.25rem;            /* subtitle/title -> carousel */
}

/* Optional: if you want even more gap below carousel */
#projects .projects-carousel{
  margin-bottom: 0.75rem;
}

.color-container {
  border-color: rgb(163, 163, 163);
  background: rgb(250, 250, 250);
}

/* Project image container */
#projects .article-container{
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Project images (desktop default) */
#projects .project-img{
  width: 100%;
  max-width: 420px;
  height: 280px;
  object-fit: cover;
  border-radius: 1rem;
  display: block;
}

#projects .project-title {
  margin: 1rem;
  color: black;
}

#projects .project-desc{
  margin: 0 0 1.35rem;
  padding: 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--grey-color);
  text-align: center;
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

#projects .project-btn {
  color: black;
  border-color: rgb(163, 163, 163);
}

/* Carousel structure */
.projects-carousel{ position: relative; width: 100%; }

.projects-belt{
  width: 100%;
  position: relative;
  overflow-y: visible;
  overflow-x: hidden;
  padding: 0.5rem 0 3rem;
  mask-image: linear-gradient(
    to right,
    transparent 0,
    black 14%,
    black 86%,
    transparent 100%
  );
}

.projects-track{
  display: flex;
  gap: var(--projects-gap);
  align-items: stretch;
  will-change: transform;
  transform: translate3d(0,0,0);
}

.projects-track.is-animating{
  transition: transform 420ms cubic-bezier(.22,1,.36,1);
}

/* fixed width + no shrinking */
#projects .details-container{
  flex: 0 0 var(--projects-card-width);
  width: var(--projects-card-width);
}

/* Fade logic */
.projects-track .details-container{
  position: relative;
  z-index: 1;
  transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
}

/* Hovered card comes to the front */
.projects-track .details-container:hover{
  z-index: 20;
}

#projects .details-container.color-container{
  transform-style: preserve-3d;
  will-change: transform;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);

  /* JS updates --rx/--ry. Carousel updates --cardScale. */
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--cardScale, 1));
  transition: box-shadow 180ms ease;
}


/* Make every project card the same height */
#projects .details-container.color-container{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 590px;           /* tweak this once, then everything aligns */
  padding: 1.5rem;
}

/* default tilt for normal project cards */
#projects .details-container.color-container { --tilt: 18; }

/* Keep title area consistent even if some titles wrap (2 lines etc.) */
#projects .project-title{
  margin: 0.9rem 0 0.6rem;
  line-height: 1.15;
  min-height: 2.6em;       /* reserves space for ~2 lines */
}

/* THIS is the key: description becomes the flexible middle zone */
#projects .project-desc{
  flex: 1;                 /* takes remaining space between title and button */
  display: flex;
  align-items: center;     /* vertically centers the text in that space */
  justify-content: center; /* keeps it centered */
  
  margin: 0;
  padding: 0 0.5rem;
  max-width: 46ch;
  line-height: 1.55;
}

/* Button always sits at the bottom, same place */
#projects .btn-container{
  margin-top: 0;           /* don’t push it up */
  padding-top: 0.8rem;
  padding-bottom: 0.3rem;  /* optional: consistent bottom breathing room */
}

/* Optional: consistent button sizing */
#projects .project-btn{
  width: 10.5rem;
}


.projects-track .details-container.is-center{
  opacity: 1;
  filter: none;
  --cardScale: 1;
}

.projects-track .details-container.is-peek{
  opacity: var(--projects-peek-fade);
  filter: blur(0.35px);
  --cardScale: 1;   
}

#projects .details-container.color-container:hover{
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}


/* don't let reveal hide cards inside carousel */
#projects .projects-track .reveal{
  opacity: 1 !important;
  /* transform: none !important; */
  transition: none !important;
}

/* If you still want to cancel reveal transforms ONLY for non-card elements */
#projects .projects-track .reveal:not(.details-container){
  transform: none !important;
}

/* edges overlay (fade sides) */
.projects-belt::before,
.projects-belt::after{
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  width: 90px;
  pointer-events: none;
  z-index: 5;
}


.projects-belt::before{
  left: 0;
  background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
}

.projects-belt::after{
  right: 0;
  background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
}

/* arrows */
.projects-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  border: 1px solid rgb(163,163,163);
  background: rgba(255,255,255,0.92);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease;
}

.projects-nav--left{ left: -12px; }
.projects-nav--right{ right: -12px; }

.projects-nav:hover{ transform: translateY(-50%) scale(1.06); }
.projects-nav i{ font-size: 1.7rem; color: #000; }

.projects-nav:disabled{
  opacity: 0.35;
  cursor: default;
}

/* 3D project card hover */
#projects .about-containers{ perspective: 1000px; }

#projects .details-container.color-container .project-img{
  transform: translateZ(20px);
  transition: transform 180ms ease;
}

#projects .details-container.color-container .project-title{
  transform: translateZ(16px);
}

#projects .details-container.color-container .project-desc{
  transform: translateZ(10px);
}


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

#contact {
  display: flex;
  justify-content: center;
  flex-direction: column;
  height: 70vh;
}

.contact-info-upper-container {
  display: flex;
  justify-content: center;
  border-radius: 2rem;
  border: rgb(53, 53, 53) 0.1rem solid;
  border-color: rgb(163, 163, 163);
  background: rgb(250, 250, 250);
  margin: 2rem auto;
  padding: 0.5rem;
}

.contact-info-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem;
}

.contact-info-container p { font-size: larger; }

.contact-icon { cursor: default; }

.email-icon { height: 2.5rem; }


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

footer {
  height: 12vh;
  margin: 0 1rem;
}

footer p { text-align: center; }


/* ============================================================
   TYPEWRITER / ROTATOR
   ============================================================ */

.hero-rotator {
  display: flex;
  justify-content: center;
  width: 100%;
}

.center-typewriter {
  width: 520px;
  max-width: 100%;
  margin: 0 auto 1rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.rotator-static { opacity: 0.9; }
.rotator-dynamic { font-weight: 700; }

.type-cursor {
  margin-left: 3px;
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }


/* ============================================================
   TRANSPARENCY OVERLAY FOR CARDS
   ============================================================ */

.details-container,
.contact-info-upper-container {
  background: rgba(255,255,255,0.88);
}


/* ============================================================
   REVEAL ON SCROLL (base)
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 420ms ease-out,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#projects .reveal {
  transition:
    opacity 1400ms ease-out,
    transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Global stagger */
.reveal[data-delay="1"] { transition-delay: 60ms; }
.reveal[data-delay="2"] { transition-delay: 120ms; }
.reveal[data-delay="3"] { transition-delay: 180ms; }
.reveal[data-delay="4"] { transition-delay: 220ms; }
.reveal[data-delay="5"] { transition-delay: 260ms; }

/* Projects custom stagger */
#projects .reveal[data-delay="3"] { transition-delay: 0ms; }
#projects .reveal[data-delay="4"] { transition-delay: 180ms; }
#projects .reveal[data-delay="5"] { transition-delay: 360ms; }


/* ============================================================
   RESEARCH SECTION
============================================================ */

#research {
  position: relative;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

#research .title {
  margin-bottom: 1.4rem;
}

.research-wrap {
  max-width: 1250px;
  margin: 0 auto;
}

/* ============================================================
   RESEARCH CONTROLS
============================================================ */

.research-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.research-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-self: end;
}

.research-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.research-filter {
  border: 1px solid rgb(163, 163, 163);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-family: var(--body-font);
  font-weight: 600;
  color: var(--grey-color);
  transition:
    transform 150ms ease,
    background 150ms ease,
    color 150ms ease,
    opacity 150ms ease;
}

.research-filter:hover {
  transform: translateY(-1px);
  background: rgba(245, 245, 245, 0.95);
}

.research-filter.is-active {
  color: #111;
  background: rgba(233, 233, 233, 0.95);
}

.research-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 320px;
}

.research-search i {
  position: absolute;
  left: 0.9rem;
  font-size: 1.2rem;
  color: var(--grey-color-lighter2);
}

.research-search input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgb(163, 163, 163);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  font-family: var(--body-font);
  outline: none;
}

.research-search input:focus {
  border-color: #bdbdbd;
}

.research-sort {
  width: 180px;
}

.research-sort select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgb(163, 163, 163);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.72rem 0.9rem;
  font-family: var(--body-font);
  outline: none;
}

/* ============================================================
   RESEARCH LIST
============================================================ */

.research-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

/* ============================================================
   FEATURED RESEARCH / WORKSHOP CARD
============================================================ */

.research-card {
  width: 100%;
  padding: 1.5rem 1.7rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);

  overflow: hidden;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.research-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.96);
}

/* Main visible row */
.research-card-main {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 1.6rem;
  align-items: center;
}

/* Logo container: no border, no grey background */
.research-card-media {
  width: 150px;
  height: 150px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: none;
  padding: 0;
  overflow: visible;
}

.research-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.research-card-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.research-card-top {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.research-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #f0f0f0;
}

.research-date {
  font-size: 0.95rem;
  color: #666;
}

.research-card-title {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 0.45rem;
  color: #111;
}

.research-meta {
  font-weight: 600;
  color: #555;
  margin: 0 0 0.7rem;
  line-height: 1.45;
}

.research-desc {
  color: #444;
  line-height: 1.65;
  margin: 0;
  max-width: 80ch;
}

/* Hidden hover section */
.research-card-hover {
  max-height: 0;
  opacity: 0;
  overflow: hidden;

  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;

  margin-left: calc(150px + 1.6rem);
  margin-top: 0;

  transition:
    max-height 320ms ease,
    opacity 260ms ease,
    margin-top 260ms ease;
}

.research-card:hover .research-card-hover {
  max-height: 260px;
  opacity: 1;
  margin-top: 1.2rem;
}

.research-hover-image {
  width: 220px;
  height: 145px;
  border-radius: 1rem;
  overflow: hidden;
  background: #f5f5f5;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.research-hover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* For vertical / portrait conference photos */
.research-hover-image--portrait {
  width: 220px;
  height: 280px;
}

.research-hover-image--portrait img {
  object-fit: cover;
  object-position: center 60%;
}

/* Give the hover area enough height for portrait images */
.research-card:hover .research-card-hover {
  max-height: 380px;
}


/* Hover text + button */
.research-hover-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

.research-hover-content p {
  margin: 0;
  color: #444;
  line-height: 1.55;
  max-width: 65ch;
}

.research-hover-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgb(163, 163, 163);

  color: #111;
  background: rgba(250, 250, 250, 0.95);
  font-weight: 600;
  font-size: 0.92rem;

  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.research-hover-btn:hover {
  transform: translateY(-2px);
  background: #eeeeee;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.09);
}

/* ============================================================
   STANDARD RESEARCH ITEM CARDS
   Keep this for future publications/preprints
============================================================ */

.research-item {
  border-radius: 2rem;
  border: 0.1rem solid rgb(163, 163, 163);
  background: rgba(255, 255, 255, 0.88);
  padding: 1.3rem 1.4rem 1.2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.research-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.10);
}

.research-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.research-pill {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgb(163, 163, 163);
  background: rgba(250, 250, 250, 0.95);
  color: #111;
}

.research-pill--preprint {
  background: rgba(245, 245, 245, 0.95);
}

.research-year {
  color: var(--grey-color-lighter2);
  font-weight: 600;
}

.research-title {
  margin: 0.15rem 0 0.5rem;
  font-size: 1.25rem;
  color: #111;
  line-height: 1.25;
}

.research-authors,
.research-venue {
  margin: 0.25rem 0;
  color: var(--grey-color);
  line-height: 1.55;
}

.research-venue-name {
  font-weight: 700;
  color: #111;
}

.research-venue-sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

.research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.research-btn {
  width: auto;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
}

.research-empty {
  text-align: center;
  margin-top: 1.2rem;
  color: var(--grey-color-lighter2);
}

/* ============================================================
   WORK IN PROGRESS BLOCK
============================================================ */

.research-wip {
  width: 100%;
  padding: 0;
  background: none;
  border: none;
}

.research-wip-title {
  padding-top: 5rem;
  margin: 1.2rem 0 0.8rem;
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  color: #111;
}

.research-wip-video {
  display: block;
  margin: 0 auto;
  width: min(150px, 100%);
  border-radius: 1rem;
  border: none;
  padding-bottom: 8rem;
}

/* ============================================================
   UTILITIES
============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media screen and (max-width: 1100px) {
  .research-controls {
    grid-template-columns: 1fr;
  }

  .research-right {
    justify-self: start;
  }
}

@media screen and (max-width: 768px) {
  .research-card {
    padding: 1.4rem;
  }

  .research-card-main {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .research-card-media {
    width: 140px;
    height: 140px;
    margin: 0 auto;
  }

  .research-card-top {
    justify-content: center;
  }

  .research-desc {
    max-width: none;
  }

  .research-card-hover {
    grid-template-columns: 1fr;
    margin-left: 0;
    text-align: center;
  }

  .research-card:hover .research-card-hover {
    max-height: 580px;
  }

  .research-hover-image {
    width: 100%;
    max-width: 320px;
    height: 190px;
    margin: 0 auto;
  }

  /* Portrait hover image on phone */
  .research-hover-image.research-hover-image--portrait {
    width: 100%;
    max-width: 260px;
    height: 340px;
    margin: 0 auto;
  }

  .research-hover-image.research-hover-image--portrait img {
    object-fit: cover;
    object-position: center 65%;
  }

  .research-hover-content {
    align-items: center;
  }

  .research-search {
    width: 100%;
  }
}

/* ===========================
   MODAL (Python Games)
=========================== */

.modal-overlay{
  position: fixed;
  inset: 0;
  display: none;              /* hidden by default */
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 2000;
}

.modal-overlay.is-open{
  display: flex;
}

.modal{
  position: relative;
  width: min(520px, 92vw);
  border-radius: 1.5rem;
  border: 0.1rem solid rgb(163, 163, 163);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
  padding: 2rem 1.8rem 1.7rem;
}

.modal-title{
  margin: 0 0 0.4rem 0;
  text-align: center;
  font-size: 1.8rem;
  color: var(--black-color);
}

.modal-subtitle{
  text-align: center;
  color: var(--grey-color);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.modal-actions{
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-btn{
  width: 12rem; /* feel free to tweak */
}

.modal-close{
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  width: 42px;
  height: 42px;
  border: 1px solid rgb(163, 163, 163);
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 150ms ease, opacity 150ms ease;
}

.modal-close:hover{
  transform: scale(1.06);
  opacity: 0.9;
}

/* Modal cards grid */
.modal-projects{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.2rem;
}

/* Center the last card when there's an odd number of cards (e.g., 3) */
.modal-projects > .modal-project-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;      /* span full row */
  justify-self: center;     /* center the card */
  max-width: 420px;         /* optional: keep it from being too wide */
  width: 100%;
}


/* Make the modal wider to fit 2 cards */
.modal{
  width: min(980px, 94vw);
  max-height: 86vh;
  overflow: auto;
}

/* Card sizing inside modal */
.modal-project-card{
  height: auto;              /* let content define height */
  padding: 1.25rem;
}

/* Images inside modal cards: slightly smaller */
.modal-project-card .project-img{
  max-width: 100%;
  height: 220px;
}

/* tighten text a bit inside modal */
.modal-project-card .project-desc{
  margin-top: 0.6rem;
  margin-bottom: 1rem;
}

/* Mobile: stack cards */
@media (max-width: 900px){
  .modal-projects{
    grid-template-columns: 1fr;
  }
  .modal{
    width: min(560px, 92vw);
  }
}

/* ===========================
   MODAL: 3D hover cards
=========================== */

/* perspective must be on a parent of the tilting element */
.modal {
  perspective: 1200px;
  perspective-origin: 50% 40%;
}

/* the cards themselves tilt */
.modal-project-card{
  position: relative;
  transform-style: preserve-3d;
  will-change: transform, box-shadow, filter;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--cardScale, 1));
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* lift */
.modal-project-card:hover{
  --cardScale: 1.03;
  box-shadow: 0 22px 55px rgba(0,0,0,0.18);
  filter: saturate(1.04);
  z-index: 5;
}

/* depth on inner elements */
.modal-project-card .project-img{ transform: translateZ(28px); }
.modal-project-card .project-title{ transform: translateZ(18px); }
.modal-project-card .project-desc{ transform: translateZ(12px); }
.modal-project-card .btn-container{ transform: translateZ(16px); }

/* optional shine */
.modal-project-card::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 2rem; /* match your card radius */
  pointer-events:none;
  background: radial-gradient(
    520px 220px at var(--mx, 50%) var(--my, 30%),
    rgba(255,255,255,0.22),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 160ms ease;
}

.modal-project-card:hover::after{ opacity: 1; }

/* smaller tilt inside the Python Games modal */
.modal-project-card { --tilt: 10; }  /* try 8–12 */

/* Slight zoom for noot-noot only */
.modal-project-card .project-img.noot-zoom{
  transform: scale(1.18);
  transform-origin: center;
}


/* ============================================================
   ACCESSIBILITY (NOT screen-size)
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .cd-timeline-img.bounce-in,
  .cd-timeline-content.bounce-in,
  .reveal,
  #projects .details-container.color-container,
  #projects .details-container.color-container .project-img {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .reveal { opacity: 1 !important; }
}
