/* ================================================
   Global Reset & Base
   ================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #ffffff;
  color: #1a1a1a;
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sub-page layout */
body.sub-page {
  overflow: hidden;
}

body.sub-page .page-content {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 2;
  padding: 9rem 1.5rem 2rem;
  scroll-behavior: smooth;
}

/* ================================================
   Fixed Header for Sub-Pages
   ================================================ */
.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem;
  background: linear-gradient(to bottom, #ffffff 0%, #ffffff 70%, transparent 100%);
  pointer-events: none;
}

.page-header-inner {
  max-width: 38em;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.page-header .name {
  font-family: "Yuyu", sans-serif;
  font-size: 3em;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  line-height: 1.15;
  margin-bottom: 0;
}

.page-header .divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin-bottom: 0;
}

.page-header .divider-line {
  display: block;
  width: 18em;
  height: 0.125em;
  background: var(--divider-color, #1a1a1a);
  border-radius: 1px;
}

.page-header .nav-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3em 1.5em;
  width: 100%;
  max-width: 38em;
  margin: 0 auto;
}

/* ================================================
   Background Canvas (dispersion curves)
   ================================================ */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

/* ================================================
   Crystal illustration (full-width, bottom)
   ================================================ */
.bg-crystal {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  z-index: 1;
  object-fit: contain;
  object-position: bottom center;
  max-height: 38vh;
}

/* ================================================
   Hero Layout
   ================================================ */
/* ================================================
   Hero Layout (Homepage - centered)
   ================================================ */
.hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 8vh 1.5rem 0;
  justify-content: flex-start;
}

/* Sub-page hero wrapper - keep visible for content */
.sub-page .hero {
  display: flex;
  align-items: center;
  min-height: auto;
  padding: 0;
}

/*
   Single scaling anchor for all hero content.
   Everything inside uses em/rem relative to this,
   so all elements keep consistent proportions.
*/
.hero-content {
  text-align: center;
  width: 100%;
  max-width: 38em;            /* caps width proportional to font size */
  font-size: 16px;
  margin-top: 0;
  padding-top: 2vh;
  padding-bottom: 2vh;
}

/* Sub-page hero content adjustments */
.sub-page .hero-content {
  margin-top: 0;
  padding-top: 1rem;
}

/* Graph canvas - fixed position, centered in viewport, size set by JS */
#graph-canvas {
  display: block;
}

/* ================================================
   Name (Title)
   ================================================ */
.name {
  font-family: "Yuyu", sans-serif;
  font-size: 3em;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  line-height: 1.15;
  margin-bottom: 0.25em;
}

/* ================================================
   Divider (coloured line + diamond)
   ================================================ */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin-bottom: 0.3em;
}

