@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500&family=Inter:wght@300;400;600&display=swap');

/* ── BODY — background only, NOT font/color ── */
body.ra-page {
  background: radial-gradient(circle at top, #e4e4e4  ) !important;
  background-attachment: fixed !important;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── APPLY DARK THEME ONLY TO RESEARCH CONTENT ── */
.ra-content-frame {
  border-left: 6px solid #FFAD00;
  border-right: 6px solid #FFAD00;
  font-family: 'Inter', sans-serif;
  color: #F7F7F7;
}

.ra-hero {
  height: 100vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

/* ── CANVAS ── */
#nnCanvas {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 100%;
  z-index: -10;
  pointer-events: none;
  opacity: 0.2;  /* ← add this */
}
/* ── HERO FRAME ── */
.ra-hero-frame {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  border-top: 6px solid #FFAD00;
  margin-top: -30px;  /* ← pull border upward */
}
/* ── CORE CIRCLE ── */
.ra-core {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #FFAD00;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  padding: 10px;
  z-index: 2;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

@media (min-width: 769px) {
  .ra-core {
    width: 260px;
    height: 260px;
    font-size: 26px;
  }
}

/* ── NODE BASE ── */
.ra-node {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  color: white;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  width: 190px;      /* ← add this */
  height: 190px;     /* ← add this */
  padding: 12px;     /* ← add this */
  transition: transform 0.1s ease-out, box-shadow 0.3s, border 0.3s, width 0.25s ease, height 0.25s ease;
}
@media (max-width: 768px) {
  .ra-node {
    width: 85px;
    height: 85px;
    padding: 8px;
  }
}

@media (min-width: 769px) {
  .ra-node {
    width: 170px;
    height: 170px;
    padding: 12px;
  }
}

/* ── NODE TITLE ── */
.ra-node-title {
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  transition: font-size 0.25s ease, margin-bottom 0.25s ease;
}

@media (max-width: 768px) {
  .ra-node-title {
    font-size: 11px;
  }
}

@media (min-width: 769px) {
  .ra-node-title {
    font-size: 22px;
  }
}

.ra-faculty-list {
  display: none;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  color: #FFAD00;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.25s ease, max-height 0.25s ease;
  width: 100%;
}

@media (min-width: 769px) {
  .ra-node:hover, .ra-node.active {
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
    border: 2px solid white;
    width: 240px;
    height: 240px;
    z-index: 10;
  }
  .ra-node:hover .ra-node-title, .ra-node.active .ra-node-title {
    font-size: 24px;
    margin-bottom: 6px;
  }
  .ra-node:hover .ra-faculty-list, .ra-node.active .ra-faculty-list {
    opacity: 1;
    max-height: 80px;
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .ra-node.active {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    border: 2px solid white;
    width: 130px;
    height: 130px;
    z-index: 10;
    transform-origin: center center;
  }
  .ra-node.active .ra-node-title {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .ra-node.active .ra-faculty-list {
    display: block;
  }
}

/* ── IMAGE CLASSES ── */
.ra-node-ml { background-image: url('../images/research/machinelearning.webp'); }
.ra-node-dl { background-image: url('../images/research/dl.webp'); }
.ra-node-cv { background-image: url('../images/research/CV.webp'); }
.ra-node-nlp { background-image: url('../images/research/NLP.webp'); }
.ra-node-tsa { background-image: url('../images/research/timeseries.webp'); }
.ra-node-ir { background-image: url('../images/research/ir.webp'); }
.ra-node-ct { background-image: url('../images/research/coding.webp'); }
.ra-node-sl { background-image: url('../images/research/LinearAlgebra.webp'); }
.ra-node-est { background-image: url('../images/research/ml.webp'); }
.ra-node-gtmd { background-image: url('../images/research/gamet.webp'); }
.ra-node-sys { background-image: url('../images/research/aisystems.webp'); }
.ra-node-frai { background-image: url('../images/research/fairness.webp'); }
.ra-node-dist { background-image: url('../images/research/distributed.webp'); }
.ra-node-agl { background-image: url('../images/research/LinearAlgebra.webp'); }

/* ── SCROLL HINT ── */
.ra-scroll {
  position: absolute;
  bottom: 30px;
  font-size: 14px;
  color: #FFAD00;
  animation: ra-float 2s ease-in-out infinite alternate;
  z-index: 2;
  cursor: pointer;
  user-select: none;
}

@keyframes ra-float {
  from { transform: translateY(0); }
  to { transform: translateY(10px); }
}

/* ── APPLICATION SECTION ── */
.ra-section {
  position: relative;
  margin-top: 0;
  background: #FFAD00;
  z-index: 100;
  color: #111;
  padding: 40px 6% 60px;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
}

.ra-section h1 {
  margin-top: 0;
  font-size: clamp(22px, 5vw, 36px);
}

/* ── APP GRID ── */
.ra-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

@media (max-width: 480px) {
  .ra-app-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* ── APP CARD ── */
.ra-app-card {
  background: white;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(40px);
  -webkit-tap-highlight-color: transparent;
}

.ra-app-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.ra-app-card:hover, .ra-app-card:active {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.ra-app-card h3 {
  margin: 0;
  font-size: clamp(12px, 3vw, 16px);
}

.ra-card-img {
  width: 100%;
  height: 120px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  margin-bottom: 12px;
  background-size: cover;
  background-position: center;
  border: 1px dashed rgba(0, 0, 0, 0.15);
}

@media (max-width: 480px) {
  .ra-card-img {
    height: 80px;
  }
}

/* ── DETAIL PANEL ── */
.ra-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  color: black;
  padding: 80px 8%;
  box-sizing: border-box;
  z-index: 2000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  --x: 50%;
  --y: 50%;
  clip-path: circle(0px at var(--x) var(--y));
  transition: clip-path 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-overflow-scrolling: touch;
}

.ra-panel.open {
  clip-path: circle(150% at var(--x) var(--y));
}

.ra-panel-close {
  position: absolute;
  top: 24px;
  right: 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  color: #555;
  padding: 8px;
  transition: color 0.2s;
  background: none;
  border: none;
}

.ra-panel-close:hover {
  color: #111;
}

.ra-panel h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 6vw, 40px);
  margin-top: 0;
}

.ra-panel p {
  font-size: clamp(14px, 3vw, 18px);
  max-width: 600px;
}

.ra-panel img {
  width: 100%;
  max-width: 600px;
  margin-top: 20px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

body.ra-page .back-to-top {
  z-index: 200;
  bottom: 80px;
}

/* ── FACULTY TOOLTIP POPUP ── */
.ra-tooltip {
  position: fixed;
  background: #FFAD00;
  color: #111;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  padding: 10px 16px;
  border-radius: 12px;
  pointer-events: none;
  z-index: 9000;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ra-tooltip.visible {
  opacity: 1;
}

/* ── APP CARD FACULTY ── */
.ra-app-faculty {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  line-height: 1.6;
  margin-top: 6px;
}
/* ── APP CARD EQUAL HEIGHT ON MOBILE ── */
@media (max-width: 768px) {
  .ra-app-grid {
    align-items: stretch;
    grid-auto-rows: 1fr;  /* ← add this line only */
  }

  .ra-app-card {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .ra-card-img {
    height: 80px;
    flex-shrink: 0;
  }

  .ra-app-card h3 {
    font-size: 11px;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 4px 0;
    line-height: 1.3;
  }

  .ra-app-faculty {
    font-size: 10px;
    margin-top: 4px;
  }
}