/* ============================================
   GLOBAL STYLES & RESET
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #fdfdfd;
  color: #333;
  line-height: 1.6;
  padding-top: 70px;
}

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
  color: #2F4156;
  font-weight: 600;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 0.75rem;
}

h4 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 0.5rem;
}

h5 {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

p {
  font-size: clamp(1rem, 1.75vw, 1.125rem);
  line-height: 1.6;
  margin-bottom: 1rem;
}

a {
  color: #2F4156;
  transition: color 0.3s ease;
}

a:hover {
  color: #C8D9E6;
}


/* ============================================
   NAVIGATION
   ============================================ */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  padding: 1rem 2rem;
  border-bottom: 4px solid #2F4156;
  z-index: 1000;
  transition: top 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: bold;
  color: #2F4156;
}

.top-nav nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.top-nav nav ul li a {
  text-decoration: none;
  color: #2F4156;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.top-nav nav ul li a:hover {
  color: #C8D9E6;
}

.pdf-tag {
  background-color: #2F4156;
  color: #F5EFEB;
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 5px;
  vertical-align: middle;
}


/* ============================================
   HOME SECTION
   ============================================ */

.home-section {
  background-color: #eff1f4;
  border-top: 4px solid #2F4156;
  border-bottom: 4px solid #2F4156;
  padding: 4rem 2rem;
  text-align: center;
  min-height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-overlay {
  padding: 2rem;
  border-radius: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.home-section p {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  color: #2F4156;
  margin-bottom: 1rem;
}

.headshot-img {
  width: clamp(200px, 30vw, 400px);
  height: clamp(200px, 30vw, 400px);
  border-radius: 50%;
  border: 8px solid #fff;
  object-fit: cover;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}


/* ============================================
   SECTION HEADINGS
   ============================================ */

.custom-heading {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-family: 'Playfair Display', serif;
  color: #2F4156;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 3.5rem 0 1.5rem;
  text-align: center;
  position: relative;
}

.custom-heading::after {
  content: '';
  display: block;
  height: 2px;
  width: 80px;
  background: #2F4156;
  margin: 0.5rem auto 0;
}


/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}


/* ============================================
   SUBPAGE PROJECT SECTIONS
   ============================================ */

.subpage-project {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 3rem auto;
  max-width: 1400px;
  padding: 0 1rem;
  flex-wrap: wrap;
}

.subpage-project .project-text {
  flex: 1;
  min-width: 280px;
  max-width: 700px;
  text-align: left;
  font-family: 'Playfair Display', serif;
  color: #2F4156;
}

.subpage-project .project-text ul {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.subpage-project .project-text li {
  margin-bottom: 0.5rem;
}

.subpage-project .project-text a {
  color: #2F4156;
  font-weight: bold;
  text-decoration: underline;
}

.subpage-project .project-card {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
  height: 400px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
  display: block;
  text-decoration: none;
}

.subpage-project .project-card:hover {
  transform: scale(1.03);
}

.subpage-project .project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.subpage-project .project-title {
  background-color: rgba(47, 65, 86, 0.9);
  color: #fff;
  padding: 1rem;
  position: absolute;
  bottom: 0;
  width: 100%;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: 'Playfair Display', serif;
}


/* ============================================
   FLIP CARDS (AI/ML Projects)
   ============================================ */

.flip-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
}

.flip-card {
  background-color: transparent;
  perspective: 1000px;
  height: 400px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card-inner:hover {
  transform: rotateY(180deg);
}

.flip-card-inner:hover .flip-card-back {
  z-index: 10;
  pointer-events: all;
}

.flip-card-inner:hover .flip-card-front {
  z-index: 0;
  pointer-events: none;
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  -webkit-backface-visibility: hidden;
}

.flip-card-front {
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.flip-card-title {
  position: absolute;
  bottom: 0;
  width: 100%;
  background-color: rgba(47, 65, 86, 0.9);
  color: #fff;
  padding: 1rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  z-index: 2;
}

.flip-card-back {
  background: linear-gradient(135deg, #2F4156 0%, #3d5a73 100%);
  color: #fff;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: left;
  pointer-events: none;
}

.flip-card-back h4 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.flip-card-back p {
  color: #e8ecf0;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.flip-card-back a {
  color: #CCDEEB;
  font-weight: bold;
  text-decoration: none;
  border: 2px solid #CCDEEB;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: inline-block;
  position: relative;
  z-index: 100;
  pointer-events: all;
}

.flip-card-back a:hover {
  background-color: #CCDEEB;
  color: #2F4156;
}

/* Flip button - hidden by default, only visible on mobile */
.flip-btn {
  display: none;
}

/* Flipped state - works on all devices */
.flip-card-inner.flipped {
  transform: rotateY(180deg) !important;
}

/* Mobile: Static card layout instead of flip */
@media (max-width: 768px) {
  .flip-cards-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .flip-card {
    height: auto;
    perspective: none;
  }

  .flip-card:hover .flip-card-inner {
    transform: none;
  }

  .flip-card-inner {
    transform: none !important;
    transform-style: flat;
    position: static;
    display: block;
    height: auto;
  }

  .flip-card-front,
  .flip-card-back {
    position: relative;
    backface-visibility: visible;
    transform: none !important;
    width: 100%;
    height: auto;
    box-shadow: none;
  }

  .flip-card-front {
    display: block;
    height: 200px;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .flip-card-front img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
    z-index: 0;
  }

  .flip-card-front .flip-card-title {
    display: none !important;
  }

  .flip-card-back {
    display: block;
    position: relative;
    transform: none;
    padding: 0.75rem;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .flip-card-back h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .flip-card-back p {
    font-size: 0.85rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }

  .flip-card-back a {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  .flip-btn {
    display: none;
  }
}


/* ============================================
   ABOUT SECTION
   ============================================ */

.about-section {
  padding: 4rem 2rem;
  text-align: center;
  background-color: #fdfdfd;
  color: #2F4156;
}

.about-elements {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 1000px;
  margin: 0 auto;
}

.about-item {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.about-item img {
  max-width: 300px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  flex-shrink: 0;
}

.about-item:nth-child(even) {
  flex-direction: row-reverse;
}

.about-text {
  text-align: left;
  flex: 1;
}

.about-text h3 {
  margin-bottom: 0.5rem;
}

.about-text p {
  font-size: 1rem;
}


/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
  border-top: 4px solid #2F4156;
  background-color: #eff1f4;
  font-family: 'Playfair Display', serif;
  padding: 4rem 2rem;
  text-align: center;
}

.contact-section h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-family: 'Playfair Display', serif;
  color: #2F4156;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 1.5rem 0 1.5rem;
  position: relative;
}

.contact-section h2::after {
  content: '';
  display: block;
  height: 2px;
  width: 80px;
  background: #2F4156;
  margin: 0.5rem auto 0;
}

.contact-overlay {
  padding: 2rem;
  border-radius: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-section p {
  font-family: 'Playfair Display', serif;
  color: #2F4156;
  margin: 0.5rem 0;
}

.contact-section a {
  color: #2F4156;
  text-decoration: none;
}

.contact-section a:hover {
  text-decoration: underline;
  color: #1e2a39;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-family: 'Playfair Display', serif;
  color: #2F4156;
  font-size: 1rem;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form button {
  padding: 0.75rem;
  background-color: #fff;
  color: #2F4156;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-family: 'Playfair Display', serif;
  transition: background-color 0.3s ease;
}

.contact-form button:hover {
  background-color: #bed6e7;
}


/* ============================================
   FOOTER
   ============================================ */

footer {
  border-top: 4px solid #2F4156;
  background-color: #fff;
  color: #2F4156;
  text-align: center;
  padding: 1.5rem;
  font-family: 'Playfair Display', serif;
}

footer a {
  color: #2F4156;
  text-decoration: underline;
}


/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets and smaller */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 140px;
  }

  body {
    padding-top: 130px;
  }

  .nav-container {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
  }

  .nav-title {
    font-size: 1rem;
  }

  .top-nav nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .top-nav nav ul li a {
    font-size: 0.9rem;
  }

  .home-section {
    min-height: 70vh;
    padding: 2rem 1rem;
  }

  .subpage-project {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .subpage-project .project-text {
    text-align: center;
    max-width: 100%;
  }

  .about-item,
  .about-item:nth-child(even) {
    flex-direction: column;
    text-align: center;
  }

  .about-text {
    text-align: center;
  }

  .about-item img {
    max-width: 100%;
  }

  #courses > div {
    flex-direction: column;
    text-align: center;
  }

  .course-img {
    margin-right: 0;
    margin-bottom: 1rem;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .top-nav {
    padding: 0.75rem 1rem;
  }

  .top-nav nav ul {
    gap: 0.5rem;
  }

  .top-nav nav ul li a {
    font-size: 0.85rem;
  }

  .nav-title {
    font-size: 0.95rem;
  }

  .home-section {
    padding: 1.5rem 1rem;
  }

  .subpage-project {
    padding: 0 0.5rem;
    margin: 2rem auto;
  }

  .contact-overlay {
    padding: 1rem;
  }
}

/* Large desktops */
@media (min-width: 1400px) {
  .nav-container {
    max-width: 1600px;
  }

  .main-content,
  .subpage-project,
  .about-elements {
    max-width: 1200px;
  }
}
