/* =========================================================
   reset
   ========================================================= */

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

html, body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #000;
}


/* =========================================================
   base layout (mobile first)
   ========================================================= */

body {
  min-height: 100vh;

  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: scroll;

  padding: 1rem 0;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1rem;
}

/* prevent horizontal scroll on mobile */
@media (max-width: 767px) {
  html, body {
    overflow-x: hidden;
  }
}


/* =========================================================
   content card
   ========================================================= */

.content-card {
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;

  width: 100%;
  max-width: 900px;
  margin: 0 auto;

  padding: 1.2rem;
  border-radius: 8px;

  display: flex;
  flex-direction: column;
  gap: 1rem;

  min-width: 0;
}


/* =========================================================
   sidebar (hidden by default)
   ========================================================= */

.sidebar-card {
  display: none;
}


/* =========================================================
   mobile header + menu
   ========================================================= */

.mobile-header {
  display: flex;
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}

#menu-toggle {
  background: rgba(0,0,0,0.9);
  color: #fff;
  border: 1px solid #444;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
}

/* mobile sidebar overlay */
@media (max-width: 767px) {

  .sidebar-card {
    position: fixed;
    top: 0;
    left: 0;

    width: 80%;
    max-width: 300px;
    height: 100%;

    background-color: rgba(0, 0, 0, 0.95);

    z-index: 1000;
    overflow-y: auto;
  }

  .sidebar-card.open {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
  }
}


/* =========================================================
   typography
   ========================================================= */

.content-card h1 { font-size: 1.5rem; }
.content-card h2 { font-size: 1.3rem; }
.content-card h3 { font-size: 1.1rem; }

.content-card p,
.content-card li {
  font-size: 1rem;
  line-height: 1.5;
}

.content-card p { margin-bottom: 0.6rem; }
.content-card ul { margin-bottom: 0.6rem; padding-left: 1.2rem; }
.content-card li { margin-bottom: 0.25rem; }


/* =========================================================
   sidebar links
   ========================================================= */

.sidebar-card a { color: #fff; }
.sidebar-card a:hover { color: #82c4ff; }
.sidebar-card a.active { font-weight: 600; }


/* =========================================================
   profile / misc
   ========================================================= */

.profile-image {
  display: flex;
  justify-content: center;
}

.profile-image img {
  width: 200px;
  height: 300px;
  object-fit: cover;
}

.about h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.about p {
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0.9;
}


/* =========================================================
   tables
   ========================================================= */

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th, td {
  border-bottom: 1px solid #333;
  padding: 6px 10px;
  text-align: left;
}

th {
  color: #ddd;
  font-weight: 600;
  border-bottom: 1px solid #555;
}


/* =========================================================
   links
   ========================================================= */

a {
  color: #4da3ff;
  text-decoration: none;
}

a:visited { color: #4da3ff; }

a:hover {
  color: #82c4ff;
  text-decoration: underline;
}


/* =========================================================
   link cards
   ========================================================= */

.link-card {
  text-decoration: none;
  color: #fff;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;

  width: 120px;
}

.link-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.link-card:hover img { opacity: 0.85; }
.link-card:hover span { text-decoration: underline; }


/* =========================================================
   page backgrounds
   ========================================================= */

.home-page { background-image: url("/assets/images/background.jpg"); }
.research-page { background-image: url("/assets/images/research.png"); }
.teaching-page { background-image: url("/assets/images/teaching.png"); }
.open-source-research-page { background-image: url("/assets/images/open-source-research.png"); }
.software-page { background-image: url("/assets/images/software.png"); }


/* =========================================================
   desktop overrides
   ========================================================= */

@media (min-width: 768px) {

  body {
    background-attachment: fixed;
    padding: 2rem 0;
  }

  .layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .mobile-header {
    display: none;
  }

  .sidebar-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    width: 240px;
    padding: 1.5rem;

    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;

    border-radius: 8px;

    position: sticky;
    top: 2rem;

    height: fit-content;
  }

  .content-card {
    flex: 1;
    margin: 0;
    padding: 2rem;
    gap: 1.5rem;
  }

  .content-card h1 { font-size: 1.8rem; }
  .content-card h2 { font-size: 1.5rem; }
  .content-card h3 { font-size: 1.3rem; }
}

/* =========================================================
   primary links (homepage cards)
   ========================================================= */

.primary-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}
