/* === GLOBAL === */
* { box-sizing: border-box; }

body, html {
  height: 100vh;
  width: 100vw;
  margin: 0;
  font-family: 'Times New Roman', Times, serif;
  overflow: hidden;
}

aside {
  width: 25%;
  height: 100%;
  background-color: #e6e6e6;
  float: left;
  overflow-y: auto;
  position: relative;
}

main {
  width: 75vw;
  height: 100vh;
  float: right;
  background-image: url('../img/nebula.jpg');
  background-repeat: no-repeat;
  background-size: cover;            /* Scale to fill main, may crop edges */
  background-position: 1% bottom;    /* Prioritize lower part (with credits) */
  background-color: black;
  background-attachment: local;
  overflow: hidden;
  position: relative;
}

/* === SIDEBAR === */
#avatar {
  border-radius: 50%;
  width: 180px;
  height: auto;
  max-width: 20vw;
  display: block;
  margin: 10% auto 0 auto;
}

figure { margin: 0; }

figcaption {
  text-align: center;
  font-weight: bold;
  font-size: 20px;
  opacity: 0.9;
}

#podpis {
  text-align: center;
  font-size: 15px;
}

nav {
  margin-top: 30%;
  text-align: center;
  text-transform: uppercase;
  font-family: 'Book Antiqua', serif;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  margin: 15px 0;
}

/* === NAV LINKS === */
nav a {
  text-decoration: none;
  color: black;
  position: relative;
  display: inline-block;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
}

nav a:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  border-bottom: 1px solid #002b80;
  transition: 0.4s;
}

nav a:hover:after {
  width: 100%;
}

nav a.selected {
  border-bottom: 1px solid #002b80;
}
nav a.selected:hover:after {
  width: 0%;
}

/* === NAV SUBLIST (e.g. Research paper links) === */
.sublist {
  display: none;
  margin-top: 0.5rem;
}

nav a.selected + .sublist {
  display: block;
}

.sublist li {
  margin: 6px 0;
}

.sublist a {
  font-size: 12px;
  text-transform: none;
  font-weight: normal;
}

/* === SOCIAL MEDIA === */
#follow {
  text-align: center;
  position: absolute;
  bottom: 2rem;
  width: 100%;
}

.fa, .ai {
  font-size: 35px;
  text-align: center;
  text-decoration: none;
  padding: 1rem;
  color: black;
}

.fa:hover, .ai:hover {
  opacity: 0.7;
}

/* === TAB SECTIONS === */
.tab-section {
  display: none;
}
.tab-section.active {
  display: block;
}

/* === MAIN CONTENT BOX === */
#content_box {
  height: 100%;
  width: 60%;
  font-size: 18px;
  color: white;
  position: absolute;
  bottom: 0;
  left: 20%;
  text-align: justify;
  overflow-y: auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#content_box a {
  color: #cdd4ff;
}

.about-box {
  position: relative;
  z-index: 0;
  font-size: 21px;
  line-height: 1.65;
  padding: 3.5rem 4rem;
}

.about-box::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 40%,
    rgba(0, 0, 0, 0.55) 68%,
    rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 40%,
    rgba(0, 0, 0, 0.55) 68%,
    rgba(0, 0, 0, 0) 100%);
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.78) 40%,
    rgba(0, 0, 0, 0.45) 68%,
    rgba(0, 0, 0, 0) 100%);
}

.about-box p {
  margin: 0 0 1.3rem 0;
}
.about-box p:last-child {
  margin-bottom: 0;
}

/* === RESEARCH TILES === */
#content_box.research {
  width: 92%;
  left: 4%;
  justify-content: center;
  text-align: left;
  padding: 2rem 0.5rem;
}

#content_box.research.topic-active {
  justify-content: flex-start;
  padding-top: 3rem;
}

.research-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  transition: gap 0.7s ease;
}

.tile {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
  height: 280px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background-image: linear-gradient(160deg, #262b52, #0a0c1c);
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease, width 0.7s ease,
    height 0.7s ease, max-width 0.7s ease, flex-basis 0.7s ease, border-radius 0.6s ease,
    background-color 0.6s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  outline: none;
}

.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(6, 7, 18, 0.22);
  transition: background-color 0.3s ease;
}

.tile:hover::before,
.tile:focus-visible::before {
  background-color: rgba(6, 7, 18, 0.5);
}

.tile-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem 1.4rem;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.4) 55%,
    rgba(0, 0, 0, 0.05) 100%);
  color: #f2f2f5;
}

.tile h3 {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.3px;
}

.tile-cta {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, margin-top 0.3s ease;
  display: block;
  margin-top: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #cdd4ff;
}

.tile:hover .tile-cta,
.tile:focus-visible .tile-cta {
  opacity: 1;
  max-height: 30px;
  margin-top: 0.6rem;
}

