:root {
    --navbar-height: 60px;
    overflow-x: hidden;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, hsl(0, 0%, 15%) 0%, #292929 100%);
    overflow-x: hidden;
    overflow-y: hidden;
}

/**********************************************************************
******                         Hero Section                      ******
**********************************************************************/
.hero-section {
    min-height: calc(100dvh - var(--navbar-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-bottom: 3px solid #310000;
    margin-top: var(--navbar-height);
}

#outer-border {
    width: min(55vh, 600px);
    height: min(70vh, 700px);
    background: linear-gradient(45deg, #100021, #2f005c);
    border: 8px solid #380000;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(-100px);
    animation: slideInLeft 1s ease-out 0.5s forwards;
}

.hero-photo {
    width: 100%;
    height: 100%;
    position: relative;
    border: 12px solid #100021;
    background: #100021;
    border-radius: 15px;
}

.photo-fit {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.hero-text-container {
    margin-top: -100px;
    flex: 1 1 0;
    min-width: 0;
    padding-left: 2rem;
    overflow: visible;
    color: rgb(214, 214, 214);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(100px);
    animation: slideInRight 1s ease-out 0.7s forwards;
    height: auto;
}

.hero-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 7rem);
    font-weight: 700;
    margin-bottom: -3rem;
    background: rgb(214, 214, 214);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: "Atkinson Hyperlegible", sans-serif;
}

.hero-subtitle-degrees-container {
    font-family: "Atkinson Hyperlegible", sans-serif;
    display: flex;
    flex-direction: row;    
    width: 100%;              
    justify-content: space-between; 
    align-items: flex-start;  
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-subtitle {
    display: flex;
    align-items: center;
    margin: 0;
    flex: 0 0 auto;
}

.typing-text {
    padding-left: 15px;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: rgb(214, 214, 214);
    min-height: 2rem;
}

.typing-text {
    border-right: 2px solid #fff;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: #fff; }
}

.degrees {
    display: flex;
    justify-content: flex-end;
    flex: 1 1 300px;
    min-width: 250px;
    padding: 0.5rem 0;
    margin-top: 15px;
    margin-left: auto;
    text-align: right; 
    font-family: "Atkinson Hyperlegible", sans-serif;
}

.degrees ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.degree-list-item{
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: clamp(0.5rem, 2vw, 1.25rem);
  align-items: baseline;
}

.degree-list-item > span:first-child{
  min-width: 0;
  text-align: left;
}

.degree-list-item .align-right{
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 420px){
  .degree-list-item > span:first-child{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.hero-paragraph {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin-top: 4rem;
    line-height: 1.3;
    color: rgb(214, 214, 214);
    overflow-wrap: anywhere;
}

/**********************************************************************
******                      Project Section                     ******
**********************************************************************/
.project-section {
    min-height: calc(100vh - 60px);
    background: linear-gradient(-135deg, hsl(0, 0%, 15%) 0%, #292929 100%);
    display: flex;
    flex-direction: row;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 3px solid #310000;
    border-bottom: 3px solid #310000;
}

.project-left {
    flex: 1 1 auto;
    padding: 3%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    line-height: 1.3;
    color: rgb(214, 214, 214);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.8s ease-out;
}

.project-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.see-more-link {
    border: 5px solid #230000;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);       
    background: #310000;
    color: rgb(214, 214, 214);
    padding: 15px;
    text-decoration: none;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    margin-top: 30px;
    border-radius: 10px;
    transition: background 0.2s ease-in-out;
}

.see-more-link:hover {
    background: rgba(104, 0, 0, 0.8);
}

.project-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-135deg, #1c0101, #3d0000);
    border-left: 3px solid #310000;
    color: rgb(214, 214, 214);
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    width: auto;
    min-width: 500px;
    flex: 0 0 auto;
    padding: 0.5rem 2rem;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.8s ease-out;
}

.project-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 125px);
    grid-template-rows: repeat(4, 125px);
    gap: 30px;
    justify-content: center;
    align-content: center;
    width: 100%;
    height: auto;
    padding: 20px;
    max-height: calc(100vh - 120px);
}

.card {
    width: 125px;
    height: 125px;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
}

.card-content {
    width: 100%;
    height: 100%;
    position: relative;
    background: #310000;
    border-radius: 15px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);       
    border: 2px solid #1c0000;
    transition: 0.2s ease;
    overflow: hidden;
}

.card:hover .card-content {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.icon-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    transition: all 2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card.expanded .icon-container {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: none;
    background: rgb(214, 214, 214);
    border-radius: 15px;
}

.card.expanded {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    border-radius: 0;
}

.grid.grid-expanded .card:not(.expanded){
    opacity: 0;
    pointer-events: none;
}

.language-icon {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    transition: all 1s cubic-bezier(0.55, 0.085, 0.68, 0.53);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: rgb(214, 214, 214);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: rgb(214, 214, 214);
}

.language-icon::before {
    content: attr(data-lang);
    font-size: 0.8rem;
    color: #333;
}

.card.expanded .language-icon {
    transform: rotateY(180deg);
    opacity: 0;
}

.text-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: rgb(214, 214, 214);
    opacity: 0;
    transform: rotateY(-180deg);
    transition: all 1s cubic-bezier(0.55, 0.085, 0.68, 0.53);
    z-index: 1;
}

.card.expanded .text-content {
    opacity: 1;
    transform: rotateY(0deg);
}

.language-description {
    color: black;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
    opacity: 0.9;
}

/**********************************************************************
******                      Employment Section                   ******
**********************************************************************/
.employment-section {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: row;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 3px solid #310000;
    border-bottom: 3px solid #310000;
}

.employment-right {
    flex: 1 1 auto;
    padding: 3%;
    background: linear-gradient(135deg, hsl(0, 0%, 15%) 0%, #292929 100%);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    line-height: 1.3;
    color: rgb(214, 214, 214);
    position: relative;
    overflow: hidden;
    text-align: center;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.8s ease-out;
}

.employment-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.employment-left {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1c0101, #3d0000);
    border-right: 3px solid #310000;
    color: rgb(214, 214, 214);
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    padding: 1rem 2rem;
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.8s ease-out;
}

.employment-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.employment-left img {
    box-shadow: 0 0 20px black;
    border-radius: 30px;
    max-height: 450px;
    max-width: 450px;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/**********************************************************************
******                      Education Section                    ******
**********************************************************************/
.education-section {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 3px solid #310000;
    border-bottom: 3px solid #310000;
}

.education-left {
    background: linear-gradient(-135deg, hsl(0, 0%, 15%) 0%, #292929 100%);
    flex: 1 1 auto;
    padding: 3%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    line-height: 1.3;
    color: rgb(214, 214, 214);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.8s ease-out;
}

.education-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.education-right {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-135deg, #1c0101, #3d0000);
    border-left: 3px solid #310000;
    color: rgb(214, 214, 214);
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    padding: 0.5rem 2rem;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.8s ease-out;
}

.education-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.education-right img {
    box-shadow: 0 0 20px black;
    border-radius: 10px;
    max-height: 450px;
    width: 100%;
    height: auto;
    object-fit: cover;
    max-width: 700px;
}

/**********************************************************************
******                      Animations                           ******
**********************************************************************/
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-100px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(50px); }
    to   { opacity: 1; transform: translateY(0); }
}

/**********************************************************************
******                      Responsive                           ******
**********************************************************************/

/* Tablet and smaller desktop */
@media (max-width: 1350px) {
    .hero-text-container {
        margin-top: 0px;
        flex-direction: column;
        align-items: center;
        padding-left: 0;
        width: 100%;
        max-width: 100%;
    }

    .hero-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
    }        

    .hero-subtitle-degrees-container {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .degrees {
        margin-top: -25px;
        margin-bottom: -12rem;    
        margin-left: 0;
        text-align: center;
        min-width: auto;
    }
    
    .hero-paragraph {
        text-align: center;
        font-size: clamp(1rem, 2vw, 1.4rem);
    }

    .project-right {
        min-width: 450px;
    }
    
    .grid {
        grid-template-columns: repeat(3, 110px);
        grid-template-rows: repeat(4, 110px);
        gap: 25px;
    }
    
    .card {
        width: 110px;
        height: 110px;
    }

    .education-right img {
        width: min(50vh, 450px);
    }
}

/* Large tablets */
@media (max-width: 1024px) {
    .hero-section {
        /* FIX: previously height:100vh (hard cap). Use min-height so it can expand. */
        min-height: calc(100dvh - var(--navbar-height));
        flex-direction: column;
        text-align: center;
        padding: 20px 1rem;
        gap: 2.5rem;
    }
    
    #outer-border {
        width: min(60vw, 350px);
        height: min(60vw, 350px);
    }
    
    .hero-text-container {
        padding-left: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .hero-subtitle-degrees-container {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .degrees {
        margin-left: 0;
        text-align: center;
        min-width: auto;
        margin-bottom: -12rem;
    }
    
    .hero-paragraph {
        text-align: center;
        font-size: clamp(0.8rem, 2.5vw, 1.5rem);
    }
    
    .project-right {
        min-width: 400px;
    }

    .education-right img {
        width: min(35vh, 350px);
    }

    .project-left, .employment-right, .education-left {
        font-size: 1.3em;
    }
}

/* Medium tablets */
@media (max-width: 900px) {
    .hero-title {
        margin-bottom: -2.75rem
    }

    .project-section, .employment-section, .education-section {
        flex-direction: column;
    }
    
    .project-right, .employment-left, .education-right {
        border-left: none;
        border-right: none;
        border-top: 3px solid #310000;
        width: 100%;
        min-width: 100%;
        padding: 2rem 1rem;
    }
    
    .employment-right, .project-left, .education-left {
        padding: 2rem 1rem;
    }
    
    .grid {
        grid-template-columns: repeat(4, 80px);
        grid-template-rows: repeat(3, 80px);
        gap: 15px;
        padding: 15px;
    }
    
    .card {
        width: 80px;
        height: 80px;
    }

    .project-right {
        min-width: 100%;
    }

    .education-right img {
        width: min(80vh, 500px);
    }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
    .hero-section {
        margin-top: 0;
        padding: 2rem 1rem;
    }
    
    #outer-border {
        width: min(70vw, 300px);
        height: min(70vw, 300px);
        border: 6px solid #380000;
    }
    
    .hero-photo {
        border: 6px solid #100021;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 10vw, 2.5rem);
        margin-bottom: -2.5rem;
    }
    
    .pre-typing-text, .typing-text {
        font-size: clamp(1rem, 6vw, 1.3rem);
    }
    
    .hero-paragraph {
        font-size: clamp(0.5rem, 5vw, 1.3rem);
        margin-top: 3rem;
    }
    
    .degree-list-item {
        font-size: clamp(0.7rem, 4vw, 0.9rem);
    }

    .hopkins {
        font-size: clamp(0.7rem, 3vw, 0.9rem);
    }
    
    .project-left, .employment-right, .education-left {
        padding: 1.5rem 1rem;
        font-size: clamp(1rem, 4vw, 1.3rem);
    }

    .hero-section, .project-section, .employment-section, .education-section {
        min-height: 100vh;
    }
    
    .see-more-link {
        font-size: clamp(1rem, 4vw, 1.2rem);
        padding: 12px;
    }
    
    .grid {
        grid-template-columns: repeat(3, 70px);
        grid-template-rows: repeat(4, 70px);
        gap: 8px;
        padding: 10px;
    }
    
    .card {
        width: 70px;
        height: 70px;
    }

    .employment-left img, .education-right img {
        max-height: 200px;
    }
    
    .social-list {
        gap: 15px;
        padding: 0 1rem;
    }
    
    .social-list li a i {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .education-right img {
        width: min(90vh, 350px);
    }
}

@media (max-width: 540px) {
    .hero-paragraph {
        font-size: clamp(1rem, 4.5vw, 1.2rem);
        margin-top: 3rem;
    }
}

@media (max-width: 462px) {
    .hero-paragraph {
        font-size: clamp(1rem, 4.2vw, 1.2rem);
        margin-top: 2.5rem;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .hero-section {
        padding: 1rem 0.25rem;
    }
    
    .grid {
        grid-template-columns: repeat(3, 60px);
        grid-template-rows: repeat(4, 60px);
        gap: 6px;
    }
    
    .card {
        width: 60px;
        height: 60px;
    }

    .hero-title {
        font-size: clamp(1.5rem, 12vw, 2rem);
    }
    
    .degree-list-item {
        font-size: clamp(0.6rem, 5vw, 0.8rem);
    }

    .hopkins {
        font-size: clamp(0.5rem, 3vw, 0.9rem);
    }

    .education-right img {
        width: min(80vh, 250px);
    }
}