.divider-line {
  display: block;
  width: 18em;
  height: 0.125em;
  background: var(--divider-color, #1a1a1a);
  border-radius: 1px;
}

.divider-diamond {
  display: block;
  width: 0.55em;
  height: 0.55em;
  background: var(--divider-color, #1a1a1a);
  transform: rotate(45deg);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ================================================
   Tagline
   ================================================ */
.tagline {
  font-family: "Yuyu", sans-serif;
  font-size: 1.5em;
  color: var(--tagline-color, #1a1a1a);
  letter-spacing: 0.08em;
  margin-bottom: 1.5em;
}

/* ================================================
   Content Sections
   ================================================ */
.content-section {
  width: 100%;
  max-width: 38em;
  margin: 0 auto 1.5em;
  text-align: center;
}

/* ================================================
   Projects List
   ================================================ */
.projects-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5em;
}

.project-card {
  background: rgba(0, 0, 0, 0.02);
  border: 0.15em solid var(--card-color, #1a1a1a);
  padding: 1.2em;
  text-align: left;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  background: rgba(0, 0, 0, 0.03);
  box-shadow: 0 0.2em 0.8em rgba(0, 0, 0, 0.06);
}

.project-title {
  font-size: 1.3em;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #1a1a1a;
  margin-bottom: 0.3em;
  line-height: 1.2;
}

.project-meta {
  font-size: 0.75em;
  color: #666;
  letter-spacing: 0.04em;
  margin-bottom: 0.6em;
  font-style: italic;
}

.project-description {
  font-size: 0.85em;
  color: #1a1a1a;
  line-height: 1.5;
  margin: 0;
}

/* ================================================
   Navigation Grid (Homepage)
   ================================================ */
.hero .nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5em;
  width: 100%;
  max-width: 34em;
  margin: 0 auto;
}

.hero .nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  padding: 0.9em 0.3em;
  border-radius: 0.8em;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
  /* font-family: 'Ovo', serif; */
  font-family: "Yuyu", sans-serif;
  font-size: inherit;
  line-height: inherit;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Hover glow accent matching card colour */
.nav-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0.8em;
  background: var(--card-color, #1a1a1a);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-card:hover::before {
  opacity: 0.08;
}

.nav-card:hover {
  border-color: var(--card-color, #1a1a1a);
  transform: translateY(-0.2em);
  box-shadow: 0 0.4em 1.6em rgba(0, 0, 0, 0.08);
}

.nav-card:active {
  transform: translateY(-0.05em);
}

.nav-icon {
  width: 1.8em;
  height: 1.8em;
  color: var(--card-color, #1a1a1a);
  position: relative;
  z-index: 1;
}

.nav-label {
  font-family: "Yuyu", sans-serif;
  font-size: 0.7em;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

/* ================================================
   Highlight Text
   ================================================ */
.highlight {
  color: #4ca730;
  font-weight: 600;
}

/* ================================================
   Publications List
   ================================================ */
.publication-list {
  text-align: left;
  padding-left: 1.5em;
  list-style-position: outside;
}

.publication-list li {
  margin-bottom: 1em;
  line-height: 1.6;
  padding-left: 0.5em;
}

.publication-list a {
  color: #1a1a1a;
  text-decoration: none;
  border-bottom: 1px solid #1a1a1a;
  transition: opacity 0.25s ease;
}

.publication-list a:hover {
  opacity: 0.7;
}

/* ================================================
   Text Navigation for Header
   ================================================ */
.page-header .nav-link {
  font-family: "Yuyu", sans-serif;
  font-size: 1.5em;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  text-decoration: none;
  padding: 0.2em 0;
  position: relative;
  transition: color 0.25s ease;
  background: none;
  border: none;
  cursor: pointer;
}

.page-header .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0.08em;
  background: var(--card-color, #1a1a1a);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.page-header .nav-link:hover::after,
.page-header .nav-link.active::after {
  transform: scaleX(1);
}

.page-header .nav-link:hover,
.page-header .nav-link.active {
  color: var(--card-color, #1a1a1a);
}

/* ================================================
   Responsive: Small Screens
   ================================================ */
@media (max-width: 500px) {
  .hero-content {
    font-size: 14px;
    margin-top: 0;
  }

  .projects-list {
    gap: 1em;
  }

  .project-card {
    padding: 1em;
  }

  .project-title {
    font-size: 1.15em;
  }

  .project-meta {
    font-size: 0.7em;
  }

  .project-description {
    font-size: 0.8em;
  }

  .hero .nav-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 18em;
    gap: 0.4em;
  }

  .hero {
    padding-top: 10vh;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 0;
  }

  /* Sub-page responsive */
  .page-header .nav-grid {
    gap: 0.5em 1em;
  }

  .page-header {
    padding: 1rem;
  }

  .page-header .name {
    font-family: "Yuyu", sans-serif;
    font-size: 1.6em;
  }

  .page-header .divider-line {
    width: 18em;
  }

  body.sub-page .page-content {
    padding: 9rem 1rem 2rem;
  }
}