/* --- compact "tab" state, active after a tile is clicked --- */
.research-tiles.is-compact {
  justify-content: flex-start;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.research-tiles.is-compact .tile {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  height: 44px;
  border-radius: 8px;
  background-image: none !important;
  background-color: rgba(20, 22, 40, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.research-tiles.is-compact .tile::before {
  display: none;
}

.research-tiles.is-compact .tile:hover,
.research-tiles.is-compact .tile:focus-visible {
  transform: none;
}

.research-tiles.is-compact .tile.active {
  background-color: rgba(60, 66, 110, 0.9);
  box-shadow: 0 0 0 1px rgba(205, 212, 255, 0.7), 0 2px 10px rgba(0, 0, 0, 0.4);
}

.research-tiles.is-compact .tile-inner {
  position: static;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 1.1rem;
  background: none;
}

.research-tiles.is-compact .tile h3 {
  font-size: 14px;
  white-space: nowrap;
}

.research-tiles.is-compact .tile-cta {
  display: none;
}

/* --- topic text panels --- */
.research-panel {
  display: none;
}

.research-panel.active {
  display: block;
}

.research-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.9rem;
  background: none;
  border: 1px solid rgba(205, 212, 255, 0.5);
  border-radius: 4px;
  color: #cdd4ff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.research-back:hover {
  background-color: rgba(205, 212, 255, 0.12);
}

.research-panel h2 {
  font-size: 26px;
  color: #e2e2e6;
  margin: 0 0 1rem 0;
}

.research-panel p {
  font-size: 20px;
  line-height: 1.6;
  color: #d8d8e2;
  max-width: 640px;
}

.research-panel p.research-intro {
  margin-bottom: 2rem;
  max-width: none;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 100%;
}

.pub-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background-color: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 1rem;
}

.pub-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  background: linear-gradient(160deg, #262b52, #0a0c1c);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pub-thumb:hover,
.pub-thumb:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  outline: none;
}

.pub-thumb:hover svg,
.pub-thumb:focus-visible svg {
  opacity: 1;
  transform: rotate(10deg) scale(1.05);
}

.pub-thumb svg {
  width: 32px;
  height: 32px;
  fill: #cdd4ff;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.pub-body {
  flex: 1;
  min-width: 0;
}

.pub-title {
  margin: 0 0 0.5rem 0;
  font-size: 20px;
  font-weight: bold;
  line-height: 1.4;
  color: #e2e2e6;
}

.research-panel p.pub-abstract {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: #b8b8bf;
  max-width: none;
}

/* === CV LAYOUT === */
#content_box.cv {
  width: 84%;
  left: 8%;
  color: #d0d0d3;
  justify-content: flex-start;
  text-align: left;
  font-size: 19px;
}

.cv-wrap {
  background-color: rgba(0, 0, 0, 0.55);   /* dark, transparent to show nebula */
  padding: 2rem 2.2rem;
  border-radius: 6px;
  margin: 1rem 0 2.5rem 0;
}

.cv-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.cv-header h1 {
  font-size: 30px;
  color: #e2e2e6;
  margin: 0;
  letter-spacing: 1px;
}

.cv-header .loc {
  color: #a9a9b0;
  font-size: 15px;
}

.cv-download {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: 1px solid rgba(205, 212, 255, 0.6);
  border-radius: 4px;
  color: #cdd4ff !important;
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  transition: 0.3s;
}
.cv-download:hover {
  background-color: rgba(205, 212, 255, 0.15);
}

.cv-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.cv-section {
  margin-bottom: 1.6rem;
}

.cv-section h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #cdd4ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.3rem;
  margin: 0 0 0.8rem 0;
  font-weight: bold;
}

.cv-entry {
  margin-bottom: 0.7rem;
}

.cv-entry .row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.cv-entry .title {
  font-weight: bold;
  color: #e2e2e6;
}

.cv-entry .date {
  color: #a9a9b0;
  font-size: 15px;
  white-space: nowrap;
}

.cv-entry .sub {
  color: #b8b8bf;
  font-size: 16px;
}

.cv-entry .sub-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.cv-entry .sub-row .date {
  color: #a9a9b0;
  font-size: 15px;
  white-space: nowrap;
}

.cv-section ul.plain {
  margin: 0.3rem 0 0 0;
  padding-left: 1.1rem;
}
.cv-section ul.plain li {
  margin: 0.25rem 0;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-thumb {
  background: #5B595D;
  border-radius: 5px;
}

/* === RESPONSIVE === */
@media (max-width: 760px) {
  body, html {
    overflow-y: auto;
    height: auto;
    width: 100%;
  }
  aside {
    width: 100%;
    height: auto;
    float: none;
    padding-bottom: 1.5rem;
  }
  #avatar { margin-top: 1.5rem; }
  nav { margin-top: 1.5rem; }
  #follow {
    position: static;
    margin-top: 1rem;
  }
  main {
    width: 100%;
    height: auto;
    min-height: 60vh;
    float: none;
    overflow: visible;
  }
  #content_box,
  #content_box.cv,
  #content_box.research {
    position: static;
    width: 100%;
    left: 0;
    padding: 1.5rem 1rem;
    display: block;
  }
  .pub-item {
    flex-direction: column;
  }
  .pub-thumb {
    width: 100%;
    height: 100px;
  }
}

/* === PRINT === */
@media print {
  aside, #follow, .cv-download { display: none !important; }
  body, html, main { height: auto; overflow: visible; background: none; }
  main { width: 100%; float: none; background-image: none; }
  #content_box.cv {
    position: static;
    width: 100%;
    left: 0;
    color: #000;
  }
  .cv-wrap { background: none; padding: 0; }
  .cv-header h1, .cv-entry .title { color: #000; }
  .cv-section h2 { color: #000; }
  .cv-header .loc, .cv-entry .date, .cv-entry .sub { color: #333; }
}
