/* Minimal, clean, responsive styles */
:root {
  --bg: #0b0c10;
  --card: #121317;
  --text: #e6e6e6;
  --muted: #a5a5a5;
  --accent: #7dd3fc;
  --border: #2a2b31;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
html, body { margin: 0; padding: 0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, Apple Color Emoji, Segoe UI Emoji; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1000px; margin: 0 auto; padding: 1.2rem; }

.site-header { border-bottom: 1px solid var(--border); position: sticky; top: 0; backdrop-filter: blur(8px); background: rgba(11,12,16,0.7); z-index: 100; }
.site-title { font-size: 1.8rem; margin: 0 0 .25rem; }
.site-subtitle { margin: 0 0 .75rem; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; gap: .75rem; padding-bottom: .4rem; }
.site-nav a {
  --roundness: 999px;
  --color: #a78bfa;
  padding: .35rem .8rem;
  border: 2px solid transparent;
  border-radius: var(--roundness);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  color: var(--color);
  position: relative;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}
.site-nav a::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--roundness);
  padding: 2px;
  background: linear-gradient(90deg, 
    transparent,
    var(--color),
    transparent,
    var(--color),
    transparent
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  filter: blur(4px) drop-shadow(0 0 8px var(--color));
  animation: border-rotate 3s linear infinite;
  animation-play-state: paused;
  transition: opacity 0.3s;
}
.site-nav a:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  filter: brightness(1.2);
  text-decoration: none;
}
.site-nav a:hover::before {
  opacity: 0.8;
  animation-play-state: running;
}
.site-nav a:active::before {
  opacity: 0;
}

@keyframes border-rotate {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}

main section { padding: 2rem 0; border-bottom: 1px dashed var(--border); }
h2 { margin: 0 0 1rem; font-size: 1.4rem; }
.meta, .list { margin: .5rem 0 0 1rem; color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; }

.about-content { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.about-text { flex: 1; min-width: 300px; }
.about-image { flex-shrink: 0; text-align: center; max-width: 200px; }
.about-image img { width: 200px; height: 300px; object-fit: cover; border-radius: 16px; border: 2px solid var(--border); }
.about-image img.clickable-image { 
  cursor: pointer; 
  transition: all 0.3s ease;
}
.about-image img.clickable-image:hover {
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(125, 211, 252, 0.3);
}
.image-caption { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--muted); font-style: italic; }

.album-covers { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.album-covers a { display: block; transition: transform 0.2s; }
.album-covers a:hover { transform: scale(1.05); }
.album-covers img { width: 160px; height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }

.carousel-container { position: relative; display: flex; align-items: center; gap: 1rem; }
.cards-carousel { 
  display: flex; 
  gap: 1rem; 
  overflow-x: auto; 
  scroll-behavior: smooth; 
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--card);
  padding: 0.5rem 0 1rem;
}
.cards-carousel::-webkit-scrollbar {
  height: 8px;
}
.cards-carousel::-webkit-scrollbar-track {
  background: var(--card);
  border-radius: 4px;
}
.cards-carousel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.cards-carousel::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
.card { 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 16px; 
  padding: 1rem; 
  min-width: 320px; 
  max-width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 320px;
}
.card h3 { margin-top: 0; margin-bottom: 0.75rem; flex-shrink: 0; font-size: 1.1rem; }
.card p:not(.tags) { flex-grow: 1; overflow: hidden; font-size: 0.95rem; line-height: 1.5; margin: 0.5rem 0; }
.tags { color: var(--muted); font-size: .9rem; margin: 0.5rem 0; flex-shrink: 0; }
.card p:last-child { margin-bottom: 0; flex-grow: 0; flex-shrink: 0; }
.carousel-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.carousel-btn:hover { background: var(--border); transform: scale(1.1); }
.carousel-btn:active { transform: scale(0.95); }

@media (max-width: 768px) {
  .carousel-btn { display: none; }
  .cards-carousel { padding: 0.5rem; }
}

.pub { margin-bottom: 1rem; }
.pub .title { font-weight: 600; }
.pub .by, .pub .venue { color: var(--muted); margin: .1rem 0; }
.pub .links a { margin-right: .75rem; }

/* Fancy Read More Button with Edge Glow */
.read-more-btn {
  --thickness: 0.3rem;
  --roundness: 1.2rem;
  --color: #a78bfa;
  --opacity: 0.8;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  color: var(--color);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--roundness);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  font-family: inherit;
  backdrop-filter: blur(10px);
}

.read-more-btn:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  filter: brightness(1.2);
}

.read-more-btn:active {
  --opacity: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.read-more-btn svg {
  border-radius: var(--roundness);
  display: block;
  filter: url(#glow);
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  pointer-events: none;
}

.read-more-btn rect {
  fill: none;
  stroke: var(--color);
  stroke-width: var(--thickness);
  rx: var(--roundness);
  stroke-linejoin: round;
  stroke-dasharray: 185%;
  stroke-dashoffset: 80;
  animation: snake 2s linear infinite;
  animation-play-state: paused;
  height: 100%;
  opacity: 0;
  transition: opacity 0.2s;
  width: 100%;
}

.read-more-btn:hover rect {
  animation-play-state: running;
  opacity: var(--opacity);
}

@keyframes snake {
  to {
    stroke-dashoffset: 370%;
  }
}

.read-more-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Demo (horizontal scrolling carousel) */
.demo-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--card);
  padding: 0.5rem 0 1rem;
}
.demo-carousel::-webkit-scrollbar {
  height: 8px;
}
.demo-carousel::-webkit-scrollbar-track {
  background: var(--card);
  border-radius: 4px;
}
.demo-carousel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.demo-carousel::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
.demo-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  width: 400px;
}
.demo-item img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 768px) {
  .demo-item { width: 300px; }
}

/* Modal Styles */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

.modal-dialog {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  z-index: 1001;
  animation: slideUp 0.3s ease-out;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-dialog h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.modal-dialog h3 {
  color: var(--text);
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.modal-dialog p {
  line-height: 1.7;
  color: var(--text);
  margin: 0.75rem 0;
}

.modal-dialog .list {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
  line-height: 1.8;
}

.modal-dialog .list li {
  margin-bottom: 0.5rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1.8rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
  transform: rotate(90deg);
}

.modal-dialog::-webkit-scrollbar {
  width: 8px;
}

.modal-dialog::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.modal-dialog::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.modal-dialog::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (max-width: 768px) {
  .modal-dialog {
    padding: 1.5rem;
    max-height: 90vh;
  }
  
  .modal-dialog h2 {
    font-size: 1.3rem;
  }
}

/* Research Figures */
.research-figures {
  margin: 1.5rem 0;
}

.figure-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.research-figure {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.research-figure img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.research-figure-single {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.research-figure-single img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 4px;
  margin: 0 auto 0.5rem;
  display: block;
}

.research-figure figcaption,
.research-figure-single figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .figure-pair {
    grid-template-columns: 1fr;
  }
}

/* Cat Collage Grid */
.cat-collage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.cat-collage img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: zoom-in;
}

.cat-collage img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(125, 211, 252, 0.3);
  border-color: var(--accent);
  z-index: 1;
}

@media (max-width: 768px) {
  .cat-collage {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .cat-collage img {
    height: 140px;
  }
}

.site-footer { border-top: 1px solid var(--border); }
